Tools

n8n tutorial: automating inbound email triage in a small business

Six nodes, half a day of build time, and a draft reply ready for review.

Louis Graffeuil
Founder Tandem
Published
9 minread
Envelope resting on a dark sorting block with three cables running out to three trays

This n8n tutorial builds a complete inbound email triage workflow, from the trigger through to a draft reply. Allow half a day for the first version and around 20 € a month in hosting. The case serves a small business receiving some forty emails a day on a shared mailbox, losing real time sorting them.

n8n is an open-source automation tool that wires your applications together. If the tool is new to you, our n8n guide for beginners covers the vocabulary and the nodes. Here, you build. Every step names the exact node, its settings and the pitfall that comes with it.

Email handling remains the most requested automation case in business. An artificial intelligence model reads a text, understands a request and proposes a reply. Those three operations are exactly what a shared mailbox demands all day long.

Diagram of the six steps of the n8n email triage workflow, with the node name under each step
Five steps are built inside n8n. The sixth is the only one that truly matters.

What you are going to build, and why it is a workflow

The workflow receives every inbound email and has a model classify it, into a closed list of categories. It logs the decision in a spreadsheet, routes the email to the right branch, then writes a draft reply. A human reviews and sends. Nothing leaves without validation.

This architecture follows hybrid logic. Fixed rules frame the path, and the model steps in only on the two stages that require understanding text. An autonomous agent would decide its actions as it goes. For a company inbox, predictability beats improvisation.

Table comparing automation, AI workflow and AI agent on definition, strengths and weaknesses
The middle column describes exactly what you are about to build. The third one looks exciting and runs in production far less often.

I set out this distinction in a LinkedIn post from March 2026 on workflows versus agents. Agents make people dream, workflows keep the business running. If what you need is an agent able to explore and chain unplanned actions, our tutorial on building an AI agent with n8n covers that case.

Three decisions to take before opening n8n

Three choices shape everything that follows, and revisiting them mid-build is expensive. Take them before creating the first node.

  • Hosting. The community edition installs on your own server and costs only the machine. The managed offer starts at 20 € a month on annual billing. A small business without internal technical staff gains by starting on the managed offer, and can bring the workflow back in-house later.
  • The model. Sorting an email into eight categories is a simple task. A small model is enough and costs a few cents per thousand emails. Keep the large model for writing the draft, where quality shows.
  • The scope. One shared mailbox to begin with, the one that hurts most. Wiring three mailboxes at once multiplies edge cases before the categories have even settled.

Plan detail and real project cost live in two dedicated articles, n8n free or paid and the cost of an n8n automation project. This tutorial does not redo the price list, it simply costs this one workflow.

Step 1, trigger the workflow the moment the email lands

Two paths exist and they are not equivalent. The first uses the Gmail Trigger node, which checks the mailbox at a set interval. The second uses the Webhook node, fed by a forwarding rule set in the mail service. The second path is faster and markedly less greedy.

Setting up forwarding takes five minutes. Create a Webhook node, copy its production URL, then open the forwarding settings of your mail service. Add the address or URL supplied, confirm the verification message the service sends, and enable forwarding of a copy of incoming messages. Every email then fires the workflow within seconds.

Bar chart comparing monthly trigger counts for 5-minute polling, 15-minute polling and webhook forwarding
Polling wakes the workflow at night and at weekends, when nobody writes. Forwarding only costs the emails actually received.

The arithmetic is easy to check. Polling every five minutes means around 8,640 wake-ups over thirty days. Polling every quarter of an hour means 2,880. A mailbox receiving some forty emails per working day produces around 880 through forwarding. On the price list recorded in October 2026, the Starter plan includes 2,500 monthly executions for 20 € a month on annual billing.

Step 2, have the model classify the email

Add a Basic LLM Chain node and connect the model of your choice. Two settings make all the difference. The Prompt parameter switches to « Define below » so that you write the message yourself. And the « Require Specific Output Format » option is turned on, which reveals a connection point for a parser.

Three parsers connect at that point. Pick the Structured Output Parser and describe the expected schema to it. The parser appends formatting instructions to the message sent to the model, then validates the reply. Without it, you get free text and every downstream node becomes fragile.

FieldWhat it holdsWhat it drives next
categoryOne value from the closed listFeeds the Switch node
explanationOne sentence justifying the classificationUsed to tune the prompt and brief the reviewer
reply_neededYes or noDecides whether a draft gets written
The output schema to describe in the Structured Output Parser

The system message always follows the same skeleton. You give a role, a few lines of company context, the exhaustive list of categories, and the instruction to file anything that fits nowhere under « other ». That catch-all category is deliberate. How full it gets will tell you which categories are missing.

Always ask for the explanation field. It does not serve the machine, it serves you. When an email lands in the wrong branch, the explanation tells you why, and you fix the category definition rather than fumbling with the whole prompt.

Step 3, log a week before automating a single action

Wire a Google Sheets node in append mode right after the classification, then activate the workflow and stop there. For one week, the workflow does nothing but watch and write. Each row carries the date, the sender, the subject, the chosen category and the model explanation.

This observation week is the part everyone skips, and it is the one that decides the quality of the result. You read three things in it. The share of emails filed under « other », which reveals missing categories. The recurring confusions between two neighbouring categories, fixed by sharpening their boundary. And the real volume per category, which tells you which ones deserve automation.

I filmed the full method, from the trigger to generating the CRM-enriched draft. The build there uses a different automation tool, and the steps map node for node onto n8n.

