{
  "$schema": "https://promptfoo.tech/schemas/workflow-template.json",
  "name": "n8n: Inbox Triage That Actually Learns Your Priorities",
  "slug": "n8n-inbox-triage-with-claude",
  "platform": "n8n",
  "category": "productivity",
  "difficulty": "Intermediate",
  "tags": [
    "n8n",
    "email",
    "claude",
    "productivity",
    "gmail"
  ],
  "summary": "A Gmail-to-Notion pipeline that classifies email by priority, drafts replies, and quietly archives the noise — using Claude for classification and a small feedback loop that improves weekly.",
  "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.",
  "variables": {
    "WEBHOOK_URL": "<your webhook URL>",
    "API_KEY": "<your provider API key>",
    "ANTHROPIC_API_KEY": "sk-ant-..."
  },
  "steps": [
    {
      "order": 1,
      "name": "Set up Gmail OAuth in n8n",
      "description": "Use a dedicated Google Cloud project and restrict scopes to gmail.readonly, gmail.modify, and gmail.compose. Never grant full access."
    },
    {
      "order": 2,
      "name": "Build the Notion database",
      "description": "Columns: Subject, From, Received, AI Category, AI Confidence, Human Category, Draft Reply, Sent. The Human Category column is the training signal."
    },
    {
      "order": 3,
      "name": "Write the classifier prompt",
      "description": "Anchor with your five categories, define each with 2-3 real examples from your own inbox, and demand a JSON output. Temperature 0."
    },
    {
      "order": 4,
      "name": "Draft replies only for two buckets",
      "description": "reply-now and reply-today. Everything else is triage, not composition. This keeps token cost sane."
    },
    {
      "order": 5,
      "name": "Add the weekly feedback job",
      "description": "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."
    },
    {
      "order": 6,
      "name": "Measure and cap",
      "description": "Track weekly accuracy in Notion. If it stops improving, freeze the prompt — over-training on your own corrections leads to overfit rules."
    }
  ],
  "howItWorks": [
    "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."
  ],
  "useCases": [
    "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."
  ],
  "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.' }",
  "faqs": [
    {
      "q": "Why Claude Haiku over GPT-4o-mini?",
      "a": "Both work. Haiku is marginally better at strict JSON with short prompts; pick whichever your existing account already uses to avoid a new billing relationship."
    },
    {
      "q": "Does this send emails automatically?",
      "a": "No. Drafts land in Gmail as actual drafts you review before sending. Never let an autonomous agent hit send on personal email."
    },
    {
      "q": "What about spam and phishing?",
      "a": "Let Gmail's filters run first. The classifier only sees primary-tab mail. Never trust AI to catch phishing — it's not a security tool."
    }
  ],
  "source": "https://promptfoo.tech/workflows/n8n-inbox-triage-with-claude",
  "updated": "2026-06-01",
  "license": "CC-BY-4.0"
}