Skip to content
AI & Automation

How to Automate a Shared Email Inbox with n8n and AI

Automate your shared email inbox with n8n: rules for predictable mail, AI classification for the rest, smart routing and AI-drafted replies a human approves.

How to Automate a Shared Email Inbox with n8n and AI

Your team shares one info@ or office@ address, and every morning someone spends the first hour reading, sorting and forwarding messages that could have reached the right person on their own. If you want to automate an email inbox without letting a machine answer your customers unsupervised, this guide gives you a layered setup you can build in n8n: plain rules for the predictable mail, AI classification for the messy rest, routing into the right tools, and AI-drafted replies that a person approves before anything is sent.

Where shared inboxes waste time

A shared inbox rarely fails because of volume alone. It fails because nobody owns the sorting. Typical symptoms:

  • Everyone reads everything. Three people open the same message, two assume the third will handle it, and nobody replies.
  • Forwarding chains. A billing question lands with sales, gets forwarded to accounting, then to the owner for approval. Each hop adds a delay and loses context.
  • Noise drowns signal. Newsletters, delivery notifications, automatic replies and supplier invoices sit next to a customer complaint that needed an answer this morning.
  • No record. Once a message is answered, the conversation lives in one person's sent folder instead of the CRM or the ticket system.

Before you build anything, spend a week counting what actually arrives. Group messages into rough categories (orders, support questions, invoices, job applications, sales inquiries, spam and notifications) and note who should handle each. Keep it simple: a spreadsheet with sender, subject, category and owner is enough. That list becomes your routing table.

Rules first: automate email inbox sorting without AI

Shared inbox automation does not need to start with AI. A large share of incoming mail is predictable, and predictable mail is best handled by rules: they are free, fast, explainable and never hallucinate.

Both major platforms already give you a lot:

  • Microsoft 365: shared mailboxes with Outlook rules (server-side rules run even when nobody has Outlook open), plus transport rules that an administrator can set up for the whole organization.
  • Google Workspace: Gmail filters and labels, and Google Groups configured as a collaborative inbox where messages can be assigned to team members.

Use these built-in tools for the obvious cases, then add an n8n workflow for anything that needs logic across systems. In n8n, the flow usually starts with the Gmail Trigger, the Microsoft Outlook Trigger or the generic IMAP Email Trigger, followed by IF and Switch nodes that check:

SignalExample ruleAction
Sender domainMessages from your payment provider or shop systemLabel "System", no notification
Known senderAddress matches an existing customer in the CRMAttach to the customer record
Subject patternContains an order number like #10234Route to order handling
Attachment typePDF from a known supplierSend to the invoice workflow
HeadersAuto-Submitted or List-Unsubscribe presentArchive as automated mail

The last row matters more than it looks. Auto-replies and mailing lists are a classic source of loops: your workflow replies to an out-of-office message, which replies to your reply. Filter them out at the start.

If invoices are a large part of your inbox, handle them in their own workflow. The same trigger-and-route pattern applies; only the downstream steps differ.

Adding AI classification for the messy rest

After the rules, what is left is the mail that humans write freely: "Hi, quick question about my last delivery, and can you also send me a quote for…". This is where email classification with AI pays off, because the input is unstructured and keyword rules break down.

In n8n, the Text Classifier node connected to a chat model is a good fit. You define the categories and a short description for each, and the node routes every message to one output. A practical setup:

  1. Send only what the model needs. Subject, sender domain and the first part of the body, with signatures and quoted reply chains stripped. Shorter input means lower cost and fewer distractions.
  2. Define clear, non-overlapping categories. For example: support, sales_inquiry, order_change, complaint, job_application, other. Write one or two sentences per category describing what belongs there and what does not.
  3. Always include a fallback. Anything the model is unsure about goes to other, which a person sorts by hand. A confident wrong answer does more damage than an honest "I don't know".
  4. Extract fields at the same time if useful. The Information Extractor node can pull an order number, a requested date or the customer's company name into structured fields for the next step.

How you write the instructions makes a large difference. Our guide to AI agent prompting for n8n in production covers category descriptions, examples and output formats in more depth.

AI filtering works well on exactly this kind of messy input. On a form platform we built, AI-based filtering reduced spam by 95% (case study). An inbox is a different input, so test on your own mail before you rely on any number, including ours.

A note on scope: you do not need an autonomous agent here. A classifier with fixed categories followed by fixed routing is easier to test and cheaper to run. If you are weighing the two approaches, our comparison of agentic and traditional automation explains when the extra flexibility is worth it.

Routing to the right person, ticket or CRM record

Once a message has a category, routing is regular automation again. Common destinations:

  • A person or team: apply a label in Gmail or move the message to a folder in the shared mailbox, and post a short notice in the team chat with sender, category and a link.
  • A ticket: create a ticket in your help desk tool with the original message attached, so support works from one queue.
  • A CRM record: look up the sender by email address, attach the message to the contact or deal, and create a follow-up task for the owner. If the sender is new and the category is sales_inquiry, create a lead.

