Skip to content
Mia Automation
NLEN Sign in Put Mia to workGet started

An n8n AI agent that sorts email and drafts replies, with approval before sending

This n8n workflow reads your inbox, categorizes every email and drafts a reply to quote requests, client questions and appointment requests. Each draft lands in your inbox with two buttons, Send and Don't send, and nothing reaches the client until you click. We tested it on 50 emails. Sorting held up: 46 of 50 right, and every email that needed a reply got a draft. Drafting didn't: 17 of the 27 drafts were unusable, and five of them mentioned another client's unpaid invoice. That's why the approval step is there.

Automation recipesUpdated 8 min read

Tested by us on 11 November 2026.

Animated diagram: an email arrives, gets sorted by a sender rule and AI, the AI drafts a reply, the owner gets an approval email, and the reply is only sent after a click.
The whole chain. The human sits before sending, not after.

What you need

  • n8n 2.x, self-hosted or cloud. We tested on n8n 2.47.3.
  • An email account with IMAP for reading and SMTP for sending.
  • A chat model. We tested with qwen2.5:7b, a small model running locally through Ollama. It was good enough for sorting and not good enough for writing (see the test).
  • An n8n Data Table called *inbox_log* with the columns sender, subject, category and route.
  • Monthly cost: n8n itself (free self-hosted, or from €20 in the cloud) plus the model. A draft used about 610 tokens in and 76 out in our English run, roughly $0.10 per 1,000 emails on a small hosted model.

How it's built

The agent is two workflows. The main flow reads and sorts. For each email that needs a reply, it starts a second workflow, which drafts the reply and waits for your approval. Every email gets its own execution, so you approve or reject each one separately.

  1. Email Trigger (IMAP)

    Reads new mail. When many messages arrive together, n8n handles them as one execution with several items.

  2. Fixed rules on the sender

    A Code node recognizes your suppliers and addresses like accounting@. Those emails skip the AI step. In our tests, rules based on keywords caused errors; rules based on the sender didn't.

  3. AI picks a category, code checks it

    A Basic LLM Chain picks one of nine categories. A Code node after it marks any answer that isn't on the list as *review*. Everything then goes to the inbox log.

  4. Reply needed?

    A Filter node only lets quote requests, client questions and appointments through.

  5. One draft per email

    An Execute Workflow node in *each* mode, with *wait for sub-workflow* turned off. Each email starts its own execution of the second workflow, so one pending approval doesn't block the rest.

  6. Draft reply

    In the second workflow, an AI Agent writes the draft. The prompt forbids promising prices, dates or discounts that aren't in the email.

  7. Ask for approval

    The Send Email node with the *Send and Wait for Response* operation emails you the original message and the draft, with Send and Don't send buttons. Set a time limit; we use 3 days. No click means nothing goes out.

  8. Send

    Only after Send does a regular email node send the draft to the original sender, with *Re:* in front of the subject.

n8n execution of the main flow: 43 emails in, 7 handled by the fixed rule, 36 by the AI step and the check, and 22 passed on to One draft per email. (opens at full size)
The main flow during the test. In this execution, 22 of 43 emails needed a reply; the rest arrived in the second execution.

The template

Download 13-email-agent-sort-and-draft.json and 14-draft-reply-with-approval.json. Import 14 first, then 13, and pick workflow 14 in the *One draft per email* node. The template deliberately leaves out the lookup tool we tested with (see the warning below); otherwise it matches what we ran. The files contain no keys and no addresses, only example values to replace.

The test: 50 emails, 27 drafts, every draft read

We sent 50 emails we wrote for a made-up carpentry shop to a test inbox, each with its correct category recorded in advance. The main flow sorted 46 correctly. All 26 emails that needed a reply got a draft. One piece of spam, a pitch to improve our website, was misfiled as an appointment and got a draft too. Then we read all 27 drafts.

Bar chart of the 27 drafts: 3 nearly ready to send, 7 usable after a rewrite, 17 unusable or wrong.
With a small local model, only 3 of 27 drafts were close to sendable.
  • Made-up prices. Asked about a bathroom vanity, the model wrote that vanities *start around $800*; asked about a built-in closet, it estimated *$2,500*. Neither number came from anywhere.
  • Concessions nobody approved. Asked whether an invoice for 6 hours was right when the crew was there for 4, the draft promised to correct the invoice.
  • Spam answered. The website pitch got a polite reply instead of being ignored.
  • Placeholders left in. Many drafts ended with *[Your Company Name]* or guessed a first name from the email address.

What worked: the tone was friendly, most drafts were short, and the reply to a complaint about a scratched desk asked for the order number and offered a repair visit. We approved that one. For writing, use a stronger model than the small local one we tested. Keep the small model for sorting, where it got 46 of 50 right. We ran the same test in Dutch; there the agent never called the lookup tool, and 10 of 26 drafts were unusable.

Where a human signs off

Every reply goes through you. We tested both buttons. After Send on the scratched-desk reply, the client had it within seconds. After Don't send on a draft that mentioned another client's invoice, nothing went out; in the execution, the send step stayed grey.

n8n execution of the draft workflow after Don't send: draft written and approval requested, the Send reply step did not run. On the left, other drafts are still waiting for approval. (opens at full size)
Don't send: the last step stays grey. On the left, the other drafts wait for a click.

Cost per run, and when things fail

Measured in n8n 2.47.3 on November 11, 2026; prices per million tokens from Anthropic's official pricing page (Haiku 5.5 $0.10 / $0.50, Sonnet 5.5 $2 / $10). Without the lookup tool, a draft reads far fewer tokens. Other models count tokens a little differently.
StepTokens in / outClaude Haiku 5.5Claude Sonnet 5.5
Sorting, per email210 / 2$0.02 per 1,000$0.44 per 1,000
Drafting with the lookup tool, per email610 / 76$0.10 per 1,000$1.99 per 1,000

Running locally cost nothing per email but took time: with 27 drafts in parallel, the model averaged about a minute per draft. Hook the error alert from our ten tested n8n workflows up to both workflows so you hear about it when the model or mail server stops responding. An email marked *review* stays in the inbox log until someone looks at it.

Variations

To sort without drafting, use template 05; our comparison of three sorting setups is in AI automation. An agent that answers questions about your open invoices, with the math done in code, is in our n8n AI tutorial.

Questions

Can an n8n AI agent answer email on its own?

Technically yes, but we advise against it. In our English test, 17 of 27 drafts were unusable, including made-up prices and another client's invoice details. Let the agent draft and approve every reply yourself.

How do I add an approval step in n8n?

Use the Send Email node with the Send and Wait for Response operation and the Approval response type. n8n pauses until you click a button in the email, with a time limit you choose.

Which model should I use for an n8n email agent?

A small model was enough for sorting in our test. It wasn't enough for writing replies: use a stronger model there and keep the approval step.

What does an n8n email agent cost per month?

On a small hosted model, around ten cents per 1,000 emails for sorting and drafting, plus n8n itself. On a large model, around $2.40 per 1,000 emails.

Sources