Skip to main content

Create personalized news digests with GPT-5.1, SerpAPI, and Telegram delivery

Workflow preview

Workflow preview
100%
Create personalized news digests with GPT-5.1, SerpAPI, and Telegram delivery preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Staying up to date with fast moving topics like AI, machine learning, or your specific industry can be overwhelming. You either drown in daily noise or miss important developments between weekly di...

Best for

  • Social Media automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.set, n8n-nodes-base.code, n8n-nodes-base.httprequest, n8n-nodes-base.splitout, n8n-nodes-base.datatable, n8n-nodes-base.sort, n8n-nodes-base.limit, n8n-nodes-base.aggregate

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Felix Kemeth.

Original n8n.io source

1.1 Workflow description

Title
Create personalized news digests with GPT-5.1, SerpAPI, and Telegram delivery
Workflow name
Create personalized news digests with GPT-5.1, SerpAPI, and Telegram delivery

Overview

Staying up to date with fast-moving topics like AI, machine learning, or your specific industry can be overwhelming. You either drown in daily noise or miss important developments between weekly digests.

This AI News Agent workflow delivers a curated newsletter only when there's genuinely relevant news. I use it myself for AI and n8n topics.

Key features:

  • AI-driven send decision: An AI agent evaluates whether today's news is worth sending.
  • Deduplication: Compares candidate articles against past newsletters to avoid repetition.
  • Real-time news: Uses SerpAPI's DuckDuckGo News engine for fresh results.
  • Frequency guardrails: Configure minimum and maximum days between newsletters.

In this post, I'll walk you through the complete workflow, explain each component, and show you how to set it up yourself.

What this workflow does

At a high level, the AI News Agent:

  1. Fetches fresh news twice daily via SerpAPI's DuckDuckGo News engine.
  2. Stores articles in a persistent data table with automatic deduplication.
  3. Filters for freshness - only considers articles newer than your last newsletter.
  4. Applies frequency guardrails - respects your min/max sending preferences.
  5. Makes an editorial decision - AI evaluates if the news is worth sending.
  6. Enriches selected articles - uses Tavily web search for fact-checking and depth.
  7. Delivers via Telegram - sends a clean, formatted newsletter.
  8. Remembers what it sent - stores each edition to prevent future repetition.

This allows you to get newsletters only when there's genuinely relevant news - in contrast to a fixed schedule.

Requirements

To run this workflow, you need:

  • SerpAPI key
    Create an account at serpapi.com and generate an API key. They offer 250 free searches/month.

  • Tavily API key
    Sign up at app.tavily.com and create an API key. Generous free tier available.

  • OpenAI API key
    Get one from OpenAI - required for AI agent calls.

  • Telegram bot + chat ID
    A free Telegram bot (via BotFather) and the chat/channel ID where you want the newsletter. See Telegram's bot tutorial for setup.

How it works

The workflow is organized into five logical stages.

Stage 1: Schedule & Configuration

  • Schedule Trigger
    Runs the workflow on a cron schedule. Default: 0 0 9,17 * * * (twice daily at 9:00 and 17:00). These frequent checks enable the AI to send newsletters at these times when it observes actually relevant news, not only once a week. I picked 09:00 and 17:00 as natural check‑in points at the start and end of a typical workday, so you see updates when you’re most likely to read them without being interrupted in the middle of deep work. With SerpAPI’s 250 free searches/month, running twice per day with a small set of topics (e.g. 2–3) keeps you comfortably below the limit; if you add more topics or increase the schedule frequency, either tighten the cron window or move to a paid SerpAPI plan to avoid hitting the cap.

  • Set topics and language
    A Set node that defines your configuration:

    • topics: comma-separated list (e.g., AI, n8n)
    • language: output language (e.g., English)
    • minDaysBetween: minimum days to wait (0 = no minimum)
    • maxDaysBetween: maximum days without sending (triggers a "must-send" fallback)

Stage 2: Fetch & Store News

  • Build topic queries
    Splits your comma-separated topics into individual search queries: In DuckDuckGo News via SerpAPI, a query like AI,n8n looks for news where both “AI” and “n8n” appear. For a niche tool like n8n, this is often almost identical to just searching for n8n (docs). It’s therefore better to split the topics, search for each of them separately, and let the AI later decide which news articles to select.
