If you already run automations in n8n, inbound email is one of the richest triggers you can wire up. Orders, support requests, form notifications, and system alerts all arrive as messages you can turn into actions. The hard part is getting clean, structured data into the workflow reliably. This walkthrough shows the path from an inbound message to an n8n webhook node: what the event payload looks like, how to pull out the fields you need, how to branch on them, and how to keep the whole thing from breaking the first time a sender changes their format.
The examples here are deliberately generic so you can adapt them to your own workflow. The point is to show how the pieces fit together when a parsing gateway feeds n8n, rather than to publish a fixed endpoint.
Why a Webhook Beats Polling
As covered in what inbound email parsing is, there are two ways to feed email into automation: poll a mailbox on a timer, or have a gateway push an event the moment a message arrives. For n8n, the webhook approach wins on every axis that matters in production. There is no polling delay, no shared mailbox credentials sitting inside every workflow, and no duplicate-detection logic to maintain. The gateway parses the message once and posts a single, structured event to your n8n Webhook node. Your workflow starts from clean data instead of raw MIME.
The Event Payload
The key idea is that parsing happens before n8n sees anything. By the time the event reaches your Webhook node, the message has already been read and the fields you care about have been extracted. A typical event for an inbound order email looks like this:
{
"message_id": "<CA+abc123@mail.example.com>",
"received_at": "2026-06-04T14:08:22Z",
"from": "orders@acme-supplier.com",
"to": "intake@yourcompany.com",
"subject": "PO 48213 - 3 units",
"fields": {
"po_number": "48213",
"quantity": 3,
"ship_to": "200 Main St, Knoxville TN"
},
"attachments": [
{ "name": "po-48213.pdf", "type": "application/pdf", "size": 18244 }
]
}
Everything your workflow needs is in named fields. There is no parsing left for n8n to do, which is exactly what keeps the workflow simple and stable.
Wiring the n8n Webhook Node
A minimal workflow is four nodes: a Webhook node to receive the event, a Set node to map the fields you want, an IF or Switch node to branch on them, and an action node (an HTTP Request to your API, a database insert, a ticket create) to do the work.
Start by adding a Webhook node, set its method to POST, and copy the URL it generates. That URL is where the parsing gateway delivers each event. Because the gateway is configured on our side to post to your node, you never expose mailbox credentials and you never write a poller. The Webhook node is the entire ingestion layer.
Mapping and Validating Fields
With the event arriving, use a Set node (Edit Fields) to map the values you want into clean workflow variables. n8n expressions reference the payload directly:
po_number = {{ $json.fields.po_number }}
quantity = {{ $json.fields.quantity }}
ship_to = {{ $json.fields.ship_to }}
sender = {{ $json.from }}
Validate before you act. A short IF node that checks whether po_number and quantity are present keeps malformed messages from flowing into the rest of the pipeline. Route anything that fails validation to a review path rather than dropping it.
Fixed field mapping works when senders are consistent. When the message body is free-form or every sender formats things differently, rigid extraction breaks down. That is where AI-based email parsing earns its place: the gateway reads intent and returns the same structured fields even when the wording varies, so the n8n side does not change.
Branching and Routing
Once the fields are clean, an IF or Switch node turns them into routing decisions. Common patterns include routing by sender domain (different suppliers go to different downstream systems), routing by value (orders above a threshold go to a manager-approval branch, the rest auto-create), and routing by type (an order, an invoice, and a support request each take a different path). Each branch ends in its own action node, so one inbound event can drive several outcomes from a single workflow.
Error Handling and Retries
Production reliability comes down to three habits. First, set retries on any node that calls an external system, so a brief downstream outage does not lose the event. Second, attach an error workflow in n8n so failures are captured and surfaced instead of failing silently. Third, use the stable message_id from the payload as an idempotency key: store it on first processing and skip any event whose id you have already handled. Because the gateway emits each message once with a consistent id, deduplication on your side is a single lookup rather than fuzzy matching on subject lines.
From Example to Production
The expressions and nodes above are vendor-neutral on purpose. In a real deployment, the work that makes this dependable is the parsing itself: reading each sender's layout, handling attachments and edge cases, and emitting one consistent event no matter how different the source messages are. The StrataMail Parsing and Routing gateway is designed and deployed around your specific message formats, so your n8n workflows stay clean even as senders change. It is a managed gateway, not a self-serve endpoint you stand up and maintain alone.
The most useful next step is a scoped conversation: describe the messages you receive and the systems they need to reach, and we map the rules. The live demo shows the rules engine in action, and the Contact Us link in the sidebar reaches the team that designs these pipelines - tag the request under AI and Automation. When the data cannot leave your network at all, the same workflow can run against a private local LLM on dedicated hardware.