AI News Digest — Instruction Manual

AI News Digest Workflow

Complete Instruction Manual — n8n Self-Hosted Automation

n8n v2.10.4 GPT-4o-mini Gmail SMTP Version 1.0 — March 2026 Weekday 8 AM Auto-Send

No results found. Try a different search term.

1 What This Workflow Does

This is a fully automated AI News Digest system that runs without any manual action needed.

📅 Runs every weekday at 8:00 AM 📰 Fetches from 4 news sources 🧠 Summarizes with GPT-4o-mini 📧 Sends HTML email to 2 recipients

Four Coverage Categories

🔮 New AI Technologies 🔧 New AI Tools ⚙ AI Automation 🧠 AI Language Models

Why This Is Useful

  • Saves 30–60 minutes of manual news reading per day
  • Provides a curated, summarized view instead of raw articles
  • Delivered automatically — no manual action needed
  • Consistent format makes it easy to scan quickly
💡 Key Insight
This workflow collects data from multiple public sources, processes and cleans it, enriches it with AI intelligence, formats it for human consumption, and delivers it automatically — all without touching a keyboard.
2 Applications & Tools Involved

2.1 n8n (Workflow Automation Platform)

ℹ What it is
An open-source workflow automation tool, similar to Zapier or Make.com. The central orchestrator that connects all other tools together.
  • Runs: Locally on your Windows machine via Node.js
  • Access: http://localhost:5678
  • Key concept: n8n uses "nodes" (building blocks) connected together to form a "workflow"

2.2 RSS Feeds (News Sources)

RSS (Really Simple Syndication) is a standard format websites use to publish their latest content in a structured, machine-readable way. No API key needed — RSS feeds are publicly available.

SourceURLFocus
TechCrunch AItechcrunch.com/category/artificial-intelligence/feed/Startup & industry news
The Verge AItheverge.com/rss/index.xmlConsumer tech & AI products
VentureBeat AIventurebeat.com/category/ai/feed/Enterprise AI & business
MIT Tech Reviewtechnologyreview.com/feed/Research & deep tech

2.3 OpenAI API (GPT-4o-mini)

💰 Cost
Very low — approximately $0.001–$0.003 per daily digest. At this rate, $5 covers over 1,000 digests.
  • Model: GPT-4o-mini — fast, cost-effective, and highly capable
  • How it's called: Via n8n's built-in OpenAI node with your API key
  • API Key: Obtained from https://platform.openai.com/api-keys

2.4 Gmail SMTP (Email Delivery)

  • Server: smtp.gmail.com, Port 465 (SSL)
  • Authentication: Uses a Gmail App Password (not your regular password)
  • Recipients: chekchoon@gmail.com and chekchoon@sp.edu.sg
⚠ Important
Regular Gmail passwords don't work with SMTP. You must use a Gmail App Password. See Section 5.2 for setup instructions.
3 How They Work Together — Flow Diagram
┌───────────────────────────────────────┐ │ WORKFLOW FLOW DIAGRAM │ └───────────────────────────────────────┘ ┌──────────────────┐ │ SCHEDULE TRIGGER │ ← Fires every weekday 8:00 AM │ (Mon–Fri 8AM) │ └───────├─────────┘ │ triggers all 4 simultaneously ▼ ┌───────────────────────────────────────┐ │ RSS FEED READERS (4 parallel) │ │ ┌────────────┐ ┌────────────┐ │ │ │ TechCrunch │ │ The Verge │ │ │ └──────├─────┘ └──────├─────┘ │ │ │ │ │ │ ┌────────────┐ ┌────────────┐ │ │ │ VentureBeat │ │ MIT Review │ │ │ └──────├─────┘ └──────├─────┘ │ └─────────├─────────────────├─────────┘ │ │ ▼ ▼ ┌───────────────┐ ┌───────────────┐ │ Merge Group 1 │ │ Merge Group 2 │ │ (TC + Verge) │ │ (VB + MIT) │ └──────├────────┘ └──────├────────┘ │ │ └───────────┴─────────┮ ▼ ┌──────────────────┐ │ Merge All News │ ← Combines all 4 sources └─────────├────────┘ ▼ ┌──────────────────┐ │ Process & Dedup │ ← Sort, deduplicate, │ (Code Node) │ top 25, format for AI └─────────├────────┘ ▼ ┌──────────────────┐ │ OpenAI Summarize │ ← GPT-4o-mini reads all │ (OpenAI Node) │ articles, writes summary └─────────├────────┘ ▼ ┌──────────────────┐ │ Build HTML Email │ ← Converts to HTML with │ (Code Node) │ green CSS styling └─────────├────────┘ ▼ ┌──────────────────┐ │ Send Email │ ← Gmail SMTP to both │ (Email Node) │ recipients └──────────────────┘

