How to Build an AI Email Triage Bot in n8n
(The One I Actually Use)
If your morning starts with twenty minutes of inbox archaeology, this fixes that. Here's the exact n8n email triage workflow I use: Gmail in, GPT-4 classification in the middle, Telegram digest out the other side.
What's in this guide
Inbox triage is not work. It's just expensive friction pretending to be a job.
Not because email is hard. Email is mostly boring. That's the problem.
The annoying part is the context switching. You open Gmail to find one thing, then your brain gets dragged through sales emails, receipts, random newsletters, client stuff, platform alerts, and one actually important message buried under twelve pieces of garbage. Before you've done any real work, you've already spent energy deciding what deserves attention.
That's the daily tax. Not the reading. The sorting.
I do not want to manually decide whether an unread email is urgent, actionable, or trash at 8 in the morning. That is not noble work. That is admin sludge in a fake mustache.
So I automated it.
This n8n email triage workflow runs every weekday at 8am, pulls unread email from Gmail, sends the relevant parts to GPT-4 through the OpenAI node, classifies each message into URGENT, REPLY TODAY, FYI, or JUNK, and then sends me one clean Telegram digest.
No inbox wandering. No manually starring nonsense. No opening Gmail and immediately getting punched in the face by chaos.
What the workflow does: Schedule triggers Gmail, GPT-4 sorts it, Telegram delivers the verdict
The shape is simple:
Schedule Trigger โ Gmail โ Filter/Prep โ OpenAI (GPT-4) โ Format Digest โ Telegram
More specifically:
- Schedule Trigger fires every weekday at 8:00am
- Gmail node reads unread messages from the inbox
- Prep step trims the data down to the fields the model actually needs
- OpenAI node classifies each email into one of four buckets
- Code or Set step turns that into a readable summary
- Telegram node sends the digest to me
You can build this with either the OpenAI node plus a Code node, or with n8n's AI tooling depending on how you like to structure things. I use GPT-4 via the OpenAI API node because it's predictable and easy to swap later if I want Claude, Gemini, or a local model.
What this is not: a magic robot that writes your replies and runs your life. It's a sorting system. That's why it works. Keep the job narrow and the output clean.
How to build it: seven nodes, no surprises, one working triage system
I'm going to show this the way I'd actually build it from scratch, not the weirdly abstract version tutorials love where they skip the exact nodes and then act surprised when your workflow eats shit.
Schedule Trigger node.Set it to run on weekdays at 8:00am in your local timezone. In n8n, the easiest way is usually a cron-style schedule or the weekday/time options in the node UI.
The important bit is this: Monday through Friday, 8am. Not every hour. Not every day. This is a morning digest, not an anxious surveillance system.
Gmail node after the trigger. Use the message retrieval operation that lets you read messages from the inbox.Configure it to look for unread messages only. Depending on the Gmail node version and fields available in your n8n instance, that usually means using a query like
is:unread in:inbox or enabling the unread filter directly.Keep the fetch count sane. I usually cap it so the workflow doesn't try to process some cursed backlog of 400 unread emails because a credential broke for two weeks.
Set node or a Code node. The goal is to keep only the bits the classifier needs:fromsubjectsnippetor plain-text body previewreceivedAtthreadIdor message ID if you want follow-up actions later
Do not dump the full raw payload into the model if you can avoid it. It wastes tokens and increases the chance of weird output. Clean inputs make calmer workflows.
OpenAI node and pass in the cleaned email fields. Your prompt should be brutally specific. Tell it to return exactly one label from this list:URGENTREPLY TODAYFYIJUNK
Also tell it what those labels mean. Example logic:
- URGENT: time-sensitive, business-critical, human needs to look now
- REPLY TODAY: legitimate message that needs a response today, but not a fire
- FYI: useful to know, no immediate action needed
- JUNK: spam, promos, cold junk, obvious low-value noise
Make the model return structured output if possible. JSON is ideal. Something like:
{
"label": "REPLY TODAY",
"reason": "Client asking for status update on active project"
}
That reason field makes the digest way more useful than just raw category labels.
Code node or Set node after OpenAI to normalize the result.Why? Because even good models occasionally return
Reply Today instead of REPLY TODAY, or stick extra explanation around the answer if your prompt wasn't strict enough. That's not evil. It's just annoying.This step should:
- force the label into one of the four allowed values
- attach sender, subject, and reason to the item
- discard junk fields you no longer need
Code node to group the items by category and build one formatted message.I prefer a digest that looks roughly like this:
๐ฌ Morning Email Triage
URGENT
- Client X โ Need approval before 10am
REPLY TODAY
- Stripe โ payout issue on account
- Sarah โ contract question
FYI
- GitHub โ deploy completed
- Beehiiv โ weekly report ready
JUNK
- 11 filtered messages
The exact format doesn't matter. What matters is that you can scan it in ten seconds and know whether you need to open Gmail at all.
Telegram node and send the compiled digest to your own chat or a private ops channel.Telegram is great for this because it's fast, dead simple, and separate from the inbox you're trying to tame. Slack works too. Emailing the digest back to yourself would be very funny and also completely defeats the point.
Want the exact workflow without rebuilding it from scratch?
The AI Email Triage Bot from this post is in my n8n Starter Pack, along with 13 other production workflows I actually use. Import it, swap your credentials, and you're most of the way there.
See Google Workspace MCP โThe five ways this workflow quietly breaks, and how to stop each one
This workflow is not complicated, but there are a few places where people accidentally make it worse than just opening Gmail themselves.
1. Gmail snippets are sometimes too thin
If you only classify on subject line plus a tiny snippet, some emails will get bucketed wrong because the useful context is further down in the body. For most inboxes, snippet-level triage is enough. If yours is heavy on conversational threads, consider pulling a little more body text before classification.
2. Newsletters and promos can pollute the useful buckets
GPT-4 is good, but if your inbox is a landfill, it helps to pre-filter obvious noise before the AI step. You can do that with Gmail search rules, sender filters, or a simple IF node that catches known promo domains and marks them as junk without paying model costs for the privilege.
3. Model output needs guardrails
If you let the model freestyle, it will eventually invent a fifth category because apparently that seemed fun at the time. Force the allowed labels. Validate them. Default unknown output to FYI or send it to an exceptions branch.
4. Timezones matter more than you think
If your schedule trigger is off, your "morning digest" arrives at 3am and now you've built a tiny robot insomniac. Check the workflow timezone. Check the server timezone. Then check them again.
5. Don't auto-archive or auto-reply on day one
You can absolutely extend this workflow later so junk gets archived or urgent stuff gets copied to a task system. Cool. Great. But first make sure the classifier is right often enough to trust. Start with read-only digest mode. Earn the right to automate destructive actions.
My rule: if an automation is making judgment calls, the first version should report, not act. Let it prove it's smart before you hand it a knife.
How to adapt this to your stack without starting over
This same pattern works outside Gmail and Telegram. The core idea is still the same: grab messages, classify them, send the summary somewhere useful.
Swap Gmail for Outlook
If you live in Microsoft land, use Outlook or Microsoft email nodes instead of Gmail. The exact field names change, but the logic doesn't. Pull unread messages, map sender/subject/body preview, then send that into the same classification step.
Swap Telegram for Slack
If your team already lives in Slack, send the digest there instead. I'd use a private channel or a personal DM so the summary doesn't get buried under people posting reaction GIFs and pretending that counts as operations.
Swap GPT-4 for something else
I use GPT-4 through the OpenAI API node because it works. That said, this piece is swappable. Claude, Gemini, OpenRouter-backed models, or even a local model can work if the output stays consistent. The workflow pattern matters more than the brand of brain in the middle.
Add downstream actions later
Once the digest is reliable, you can branch on category:
- URGENT โ send SMS or high-priority Telegram ping
- REPLY TODAY โ create task in Notion, Todoist, or Linear
- FYI โ digest only
- JUNK โ optionally label or archive after you trust the workflow
But again: don't start there. Start with the digest. It gives you most of the value with almost none of the risk.
What this workflow actually changed: I stopped opening Gmail first
I use this workflow as a decision filter.
That's the real value. Not "AI reads my email for me." That sounds clever and mostly means nothing. The useful part is that by the time the workday starts, I already know whether there's anything in the inbox that deserves immediate attention.
Some days the digest tells me there's one urgent message and two reply-today items. Great. I go handle those and ignore the rest until later. Other days it's all FYI and junk, which means I do not have to open Gmail first thing and let it derail the morning.
That's it. That's the win. Less random inbox energy leaking into the start of the day.
Inbox anxiety is not a character flaw. It's a systems problem. And systems problems have solutions. This one takes about an hour to build, runs every weekday morning without you touching it, and removes the worst part of the workday before the workday starts. If you want to build it yourself, the guide above is all you need. If you'd rather import the version I'm already running, it's in the pack.
Steal the workflow instead of rebuilding it from scratch
The n8n Starter Pack includes this AI Email Triage Bot plus 13 other production workflows from my actual stack. Import the JSON, swap your credentials, and stop doing the dumb repetitive parts by hand.
See Google Workspace MCP โOne-time purchase ยท Instant download ยท 30-day money-back guarantee