n8n Trending Topics Workflow: Monitor and Alert in Real Time
Build an n8n workflow that monitors trending topics and sends alerts: node-by-node steps, API code, deduplication, error handling, and Slack or Sheets routing.

To build an n8n workflow that monitors trending topics and sends alerts, you need three things: a scheduled trigger, a reliable trend data source, and an alert destination. The fastest path is n8n's Schedule Trigger (or a Manual Trigger for testing) calling a real-time trend API over HTTP, then filtering and routing results to Slack, Sheets, Notion, Telegram, or a signed webhook. This tutorial uses TrendsAGI as the trend source because it returns measured velocity and AI insights as clean JSON, so you avoid fragile scraping of Google Trends, Reddit, and X inside n8n.
By the end you will have a runnable node-by-node recipe, working HTTP Request code, deduplication logic to stop repeat alerts, error handling for the trend step, and honest guidance on when a prebuilt n8n template is enough versus when you need a trend intelligence API. n8n is a fair-code licensed workflow automation tool that combines AI features with business process automation and offers over 500 pre-configured integrations, according to n8n.io and its documentation at docs.n8n.io.
Why n8n is a good fit for trend monitoring
n8n's visual editor makes the trend step a single HTTP Request node, and the rest of the workflow (scheduling, filtering, notifications, spreadsheets) is where it shines. Its template library already hosts multiple trend-monitoring workflows that pull from Google Trends, News, Reddit, X/Twitter and AI models and push results to Sheets, Notion or Telegram, which confirms active demand for this build. Community projects such as content-autopilot on GitHub run a Trend Collector every 6 hours that collects topics from multiple sources and processes them with AI.
The weakness in most of those templates is the trend source itself. Scraping Reddit, X, and Google Trends from n8n depends on rate limits, quotas, and page structures that the sources can change without notice. This tutorial keeps n8n for orchestration and puts the trend detection behind a stable, authenticated JSON endpoint.
Prerequisites and data-source options
- An n8n instance. According to docs.n8n.io, n8n can be self-hosted on your own infrastructure, on-premises, or in a private cloud using Docker Compose, a one-line setup, or other deployment methods.
- A TrendsAGI API key, created in your account profile.
- An alert destination: a Slack credential in n8n, a Google Sheets node, or a webhook receiver.
Before you build, choose your source deliberately:
| Source type | Strength | Limitation |
|---|---|---|
| Native/scraped nodes (Reddit, X, Google Trends) | Free and familiar; common in n8n templates | Rate limits, quotas, and page changes are not documented in the templates; reliability varies |
| AI model enrichment inside n8n | Summarizes and classifies topics you already collected | Does not detect what is gaining attention; it only interprets input |
| TrendsAGI REST API | Measured velocity from stored snapshots, growth, AI insights, stable JSON | Requires an API key; velocity is a snapshot rate, not a forecast |
Step 1: Create the trigger
- Add a Schedule Trigger node and set it to run every 6 hours, or every hour if you need tighter freshness.
- Add a Manual Trigger in parallel so you can test without waiting for the schedule.
Community trend collectors commonly run on a 6-hour cadence (content-autopilot on GitHub), and one n8n template runs daily at 8 AM. Pick a cadence your alert channel can tolerate, since shorter intervals mean more API calls and more noise.
Step 2: Pull live trends with an HTTP Request node
Add an HTTP Request node after the trigger. Set the method to GET, the URL to https://api.trendsagi.com/api/trends, and add the header X-API-Key with your key kept in an environment variable or n8n credential rather than hard-coded.
Supported query parameters include category, search, sort_by (velocity, growth, volume, timestamp, name), sort_dir, limit, page, and period. A practical starting request sorts by velocity:
GET https://api.trendsagi.com/api/trends?category=Technology&sort_by=velocity&sort_dir=desc&limit=25&period=24h
Header: X-API-Key: {{$env.TRENDSAGI_API_KEY}}
Header: Accept: application/jsonFor a category list to populate a dropdown or loop, call GET /api/trends/categories. If you prefer code over nodes, the same data is available from the Python SDK:
import os
from trendsagi import TrendsAGIClient
client = TrendsAGIClient(api_key=os.environ["TRENDSAGI_API_KEY"])
trends = client.get_trends(category="Technology", sort_by="velocity", limit=5)
for t in trends:
print(t)You can also pull the endpoints through the hosted MCP server at https://api.trendsagi.com/mcp if you want an agent layer in front of n8n; each tool call counts as one API request.
Step 3: Enrich the top trends with AI insights
For each trend worth acting on, call GET /api/trends/{id}/ai-insights to get a summary, key themes, sentiment, audience, and marketing angles. Analytics are available at GET /api/trends/{id}/analytics?period=7d. In n8n, add a Loop Over Items node, then an HTTP Request node using the trend ID expression. To limit calls, cap the batch at 5–10 items.
GET https://api.trendsagi.com/api/trends/{{ $json.id }}/ai-insights
Header: X-API-Key: {{$env.TRENDSAGI_API_KEY}}Cross-check before you merge nodes: findings from /api/insights/search?q=AI chips can confirm whether a topic is already part of a broader theme.
Step 4: Deduplicate and filter before alerting
Duplicate alerts are the most common failure in trend workflows. The theme-level answers are simple: store what you already alerted on, compare by trend ID and theme, and require a meaningful threshold before a new alert fires. In n8n, the cleanest approach is a small persistence step before the alert node.
- Append the trend ID to a Google Sheets tab (or a data store node) after each alert.
- Before alerting, check whether the ID already exists; skip if it does.
- Also skip trends whose velocity falls below your threshold, so stale topics do not re-trigger.
n8n's built-in Data Store and Sheets nodes both work here. If you push trend output to Sheets anyway, you get the dedup log for free.
Step 5: Route alerts to Slack, Sheets, or a webhook
n8n's Slack node posts a formatted message; TrendsAGI delivery also supports Slack notifications directly. For a morning digest, use the Google Sheets node to append a row per topic with name, category, velocity, growth, and the AI summary. For teams that want downstream automation, register a signed webhook with TrendsAGI:
POST https://api.trendsagi.com/api/integrations/webhooks
Content-Type: application/json
Header: X-API-Key: {{$env.TRENDSAGI_API_KEY}}
{
"url": "https://your-n8n-host/webhook/trendsagi",
"trigger_type": "trend_velocity",
"delivery_mode": "threshold",
"threshold_value": 500,
"cooldown_seconds": 3600
}New subscriptions start paused. Send POST /api/integrations/webhooks/{id}/test, inspect the delivery, then activate with PATCH /api/integrations/webhooks/{id} and {"is_active": true}. Each delivery carries an X-Webhook-Signature header: the lowercase hex HMAC-SHA256 of the exact raw request body, keyed with the one-time signing secret. Verify it against the unmodified raw bytes using a constant-time comparison before acting on the payload. Map field names from the test delivery rather than guessing, and check attempts with GET /api/integrations/webhooks/{id}/executions.
Step 6: Add error handling to the trend step
- Enable the HTTP Request node's Retry On Fail setting with a short backoff for transient network errors.
- Set the node to continue on error and route failures to a separate Slack message so a single failed trend call does not silence the whole workflow.
- Watch rate pressure with
GET /api/user/api-usageso scheduled runs do not exhaust your quota. - Treat an empty trends array as valid data, not an error; alerting on an empty list wastes attention.
Step 7: Optional — an agent layer with MCP
n8n can be extended via MCP; docs.n8n.io documents claude mcp add --transport http n8n-mcp https:///mcp-server/http, though the endpoint in that example appears truncated, so confirm the exact URL in your setup. In the other direction, TrendsAGI's agent tools let an AI step call trend functions directly:
from trendsagi import TrendsAGIClient, TrendsAGITools
client = TrendsAGIClient(api_key=os.environ["TRENDSAGI_API_KEY"])
tools = TrendsAGITools(client)
print(tools.call("list_trends", {"category": "Technology"}))
print(tools.call("get_trend_ai_insights", {"trend_id": 123}))TrendsAGITools is read-only unless you pass allow_writes=True, and tools.call returns {"result": ...} on success or {"error": ..., "detail": ...} on failure instead of raising.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| 401 from the trends node | Missing or malformed key | Send X-API-Key or Authorization: Bearer; confirm the key in your account profile |
| Empty results | Filter too narrow | Widen category, drop search, or use period=7d |
| Alerts never fire after a webhook subscription | Subscription still paused | Send /test, then PATCH is_active: true |
| Repeated alerts on one topic | No dedup store | Log trend IDs and skip matches |
| Signature check fails | Body parsed before hashing | Hash the raw bytes exactly as received |
| Workflow dies on one bad call | No continue-on-error | Enable retries and a failure branch |
Practical use cases
- Morning digest: a creator or social media manager gets a Sheets row and Slack summary of top velocity topics each morning, matching the pattern of n8n templates that push trends to Sheets and Telegram.
- Content pipeline: an editorial team enriches the top 5 trends with AI insights and writes them to Notion as draft brief topics.
- YouTuber topic radar: filter to AI and automation categories and alert on X and Reddit-adjacent buzz via the trend API instead of scraping.
- Crisis watch: poll
GET /api/intelligence/crisis-eventsand open a Slack thread when something matches your watchlist. - Paid media: feed high-growth topics into previewed ad connector changes; n8n itself does not execute those, so route them through the supported ad connectors where changes are previewed before execution.
Template or build it yourself?
An n8n template gets you moving fast, and the gallery covers Google Trends, News, Reddit, and X patterns. But templates are often labelled only with a relative "last update" note, with no node-compatibility version, no rate-limit guidance, and no dedup logic. Building the trend step yourself against an API costs more setup but gives you stable schemas, documented limits, and error handling. For anything you rely on daily, build the trend source and keep n8n for scheduling and delivery.
Frequently asked questions
What is the fastest way to build an n8n workflow that detects trending topics and alerts me?
Use a Schedule Trigger, one HTTP Request node to GET https://api.trendsagi.com/api/trends?sort_by=velocity, a filter node, and a Slack or Sheets node. That is four nodes and no scraping to maintain.
Which trend data sources can n8n pull from, and what are their limits?
n8n templates pull from Google Trends, News, Reddit, X/Twitter and AI models. The provided sources do not document rate limits or quotas for those services from n8n, so treat scraping reliability as unconfirmed and test your own cadence.
How do I schedule the workflow and avoid duplicate or stale alerts?
Use a Schedule Trigger (6 hours is common in community collectors), store alerted trend IDs in Sheets or a data store, skip IDs already seen, and apply a velocity threshold so stale topics do not re-fire.
Can n8n call an external trend API, Python SDK, or MCP server?
Yes. n8n can call any REST endpoint with an HTTP Request node, including TrendsAGI's API, and it can be extended via MCP per docs.n8n.io. TrendsAGI also exposes a hosted MCP server at https://api.trendsagi.com/mcp.
How do I route trend output to Sheets, Notion, Telegram, or Slack from n8n?
Add the matching n8n node after your filter — Google Sheets append, Notion page create, Telegram send, or Slack post — and map the trend name, category, velocity, and summary fields.
What are the trade-offs between a prebuilt n8n template and building the logic myself?
Templates are faster to start but often undocumented on rate limits, compatibility, and deduplication. A custom build costs setup time but gives stable schemas, error handling, and control over freshness.
How we researched this
Prepared by TrendsAGI Research. Facts checked on 6 November 2026 against the sources listed below.
We read the official n8n documentation listed below. The TrendsAGI steps and code use its documented REST API and Python SDK; confirm the n8n side against its current documentation, since third-party products change.
| Claim | Applies to | Source |
|---|---|---|
| n8n is a fair-code licensed workflow automation tool that combines AI features with business process automation. | All plans | docs.n8n.io |
| n8n documentation supports adding an MCP server to Anthropic Claude Code with `claude mcp add --transport http n8n-mcp https:///mcp-server/http`. | All plans | docs.n8n.io |
| n8n provides over 500 pre-configured integrations and a visual editor for building workflows and AI agents. | All plans | n8n.io |
| An n8n workflow template automates trend monitoring by identifying trending topics, collecting recent news articles, and generating content suggestions. | All plans | n8n.io |
| An n8n template uses a Manual Trigger or Cron to start the flow, sets a topic keyword (default 'Artificial Intelligence'), and gathers trend data via API calls into a spreadsheet. | All plans | n8n.io |
| An n8n workflow runs daily at 8 AM to find trending AI, n8n, and automation topics on X and Reddit, sending results to Telegram and saving them in Notion. | All plans | n8n.io |
| The content-autopilot repo's Trend Collector workflow runs every 6 hours, collects trending topics from multiple sources, and uses AI to process them. | All plans | github.com |
| Social Story Scraper is a series of n8n automations for finding early trending stories on X and turning them into viral content ideas, with a video walkthrough. | All plans | github.com |
| n8n can be self-hosted on your own infrastructure, on-premises, or in a private cloud using Docker Compose, a one-line setup, or other deployment methods. | self-hosted | docs.n8n.io |
We re-research and rewrite this page at least every four months; the updated date only changes when the facts are re-checked.
Sources
- n8n Docs — docs.n8n.io
- Workflows App Automation Features from n8n.io — n8n.io
- content-autopilot (GitHub (lcr154)) — github.com