🔓 Unlock all 10,000+ workflows & prompts free Join Newsletter →
✅ Full access unlocked — explore all 10,000 AI workflow and prompt templates Browse Templates →
Home n8n Workflow
January 22, 2026

Gmail + Gemini: cleaner inbox, ready draft replies

Lisa Granqvist Partner Workflow Automation Expert

Your inbox is probably lying to you. Important threads are buried under newsletters, “quick questions” that aren’t quick, and random notifications that look urgent until you open them.

Freelancers feel it when client replies slip. Small business owners feel it when sales leads go cold. And if you run marketing, it’s the follow-up pile that quietly gets you. This Gmail Gemini automation cleans the noise and prepares drafts, so you spend your time answering the right messages.

You’ll set up an n8n workflow that labels new emails, moves obvious junk out of sight, and creates ready-to-review reply drafts inside Gmail. Nothing gets sent automatically. You stay in control.

How This Automation Works

Here’s the complete workflow you’ll be setting up:

n8n Workflow Template: Gmail + Gemini: cleaner inbox, ready draft replies

Why This Matters: Inbox triage steals your best hours

Inbox “management” usually means micro-decisions all day long. Is this spam or a real person? Is it actionable or just noise? Do you need to reply now, or later, or not at all? Those little calls don’t feel heavy, but they add up fast, especially when you’re switching between tabs, threads, and half-remembered context from last week. Miss one key email and you pay for it twice: once in the awkward follow-up, and again in the scramble to rebuild trust.

None of these alone is the problem. Together, they are.

  • You re-read the same email thread just to remember what was agreed, because the context is scattered across replies and sent messages.
  • Labels get messy or inconsistent, so “sorting” becomes another task you don’t trust.
  • Low-value emails stay visible, which means they keep stealing attention every time you open Gmail.
  • Drafting replies takes longer than it should because you start from a blank page instead of a solid first draft.

What You’ll Build: Gmail labeling plus safe AI reply drafts

This workflow starts the moment a new email hits your Gmail inbox. n8n grabs the message, clears any existing labels you don’t want on incoming mail, then hands the content to a Gemini-powered classification agent that reads the email like a human would. It checks context too, pulling in the email thread and even your sent history when needed, so it understands if this is a new request, a follow-up, or something you already handled. Based on your rules, it applies the right Gmail label, and if the message is clearly irrelevant, it can route it toward deletion or out of your way. When an email needs a response, the workflow generates a concise, professional draft reply and saves it in Gmail Drafts for you to review. It never auto-sends.

It’s basically inbox triage with memory. Gmail triggers it, Gemini decides what matters, and Gmail drafts hold the output until you approve it.

What You’re Building

Expected Results

Say you receive about 40 emails a day. If you spend even 2 minutes per email deciding what it is and where it belongs, that’s roughly 80 minutes gone, before you write a single reply. Add 10 more emails that need responses, and drafting at about 5 minutes each is another 50 minutes. With this workflow, labeling and “needs response” decisions happen automatically, and drafting runs in the background. Your active time becomes reviewing maybe 10 drafts, which is often 20 minutes total.

Before You Start

  • n8n instance (try n8n Cloud free)
  • Self-hosting option if you prefer (Hostinger works well)
  • Gmail for inbox access, labels, and drafts.
  • Google Gemini to classify emails and draft replies.
  • Google OAuth2 credentials (create them in Google Cloud Console).

Skill level: Beginner. You’ll connect accounts, confirm labels exist, and paste in prompts.

Want someone to build this for you? Talk to an automation expert (free 15-minute consultation).

Step by Step

A new Gmail email arrives. The Gmail Trigger watches your inbox and kicks off the workflow the moment a message lands.

The message gets normalized and prepared. n8n parses key fields (sender, subject, body) into structured data and clears any labels you don’t want lingering on fresh mail.

Gemini classifies it with real context. The workflow can fetch the email thread and review your sent history, then the AI Agent decides the right label and whether it should be archived or trashed based on your rules.