return $input.first().json.topics.split(',').map(topic => ({
  json: { topic: topic.trim() }
}));
  • Fetch news from SerpAPI (DuckDuckGo News)
    HTTP Request node calling SerpAPI with:

    • engine: duckduckgo_news
    • q: your topic
    • df: d (last day)

    Auth is handled via httpQueryAuth credentials with your SerpAPI key.

SerpAPI also offers other news engines such as the Google News API (see here). DuckDuckGo News is used here because, unlike Google News, it returns an excerpt/snippet in addition to the title, source, and URL (see here)—giving the AI more context to work with. Another option is NewsAPI, but its free tier delays articles by 24 hours, so you miss the freshness window that makes these twice-daily checks valuable. DuckDuckGo News through SerpAPI keeps the workflow real-time without that lag. n8n has official SerpAPI nodes, but as of writing there is no dedicated node for the DuckDuckGo News API. That’s why this workflow uses a custom HTTP Request node instead, which works the same under the hood while giving you full control over the DuckDuckGo News parameters.

  • Split SerpAPI results into articles
    Expands the results array so each article becomes its own item.

  • Upsert articles into News table
    Stores each article in an n8n data table with fields: title, source, url, excerpt, date. Uses upsert on title + URL to avoid duplicates. Date is normalized to ISO UTC:

DateTime.fromSeconds(Number($json.date), {zone: 'utc'}).toISO()

Stage 3: Filtering & Frequency Guardrails

This is where the workflow gets smart about what to consider and when to send.

  • Get previous newsletters → Sort → Get most recent
    Pulls all editions from the Newsletters table and isolates the latest one with its createdAt timestamp.

  • Combine articles with last newsletter metadata
    Attaches the last newsletter timestamp to each candidate article.

  • Filter articles newer than last newsletter
    Keeps only articles published after the last edition. Uses a safe default date (2024-01-01) if no previous newsletter exists:

$json.date_2 > ($json.createdAt_1 || DateTime.fromISO('2024-01-01T00:00:00.000Z'))
  • Stop if last newsletter is too recent
    Compares createdAt against your minDaysBetween setting. If you're still in the "too soon to send" window, the workflow short-circuits here.

Stage 4: AI Editorial Decision

This is the core intelligence of the workflow - an AI that decides whether to send and what to include. This stage is also the actual agentic part of the workflow, where the system makes its own decisions instead of just following a fixed schedule.

  • Aggregate candidate articles for AI
    Bundles today's filtered articles into a compact list with title, excerpt, source, and url.

  • Limit previous newsletters to last 5 → Aggregate
    Prepares the last 5 newsletter contents for the AI to check against for repetition.

  • Combine candidate articles with past newsletters
    Merges both lists so the AI sees "today's candidates" + "recent history" side by side.

  • AI: decide send + select articles
    The heart of the workflow. A GPT-5.1 call with a comprehensive editorial prompt:

You are an **AI Newsletter Editor**. Your job is to decide whether today’s newsletter edition should be sent, and to select the best articles.

You will receive a list of articles with:
'title', 'excerpt', `source`, `url`.

You will also receive content of **previously sent newsletters** (markdown).

# Your Tasks

## 1. Decide whether to send the newsletter

Output "YES" only if all of the following are satisfied **OR** the fallback rule applies:

### **Base Criteria**

1. There are **at least 3 meaningful articles**.
   *Meaningful = not trivial, not purely promotional, not clickbait, contains actual informational value.*

2. Articles must be **non-duplicate and non-overlapping**:

   * Not the same topic/headline rephrased
   * Not reporting identical events with minor variations
   * Not the same news covered by multiple sources without distinct insights

3. Articles must be **relevant to the user's topics**:
   **{{ $('Set topics and language').item.json.topics }}**

4. Articles must be **novel** relative to the **topics in previous newsletters**:

   * Compare against all previous newsletters below
   * Exclude articles that discuss topics already substantially covered

5. Articles must offer **clear value**:

   * New information
   * Impact that matters to the user
   * Insight, analysis, or meaningful expansion

### **Fallback rule: Newsletter frequency requirement**

If **at least 1 relevant article exists** *and*
the last newsletter was sent **more than {{ $('Set topics and language').item.json.maxDaysBetween }} days ago**, then you **MUST** return "YES" as a decision even if the other criteria are not completely met.

Last newsletter was sent {{ $('Get most recent newsletter').item.json.createdAt ? Math.floor($now.diff(DateTime.fromISO($('Get most recent newsletter').item.json.createdAt), 'days').days) : 999 }} days ago.

### Otherwise → "NO"

## **2. If "YES": Select Articles**

Select the **top 3–5** articles that best fulfill the criteria above.

For each selected article, output:

* **title** (rewrite for clarity, conciseness, and impact)
* **summary** (1–2 sentences; written in the output language)
* **source**
* **url**

All summaries **must** be written in:
**{{ $('Set topics and language').item.json.language }}**

---

# **Output Format (JSON)**

{
  "decision": "YES or NO",
  "articles": [
    {
      "title": "...",
      "summary": "...",
      "source": "...",
      "url": "..."
    }
  ]
}

When "decision": "NO", return an empty array for "articles".

# **Article Input**

Use these articles:

{{
  $json.results.map(
   article =>
    `Title: ${article.title_2}
     Excerpt: ${article.excerpt_2}
     Source: ${article.source_2}
     URL: ${article.url_2}`
  ).join('\n---\n')
}}

You must also consider the topics already covered in previous newsletters to avoid repetition:

{{ $json.newsletters.map(x => `Newsletter: ${x.content}`).join('\n---\n') }}

The AI outputs structured JSON:

{
  "decision": "YES",
  "articles": [
    {
      "title": "...",
      "summary": "...",
      "source": "...",
      "url": "..."
    }
  ]
}
  • If AI decided to send newsletter
    Routes based on decision === "YES". If NO, the workflow ends gracefully.

Stage 5: Content Enrichment & Delivery

  • Split selected articles for enrichment
    Each selected article becomes its own item for individual processing.

  • AI: enrich & write article
    An AI Agent node with GPT-5.1 + Tavily web search tool. For each article:

You are a research writer that updates short news summaries into concise, factual articles.

**Input:**
Title: {{ $json["title"] }}
Summary: {{ $json["summary"] }}
Source: {{ $json["source"] }}
Original URL: {{ $json["url"] }}
Language: {{ $('Set topics and language').item.json.language }}

**Instructions:**

1. Use **Tavily Search** to gather 2–3 reliable, recent, and relevant sources on this topic.
2. Update the **title** if a more accurate or engaging one exists.
3. Write **1–2 sentences** summarizing the topic, combining the original summary and information from the new sources.
4. Return the original source name and url as well.

**Output (JSON):**

{
  "title": "final article title",
  "content": "concise 1–2 sentence article content",
  "source": "the name of the original source",
  "url": "the url of the original source"
}

**Rules:**

* Ensure the topic is relevant, informative, and timely.
* Translate the article if necessary to comply with the desired language {{ $('Set topics and language').item.json.language }}.

The Output Parser enforces the JSON schema with title, content, source, and url fields.

  • Aggregate enriched articles
    Collects all enriched articles back into a single array.

  • Insert newsletter content into Newsletters table
    Stores the final markdown content for future deduplication:

$json.output.map(article => {
  const title = JSON.stringify(article.title).slice(1, -1);
  const content = JSON.stringify(article.content).slice(1, -1);
  const source = JSON.stringify(article.source).slice(1, -1);
  const url = JSON.stringify(article.url).slice(1, -1);
  return `*${title}*\n${content}\nSource: [${source}](${url})`;
}).join('\n\n')
  • Send newsletter to Telegram
    Sends the formatted newsletter to your Telegram chat/channel.

Why this workflow is powerful

  • Intelligent send decisions
    The AI evaluates news quality before sending, leading to a less noisy and more relevant news digest.

  • Memory across editions
    By persisting newsletters and comparing against history, the workflow avoids repetition.

  • Frequency guardrails with flexibility
    Set boundaries (e.g., "at least 1 day between sends" and "must send within 5 days"), but let the AI decide the optimal moment within those bounds.

  • Source-level deduplication
    The news table with upsert prevents the same article from being considered multiple times across runs.

  • Grounded in facts
    SerpAPI provides real news sources; Tavily enriches with additional verification. The newsletter stays factual.

  • Configurable and extensible
    Change topics, language, frequency - all in one Set node. In addition, the workflow is modular, allowing to add new news sources or new delivery channels without touching the core logic.

Configuration guide

