Why Connect n8n to Inbound Email
Automation platforms like n8n are designed to connect apps and trigger actions automatically. Email remains one of the most universal communication channels, yet most automation tools have no built-in way to receive email as a trigger. JsonHook solves this by turning any inbound email into a structured JSON event that n8n can act on immediately.
Connecting your inbound email to n8n through JsonHook unlocks a range of high-value automation scenarios:
- Trigger a multi-step automation every time a support email arrives
- Route emails from different senders to different automation branches
- Parse order confirmation emails and sync data to a spreadsheet automatically
- Send a follow-up SMS or email whenever a specific keyword appears in the subject line
- Create calendar events from email-based meeting requests without any manual input
n8n supports Webhook node (HTTP POST trigger), which makes it a natural target for JsonHook's outbound POST requests. Every email that hits your JsonHook address is parsed within milliseconds and delivered to n8n as a clean JSON object — no polling, no manual export, no middleware server to maintain.
Setting Up n8n with JsonHook
The following steps walk you through connecting JsonHook to n8n. The entire setup typically takes under ten minutes.
- Step 1: In your n8n instance, create a new workflow and add a "Webhook" node as the start. Set the HTTP method to POST and copy the generated production webhook URL (activate the workflow first to get the production URL).
- Step 2: In JsonHook, create an inbound address and paste the n8n webhook production URL as the destination endpoint. Test the route by sending a sample email.
- Step 3: In n8n, use the "Webhook" node's "Test" tab to capture the live payload from JsonHook. Inspect the JSON structure —
body.from,body.subject,body.text— and confirm all fields are present. - Step 4: Connect downstream n8n nodes such as HTTP Request, Postgres, Slack, or a Function node for custom JavaScript processing. Activate the workflow to begin handling production emails.
Once the connection is active, every email sent to your JsonHook address will be automatically parsed and forwarded to n8n. You can test the integration by sending a plain-text email to your JsonHook address and verifying that the payload appears in n8n within a few seconds.
JsonHook supports Webhook node (HTTP POST trigger) on the n8n side, so no additional configuration is needed in n8n beyond the steps above. If n8n requires header-based authentication for incoming webhooks, add the required headers in the JsonHook endpoint configuration under Advanced Settings.
Example Workflow: When a server alert email arrives, parse the error details and insert a record into a Postgres incident table
This walkthrough demonstrates one concrete way to use JsonHook with n8n. The scenario: When a server alert email arrives, parse the error details and insert a record into a Postgres incident table.
When an email matching this scenario arrives, JsonHook parses the raw SMTP message and constructs the following JSON payload before POSTing it to your n8n endpoint:
{
"messageId": "",
"from": {
"name": "Jane Smith",
"address": "[email protected]"
},
"to": [
{ "address": "[email protected]" }
],
"subject": "When a server alert email arrives, parse the error details and insert a record into a Postgres incident table",
"text": "Hi, I need help with my account. Please contact me at your earliest convenience.",
"html": "Hi, I need help with my account...
",
"date": "2026-03-15T10:32:00.000Z",
"attachments": [],
"headers": {
"x-priority": "1"
}
}
n8n exposes the POST body under the body key in the Webhook node output. Reference fields as {{ $json.body.from.address }}, {{ $json.body.subject }}, and {{ $json.body.text }}. Use the Function node for complex transformations such as regex extraction from the email body.
Once n8n receives this payload, it can execute any downstream action — whether that is posting a notification, creating a record, updating a field, or triggering an entire multi-step workflow. The key advantage is that the data arrives as structured JSON, so n8n never needs to parse raw email text or deal with MIME encoding.
Payload Mapping for n8n
JsonHook delivers a consistent JSON schema for every parsed email. The table below shows which JsonHook fields map to the equivalent fields in n8n. Use this as a reference when configuring your n8n Webhook node (HTTP POST trigger).
| JsonHook Field | Description | n8n Field |
|---|---|---|
from.address | Sender email address | Sender / Contact email |
from.name | Sender display name | Sender / Contact name |
subject | Email subject line | Title / Subject / Name |
text | Plain-text email body | Description / Body / Message |
html | HTML email body | Rich text field / Notes |
date | Timestamp of receipt (ISO 8601) | Created date / Received at |
attachments[n].filename | Attachment filename | File name / Attachment label |
attachments[n].content | Attachment content (base64) | File content / Binary field |
headers.* | Raw email headers | Metadata / Custom properties |
messageId | Unique message identifier | External ID / Deduplication key |
Not every field will be present in every email. Always check for null or missing values before mapping to required fields in n8n. For text-only emails, html will be empty; for HTML-only emails, text may be empty or auto-generated from the HTML. The attachments array will be an empty array when no files are attached.
Best Practices for n8n Email Integration
Following these best practices will make your n8n email integration more reliable, easier to debug, and simpler to scale as your email volume grows.
- Use dedicated addresses per workflow. Create a separate JsonHook inbound address for each distinct n8n workflow you want to trigger. This makes routing explicit and avoids a single endpoint becoming a bottleneck for all email types.
- Validate the payload before acting. In n8n, add a conditional check at the start of your workflow to confirm that required fields like
from.addressandsubjectare present and non-empty before executing downstream actions. - Test with real emails first. Use JsonHook's delivery log to inspect the raw JSON payload before wiring up n8n. Confirm that all the fields you plan to map are actually populated by your email source.
- Handle errors gracefully. Configure n8n to catch webhook delivery failures and send an alert. JsonHook will retry failed deliveries, but your n8n endpoint should return a 2xx status promptly to acknowledge receipt.
- Keep secrets out of email content. Avoid routing emails that contain passwords, API keys, or PII through workflows unless you have appropriate data-handling controls configured in n8n. Use JsonHook's HTTPS delivery to protect data in transit.