Drafts are created only when needed. If the message requires a response, the Reply Drafting Agent generates a short, friendly draft and the Gmail node saves it to Drafts so you can tweak and send.

You can easily modify the labeling categories to match your pipeline (leads, clients, finance, hiring) based on your needs. See the full implementation guide below for customization options.

Step-by-Step Implementation Guide

Step 1: Configure the Gmail Trigger

Start by setting up the Gmail trigger that watches for new incoming messages.

  1. Add the Incoming Gmail Watch node as your trigger.
  2. Set the polling schedule to everyMinute in Poll Times.
  3. Credential Required: Connect your gmailOAuth2 credentials.
  4. Leave Filters empty unless you want to restrict which emails are watched.

Step 2: Connect Gmail and Calendar Services

Ensure all Gmail and Calendar nodes used by the agents and actions are authenticated.

  1. Credential Required: Connect your gmailOAuth2 credentials to Clear Inbox Labels, Apply Gmail Label, Move to Trash, and Generate Reply Draft.
  2. For tool access, Fetch Email Thread, Review Sent History, and Fetch Thread Context are connected as tools for AI agents; ensure Gmail OAuth2 credentials are available to the parent nodes (Email Classification Agent and Reply Drafting Agent).
  3. Credential Required: Connect your googleCalendarOAuth2Api credentials for the tool node Calendar Availability Check (used by Reply Drafting Agent).

Step 3: Set Up Email Classification Agent

Configure the AI classification stage that determines labeling, deletion, and whether a response is needed.

  1. Add Gemini Chat Model and connect it as the language model for Email Classification Agent and Reply Drafting Agent. Credential Required: Connect your googlePalmApi credentials to Gemini Chat Model.
  2. In Email Classification Agent, keep Prompt Type set to define and ensure the prompt includes your label rules and placeholders (e.g., [YOUR_EMAIL] and label IDs).
  3. Attach Structured JSON Parser as the output parser with the schema set to { "label": "Label name", "labelID": "Label ID", "id": "Email message ID", "requiresResponse": true }.
  4. Confirm the tool connections: Fetch Email Thread and Review Sent History are linked as tools to Email Classification Agent.

⚠️ Common Pitfall: Update placeholder values like [YOUR_EMAIL], [INPUT LABEL 1], and [INPUT LABEL 2] in Email Classification Agent before testing, or the model may return unusable labels.

Step 4: Configure Reply Drafting Agent

Set up the drafting logic that creates a draft reply when a response is required.

  1. In Reply Drafting Agent, keep Prompt Type set to define and verify the prompt rules for tone, language detection, and scheduling.
  2. Attach Draft JSON Parser as the output parser with schema { "draft": "string", "notes": "string" }.
  3. Ensure tool connections are present: Fetch Thread Context and Calendar Availability Check are linked as tools to Reply Drafting Agent.
  4. In Calendar Availability Check, confirm Calendar is set to [YOUR_EMAIL] and Timezone is set to [YOUR_TIMEZONE].

⚠️ Common Pitfall: Replace [YOUR_TIMEZONE] and [YOUR_NAME] in Reply Drafting Agent to avoid incorrect scheduling suggestions and signatures.

Step 5: Configure Output and Routing Logic

Define how emails are labeled, trashed, or drafted based on AI classification outputs.

  1. In Clear Inbox Labels, set Operation to removeLabels, Message ID to ={{ $json.id }}, and include label IDs like INBOX, IMPORTANT, and category labels.
  2. In Deletion Decision, set the condition to compare ={{ $json.output.label }} equals DELETE. The true branch goes to Move to Trash, and the false branch goes to Apply Gmail Label.
  3. In Move to Trash, set Operation to addLabels, Label IDs to TRASH, and Message ID to ={{ $('Incoming Gmail Watch').item.json.id }}.
  4. In Apply Gmail Label, set Operation to addLabels, Label IDs to ={{ $json.output.labelID }}, and Message ID to ={{ $('Incoming Gmail Watch').item.json.id }}.
  5. In Response Requirement Check, set the condition to true when ={{ $('Email Classification Agent').item.json.output.requiresResponse }} is true.
  6. In Generate Reply Draft, set Resource to draft, Message to ={{ $json.output.draft }}, Subject to =Re: {{ $('Incoming Gmail Watch').item.json.Subject }}, and Send To to ={{ $('Incoming Gmail Watch').item.json.From }}.

