Opening Problem Statement
Meet Milorad, a busy sales executive juggling numerous client meetings every week. Before every call or meeting with a company, Milorad spends at least 30 minutes manually searching for the latest news to stay informed about their recent developments. This repetitive task often leads to either missed timely information or last-minute scrambles, causing stress and reduced confidence during calls.
Imagine having 5-6 meetings daily—this adds up to 2-3 hours wasted each week! Missing out on relevant company news could mean lost business opportunities and an diminished competitive edge.
What This Automation Does
This n8n workflow triggers every morning at 7 AM, automating news gathering for your scheduled meetings. Specifically, it:
- Retrieves today’s Google Calendar events starting with “Meeting with” or “Call with” to identify company names.
- Extracts company names from the event titles by removing prefixes like “meeting with” or “call with”.
- Fetches recent news articles about each company from the News API, limited by defined age and number of articles.
- Formats news articles into a clean HTML email with clickable headlines, descriptions, and sources for easy reading.
- Sends the compiled news email to a customizable list of recipients.
- Saves hours for salespeople or client managers by delivering up-to-date, relevant news seamlessly before meetings.
By automating this, Milorad gains confidence walking into calls well-prepared, improves client engagement, and saves valuable time daily.
Prerequisites ⚙️
- Google Calendar account (configured in n8n for event retrieval) 📅
- News API account and API key (https://newsapi.org) 🔑
- Gmail account with OAuth2 credentials configured in n8n for sending emails 📧
- n8n account (can be self-hosted or cloud hosted) 🔌
- Basic familiarity with n8n workflow creation and credential setup ⏱️
Step-by-Step Guide
1. Schedule Trigger – Set Workflow to Run Daily
In n8n, create a new workflow and add the Schedule Trigger node. Configure it to trigger at 7:00 AM daily:
- Click + Add Node > Search and select Schedule Trigger.
- Set the trigger time under Rule > Trigger at Hour to 7.
- You should see the workflow run every morning at 07:00 automatically.
- Common mistake: Forgetting to select the correct time zone can cause the trigger to run at unexpected hours.
2. Setup Node – Define Workflow Parameters
Add a Set node named “Setup” to hold your configuration data:
- Click + Add Node > Set.
- Add fields:
–apiKey— Your News API key (e.g., “32aa914c947342169c4998b6701a77e0”).
–newsAge— Maximum news age in days (e.g., 10).
–maxArticles— Max number of articles to fetch (e.g., 20).
–emails— Comma-separated list of recipient emails. - This node centralizes your configuration in one place.
- Common mistake: Leaving any field empty causes later steps to fail.
3. Get Today’s Google Calendar Meetings
Add a Google Calendar node to fetch events for the current day:
- Click + Add Node > Google Calendar.
- Set Operation to “Get All”.
- Configure TimeMin as today’s date and TimeMax as tomorrow’s date (using expressions to dynamically get current date). For example:
{{ $today }}and{{ $today.plus({days:1}) }}. - Select the correct Google account credential.
- You should receive a list of all meetings scheduled for today from your calendar.
- Common mistake: Not enabling “Single Events” causes recurring meetings to be missed.
4. Filter for Relevant Meetings by Title
Add an If node named “Filter meetings” to only allow meetings starting with “call with” or “meeting with”:
- Go to the Conditions section.
- Add two string conditions with “Starts With” operator.
– Condition 1: Input ={{$json.summary.toLowerCase()}}, Value = “call with”.
– Condition 2: Input ={{$json.summary.toLowerCase()}}, Value = “meeting with”. - Set the combinator to “OR” so it passes if either matches.
- Common mistake: Using case-sensitive match blocks valid events. Make sure to use lowercase transformations.
5. Extract Company Name from Meeting Title
Add a Set node named “Extract company name” to clean up the event summary to just the company name:
- Set property
companyNamewith the expression:
{{ $json.summary.toLowerCase().replace('meeting with', '').replace('call with', '').trim() }} - This removes the prefixes and trims extra spaces, leaving just the company name.
- Expected output: If the event title is “Meeting with Acme Corp”, companyName becomes “acme corp”.
- Common mistake: Not trimming spaces will cause search issues later.
6. Get Latest News via HTTP Request
Add an HTTP Request node called “Get latest news” configured as follows to call the News API:
- Method: GET
- URL (use expression):
https://newsapi.org/v2/everything?apiKey={{ $('Setup').first().json.apiKey }}&q={{ $json.companyName }}&from={{ DateTime.now().minus({ days: $('Setup').first().json.newsAge }).toFormat('yyyy-MM-dd') }}&sortBy=publishedAt&language=en&pageSize={{ $('Setup').first().json.maxArticles }}&searchIn=title - No extra headers or body needed.
- This fetches recent English news articles about the company published within the specified time frame.
- Common mistake: Exceeding News API free plan quota results in failed requests.
7. Format News Articles into HTML Email
Add a Code node named “Format for email” to generate an HTML snippet from the News API response:
Use this JavaScript code (runs once per input item):
let html = ``;
html += `
`;
for(article of $input.item.json.articles) {
console.log(article);
html += `
${article.title}
${article.description ? article.description : article.content}
${ article.source?.name ? 'Source: ' + article.source?.name : '' }
`;
}
return { "html": html };
This formats each article into a styled table row with clickable headline and description.
Common mistake: Forgetting to return the HTML string causes email to be empty.
8. Send Email with Latest News
Add a Gmail node named “Send news”:
- Set Send To to the emails configured in “Setup” node (
{{ $('Setup').first().json.emails }}). - Set Message to the generated HTML (
{{ $json.html }}). - Set Subject to something dynamic like:
Latest news for '{{ $('Extract company name').item.json.companyName }}' - Connect your Gmail OAuth2 credentials.
- Test-send to verify formatting.
- Common mistake: Not setting advanced options to send HTML content leads to plain text emails.
Customizations ✏️
- Adjust News Age: In the Setup node, change
newsAgeto fetch fresher or older news as suits your needs. - Add More Meeting Filters: In the “Filter meetings” node, add additional conditions to filter other event prefixes like “Interview with” or “Demo with”.
- Send To Multiple Recipients: Add more emails separated by commas in the
emailsfield of Setup node to notify your sales team or assistants. - Modify Email Format: In the “Format for email” code node, adjust HTML styles, add company logos, or include article publication dates.
Troubleshooting 🔧
- Problem: “No meetings found today” or empty emails.
Cause: Meetings don’t match the filter prefixes.
Solution: Check meeting titles, expand “Filter meetings” conditions to cover all relevant prefixes (case-insensitive). - Problem: News API requests fail with 429 Too Many Requests.
Cause: Exceeded News API quota.
Solution: Upgrade News API plan or reducemaxArticlesandnewsAgesettings in “Setup” node. - Problem: Emails received as plain text without formatting.
Cause: Gmail node not set to send HTML.
Solution: Ensure the message field content is HTML and advanced options in Gmail node enable HTML format.
Pre-Production Checklist ✅
- Verify Google Calendar OAuth2 credentials are working and authorized.
- Confirm News API key is valid and has sufficient quota.
- Test Schedule Trigger fires correctly at configured time.
- Ensure meeting titles in your calendar follow the filtering convention.
- Send test email to yourself to verify formatting and links.
- Backup current workflow before deploying changes.
Deployment Guide
Once configured and tested, activate your workflow by toggling the active switch in n8n. The automation will run daily at 7 AM, fetching and delivering the latest company news relevant to your meetings.
Monitor occasional logs in n8n to track successful runs and troubleshoot errors. Adjust filtering and API usage as your meeting patterns or news needs evolve.
FAQs
- Can I use another email service instead of Gmail? Yes, you can replace the Gmail node with any SMTP or email node supported by n8n.
- Does this consume many API requests? Each company news request counts as one News API call per meeting. Keep
maxArticleslow to stay within limits. - Is my data secure? Credentials are stored securely within n8n. Use encrypted environment if self-hosting.
- Can this handle many meetings per day? Yes, but consider API rate limits and performance tuning depending on volume.
Conclusion
By building this n8n workflow, you’ve automated the tedious task of manually searching for company news before each meeting. This workflow delivers tailored news snippets every morning automatically, saving hours weekly and empowering you with relevant insights for your calls and meetings.
Next, consider extending the workflow to include other communication channels like Slack alerts, integrate CRM data for follow-ups, or schedule summary reports weekly for your team. Keep iterating to fit your exact sales or client engagement needs!
Happy automating!