AI Email Triage: Auto-Label Gmail + Urgent Alerts
Gmail filters sort by sender and keyword; they can't tell an angry customer from a newsletter that happens to say 'urgent'. This workflow has GPT-5.6 read each incoming email and classify it by what it actually is - Urgent, Customer, Invoice, or Newsletter - applies the matching Gmail label, and pings Slack only for the urgent ones. Your inbox becomes a sorted queue instead of a slot machine.
What this workflow does
- A Gmail Trigger polls for new inbox messages every few minutes.
- An OpenAI node classifies the email into one of four categories, replying with a single word.
- A Code node maps the category to your Gmail label ID.
- A Gmail node applies the label.
- An IF node routes Urgent emails to a Slack alert with sender and subject.
Setup guide
- Import the JSON into n8n (Workflows > Import from File).
- Connect Gmail (OAuth) in the trigger and the label node.
- In Gmail, create labels: AI/Urgent, AI/Customer, AI/Invoice, AI/Newsletter. Get their IDs from the n8n Gmail node's label dropdown and paste them into the Code node mapping.
- Add your OpenAI API key, and adjust the four category definitions in the prompt to your business.
- Connect Slack for urgent alerts. Activate and send yourself test emails.
Want this running 24/7?
Self-host n8n on a cheap VPS and this workflow runs around the clock for less than a coffee a month.
Get an n8n VPS from $5/monthFAQ
Want the workflows this one is a warm-up for?
The Mega Bundle packs both WorkflowForge Pro volumes — 32 production-grade workflows: automations (cart recovery, lead scoring, invoice extraction) and AI agents (support agent, calendar assistant, research agent), each with a setup guide. $39 for both, instant download.
Get the Mega Bundle →Need it customized for your exact process?
I build custom n8n automations and AI agents professionally: your tools, your edge cases, tested and documented.
Hire me on Fiverr →