Skip to main content
Lifetime license included with every purchase
n8n workflowsemail automationinbox managementproductivity

How to Automate Your Email Inbox with n8n (Triage, Route, and Auto-Reply)

Learn how to automate email triage, routing, classification, and auto-replies with n8n. Stop managing your inbox manually — build a hands-free email system.

Nn8n Marketplace Team·May 17, 2026·10 min read

Your Inbox Is a Queue. n8n Can Run It for You.

Most knowledge workers spend 2–4 hours a day on email. Sorting, reading, deciding who to forward to, writing the same replies again and again. That is operational overhead, not actual work.

n8n can intercept every incoming email, classify it by intent, route it to the right person or system, and send a contextual reply — all before you open your inbox. The trigger is a new message; the outcome is a processed, labeled, and acknowledged email without manual intervention.

This post covers practical patterns: inbox triage at scale, content-based routing, and intelligent auto-replies using n8n's Gmail, IMAP, OpenAI, and Slack nodes.

What You Can Automate

Email automation with n8n handles the full inbox lifecycle:

  • Auto-classify incoming emails into categories (lead, support, billing, spam) using AI or keyword rules
  • Route messages to the right Slack channel (#sales, #support, #billing) based on content
  • Send instant auto-replies to common inquiries — pricing questions, availability, support acknowledgments
  • Convert emails to tasks in Notion, Linear, or Asana when they contain action items
  • Extract structured data from emails (invoice amounts, tracking numbers, form responses) and write to Google Sheets
  • Forward specific email types to the right team member based on sender domain or keyword
  • Create CRM contacts from inbound sales emails and assign them to a rep automatically
  • Generate a daily digest summarizing unread emails by category

The Email Inbox Automation Pipeline

Every email workflow in n8n follows this structure:

Trigger → Classify → Route → Act → Confirm

The trigger fires on each new email. Classify uses AI, regex, or keyword matching to assign an intent category. Route sends the email to the correct branch. Act takes the right action — reply, create task, notify team. Confirm closes the loop by applying a Gmail label, logging to a spreadsheet, or posting a Slack message.

Step-by-Step Breakdown

1. Collect

Two nodes handle email triggers:

Gmail Trigger: connects via OAuth to your Gmail account and fires on every new message in a specified label or inbox. Returns sender, subject, body text, snippet, and message ID. Near real-time — checks every 1–2 minutes.

IMAP Email node: works with any IMAP server — Outlook, Fastmail, custom SMTP, G Suite — and polls on a schedule. Returns the same fields plus raw headers. Set the poll interval to 1–5 minutes for most use cases.

For shared inboxes (support@, sales@), use a service account or alias that both trigger types support.

2. Process / Segment

Raw email text rarely maps directly to a decision. Two approaches work well:

Keyword-based classification: Use an IF node chain. Check if the subject or body contains terms like "invoice", "pricing", "refund", or "urgent". Fast, zero API cost, deterministic. Works well for high-volume inboxes where categories are well-defined.

AI classification: Pass the subject and body to an OpenAI node with a prompt like: "Classify this email into one of: lead, support, billing, other. Return only the category name." The response is a single word — easy to branch on downstream. More flexible for ambiguous inputs.

Combine both approaches for reliability

Use keyword rules first for high-confidence categories — a subject starting with "Invoice #" maps directly to billing. Fall through to the AI classifier only for emails that do not match any keyword rule. This cuts API costs and keeps latency low for the easy cases.

3. Route

A Switch node reads the category field set in step 2 and sends each email to the matching branch:

  • lead → create CRM contact and notify #sales
  • support → create support ticket and send acknowledgment reply
  • billing → notify #billing and escalate if the keyword "urgent" is present
  • other → apply Gmail label "review" and take no further action

Each branch is independent — you can add, remove, or modify one branch without touching the others.

4. Act

Actions vary by branch, but the most common are:

Auto-reply: use the Gmail node's Send Email action. Set the recipient to the sender's address using ={{ $json.from.value[0].address }} and the subject to Re: ={{ $json.subject }}. Write the reply body as a static template or generate it dynamically with OpenAI.

Create a task: use the Notion, Linear, or Asana node to create an item with the email subject as the title and the body as the description. Attach the sender email as a property.

Log to Sheets: use the Google Sheets node to append a row — timestamp, sender, subject, category, and action taken.

Apply a Gmail label after every action

After acting on an email, use the Gmail node's 'Add Label' action to mark it as processed — for example, "n8n-handled". This creates a clean audit trail and prevents the same email from triggering the workflow twice if the trigger checks the inbox again before the label propagates.

5. Follow Up

After the main action, close the loop:

  • Notify the team in Slack with the sender name, category, and a link to the original Gmail thread.
  • Update the CRM — if the email was a lead, log the touchpoint in HubSpot or Pipedrive as an activity on the contact.
  • Trigger a follow-up sequence — if no reply is received after 48 hours, a scheduled workflow can check timestamps and fire a follow-up email automatically.

Implementation Patterns

Pattern 1: Lead Triage and CRM Routing

New sales emails are classified, routed to the right rep, and logged to a CRM — no manual reading required.

Gmail Trigger (inbox)
  → OpenAI: classify intent
      Prompt: "Is this a sales lead, support request, or other? Return one word."
  → Switch: on category value
      "lead" →
        HTTP Request: POST to HubSpot Contacts API
          email  = from.value[0].address
          name   = from.value[0].name
          source = "Inbound Email"
        → Slack: Post to #sales
            "New lead from [sender name]: [subject]"
      "support" →
        HTTP Request: POST to Zendesk Tickets API
        → Gmail: Reply with support acknowledgment template
      "other" →
        Gmail: Add Label "review"

The CRM row is created immediately, the rep is pinged in Slack, and the email is labeled. No inbox monitoring needed.

Browse email automation templates

Pattern 2: AI-Powered Auto-Reply

Common questions — pricing, availability, how-to — get an instant, personalized reply drafted by OpenAI and sent automatically.

Gmail Trigger (filter: label:inbox -label:n8n-handled)
  → OpenAI: draft a reply
      System: "You are a support assistant. Answer product questions concisely."
      User:   [subject] + [body text]
  → IF: reply length > 20 chars AND reply does not contain "I don't know"
      TRUE →
        Gmail: Send Email
          To      = sender address
          Subject = "Re: " + original subject
          Body    = OpenAI draft output
        → Gmail: Add Label "n8n-handled"
      FALSE →
        Gmail: Add Label "needs-human"
        → Slack: Post to #support with full email details

The confidence gate prevents nonsense replies. Emails the model cannot handle confidently are flagged for human review instead of auto-sent.

Pattern 3: Email-to-Task Converter

Emails with action-oriented language are automatically converted into tasks in your project management tool.

Gmail Trigger
  → OpenAI: extract action items
      Prompt: "List any action items from this email as a JSON array of strings.
               If none, return an empty array []."
  → Code: parse JSON and split into individual task items
      return JSON.parse(items[0].json.text).map(task => ({ json: { task } }))
  → IF: array length > 0
      TRUE →
        Notion: Create Database Item (for each task)
          Title  = task string
          Source = "Email: " + original subject
        → Gmail: Add Label "tasked"
      FALSE →
        Gmail: Add Label "no-action"
Use a Code node to split extracted task arrays

When OpenAI returns a JSON array of action items, a Code node lets you split it into individual workflow items so each task flows into Notion as a separate row. The pattern is: return parsedArray.map(task => ({ json: { task } })). Each output item creates one Notion database entry.

n8n Nodes You'll Use Most

NodePurpose
Gmail TriggerFire on new inbox messages in real time
IMAP EmailPoll any IMAP mailbox on a schedule
OpenAIClassify email intent, draft replies, extract action items
IFBranch on categories, keyword matches, or confidence scores
SwitchRoute to multiple branches by email category
GmailSend replies, add or remove labels, archive messages
SlackNotify channels with email summaries or routing alerts
HTTP RequestCreate records in CRMs, ticketing systems, or custom APIs
Google SheetsLog processed emails, categories, and actions taken
NotionConvert emails to tasks or structured database entries

Getting Started

  1. Connect your email account: in n8n, go to Settings → Credentials → New → Gmail OAuth2 and complete the OAuth flow. For non-Gmail providers, add an IMAP Email credential with your server host, port, username, and password.
  2. Add the trigger node: drop a Gmail Trigger (or IMAP Email) on the canvas, select your credential, and set it to watch the inbox or a specific label. Click "Test" to fetch a sample message and inspect the payload structure.
  3. Build the classifier: start with an IF node checking the subject field for known keywords. Once that runs cleanly, add an OpenAI node as a fallback for emails that do not match any keyword.
  4. Wire the Switch node: map each category string to its own output branch. Connect each branch to the correct action node — Gmail reply, Slack message, Notion create, or HTTP Request.
  5. Write auto-reply templates: for the Gmail "Send Email" node, write a fixed reply body first to verify the flow end-to-end. Replace it with an OpenAI-generated response once the routing works correctly.
  6. Add the processed label: after every successful branch, apply a Gmail label (e.g., "n8n-handled") so the same email is not processed again on the next trigger run.
  7. Test with real messages: send yourself test emails in each category. Confirm labels appear, Slack messages arrive, and tasks are created before activating the workflow permanently.

For a ready-to-deploy starting point, the Email Followup Automator template handles outbound follow-up sequences built on the same Gmail foundation. For lead classification and routing specifically, the AI Lead Scoring and Email Routing template covers the full classification-to-CRM flow out of the box.


If you are routing sales emails into a CRM and need to manage the pipeline after the lead arrives, see How to Automate Your CRM Workflows with n8n for contact management, deal tracking, and follow-up patterns.

For teams using Gmail alongside Google Workspace tools, How to Automate Google Workspace with n8n covers Calendar, Drive, Sheets, and Gmail working together in a single unified workflow.

Explore n8n automation templates
FAQ

Common questions

Can n8n read and process incoming emails automatically?
Yes. n8n has a Gmail Trigger node and an IMAP Email node that fire on every new message. The Gmail Trigger uses the Gmail API (OAuth) and fires in near real-time. The IMAP node polls on a schedule — useful for non-Gmail providers like Outlook or custom SMTP servers. Both deliver the full email payload: sender, subject, body (plain text and HTML), headers, and attachments.
How do I set up AI-powered auto-replies with n8n?
Add an OpenAI node after your email trigger. Pass the email subject and body as context, then prompt the model to draft a reply. Route the output through an IF node — if confidence is high, send automatically using the Gmail node's 'Reply to Email' action. If confidence is low, forward to a human. You can tune the threshold by checking whether the draft contains uncertainty phrases and branching accordingly.
What is the best way to route incoming emails to different Slack channels or teams with n8n?
Use a Switch node after the email trigger. Branch on a classified category — set by an AI node, an IF chain, or a regex match on the subject line. Map each branch to a Slack 'Send Message' action pointing at the correct channel: #sales for leads, #support for bug reports, #billing for payment issues. Add a Gmail label in the same step so the original email is tagged in your inbox for easy audit.
Stop reading. Start running.

Get the workflow templates this guide is built on

Import-ready n8n JSON, step-by-step setup, and tested end-to-end. One-time payment, own it forever.