Data Flow Explained

  1. Schedule fires → triggers all 4 RSS nodes simultaneously
  2. Each RSS node fetches ~10–20 latest articles from its source
  3. Merge nodes combine all articles into one list (~40–80 items)
  4. Code node sorts by date, removes duplicates, keeps top 25
  5. OpenAI receives the 25 article titles + summaries
  6. OpenAI returns a structured 4-section digest
  7. Code node wraps the digest in HTML with CSS styling
  8. Email node sends the HTML email via Gmail to both recipients
4 Node-by-Node Breakdown
Node 1
⏰ Schedule Trigger
Starts the entire workflow automatically. Fires at 8 AM, Monday–Friday only.
scheduleTrigger
Nodes 2–5
📰 RSS Feed Readers
Fetches latest articles from TechCrunch, The Verge, VentureBeat, and MIT Tech Review simultaneously.
rssFeedRead
Nodes 6–8
🔁 Merge Nodes
Combines articles from multiple sources into one list using append mode (3 merges because each handles 2 inputs).
merge (append)
Node 9
⚙ Process & Deduplicate
Sorts by date, removes duplicate titles, limits to top 25, and formats text for AI processing.
code (JavaScript)
Node 10
🧠 OpenAI Summarize
Uses GPT-4o-mini to intelligently read and summarize all 25 articles into a structured 4-section digest.
openAi
Node 11
🌐 Build HTML Email
Converts the plain-text AI summary into a beautiful HTML email with green CSS styling.
code (JavaScript)
Node 12
📧 Send Email
Delivers the HTML email to chekchoon@gmail.com and chekchoon@sp.edu.sg via Gmail SMTP.
emailSend

Node 1: Schedule Trigger — Cron Expression

PartValueMeaning
Minute0At minute 0 (top of the hour)
Hour8At 8 AM
Day of month*Every day of month
Month*Every month
Day of week1-5Monday (1) through Friday (5) only
0 8 * * 1-5

Nodes 2–5: RSS Feed Readers — Output Fields

Each RSS node outputs an array of article objects containing:

FieldDescription
titleArticle headline
contentSnippetShort text preview
linkURL to full article
isoDatePublication date/time (ISO format)
pubDateAlternative date format

Node 9: Process & Deduplicate — Code

const items = $input.all();
const sorted = items.sort((a, b) => {
  const dateA = new Date(a.json.isoDate || a.json.pubDate || 0);
  const dateB = new Date(b.json.isoDate || b.json.pubDate || 0);
  return dateB - dateA;
});
const seen = new Set();
const unique = sorted.filter(item => {
  const title = (item.json.title || '').toLowerCase().trim();
  if (seen.has(title)) return false;
  seen.add(title);
  return true;
});
const top = unique.slice(0, 25);
const newsText = top.map((item, i) => {
  const title = item.json.title || 'No title';
  const snippet = (item.json.contentSnippet || item.json.summary || item.json.content || '')
    .replace(/<[^>]+>/g, '').substring(0, 300);
  const date = item.json.isoDate || item.json.pubDate || '';
  return `${i + 1}. ${title} (${date})\n${snippet}`;
}).join('\n\n');
const today = new Date();
const dateStr = today.toLocaleDateString('en-US', {
  weekday: 'long', year: 'numeric', month: 'long', day: 'numeric'
});
const systemPrompt = "You are an expert AI news curator...";
const userPrompt = "AI news digest for " + dateStr + ":\n\n" + newsText;
return [{ json: {
  dateStr,
  messages: [
    { role: "system", content: systemPrompt },
    { role: "user", content: userPrompt }
  ]
} }];

