How to Build an AI Email Assistant Using n8n

Short answer: In n8n, create a workflow with an email trigger, add AI steps that classify each message and draft a reply, route the draft for your review (or auto-file low-stakes categories), and activate the workflow. Your inbox starts triaging itself.
Most inboxes are a sorting problem: a minority of messages need your judgment, and the rest need classification, a routine reply or a filing decision. An n8n email assistant does the sorting continuously, so you open the inbox to decisions, not chaos. This build uses n8n's documented capabilities, checked in December 2026.
What the assistant does
The workflow in this guide handles five jobs:
- 1Watch for new emails.
- 2Classify each one: sales, support, invoice, newsletter, personal, spam-adjacent.
- 3Draft a reply for categories that need one.
- 4File the message with the right label or folder.
- 5Escalate anything urgent or ambiguous to you directly.
You stay in control: drafts wait for your review until you trust a category enough to automate it fully.
Step 1: Set up n8n and connect email
- Use n8n Cloud for the fastest start, or self-host for full data control (free, and your inbox data stays on your infrastructure).
- Add your email account's credentials. Gmail and Outlook have dedicated n8n integrations; other providers work over IMAP.
Step 2: The trigger
Create a workflow and add the email trigger node for your provider. Configure it to watch the inbox (or a specific label if you want to pilot on a subset). Each new email becomes an item flowing through the workflow with its subject, sender, body and metadata as fields.
Step 3: Classify with an AI step
Add a language model node (connect your OpenAI, Anthropic or Google API key) with a classification prompt:
"Read the email below. Reply with exactly one category: sales, support, invoice, newsletter, personal, or other. Then one short sentence explaining why. Email: [subject, sender, body]"
Parse the result into fields your workflow can branch on. Keep the categories few and distinct; five well-chosen buckets beat fifteen fuzzy ones. The practical prompt guide covers why constrained output formats make automations reliable.
Step 4: Branch and act per category
Use a Switch node to route each category:
- Support: create a ticket or task, label the email, draft a holding reply.
- Sales: notify the sales channel in Slack with a one-line summary, label the email.
- Invoice: extract amount and due date into a tracking sheet, file the message.
- Newsletter: label and archive.
- Personal/urgent: leave unread and alert you.

Step 5: Draft replies for review
For categories that deserve a reply, add a second AI step: "Draft a short, friendly reply to this email. Acknowledge the request, give the standard answer from the notes below, and promise a specific follow-up time. Sign off as [name]."
Send the draft to your review queue: a Slack channel, a draft folder, or a task list. This is the trust-building stage. After a few weeks of reviewing, you will know which categories draft well enough to send automatically, and those are almost always the routine acknowledgments, not the nuanced ones.
Step 6: Level up with an AI Agent node
The fixed workflow handles predictable mail. When messages need multi-step judgment, "look up this order, check the policy, then decide", swap the classification step for n8n's AI Agent node with tools: a CRM lookup, a knowledge base search, a calendar check. The agent reasons about which tools to call before drafting. n8n's documentation frames the choice clearly: fixed chains for predictable work, agents where the path varies per request.
Measuring whether it works
Track three numbers from day one: how many emails the workflow touches, how many drafts you send unedited, and how many misclassifications you catch. The first shows coverage, the second shows trust earned, and the third tells you where the prompt or the categories need work. A healthy assistant trends toward high coverage, rising unedited-send rates on routine categories, and near-zero misclassification on the categories you care about most.
Guardrails for an inbox assistant
- Never auto-send to new contacts until the category has weeks of clean drafts.
- Keep a paper trail: label every AI-touched email so you can audit later.
- Mind sensitive content: invoices and contracts carry data your model provider will see; check provider terms, and self-host n8n if data control is a requirement.
- Set a kill switch: one toggle that pauses the workflow. You will want it eventually.

FAQ
Can n8n read my Gmail or Outlook inbox?
Yes. Both have dedicated n8n integrations with triggers for new mail and actions for labels, drafts and sends. Other providers work via IMAP.
Does the assistant send replies automatically?
Only if you configure it to. The safe default is AI-drafted replies in a review queue; promote a category to auto-send only after its drafts consistently pass your review.
What does it cost to run?
n8n self-hosted is free; n8n Cloud is subscription-based. AI steps consume your own model API credits, which for typical inbox volumes is modest.
How accurate is AI email classification?
With few, distinct categories and a clear prompt, very high. Accuracy problems usually trace back to overlapping category definitions, not the model.
Can it handle attachments?
Yes. n8n can download attachments and pass text content to AI steps, so invoices and documents can be summarized or extracted into sheets.
Sources
- n8n Docs, Build and manage agents: https://docs.n8n.io/build/build-and-manage-agents
- n8n Docs, AI Agent node: https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent
Key takeaways
- Watch, classify, branch, draft, file: five steps to an inbox that triages itself.
- Draft for review first; auto-send only categories that earn it.
- Use the AI Agent node when replies need lookups and judgment, not just templates.
- Label everything the AI touches, and keep a pause switch handy.
Want an inbox that sorts itself? Book a free 30 minute call with Tech AI Labs and we will build the workflow with you.
FAQ
Quick answers
Can n8n read my Gmail or Outlook inbox?
Yes. Both have dedicated n8n integrations with triggers for new mail and actions for labels, drafts and sends. Other providers work via IMAP.
Does the assistant send replies automatically?
Only if you configure it to. The safe default is AI-drafted replies in a review queue; promote a category to auto-send only after its drafts consistently pass your review.
What does it cost to run?
n8n self-hosted is free; n8n Cloud is subscription-based. AI steps consume your own model API credits, which for typical inbox volumes is modest.
How accurate is AI email classification?
With few, distinct categories and a clear prompt, very high. Accuracy problems usually trace back to overlapping category definitions, not the model.
Can it handle attachments?
Yes. n8n can download attachments and pass text content to AI steps, so invoices and documents can be summarized or extracted into sheets.
IN THE DIRECTORY
See how this tool compares, what it costs and what it is best for.
Open the tool page →

