Tutorial · Intermediate

Read all your newsletters in one email every Friday

Newsletters pile up and you never get to them: Gmail moves them out of your inbox as they arrive, and every Friday you get one short email with the week's main points and links, while the originals are marked as read.
[ The result ]

Every Friday one digest grouped by topic lands in your inbox, and the week's newsletters are marked as read without ever cluttering your inbox.

[ How it's wired ]
  1. Send newsletters to a label and out of your inbox

    In Gmail, open the search bar and click Show search options. In 'Has the words' type unsubscribe. Click Search and check the results. This also catches promo emails, so if you only want a few newsletters, put their senders in 'From' instead (example below). Click Create filter. Tick 'Skip the Inbox (Archive it)' and 'Apply the label', then pick New label and name it Newsletters. Also tick 'Also apply filter to matching conversations', so older issues get the label and leave your inbox too. Click Create filter. From now on, new issues go straight to the Newsletters label. Want a digest right now? Connect Gmail in Claude or ChatGPT and type: 'Summarize the newsletters under my Newsletters label from the past 7 days. Group the main points by topic and link each one to its email.' You get a short list of topics with the key points in the chat. A chat answers only when you ask, so for a digest that arrives every Friday by itself and marks the originals as read, build the workflow in the next steps with n8n, which runs on its own schedule.

    From: news@example.com OR hello@another-newsletter.com
    Has the words: unsubscribe
  2. Create an n8n workflow and connect Gmail and OpenAI

    Sign up at n8n.io (free trial). On the Overview page, click the Create button in the upper-right corner and select Credential. Search for Gmail, click Continue, then Sign in with Google. Allow both reading and sending, then Save. Do the same for OpenAI and paste an API key from platform.openai.com. On n8n Cloud the key is optional: you can skip this credential and later select Use Gateway credits on the OpenAI node instead. Then click Create Workflow.

  3. Run it every Friday

    Click Add first step and pick On a schedule. Set Trigger Interval to Weeks, Weeks Between Triggers to 1, Trigger on Weekdays to Friday, Trigger at Hour to 4pm (pick it from the dropdown) and Trigger at Minute to 0. The schedule uses the time zone from the workflow settings, or your n8n instance's time zone if the workflow has none set, so check it there. On n8n Cloud you change the instance time zone in the Cloud console.

  4. Fetch the week's newsletters

    Click + after the trigger, search for Gmail and pick Get many messages. Set Resource to Message, Operation to Get Many, turn Return All on and turn Simplify off, so you get the full email text. Under Filters, add Search and paste the query below. Leave Read Status on 'Unread emails only', so an issue already used in a digest never comes back. Click Execute step: you should see one item for each newsletter from the past 7 days.

    label:newsletters newer_than:7d
  5. Clean the emails into plain text

    Click +, add a Code node, name it Clean emails, set Mode to 'Run Once for All Items' and Language to JavaScript. Paste the code below. It keeps the subject, sender, a link back to each email and the plain text. It cuts each email to 8,000 characters and the total to 100,000, so a big week doesn't overload the AI. Click Execute step: you should get one item with a field called digest_input.

    const parts = $input.all().map((item) => {
      const m = item.json;
      const text = (m.text || '').replace(/\s+/g, ' ').slice(0, 8000);
      return `SUBJECT: ${m.subject || ''}\nFROM: ${m.from?.text || ''}\nLINK: https://mail.google.com/mail/u/0/#all/${m.id}\n${text}`;
    });
    return [{ json: { digest_input: parts.join('\n\n---\n\n').slice(0, 100000) } }];
  6. Let AI write the digest

    Click +, search for OpenAI and pick Generate a Chat Completion (in n8n versions before 1.117 it was called Message a model). Don't confuse it with Generate a Model Response, the newer operation for the Responses API. Choose your OpenAI credential and a model such as gpt-6-luna (gpt-4.1-mini shuts down on January 14, 2027; check the current models on https://platform.openai.com/docs/deprecations). Add a message with the role System and paste the prompt below. Add a second message with the role User and drag the digest_input field from the input panel on the left into it. Click Execute step and read the result. It should be HTML with topic headings, bullet points and links, for example an 'AI' heading with a point like 'A new model is out for small teams (The Weekly AI)', where the name links to the original email. Your newsletters' text goes to OpenAI, so keep the label for newsletters only.

    You write a weekly newsletter digest for a busy professional.
    The input is several newsletters, separated by ---. Each starts with SUBJECT, FROM and LINK.
    
    1. Group the main points of all newsletters by topic (for example: AI, product, marketing, finance). Use 3–7 topics.
    2. Under each topic, write short bullet points: one idea per bullet, one or two plain sentences.
    3. End every bullet with the source in brackets as a link: the newsletter's sender name linked to its LINK.
    4. Skip ads, sponsor blocks, job lists and "share this" sections.
    5. Do not add facts that are not in the newsletters.
    
    Return only simple HTML: <h2> for topics, <ul><li> for points, <a href> for links. No <html> or <body> tags, no markdown.
  7. Email the digest to yourself

    Click +, add Gmail and pick Send a message. Set To to your email address, Subject to the line below, and Email Type to HTML. In Message, drag the AI's text answer from the input panel on the left. Under Options, add 'Append n8n attribution' and turn it off. Click Execute step and check your inbox: the digest should be there.

    Your newsletter digest – {{ $now.toFormat('dd LLL yyyy') }}
  8. Mark the originals as read and turn the workflow on

    Click +, add a Code node named List originals, set Mode to 'Run Once for All Items' and paste the code below. It picks up the message IDs from the 'Get many messages' node, so if you renamed that node, use its new name. Then click +, add Gmail, pick Mark as read, and set Message ID to {{ $json.id }}. The originals stay in All Mail under the Newsletters label, out of your inbox and out of next week's digest. Run the whole workflow once with Execute workflow, then turn it on with the Active toggle, or the Publish button in newer versions of n8n. From now on it runs every Friday by itself.

    return $('Get many messages').all().map((item) => ({ json: { id: item.json.id } }));
DoneStuck on a step? Reply to any Daily AI Brief email and ask.
[ One tutorial a week ]

Get the next automation before it's posted.

One short email with the AI stories that matter. What happened in AI, why it matters, one tool worth trying. Free. Unsubscribe anytime.

More tutorials

All tutorials
01Find out what you missed in a long lecture with a free quiz and flashcards20 min · Beginner · 7 steps02Make Claude Code follow your project's rules in every session15 min · Beginner · 7 steps03Turn your most frequent app error into a tested fix you can review20 min · Intermediate · 7 steps
[ Daily AI Brief ]

The AI news that matters, in your inbox.

One short email with the AI stories that matter. What happened in AI, why it matters, one tool worth trying. Free. Unsubscribe anytime.