Node 10: OpenAI — Response Path

ℹ Important
The n8n OpenAI node stores the AI's response at this specific path: output[0].content[0].text

Node 11: Build HTML Email — Key Settings

SettingValue
Input path$input.first().json.output[0].content[0].text
Markdown handlingConverts ####, ###, ## to HTML headings
StylingLight green background, dark green headers
Output fieldshtml (full HTML) and subject (email subject line)

Node 12: Send Email — Configuration

FieldValue
FromYour Gmail address
Tochekchoon@gmail.com, chekchoon@sp.edu.sg
Subject={{ $json.subject }} (expression toggle ON)
Message={{ $json.html }} (expression toggle ON)
Email TypeHTML
⚠ Common Mistake
The Message and Subject fields MUST have the expression toggle switched ON (the fx icon). Without it, the literal text ={{ $json.html }} is sent instead of the actual HTML.
5 Credentials Setup Guide

5.1 OpenAI API Key

  1. Go to https://platform.openai.com/api-keys
  2. Click "Create new secret key"
  3. Give it a name (e.g., "n8n AI Digest")
  4. Copy the key (starts with sk-proj-...) — you only see it once!
  5. In n8n: Settings → Credentials → Add → OpenAI
  6. Paste the key and click Save
💰 Cost Management
Set a monthly budget limit at https://platform.openai.com/settings/limits. Recommended starting limit: $5/month — more than enough for daily digests. When the limit is reached, OpenAI will stop processing requests but your account remains active.

5.2 Gmail App Password

⚠ Why App Password?
Google blocks "less secure app" access to Gmail. App Passwords are special one-time passwords that grant specific app access without exposing your main password.
  1. Enable 2-Factor Authentication on your Google account (required first)
  2. Go to https://myaccount.google.com/apppasswords
  3. Select "Mail" as the app, then click "Generate"
  4. Copy the 16-character password (e.g., abcd efgh ijkl mnop)
  5. In n8n: Settings → Credentials → Add → SMTP
  6. Enter:
    • Host: smtp.gmail.com
    • Port: 465
    • SSL: ON
    • User: your-email@gmail.com
    • Password: the 16-char app password (no spaces)
6 Troubleshooting Guide

❌ "404 Not Found" on RSS node

Cause
The RSS feed URL has changed or the website restructured their feeds.

Fix: Visit the news website directly, look for an RSS icon or link in the footer, and update the URL in the RSS node.

Alternative URLs to try:

TechCrunch: https://techcrunch.com/feed/
The Verge:  https://www.theverge.com/rss/index.xml

❌ "Bad request" on OpenAI node

  • Is your OpenAI API key valid and not expired?
  • Do you have credits in your OpenAI account?
  • Is the credential properly linked to the node?
  • Check OpenAI status at https://status.openai.com

❌ Email sends but no content shows

Cause
The HTML message field is not properly set to use expressions.

Fix:

  1. Open the Send Email node
  2. Set Email Type = HTML
  3. Message field must contain ={{ $json.html }} with expression toggle ON
  4. Subject must contain ={{ $json.subject }} with expression toggle ON

❌ Workflow runs on weekends

Cause
Cron expression is incorrect — using * * * instead of 1-5.

Fix: Ensure cron is 0 8 * * 1-5 (not 0 8 * * *)

❌ "Module disallowed" in Code node

Cause
n8n's sandbox restricts Node.js built-in modules.

What's allowed: Pure JavaScript only (Math, JSON, Array, Date, etc.)

What's NOT allowed: require('https'), require('fs'), fetch, this.helpers

Fix: Use n8n's dedicated nodes (HTTP Request, OpenAI) for external calls

❌ Content shows as "[object Object]"

Cause
You're displaying an object instead of a string.

Fix: Use JSON.stringify(object) to convert to readable text, or navigate to the correct nested property (e.g., output[0].content[0].text)

❌ n8n stops after closing terminal

Cause
n8n process ends when the terminal closes.

Fix: Run n8n as a background service using PM2:

# Install PM2 process manager
npm install -g pm2

# Start n8n with PM2
pm2 start n8n