Keep the routing table outside the workflow, for example in a small database table or spreadsheet that n8n reads: category, owner, destination, notification channel. When someone joins or leaves the team, you change one row instead of editing nodes.

Consistent routing into the CRM is where much of the saved time comes from. In a lead pipeline we built that consolidated many web forms into one CRM flow, manual lead processing dropped by 60% (case study). The same principle applies to email: every message lands in exactly one place, with an owner.

AI-drafted replies that a human approves

Drafting email replies with AI saves time on the repetitive answers: opening hours, delivery status, how to reset a password, what documents are needed. It is also where the risk sits, because a wrong or overly confident reply goes out under your company's name.

Our recommendation is clear: the AI writes drafts, a person sends them. No fully autonomous replies to customers.

A workable flow:

  1. For selected categories only (for example support and order_change), pass the message and relevant context to a chat model: the customer's recent orders, the matching FAQ entry, your tone guidelines.
  2. Instruct the model to answer only from that context and to say clearly when information is missing, instead of guessing.
  3. Save the result as a draft in the shared mailbox, threaded to the original message. In Gmail and Outlook, n8n can create drafts rather than sending.
  4. A team member opens the draft, edits it if needed and sends it.

If you want an extra checkpoint before drafts appear, for example for complaints, n8n can pause the workflow and wait for an approval in a chat tool or form. We describe these patterns in human-in-the-loop AI automation with n8n, and our practical guide to AI customer support covers the wider picture of support automation.

Exclude some categories from drafting entirely: legal threats, data deletion requests, complaints about safety, anything involving refunds above a set amount. Those go straight to a person.

Data protection: what may go to an AI provider

Customer emails contain personal data by definition: names, addresses, order details, sometimes health or financial information someone chose to include. Sending them to an AI provider is processing that data, which the GDPR in Europe and the PDPA in Thailand both regulate. What follows is general information, not legal advice.

Points to clarify before you go live:

  • Legal basis and transparency. Document why you process the data and mention AI-assisted processing in your privacy notice where required.
  • Data processing agreement. Use a provider that offers one, and check where data is processed and whether it is used for model training. Business API terms often differ from consumer chat products, so read the terms of the specific plan you use.
  • International transfers. If the provider processes data outside the EU or Thailand, check which transfer mechanism applies.
  • Data minimization. Send the subject and the relevant part of the body, not attachments, full threads or signatures with phone numbers, unless the step needs them.
  • Sensitive categories. Route messages that look like they contain health data, ID documents or bank details to a person, without AI processing.
  • Self-hosting as an option. For strict requirements, a self-hosted model on your own server keeps the text inside your infrastructure, at the cost of more setup and usually lower quality on difficult messages.

Also secure the workflow itself: store mailbox credentials in n8n's credential store, restrict who can open the workflow and its execution logs, and set a retention period for execution data, because those logs contain full email content.

Measuring whether it works

An automated inbox that nobody measures slowly drifts. Track a few numbers from day one:

  • Classification accuracy. Each week, take a sample of classified messages and check them by hand. Note which categories get confused.
  • Share of other. If the fallback grows, your categories no longer match your mail.
  • Draft acceptance. How often is a draft sent unchanged, lightly edited or discarded? A high discard rate for one category means the context or the prompt is missing something.
  • Time to first response. Compare before and after, per category.
  • Errors. Failed executions, API timeouts and messages that matched no route. Set up an error workflow that notifies someone, so a broken step does not silently swallow mail.

Start in shadow mode: let the workflow classify and log for a week or two while the team keeps working as before. Compare its decisions with what people actually did, fix the category descriptions, and only then let it move messages and create drafts.

Frequently asked questions

Does this work with a Microsoft 365 shared mailbox?

Yes. n8n connects to Outlook through Microsoft's APIs, and a shared mailbox can be accessed with an account that has permission to it. Check your tenant's admin settings, because some organizations restrict app access to mailboxes.

How accurate is AI email classification?

It depends on how clearly your categories are defined and how varied your mail is. Clear, distinct categories with good descriptions classify well; overlapping ones do not. Measure on a sample of your own messages before relying on it, and keep a fallback for uncertain cases.

What does it cost to run?

The n8n side is predictable, whether self-hosted or managed. AI costs depend on the model and on how many messages reach the AI step. Because rules handle the predictable mail first and only short text is sent, the AI share is usually modest. Calculate it with your provider's current pricing and your real volume.

Can the AI send replies on its own for simple questions?

Technically yes, but we advise against it for customer-facing mail. Drafts with human approval keep most of the time savings and avoid the cost of a wrong answer sent in your name.

Do we need to replace our help desk or CRM?

No. The workflow connects the inbox to the tools you already use. If you have no ticket system, labels and folders in the shared mailbox plus a chat notification are a reasonable start.

Get your inbox workflow checked

A shared inbox is one of the most common starting points for automation, because the gain is visible in the first week and the risk is easy to control with rules and drafts. If you would like help setting it up, our AI & Automation service builds n8n workflows like this one, rules-based where possible and AI where the input is messy, with a fixed quote. Not sure where to begin? Describe your inbox in our free workflow check and we will send you improvement ideas by email.