To customize this workflow for your needs:

  1. Topics and language
    Open Set topics and language and modify:

    • topics: your interests (e.g., machine learning, startups, TypeScript)
    • language: your preferred output language
  2. Frequency settings

    • minDaysBetween: minimum days between newsletters (0 = no limit)
    • maxDaysBetween: maximum gap before forcing a send
    • For very high-volume topics (such as "AI"), expect the workflow to send almost every time once minDaysBetween has passed, because the content-quality criteria are usually met.
  3. Schedule
    Modify the Schedule Trigger cron expression. Default runs twice daily at 9:00 am and 5:00 pm; adjust to your preference.

  4. Telegram
    Update the chatId in the Telegram node to your chat/channel.

  5. Credentials
    Set up credentials for: SerpAPI (httpQueryAuth), Tavily, OpenAI, Telegram.

Next steps and improvements

Here are concrete directions to take this workflow further:

  • Multi-agent architecture
    Split the current AI calls into specialized agents: signal detection, relevance scoring, editorial decision, content enhancement, and formatting - each with a single responsibility.

  • 1:1 personalization
    Move from static topics to weighted preferences. Learn from click behavior and feedback.

  • Telegram feedback buttons
    Add inline buttons (👍 Useful / 👎 Not relevant / 🔎 More like this) and feed signals back into ranking.

  • Email with HTML template
    For more flexibility, send the newsletter via email.

  • Incorporating other news APIs or RSS feeds
    Add more sources such as other news APIs and RSS feeds from blogs, newsletters, or communities.

  • Adjust for arxiv paper search and research news
    Swap SerpAPI for arxiv search or other academic sources to obtain a personal research digest newsletter.

  • Images and thumbnails
    Fetch representative images for each article and include them in the newsletter.

  • Web archive
    Auto-publish each edition as a web page with permalinks.

  • Retry logic and error handling
    Add exponential backoff for external APIs and route failures to an error workflow.

  • Prompt versioning
    Move prompts to a data table with versioning for A/B testing and rollback.

  • Audio and video news
    Use audio or video models for better news communication.

Wrap-up

This AI News Agent workflow represents a significant evolution from simple scheduled newsletters. By adding intelligent send decisions, historical deduplication, and frequency guardrails, you get a newsletter that respects the quality of available news.

I use this workflow myself to stay informed on AI and automation topics without the overload of daily news or the delayed delivery caused by a fixed newsletter schedule.

Need help with your automations? Contact me here.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Set topics and language

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 2 - Build topic queries

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 3 - Fetch news from SerpAPI (DuckDuckGo News)

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 4 - Split SerpAPI results into articles

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 5 - Upsert articles into News table

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 6 - Get previous newsletters

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 7 - Sort newsletters by newest first

Type / Role
n8n-nodes-base.sort - sort
Config choices
Version 1

Block 8 - Get most recent newsletter

Type / Role
n8n-nodes-base.limit - limit
Config choices
Version 1

Block 9 - Limit previous newsletters to last 5

Type / Role
n8n-nodes-base.limit - limit
Config choices
Version 1

Block 10 - Aggregate previous newsletters into list

Type / Role
n8n-nodes-base.aggregate - aggregate
Config choices
Version 1

Block 11 - Combine articles with last newsletter metadata

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 12 - Filter articles newer than last newsletter

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.2

Block 13 - Stop if last newsletter is too recent

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 14 - Aggregate candidate articles for AI

Type / Role
n8n-nodes-base.aggregate - aggregate
Config choices
Version 1

Block 15 - Combine candidate articles with past newsletters

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 16 - If AI decided to send newsletter

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 17 - Split selected articles for enrichment

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 18 - GPT-5.1

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 19 - Tavily web search tool

Type / Role
@tavily/n8n-nodes-tavily.tavilyTool - tavilyTool
Config choices
Version 1

Block 20 - Parse enriched article JSON

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 21 - AI: enrich & write article

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 22 - AI: decide send + select articles

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.8

Block 23 - Aggregate enriched articles

Type / Role
n8n-nodes-base.aggregate - aggregate
Config choices
Version 1

Block 24 - Insert newsletter content into Newsletters table

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Showing the first 24 of 32 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Create personalized news digests with GPT-5.1, SerpAPI, and Telegram delivery
Complexity advanced
Nodes 32
Categories Social Media, AI RAG
Author Felix Kemeth
Published 02 Dec 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/11425/11425.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Create personalized news digests with GPT-5.1, SerpAPI, and Telegram delivery do?

Staying up to date with fast moving topics like AI, machine learning, or your specific industry can be overwhelming. You either drown in daily noise or miss important developments between weekly di...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Social Media, AI RAG use case.