n8n Email to Webhook Integration

Route inbound emails directly into n8n as structured JSON. n8n is an open-source, self-hostable workflow automation tool with a visual editor and support for custom code nodes. JsonHook bridges the gap between your inbox and n8n — no custom server required.

Table of Contents
  1. Why Connect n8n to Inbound Email
  2. Setting Up n8n with JsonHook
  3. Example Workflow: When a server alert email arrives, parse the error details and insert a record into a Postgres incident table
  4. Payload Mapping for n8n
  5. Best Practices for n8n Email Integration

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.

  1. 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).
  2. 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.
  3. 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.
  4. 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.

Automate n8n with Email Webhooks

Free tier: 100 emails/month. Set up in minutes.

Get Free API Key

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.addressSender email addressSender / Contact email
from.nameSender display nameSender / Contact name
subjectEmail subject lineTitle / Subject / Name
textPlain-text email bodyDescription / Body / Message
htmlHTML email bodyRich text field / Notes
dateTimestamp of receipt (ISO 8601)Created date / Received at
attachments[n].filenameAttachment filenameFile name / Attachment label
attachments[n].contentAttachment content (base64)File content / Binary field
headers.*Raw email headersMetadata / Custom properties
messageIdUnique message identifierExternal 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.address and subject are 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.

Frequently Asked Questions

Can I send emails to n8n via webhook?
Yes. JsonHook provides a unique inbound email address for each webhook endpoint you configure. When an email is delivered to that address, JsonHook parses the message — extracting the sender, subject, body text, HTML body, and any attachments — and immediately POSTs the result as a structured JSON payload to your n8n Webhook node (HTTP POST trigger). From there, n8n can trigger any downstream action you have configured.
Do I need to code to connect JsonHook to n8n?
No coding is required. n8n handles the connection entirely through its visual workflow builder. Simply paste your JsonHook webhook URL into n8n's trigger or action configuration and map the JSON fields using the point-and-click interface.
How do I filter which emails go to n8n?
JsonHook uses address-based routing. Create a dedicated inbound address such as [email protected] and point it exclusively at your n8n webhook URL. You can also create multiple addresses for different email categories — one for support, one for sales leads, one for order notifications — each routed to a different n8n workflow or channel. If n8n supports conditional logic, you can add further filtering on the subject, from, or any custom field in the parsed JSON payload.
Can I self-host n8n and still use JsonHook?
Yes. Your self-hosted n8n instance just needs to be reachable over HTTPS from JsonHook's servers. Configure a reverse proxy (Nginx or Caddy) with a valid TLS certificate and use the public-facing URL as your JsonHook destination. JsonHook will POST to it exactly as it would to n8n Cloud.
How do I handle email attachments in n8n?
The attachments array in the JsonHook payload contains each attachment's filename, contentType, and base64-encoded content. In n8n, use a Function node to decode the base64 content and write it to disk or pass it to a cloud storage node such as AWS S3 or Google Drive.