An n8n template labels Gmail threads and saves Gemini reply drafts

An n8n workflow template reads each new Gmail message with a Gemini agent, labels it, and saves a reply draft where one is needed. Each draft waits in Gmail, with the message marked unread, for a person to review.

Source: n8n.ioMay 2026

The task

The template page addresses professionals and small business owners who receive a high volume of email. The repeated work is triage, labeling, and writing first drafts of replies, with a person staying involved before anything is sent.

What they did

The template starts with a Gmail trigger that checks the inbox once a minute for new unread messages and clears labels left from an earlier pass. A Gemini 2.5 Pro agent then reads the message and, through a Gmail tool, the whole thread. It also looks at Google Calendar to check availability before it writes anything. The agent sorts each message into one of six labels: Urgent, Reply, Read, Notification, Newsletter, and Invoice. When a reply is needed, it writes the reply as HTML. For Urgent and Reply messages, a small code step adds an HTML signature and the result is saved as a Gmail draft. Every message then receives its matching Gmail label and is marked unread. Setup means connecting Gmail, Gemini, and Google Calendar credentials, matching the label IDs to the user's own Gmail labels, and editing the signature.

Where the approval sits

The workflow as described ends at a Gmail draft and has no sending step. The message is marked unread so that it stands out for a person, who reads the draft, edits it if needed, and sends it from Gmail. The labels also let a person check how each message was sorted.

Worth knowing

This is a public template page in n8n's template library, which makes it documentation of a design and not a report of a team's run. It shows the setup but no outcomes, so this entry has no results section. The calendar serves only as an availability check for the drafting step, and the page does not show meetings being booked. The page also lists an optional change that replaces the draft step with direct sending for low-risk categories. This entry covers only the draft version.

Source: n8n.io · May 2026

Drafted with AI assistance and checked automatically. A person is responsible for the collection. How these entries are made

Prompt for your agent

Summarize a long thread into decisions and next steps

Turn a long thread into a summary of decisions, open questions and next steps, with owners and dates where the thread gives them.

Ninety minutes live on your tools. One automation running before we hang up.