Tip: The execution flow is linear: Incoming Gmail WatchClear Inbox LabelsEmail Classification AgentDeletion Decision. From there, emails either go to Move to Trash or Apply Gmail Label, and only those requiring a response proceed to Reply Drafting Agent and Generate Reply Draft.

Step 6: Test and Activate Your Workflow

Validate that classification, labeling, and drafting behave as expected before turning the workflow on.

  1. Click Execute Workflow and send a test email to the connected Gmail account.
  2. Confirm that Clear Inbox Labels removes existing labels and that Email Classification Agent outputs valid JSON via Structured JSON Parser.
  3. Verify that emails labeled DELETE move to trash, while others get labels from Apply Gmail Label.
  4. For emails requiring a reply, check that Generate Reply Draft creates a draft with subject prefix Re: and body from {{$json.output.draft}}.
  5. Once validated, switch the workflow to Active to run continuously.
🔒

Unlock Full Step-by-Step Guide

Get the complete implementation guide + downloadable template

Troubleshooting Tips

  • Gmail credentials can expire or need specific permissions. If things break, check your n8n Credentials for Google OAuth2 first, then confirm Gmail scopes are allowed.
  • If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
  • Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.

Quick Answers

What’s the setup time for this Gmail Gemini automation?

About 30 minutes if your Gmail labels already exist.

Is coding required for this inbox labeling and draft reply automation?

No. You’ll connect Gmail and Gemini, then adjust a few rules and prompts.

Is n8n free to use for this Gmail Gemini automation workflow?

Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in Gemini usage costs, which depend on how many emails you process and how long they are.

Where can I host n8n to run this automation?

Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.

Can I modify this Gmail Gemini automation workflow for different use cases?

Yes, and you should. Most people customize the labels in the Gmail steps (like “Apply Gmail Label”) and adjust the instructions inside the Email Classification Agent so it matches how you actually work. You can also change what happens after “Deletion Decision” to archive instead of trashing, which is safer early on. If you want meeting suggestions, enable the Calendar Availability Check so the draft can include a couple of time slots.

Why is my Gmail connection failing in this workflow?

Usually it’s expired Google OAuth2 credentials or missing Gmail permissions in the consent/scopes setup. Reconnect the Gmail credential in n8n, then re-run a single test email. If it still fails, check that the Gmail account you authorized is the same one receiving the trigger emails and that your workspace admin (if you have one) hasn’t restricted OAuth access.

What volume can this Gmail Gemini automation workflow process?

A typical small business inbox volume is fine, and the practical limit is your n8n plan plus how quickly your AI model responds.

Is this Gmail Gemini automation better than using Zapier or Make?

Often, yes, if you care about smarter decision-making. This workflow leans on branching logic (the “Deletion Decision” and “Response Requirement Check”) and context fetching (threads and sent history), which is where n8n tends to feel more flexible. The other upside is control: drafts are created inside Gmail, not pushed out through external steps that are harder to review. Zapier or Make can be simpler for very basic “label this, then send a Slack message” automations, but they get awkward as soon as you want memory and multi-step reasoning. Talk to an automation expert if you want help picking the cleanest setup.

Once this is running, your inbox stops being a to-do list generator. It quietly sorts, flags what matters, and hands you drafts that are ready for a quick human pass.

Need Help Setting This Up?

Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.

Lisa Granqvist

Workflow Automation Expert

Expert in workflow automation and no-code tools.

×

Use template

Get instant access to this n8n workflow Json file

💬
Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Launch login modal Launch register modal