# How to route incoming email replies to the right branch in n8n

## At a glance

**Pick up the replies**Start with the Gmail Trigger or the Email Trigger (IMAP) node on the shared inbox.

**Classify each reply**Add a Text Classifier node.

**Don't lose replies that fit nowhere**By default, When No Clear Match is set to Discard Item, so a reply that fits no category disappears.

## Pick up the replies

- Start with the Gmail Trigger or the Email Trigger (IMAP) node on the shared inbox.
- If the Gmail Trigger returns a 401, n8n's docs point to the credential: enable the Gmail API for OAuth2, or set up domain-wide delegation with the Gmail API for a service account.

## Classify each reply

- Add a Text Classifier node. Set Input Prompt to an expression for the reply text. By default it reads the text field.
- Add one category per destination, for example Sales, Support and Billing. Give each a description, because the description tells the model what the category means.
- Turn on Allow Multiple Classes To Be True only if one reply may need to go to more than one place.

1. **Pick up the replies**
2. **Classify each reply**
3. **Don't lose replies that fit nowhere**

The parts of this guide, in order.

## Don't lose replies that fit nowhere

- By default, When No Clear Match is set to Discard Item, so a reply that fits no category disappears.
- Set it to Output on Extra, 'Other' Branch, and send that branch to a person to read.

Updated 2026-11-02. General guidance, not advice for your situation; we scope each project in writing before any work starts.

## What the sources say

“Use the IMAP Email node to receive emails using an IMAP email server. This node is a trigger node.”

“With an error workflow, you can control how n8n responds to a workflow execution failure.”

n8n's integrations directory lists 2,629 integrations (n8n.io, as of 2026-11-08).

### Sources

- [n8n docs: Email Trigger (IMAP)](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.emailimap/) (checked 2026-11-08)
- [n8n docs: Error handling](https://docs.n8n.io/flow-logic/error-handling/) (checked 2026-11-08)
- [n8n integrations directory](https://n8n.io/integrations/) (checked 2026-11-08)

## Questions people ask first

**Can I change the instructions the classifier uses?**

Yes. The System Prompt Template option lets you edit it, using the {categories} placeholder for your categories.

**What if the output is badly formatted?**

Enable Auto-Fixing. The node sends the parsing error back to the model and asks it to fix the output.

## Read next

[**n8n**](https://pushbuild.com/tools/n8n.html)[**Gmail**](https://pushbuild.com/tools/gmail.html)[**n8n agent calls the same tool every time**](https://pushbuild.com/guides/n8n-agent-tool-called-every-time.html)

## Tell us what you need built.

Tell us the process and the tools involved. We reply with questions or a written scope.

[hello@pushbuild.com](mailto:hello@pushbuild.com?subject=Automation%20question)

---
As of 2026-12-03. Source: https://pushbuild.com/guides/n8n-route-email-replies.html