# Auto-start on system boot
pm2 startup
pm2 save

❌ Headers not formatting in email

Cause
OpenAI uses different markdown heading levels (### or ####) that your regex doesn't handle.

Fix: Update the markdownToHtml function to handle all heading levels:

MarkdownHTML OutputUsage
####<h2>Section headers
###<h2>Main title
##<h3>Sub-headers
7 Future Enhancements

7.1 Add More News Sources

Wired AI:       https://www.wired.com/feed/tag/ai/latest/rss
Ars Technica:   https://feeds.arstechnica.com/arstechnica/index
Google AI Blog: https://blog.google/technology/ai/rss/
Hugging Face:   https://huggingface.co/blog/feed.xml

7.2 Weekday Safety Net (IF Node)

Add an IF node after the Schedule Trigger to double-check it's a weekday:

// In an IF node condition:
{{ [1,2,3,4,5].includes(new Date().getDay()) }}

7.3 Store Digest in Google Sheets

Add a Google Sheets node to keep a historical archive: log each digest with date, number of articles, and key topics. Useful for tracking AI trends over time.

7.4 Add Telegram/Slack Notification

Send a quick notification alongside the email:

  • Telegram Bot node — sends a brief 3-line summary to your phone
  • Slack node — posts to a team channel

7.5 Topic Filtering

// Keep only articles mentioning key AI terms
const aiKeywords = ['AI', 'machine learning', 'LLM', 'GPT', 'neural', 'OpenAI', 'Anthropic'];
const filtered = items.filter(item =>
  aiKeywords.some(kw =>
    (item.json.title || '').toLowerCase().includes(kw.toLowerCase())
  )
);

7.6 Personalized Summaries

Create different email versions for different audiences:

  • Technical version (for developers) — include code snippets, model benchmarks
  • Business version (for managers) — focus on business impact and ROI

7.7 Error Handling & Alerts

  1. Enable "Continue on Fail" on each node
  2. Add an IF node to check for errors
  3. Send yourself a simple text email if any node fails

7.8 Unsubscribe Feature

Add a one-click unsubscribe link in the email footer using n8n's webhook feature.

7.9 AI News Scoring

Use OpenAI to rate each news item by importance (1–10) and only include top-rated items.

7.10 Multi-Language Support

Add a translation step to send the digest in multiple languages for international recipients.

8 Quick Reference Cheatsheet

n8n Key Concepts

TermMeaning
NodeA single step/action in the workflow
WorkflowA chain of connected nodes
TriggerThe node that starts the workflow
ExpressionDynamic value using ={{ }} syntax
CredentialSaved login/API key for a service
ExecutionOne run of the entire workflow

n8n Expression Syntax

ExpressionMeaning
={{ $json.fieldName }}Access a field from current node's data
={{ $input.first().json.field }}Access first input item's field
={{ $now }}Current date/time
={{ new Date().toLocaleDateString() }}Formatted date string

Cron Expression Reference

ExpressionSchedule
0 8 * * 1-58 AM, Monday–Friday
0 9 * * 1-59 AM, Monday–Friday
0 8 * * *8 AM, every day
0 8,17 * * 1-58 AM and 5 PM, weekdays

OpenAI Model Comparison

ModelSpeedCostBest For
gpt-4o-miniFastLowestDaily digests (recommended)
gpt-4oMediumMediumMore detailed analysis
gpt-4-turboSlowHighestComplex reasoning tasks

Common n8n Node Types

NodePurpose
Schedule TriggerTime-based automation
RSS Feed ReadFetch news from RSS feeds
MergeCombine multiple data streams
Code (JavaScript)Custom data processing
OpenAIAI text generation
Send EmailSMTP email delivery
HTTP RequestCall any web API
IFConditional branching
SetModify/set data fields
🌟 Summary
This workflow demonstrates a complete end-to-end automation pipeline: Collect (RSS) → Process (Code) → Enrich with AI (OpenAI) → Deliver (Email). The same pattern applies to customer feedback analysis, social media monitoring, sales lead qualification, document processing, and price monitoring.
AI News Digest Workflow — v1.0 — March 2026 — n8n v2.10.4