Summarize regulatory news from NewsAPI with Gemini and Google Sheets plus error alerts
News Intelligence Workflow using NewsAPI, AI Model, Google Sheets & Error Alerts
This workflow automatically fetches news articles from NewsAPI, processes them using an AI model to generate summaries and key regulatory changes and stores both raw and processed data into Google Sheets. It also includes centralized error handling with email alerts for monitoring failures.
Quick Implementation Steps
Signup / Login to your n8n account Add your NewsAPI key in the configuration node. Set your Google Sheet ID and ensure required columns exist. Update the search query (e.g., regulation, finance, etc.). Configure email recipient for error alerts (optional). Execute using the Manual Trigger node. Review results in Google Sheets.
What It Does
This workflow automates the process of collecting and analyzing news articles. It starts by fetching the latest news based on a defined keyword using NewsAPI. The fetched data is cleaned, sorted and filtered to ensure only relevant and valid articles are processed further.
Each article is then processed individually in a controlled loop to avoid API rate limits. The workflow stores raw article data into Google Sheets for reference and backup. It then uses an AI model to generate a concise summary and extract key regulatory or policy changes from each article.
Finally, the structured AI output is formatted and updated back into the same Google Sheet. The workflow also includes a high-level error handling mechanism that collects errors from multiple nodes, formats them and sends email alerts for easier monitoring and debugging.
Who It's For
Business analysts tracking regulatory updates
Compliance and legal teams
Data analysts and automation engineers
News aggregation platforms
Anyone looking to automate news monitoring and summarization
Requirements
To use this workflow, you need:
n8n account NewsAPI account and API key Google Sheets account with OAuth credentials configured in n8n A Google Sheet with the following columns: Title Source Published_At Content Summary Key Changes (Optional) Gmail account connected for error alerts
How It Works & Setup Instructions
- Trigger the Workflow
Uses Manual Trigger node for execution. Ideal for testing; can be extended later.
- Configure Variables
In Workflow Config & Variables node: Add newsApiKey Set searchQuery (default: regulation) Define maxArticlesToFetch Set loopWaitSeconds Add googleSheetId Configure API timeout and headers if needed
- Fetch News Data
HTTP Request Node** calls NewsAPI using: Query keyword Sorting (publishedAt) API key authentication
- Preprocess Articles
Code Node (Python)**: Sorts articles by date Filters invalid entries Extracts required fields (title, content, source, etc.)
- Limit Articles
Limit Node** restricts number of articles processed.
- Store Raw Data
SplitInBatches + Wait + Google Sheets (Append)**: Stores raw articles into the same sheet Adds delay to avoid rate limits
- Validate & Loop
IF Node** filters valid articles SplitInBatches** processes one article at a time
- AI Processing
AI Node**: Generates: Summary (max 60 words) Key regulatory changes Ensures strict structured output
- Format Output
Code Node (JavaScript)**: Extracts summary and key changes Cleans and structures AI output
- Update Sheet
Google Sheets (Update)**: Updates existing rows based on Title Adds Summary and Key Changes
- Error Handling
Errors from multiple nodes are: Collected via Merge Node Formatted using Set Node Delayed using Wait Node Sent via Email Node
How To Customize Nodes
Search Query**
Change config.searchQuery to track different topics (e.g., AI, finance, crypto).
Article Limit**
Adjust config.maxArticlesToFetch to process more or fewer articles.
Delay Timing**
Modify config.loopWaitSeconds to control API rate limits.
AI Prompt**
Customize the prompt in AI node to extract different insights.
Google Sheet Mapping**
Add/remove columns based on your reporting needs.
Add-ons (Enhancements)
Replace Manual Trigger with: Cron (scheduled runs) Webhook (real-time trigger) Add Slack/Telegram alerts for summaries Store data in a database instead of Google Sheets Add sentiment analysis to articles Build a dashboard using BI tools
Use Case Examples
Regulatory monitoring for finance or legal industries
Daily news digest automation for teams
Competitive intelligence tracking
Research support for analysts
Content curation for blogs or newsletters
There can be many more use cases depending on how you customize the workflow.
Troubleshooting Guide
| Issue | Possible Cause | Solution | |------|--------------|---------| | No articles fetched | Invalid API key | Verify NewsAPI key | | Empty AI output | Incorrect prompt format | Check AI node prompt | | Google Sheet not updating | Wrong Sheet ID or permissions | Verify Sheet ID and OAuth access | | Duplicate entries | Matching column misconfigured | Ensure Title is used as match key | | Workflow stops unexpectedly | API timeout or rate limits | Increase wait time or timeout settings | | No email alerts | Email not configured | Add recipient email in Gmail node |
Need Help?
If you need assistance setting up this workflow, customizing nodes or building advanced automation solutions, feel free to reach out to our n8n automation team at WeblineIndia.
WeblineIndia specializes in building scalable automation workflows, AI integrations and business process solutions tailored to your needs.
Whether you're looking to extend this workflow or create something entirely new, expert help is just a step away.
Related Templates
Automatic News Summarization & Email Digest with GPT-4, NewsAPI and Gmail
📰 AI News Digest Agent: Auto News Summarizer & Email Newsletter Create an intelligent news curation system that automat...
Generate Food Recipes from Gmail & Form Requests with Ollama & Llama 3.2
This n8n template demonstrates how to create an intelligent food recipe assistant that accepts requests via Gmail and we...
Auto-classify Gmail emails with AI and apply labels for inbox organization
Who is this for? Professionals and individuals who receive high volumes of emails, those who want to automatically organ...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments