← Playbooks

Automate inbox triage with n8n and AI

Build an n8n workflow that watches Gmail, classifies each email with an AI Text Classifier, labels it, and drafts replies for routine requests, without auto-sending anything.

Who it's for: Operators, founders, support leads and assistants drowning in email. No code required, though comfort with a visual workflow builder helps.

Time: 60 to 90 minutes · Cost: n8n Cloud trial or paid plan, or free self-hosted Community edition; plus AI model usage (usually a few dollars a month at small volumes)

Tools: n8n, ChatGPT, Claude, Ollama, Make, Zapier Agents, Superhuman

Prerequisites:

  • An n8n Cloud account or a self-hosted n8n instance
  • A Gmail or Google Workspace account
  • An API key for a chat model provider (OpenAI, Anthropic, etc.) or a local Ollama server
  • Ten to twenty real example emails to test with

The average inbox mixes four kinds of mail: things only you can answer, routine requests with a known answer, FYIs, and noise. Sorting them by hand costs knowledge workers hours a week. This playbook builds an n8n workflow that does the sorting for you and drafts the routine replies, while leaving every send decision with a human. All node names and options come from the n8n docs.

Step 1: Define your categories and actions

Before opening n8n, write a short table. The categories should be mutually exclusive and each should map to one action. A good starting set:

CategoryDescription for the AIAction
Urgent clientA current client reporting a problem or deadlineLabel AI/Urgent, alert in Slack
Sales leadA new prospect asking about pricing, demos or servicesLabel AI/Lead, log to a sheet or CRM
Routine requestScheduling, document requests, simple FAQsLabel AI/Routine, create a draft reply
Newsletter / FYIUpdates, newsletters, notificationsLabel AI/FYI, mark as read

The description column matters most: n8n’s docs note that category descriptions are how you tell the model what each category means.

Step 2: Create Gmail labels

In Gmail, create the labels from your table (an AI/ prefix keeps them grouped and makes it obvious which labels the robot applied). You can also create labels from n8n with the Gmail node’s Label → Create operation, but doing it by hand is faster for four labels.

Step 3: Add the Gmail Trigger

Create a new workflow and add a Gmail Trigger node. Its event is Message Received, checked at the Poll Times you choose (every minute up to longer intervals; start with every 5–15 minutes).

  1. Under Credential to connect with, create a Google credential following n8n’s Google credentials guide. On n8n Cloud this is mostly a sign-in-with-Google click; self-hosted instances need a Google Cloud OAuth client.
  2. Leave Simplify on for now. It returns message IDs, labels and headers (From, To, CC, BCC, Subject). For the email body you’ll want it off, or add a Gmail Message → Get node afterwards.
  3. Under filters, set Read Status to Unread emails only (the default) and use Search to exclude noise, e.g. -category:promotions.
  4. Max Emails per Poll defaults to 10 (maximum 50); extra emails queue for the next poll.

Click Fetch Test Event to pull a real message and confirm the fields you’ll need (subject, from, text).

Step 4: Add the Text Classifier and a chat model

Add the Text Classifier node (in n8n’s AI nodes). Configure:

The classifier needs a chat model sub-node: connect an OpenAI, Anthropic or other model credential, or an Ollama model if you self-host and want email text to stay on your server. A small, cheap model is usually enough for classification.

Step 5: Route each category to an action

The Text Classifier has one output per category (plus Other). Wire each:

Use the message ID from the trigger in each Gmail node’s Message ID field.

Step 6: Draft replies for routine requests

On the Routine branch add a chat-model step (for example the Basic LLM Chain node or your provider’s node) with a prompt like:

You draft short, friendly email replies for [Company]. Use only the facts below. If the request needs information not listed, write “NEEDS HUMAN:” followed by what’s missing. Facts: office hours 9–5 MT; booking link: [your link]; invoices are sent on the 1st; documents are shared via [portal]. Email: {{ subject }} / {{ body }}

Then add a Gmail Draft → Create node using the AI text as the body, the original subject prefixed with “Re:”, and the sender as recipient. Nothing is sent: you open Gmail, review the draft, and click send. If the draft starts with “NEEDS HUMAN:”, route it to AI/Review instead using an If node.

Step 7: Test with real emails

Forward or star 15–20 real examples covering every category plus a few tricky ones (a client who’s also asking about pricing; a newsletter from a client). Run the workflow manually and record the predicted category versus the right one. If accuracy is below ~90%:

Step 8: Activate and monitor

Toggle the workflow Active. For the first week, check the AI/ labels daily and n8n’s Executions list for errors. Keep a note of misclassifications and update the descriptions weekly. Once the drafts are consistently good you’ll find you’re just reviewing and clicking send.

Pitfalls

Alternatives

Prefer a hosted, less technical builder? The same pattern works in Make (Gmail watch → AI module → router) or Zapier Agents. If you just want a faster inbox with built-in AI rather than an automation, see Superhuman. Compare the builders in n8n vs Make.

FAQ

Can n8n read my Gmail automatically?

Yes. The Gmail Trigger node polls for new messages on a schedule you choose and starts a workflow for each one. It authenticates with a Google credential you create in n8n.

Will the workflow send emails on its own?

Only if you build it to. This playbook uses the Gmail node's Draft Create operation so a human reviews every reply before it is sent.

Is n8n free?

n8n offers a self-hosted Community edition you can run on your own server, and n8n Cloud, a managed service with a free trial and paid plans. Check n8n's pricing page for current limits.

What happens to emails the AI cannot classify?

The Text Classifier's 'When No Clear Match' option either discards the item (the default) or sends it to an 'Other' branch. Choose the Other branch so nothing silently disappears.

Can I keep email content off third-party AI providers?

Yes, by self-hosting n8n and using a local model through Ollama as the classifier's model. Accuracy may be lower than large cloud models, so test first.

Last checked against official docs: October 2026 (n8n docs: Gmail Trigger, Gmail node operations, Text Classifier node). Prices and UI labels change; confirm on each vendor's site.