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
- An inbox: Gmail, or Outlook through the Graph API
- n8n plus a model (the consulting build uses Gemini; any model works), or a Grok Bot with Gmail
- A Google Sheet for the log
- Optional: Slack, for an alert when important mail lands
Set it up, step by step
- 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)
- 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)
- Put your own address in the self-email filter, so the agent's replies don't trigger the workflow again. (recipe)
- Paste the classifier prompt below into the model step. It returns JSON with a category, a confidence score, a summary and a draft. (recipe)
- 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)
- Add follow-ups last: lead nudges at +2 and +5 business days that stop on any reply. (recipe)
- Test on a copy of last week's mail before going live. (recipe)
Starter prompt: inbox classifier (our version, from the Outlook triage recipe)
Approval and safety rules
- Client replies stay drafts. (recipe)
- Auto-send only one narrow, low-risk category, and only after two weeks of clean drafts. (recipe)
- The prompt allows sending only when confidence is 0.85 or higher and the email mentions no money, complaints or legal terms. (recipe)
- Label and archive; deleting needs your approval. (recipe)
- Marketing follow-ups need an opt-out line where the law requires it. (recipe)
Real examples
Each one links to the recipe and its original source.
- Route a firm's inbox: candidates, clients, spamAn HR consultancy's Gmail: candidates get an instant auto-reply; client replies are saved as drafts with a Slack alert.
- Classify, draft and follow up on a small-business inboxAn agency owner's Outlook inbox: six categories, drafts and timed follow-ups. The case study is titled “From 3.5 Hours a Day to 30 Minutes.”
- Morning inbox sweep for a category you never wantA 6am Grok Bot routine that clears one category of mail he never wants. Our version labels and archives.
- PM assistant: morning brief and meeting prepA PM's read-only morning brief from email, Slack and calendar.
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