DEV Community

Tilth
Tilth

Posted on

How I Triaged 200 Emails a Day with n8n + GPT-4o-mini (Free Template Inside)

Every morning, I opened Gmail to 200+ emails. By noon I'd spent three hours sorting, tagging, and deciding what was urgent — and I still missed things. Then I built a 4-node n8n workflow and the problem largely disappeared. Here's exactly what I built, and yes, the template is free.


The Real Cost of Manual Email Sorting

Let's do the honest math. If your inbox takes 2–3 hours a day to manage — sorting, tagging, deciding what needs a reply today versus what can wait — that's 10–15 hours a week. For a freelancer billing at $50/hour, that's hundreds of dollars in potential billing time spent doing something a well-configured automation can handle more consistently.

That's the version of the math that made me actually build this.

But the deeper problem isn't volume alone — it's context-switching. Every time you open an email to decide if it matters, you pull yourself out of focused work. Even if you batch-process email twice a day, the mental overhead of triage adds up: Is this client urgent? Is this an invoice? Is this noise? Multiply that across 200 emails and it's exhausting before you've done any real work.

Why Standard Gmail Filters Fall Short

The obvious answer is Gmail filters. And they work — up to a point.

The problem with rule-based filtering is that real inbound is messy. Clients email you from different addresses depending on whether they're at their desk or on their phone. Invoices arrive with inconsistent subject lines. A prospect's first email looks a lot like a cold pitch. A "quick question" from a client can be a genuine emergency or it can be something that can wait a week.

Static rules can't read intent. GPT-4o-mini can.

The 4-Node n8n Workflow That Does the Work

Here's the architecture — no code required to understand it, and no code required to run it:

Node 1 — Gmail Trigger: Watches your inbox for new emails. Fires whenever one arrives.

Node 2 — Text Extraction: Pulls the sender address, subject line, and first 500 characters of the email body. This is enough context for the classifier to work accurately. Keeping it to 500 characters keeps API costs minimal.

Node 3 — GPT-4o-mini Classification: Sends that extracted text to GPT-4o-mini with a structured prompt that returns a JSON verdict.

Node 4 — Label + Route: Takes the JSON verdict and applies a Gmail label, routes to a folder, or flags for immediate attention. Done.

The workflow runs passively in the background. You don't open Gmail to sort anymore — you open Gmail to act.

The Classification Prompt That Actually Works

The prompt isn't magic. Here's the working version (simplified):

You are an email triage assistant for a freelance consultant. Classify the following email into exactly one priority: "urgent" (needs response today), "client" (active project, respond within 24 hours), "admin" (invoices, scheduling, non-urgent admin), or "noise" (cold outreach, newsletters, automated alerts). Return only valid JSON: {"priority": "...", "action": "reply|flag|archive"}. Email: [SUBJECT] — [FIRST 500 CHARACTERS]

That's it. GPT-4o-mini handles the ambiguity that static filters can't.

You'll want to adjust the category definitions to match how you actually work. If "urgent" means anything from your top three clients, specify that. If "admin" includes vendor invoices you pay on the 15th, add it. The more precise your categories, the more accurate the triage — and it takes about five minutes of tuning to get there.

Setup in 30 Minutes: What You Actually Need

The honest prerequisites:

  • Gmail account — personal or Workspace, either works
  • n8n account — the free cloud tier is sufficient; no self-hosting required
  • OpenAI API key — at 500-character truncation, 200 emails/day runs approximately $0.01–0.02/day, well under $10/month at high volume
  • 30 minutes — to import the template, connect your credentials, and test on five real emails

No coding required. n8n's credential system handles Gmail and OpenAI connections through OAuth and API key entry. The import is drag-and-drop.

What This Does and Doesn't Solve

What it does:

  • Classifies incoming email by priority and recommended action before you see it
  • Applies labels automatically so your inbox is pre-sorted when you open it
  • Reduces triage time significantly — reviewing AI verdicts is far faster than making each decision from scratch

What it doesn't do:

  • Write replies (that's a separate workflow and a separate AI step — possible, but not included in the base template)
  • Automatically unsubscribe you from newsletters (you can add an unsubscribe node, but it requires additional permissions)
  • Handle email attachments or calendar invites intelligently — those need their own logic

Get the Template

I packaged this exact workflow as a ready-to-import n8n template.

The Automation Starter Kit is free — it includes a basic version of this workflow plus 10 supporting AI prompts for common email situations. Download it here.

If you want the full version — the complete email triage workflow with refined classification prompts, a lead qualification overlay, and three AI response templates for common email types — that's the AI Email Triage Automation on Gumroad for $39. It includes setup documentation and runs on n8n's free tier without modification.

Either way, your inbox can work for you rather than against you. The setup takes an afternoon. The time it returns is ongoing.

Top comments (0)