Overview
Most inbox-zero automations fail because they're static: they misclassify the same email type every day. This n8n workflow adds a feedback loop — you drag emails between Notion columns, and the classifier learns from your corrections weekly. The result is a triage system that mirrors your real priorities, not a generic rubric.
How it works
- Gmail trigger fires on every new email in the primary inbox.
- A Claude Haiku call classifies the email into one of five buckets: reply-now, reply-today, FYI, newsletter, or archive.
- The email is mirrored into a Notion database with the AI's classification, confidence, and a suggested reply for the top two buckets.
- You review Notion twice a day, dragging cards between columns when the AI is wrong.
- A weekly n8n schedule pulls the last 7 days of overrides, extracts the delta, and appends them as few-shot examples to the classifier prompt.
Benefits
- Cuts inbox time to two 10-minute windows a day.
- The classifier gets more accurate every week without manual prompt engineering.
- You always have a written record of every AI-drafted reply and whether you sent it.
Use cases
- Founders whose inbox is 60% newsletters + 40% real work.
- Support leads triaging shared inboxes across time zones.
- Executives with EAs who want AI to prep, not decide.
Step-by-step guide
Step 1: Set up Gmail OAuth in n8n
Use a dedicated Google Cloud project and restrict scopes to gmail.readonly, gmail.modify, and gmail.compose. Never grant full access.
Step 2: Build the Notion database
Columns: Subject, From, Received, AI Category, AI Confidence, Human Category, Draft Reply, Sent. The Human Category column is the training signal.
Step 3: Write the classifier prompt
Anchor with your five categories, define each with 2-3 real examples from your own inbox, and demand a JSON output. Temperature 0.
Step 4: Draft replies only for two buckets
reply-now and reply-today. Everything else is triage, not composition. This keeps token cost sane.
Step 5: Add the weekly feedback job
Every Sunday, pull rows where Human Category ≠ AI Category, sample up to 20, and append them as few-shot examples to the prompt in the next run.
Step 6: Measure and cap
Track weekly accuracy in Notion. If it stops improving, freeze the prompt — over-training on your own corrections leads to overfit rules.
Example
Input: 'Re: Q3 board deck — quick question' from CEO. Output: { category: 'reply-now', confidence: 0.92, draft: 'Yes — the revenue chart is pulling from the wrong tab. Fixing now, updated deck by 3pm.' }