Back to feed
Mansour Sarr Stockholm, Sweden

Build an n8n AI Newsletter Digest in Gmail

One email instead of 50: an n8n workflow that reads all my AI newsletters and sends me a single daily digest in under 2 minutes THE PROBLEM: I subscribe to dozens of AI newsletters. The Rundown, Superhuman, TLDR, The Neuron, AlphaSignal, TheSequence, Turing Post and many more. Reading them took hours every day, and most of them cover the same three stories. I wanted the coverage without the reading time. So I moved every subscription to a dedicated Gmail address and let n8n read that inbox for me. It has run daily since February 2026 and I now read one email a day instead of 50. STACK: n8n (hosted on Hostinger), Gmail, Google Gemini 2.5 Pro. HOW TO BUILD IT: STEP 1: Create a dedicated Gmail account and move every newsletter subscription to it. This one decision makes everything else simple. Your personal inbox stays clean and the workflow never touches mail that is not a newsletter. STEP 2: Schedule Trigger node, daily at 08:00. Set the workflow timezone (mine is Europe/Stockholm) or the trigger runs on server time. STEP 3: Gmail Get Many Messages node on the newsletter account. Filter by read status: unread. Return All: on. Simplify: OFF. That last toggle matters, see gotcha 2. STEP 4: Connect two branches off that node. Branch one is a Gmail Mark As Read node with message ID {{ $json.id }}. Unread is the whole state system: each run only fetches what arrived since the last run. No database, no date filters, no dedupe logic. STEP 5: Branch two is an Aggregate node. Aggregate the "html" field of every email into one array field called CombinedNewsletter. This means one AI call per day instead of one call per email. STEP 6: AI Agent node with a Google Gemini Chat Model attached (models/gemini-2.5-pro). Turn on Retry On Fail with 5000 ms between tries. The prompt: Below is all the news in html format. Only use what is provided; if the HTML looks cut off, still summarize everything you can see. {{ $json["CombinedNewsletter"].join('\n\n').substring(0, 250000) }} The substring cap is load bearing, see gotcha 1. System message (verbatim, numbering written as (1) so this form does not strip it): "You will receive ALL the AI newsletters from the past day in HTML format. Your task: (1) Extract every distinct news item (no duplicates, even if repeated in multiple newsletters). (2) For each item, find: a short, human-readable title, the best URL, a one-sentence summary (max 25 words). (3) Estimate popularity based on how many newsletters mention it. If an item appears only once, rank by how interesting the general public might find it. Output format (Markdown only): # Daily AI News Digest, then '## Top headlines' listing the 5 most popular/important items as 'Title Summary sentence', then '## More news' listing all remaining items in the same format. Rules: Always use Markdown links like Title, never show bare URLs. Do not skip any news item. Do not add any commentary, explanations, or closing text beyond the structure above." STEP 7: Markdown node, mode Markdown to HTML, destination key combinedHTML. STEP 8: Gmail Send node to your personal address. Subject: Here's ALL the AI News! {{now.toFormat('yyyy-MM-dd')}}. Wrap {{ json.combinedHTML}} in a full HTML document with inline CSS: white card, max-width 720px, system fonts, styled links. See gotcha 4. FOUR THINGS THAT COST ME HOURS: (1) Raw newsletter HTML broke Gemini. The workflow refused to execute with a payload limit error. Newsletter HTML is enormous: tracking pixels, nested tables, inline styles. Fifty of them concatenated is millions of characters. The .substring(0, 250000) cap in the prompt fixed it, and the "if the HTML looks cut off, still summarize" line tells the model how to handle the truncation. (2) Gmail's Simplify toggle is on by default and strips the message body. Gemini kept receiving empty or gutted content and no error explained why. Turn Simplify off to get the full html field. (3) Gemini rate limits AND timeouts both hit on big runs. Retry On Fail with a 5 second wait fixed both. Without it, one 429 kills the whole morning digest. (4) Sending the model's raw markdown as email looked broken in Gmail. Two part fix: a Markdown to HTML node, then a proper HTML template with CSS in the send node. RESULT: the latest real run turned 50 unread newsletter emails into one clean digest in less than 2 minutes (1 minute 27 seconds to be exact). Running every morning since February 2026. Honest failure mode: mark as read runs as a parallel branch, so if Gemini fails after all retries, that day's emails are already marked read and drop out of tomorrow's digest. I accepted that trade off. The alternative is duplicate items on every retry, and one missed day costs less than a digest full of repeats. Rebuild time: about 30 to 45 minutes if the dedicated inbox already exists.

Industry
#dailydigest#emailautomation#informationoverload#newsletter#summarization

Tools used

0 comments

Read the Community guidelines

No comments yet. Be the first to weigh in.

Current rank #42 Upvotes 0