AI email triage: GPT-4o-mini classifies every email, drafts the reply, and pings Slack only for hot leads

I wanted my inbox to sort itself without anything being sent automatically, so I built this 5-node workflow:

  1. Gmail Trigger (every minute, skips my own emails and drafts)
  2. HTTP Request to OpenAI (gpt-4o-mini, response_format: json_object). It returns:
    category (sales_lead / billing_invoice / support), urgency (high/normal), a 1-line summary, and a draft reply
  3. Switch: hot_lead = sales_lead + high urgency
  4. Gmail: create a draft reply in the same thread (every email)
  5. Slack: alert in #sales-alerts (hot leads only)

What worked well:

  • Keeping the AI’s job to “return JSON” and letting a Switch decide the route. The routing stays predictable and testable.
  • Drafts instead of auto-send: nothing leaves the inbox without a human.
  • Cost: gpt-4o-mini is a fraction of a cent per email.

Gotcha: filter “-from:me -in:drafts” in the trigger, or the drafts it creates trigger new runs.

I tested it with 4 real emails (quote request with a deadline, casual question, invoice, login problem): 4 drafts, 1 Slack alert.

The workflow JSON (free, pay-what-you-want) is here if you want to import it: AI Email Triage & Auto-Draft Blueprint (n8n JSON)
I also recorded a walkthrough. Happy to share it if it helps.

Happy to answer questions or hear how you’d route it differently.