Skip to content

Email, phone and messaging

How to build an n8n email agent: triage and reply template, step by step

An n8n email agent reads each incoming email, decides what it is and replies or hands it on. Here is the template, node by node, and where an agent needs an inbox of its own.

An n8n email agent is a workflow that starts when an email arrives, passes it to the AI Agent node with a chat model and tools, and sends or drafts the reply. Start from the Gmail Trigger for your own mailbox. When the agent should have an address of its own, Obsession gives it an inbox in one call and delivers each new email to an n8n Webhook node.

On this page
  1. The trigger: how the email reaches n8n
  2. The AI Agent node and its tools
  3. A triage and reply template
  4. When the agent needs an inbox of its own
  5. One agent, one identity, every piece the job needs
  6. Questions about n8n email agents

An email agent in n8n is a workflow with 4 jobs. It notices a new email and works out what it asks. It looks up what the answer needs, then replies or passes the email to a person. n8n suits this because each job is a node you connect on a canvas, and the language model sits in the middle as one of them. Most builds fail for a plain reason: the mailbox they read belongs to a person.

The parts, in the order a workflow runs them:

  • Trigger: the node that starts a run when mail arrives.
  • AI Agent node: the model and its tools, which reads the email and decides what to do.
  • Tools: what the agent can look up or do while it works, such as fetching an order or running another workflow.
  • Reply step: a node that sends the answer, or saves a draft for a person to approve.

The trigger: how the email reaches n8n

There are 2 common ways in. The first is a mail trigger. As n8n documents the Gmail Trigger, it checks Gmail on a schedule you set with Poll Times, fetches up to 10 emails a poll by default (50 at most), and offers filters: labels, a Gmail search such as from:, read status (unread by default) and sender. Its one event is Message Received. That suits an agent that helps with your own inbox.

The second is a webhook, a web address in n8n that another service calls the moment something happens. n8n’s Webhook node starts a workflow from an incoming request. It gives a test address while you build and a production address once the workflow is published. It supports basic, header and JWT authentication, an IP allowlist, and 4 ways to respond, including after the last node finishes. A webhook reacts when the email lands, with no wait for the next poll.

The AI Agent node and its tools

The AI Agent node builds an agent from a chat model and one or more tools: the agent decides which tool to call to finish the task. n8n’s page says you must connect at least one tool sub-node, and that since version 1.82.0 every AI Agent node works as a Tools Agent. A tool is a node attached to the agent, not a step in the line, so the agent chooses when to use it.

The tool that matters most for email is the Call n8n Workflow Tool, which lets the agent run another workflow and read its output. Keep each skill in its own small workflow, such as “find this customer’s last order” or “fetch the refund policy”, and give each a clear description so the agent knows when to call it. In production the called workflow must be published, or n8n returns “Workflow is not active and cannot be executed” to the agent.

A triage and reply template

A triage agent sorts mail before it answers. This layout works for support, bookings and sales enquiries, and every step is a node you place yourself:

  1. Start: the Gmail Trigger on a label, or a Webhook node for mail that arrives as an event.
  2. Clean: keep the sender, subject, the new text of the message and the thread, so the model reads less quoted history.
  3. Triage: the AI Agent node, with a system message that names the categories (question, complaint, booking, spam, other) and the rule for each: answer it, draft it, or pass it to a person.
  4. Look up: tool sub-nodes for the facts a reply needs, one workflow each.
  5. Branch: an If or Switch node on the agent’s output. Easy questions go to the reply step, sensitive ones go to a person in Slack with the agent’s draft.
  6. Reply: the step that sends or drafts the answer in the same thread.
  7. Record: write the email, the category and the reply to a sheet or table, so you can read a week of decisions.

Start with draft only. Read 50 drafts, correct the system message, and let the agent send on its own only for the categories it gets right every time. Triage is where the agent saves the most time, because most inboxes are mostly the same few questions.

