Recipes / Guides / AI email agents / How-to

Step by step · built from 4 real inbox setups

How to build an AI email agent that sorts and drafts

Last updated · by Thomas, editor · How we verify

This walks you through one inbox triage agent: it reads each new email, sorts it, logs it and writes a draft. You send. Every step comes from a setup someone published, linked as we go.

What you need

Set it up, step by step

  1. Write your categories. The consulting build uses candidate, client and spam; the Outlook build uses lead, quote, invoice, support, spam and out-of-office. (recipe)
  2. Start from a working template: import the consulting firm's n8n workflow JSON from GitHub, then add your Gmail, model, Sheets and Slack credentials. (recipe)
  3. Put your own address in the self-email filter, so the agent's replies don't trigger the workflow again. (recipe)
  4. Paste the classifier prompt below into the model step. It returns JSON with a category, a confidence score, a summary and a draft. (recipe)
  5. Route by category: log every email to the sheet, save replies as Gmail or Outlook drafts, alert on client mail, and send anything that matches no category to a catch-all branch. (recipe)
  6. Add follow-ups last: lead nudges at +2 and +5 business days that stop on any reply. (recipe)
  7. Test on a copy of last week's mail before going live. (recipe)

Starter prompt: inbox classifier (our version, from the Outlook triage recipe)

For each new email, return JSON only: {"category": "lead|quote|invoice|support|spam|ooo", "confidence": 0-1, "customer": "", "service": "", "summary": "one line", "draft_reply": "in our tone, under 120 words", "follow_up_days": [2,5] or [], "send": false} Rules: "send" may be true only if confidence >= 0.85 AND the email mentions no money, complaints or legal terms. Never invent prices or dates. Use the thread history if present.

Approval and safety rules

Real examples

Each one links to the recipe and its original source.

Compare more setups: AI email agents: all 11 recipes →

Common questions

Can I build an AI email agent without code?

These builds use n8n workflows or a Grok Bot routine rather than custom code. The consulting firm's workflow is a JSON file you import into n8n.

Should an AI email agent send replies on its own?

Not at first. Both n8n builds start with drafts; the Outlook one allows auto-send for one narrow, low-risk category after two weeks of clean drafts.

How long does it take to set up?

The recipes list 1–2 days for the consulting build and 1–5 days for the Outlook build. The Grok Bot sweep takes about 10 minutes.

Get the next money recipe. Free.

New recipes every week, plus the top 10 agent setups pack. One email, no spam.

Unsubscribe anytime. Privacy

More guides: Make money with AI agents · AI voice agent business · AI agent agency ideas · Claude Code use cases · Grok Bot use cases · Claude Code vs Codex · AI agents for small business · AI email agents · AI code review agents · Parallel coding agents · AI agents that save you money · Autonomous agents that made money