Step 4, route each category with the Switch node

The Switch node splits the flow into as many branches as you have categories. Leave the mode on « Rules » and write one rule per output, compared against the category field. One branch per category you automate, and nothing for the rest.

One setting deserves your attention, the « Fallback Output » option. It decides the fate of an item matching no rule. The default value, « None », makes it disappear silently. Switch it to « Extra Output », which creates an additional output where every unplanned case lands. Wire a notification to it. An email that vanishes silently is the most expensive failure to diagnose.

CategoryAutomatic actionDraft written
Sales enquiryLabel, contact created in the CRMYes
Billing questionLabel, invoice lookupYes
Technical supportLabel, team notificationYes
Supplier outreachLabel and archiveNo
OtherNotification on the extra outputNo
Example branches for a shared small-business mailbox

Step 5, write a draft fed by the CRM

On the branches that deserve a reply, a second model call writes the draft. That second call receives more than the email. It also receives the customer record, pulled from your CRM by a lookup on the sender address. That enrichment is what separates a generic draft from one the reviewer keeps.

The build chains three nodes. A contact lookup by address, limited to one result. Retrieval of the open deal tied to that contact. Then the model call, to which you pass the relevant variables and only those. Amount due, date of last exchange, product subscribed. A whole record dumped into the message dilutes what matters.

The Gmail node then creates a draft, never a send. Two advanced settings keep the draft in the right thread, the reply and references headers, filled with the identifier of the original message. Without them the draft starts an isolated thread and the recipient loses the history.

Step 6, go to production without nasty surprises

Three safeguards are enough, and they take an hour to put in place. A dedicated error workflow, set in the main workflow settings, notifying the team as soon as an execution fails. The On Error setting on the model node, so a badly formed reply does not halt the whole flow. And a watch on the executions list during the first few days.

The most frequent error on this workflow reports that the model output does not match the required format. It happens when the model adds an introductory sentence before the structured block. The auto-fixing parser handles most of these cases, at the cost of a second model call.

On the invoice side, this workflow stays modest. Around 20 € a month for managed hosting, and a few euros of model usage for a thousand emails classified and two to three hundred drafts written. Human supervision costs more than the machine, and that is as it should be.

If your instance runs an older release, first read what changes with n8n version 2. Environment variables blocked in the code node and the new publishing paradigm change a few production habits.

Do you still need to write n8n workflows by hand?

Less and less, and that is the real novelty of this year. A coding agent connects to your instance through its programming interface. It generates a complete workflow, drops it on your account, reads the execution errors and fixes itself until the flow passes.

I detailed the setup in an edition of my newsletter, with the n8n connector installation, the project context file and the instance connection. The blank page disappears, and you spend your time on what actually matters, the list of categories and the review of drafts.

One reservation still holds. A generated workflow rarely works first time on the nodes touching your credentials and permissions. The gain lies in the structure. The final wiring stays on your plate.

Which n8n workflow should you start with in your business?

Start with inbound email triage, before reporting and before the agent. Three reasons for that. The volume is daily, so the gain shows within a week. The task is purely textual, so it lands squarely in what a model does well. And the risk stays contained, since the workflow produces a draft that somebody reviews.

Avoid the opposite, which is the most common pattern. An ambitious first project, wired to four tools, with no observation log and no « other » category. It breaks on the third edge case and nobody knows why.

Tandem has supported more than 50 companies on this kind of build, across around 100 engagements. Would you rather have the first workflow built than learn by doing it? our n8n support offer always starts from the same point, one mailbox, one week of logging, then automation.

Frequently asked questions

How long does it take to build this n8n workflow?

Allow half a day for the first four steps, trigger, classification, logging and routing. The fifth step, the CRM-enriched draft, takes another half day because it depends on how your customer data is structured. Add a week of observation before switching on any automatic action.

Do you need to code to follow this n8n tutorial?

Mostly no. The six steps are built with preconfigured nodes and simple expressions. Two places call for a little technical comfort, truncating the email body and describing the output schema. Both can be copied from the official documentation and adapted by trial and error.

How much does this email triage workflow cost per month?

Around 20 € a month for managed hosting on the entry plan, which includes 2,500 monthly executions according to the price list recorded in October 2026. Add a few euros of model usage for a thousand emails classified and two to three hundred drafts written. Self-hosting removes the subscription and leaves the server cost.

Why use a webhook rather than the Gmail trigger?

For speed and for predictable cost. Forwarding to a webhook fires the workflow within seconds and only consumes an execution for an email actually received. Polling every five minutes means around 8,640 monthly wake-ups, nights and weekends included, whereas a small-business mailbox generates around 880 through forwarding.

Can the workflow reply to customers on its own?

Technically yes, and we advise against it on a customer mailbox. The workflow writes a draft and a human reviews before sending. A model that gets an amount or a date wrong commits the company. The time saved comes mostly from removing the blank page and the CRM lookup work. The send itself takes a few seconds.

Read next

All articles →
Tools3D illustration of nodes linked by cables converging into one central block

What is n8n? The complete guide for businesses

By Louis Graffeuil
Tools3D illustration of a robot being assembled and plugged in with a cable

How to build an AI agent with n8n, the complete tutorial

By Louis Graffeuil
ToolsIllustration of a pale server cabinet topped by a coral map pin, surrounded by shield, leaf and speech bubble tiles

Mistral AI, my review after deploying it inside companies

By Louis Graffeuil