When the agent needs an inbox of its own

Reading your own Gmail is fine for a helper that works for you. It stops being right in 3 cases:

  • The agent is a separate worker: a booking agent or support agent should send from its own address, so replies reach it and your personal mail stays yours.
  • You run many agents: 1 address per agent, user or task keeps their mail apart.
  • The agent signs up to services: it needs an address of its own for confirmation links and codes, and a phone number when a site texts one.

An inbox API creates the address in code. The best email API for AI agents compares 7, and the guide to email servers for the Model Context Protocol (MCP) covers the tool route. If you would rather connect an agent to tools than build the plumbing yourself, AI agent tools versus MCP explains the difference.

One agent, one identity, every piece the job needs

Obsession is the toolkit for AI agents: phone numbers, inboxes, browsers and sandboxes on one API and one bill. For an n8n email agent, 3 parts matter.

  • The inbox. Obsession’s email API gives an agent its own address in one call. It sends and receives, keeps every thread and attachment, and reads verification codes and confirmation links out of each email. An inbox is $0.50 a month.
  • The webhook into n8n. Each new email reaches you as an email.received event, delivered by signed webhook, and the developers page lists “Zapier, Make and n8n” among the ways events arrive: each event starts a Zap, scenario or workflow. Point the Webhook node’s production address at your Obsession webhook and the workflow runs when the email lands, not on the next poll. If your server is down, events retry for 27 hours and any event can be replayed.
  • The event log. Every email, text and page the agent touches is saved in one event log, dated, so you can see what it did and why.

A persona puts the inbox, a US or UK number and a browser that keeps its logins under one identity, and costs nothing while it waits. That matters when the email is only half the job: a workflow that signs an agent up to a supplier portal gets the confirmation link by email and the 6-digit code by text, at the same agent. The usual way is 4 vendors, each with its own key, bill and webhook, so a code can arrive in one place while the browser waits in another. If your agent needs only email, one specialist is enough. AgentMail, Twilio, Browserbase and E2B, or every piece on one API sets the 2 side by side.

No code is the other way in. Pick a blueprint such as the Inbox agent, which answers every email on its own address from your help pages and rules, or describe the job in your own words and Obsession sets it up. Once an agent has its own address, number and browser, the same identity can also chase unpaid invoices, confirm bookings by text or check a competitor’s sign-up, whether you run one agent or ten thousand.

Questions about n8n email agents

Start a workflow with a mail trigger or a Webhook node, pass the email to an AI Agent node with a chat model and at least one tool, then add a step that sends or drafts the reply. Begin with drafts a person approves, and let the agent send alone only for the kinds of email it handles well.

Build one in 7 steps: trigger, clean the text, triage in the AI Agent node, look up facts with tool workflows, branch on the result, reply or draft, and record the decision. It suits support, bookings and sales enquiries.

Through the AI Agent node’s system message. It names the categories and the rule for each, such as answer, draft for a person or ignore. A Switch node then routes the email by the agent’s answer, so the agent never sends where a rule says a person should.

Not for a helper on your own mailbox. It does when the agent is a separate worker, when you run many agents, or when it signs up to services and must receive confirmation links. An inbox API creates the address in code.

Email API for AI agents

Polling is simplest for your own mailbox: n8n’s Gmail Trigger checks on a schedule you choose. A webhook reacts the moment the email lands, which suits agents with their own inbox. Both start the same workflow.

Obsession lists n8n among the ways events arrive: each event starts a workflow, and you point n8n’s Webhook node at it. Use that route, and read the developers page for the events and their names.

See the API and MCP
ShareLinkedInX

Sources

In the order the article cites them. Every link was checked on 23 Nov 2026.

  1. Gmail Trigger noden8n documentation
  2. Webhook noden8n documentation
  3. AI Agent noden8n documentation
  4. Call n8n Workflow Tooln8n documentation

What should your first AI agent do?