Trigger n8n workflows from inbound email

Use Mailhooks as the email trigger for your n8n automations — no IMAP node or polling required.

The Problem

  • The n8n IMAP node requires polling intervals that introduce delays
  • Managing IMAP credentials and connections in n8n is error-prone
  • Email attachments are difficult to process reliably in n8n workflows
  • You need to keep n8n running constantly to catch incoming emails
  • Parsing email content in n8n requires complex text manipulation nodes

Why Existing Solutions Fall Short

IMAP triggers poll on intervals — missing the immediacy of real automation

OAuth setup for email providers is complex and tokens expire

Attachment handling requires additional storage configuration

Email parsing nodes are brittle and break with different formats

You shouldn't have to build this yourself.

How Mailhooks Solves This

Webhook Trigger

Use n8n's webhook node to receive emails instantly. No IMAP setup.

Pre-parsed Data

Email arrives as structured JSON — ready for your workflow.

Attachment URLs

Download attachments directly in n8n using HTTP Request node.

Always On

Mailhooks queues webhooks even if n8n is temporarily down.

How It Works

1

Create n8n webhook

Add a Webhook trigger node to your n8n workflow.

2

Create Mailhooks inbox

Set up an inbox with your n8n webhook URL.

3

Send email

Email arrives at your Mailhooks inbox address.

4

Workflow triggers

n8n receives structured JSON and runs your workflow.

5

Automate

Process the email data with any n8n nodes.

Code Example

Mailhooks sends this JSON to your n8n webhook trigger node.

Webhook Payload

{
  "id": "msg_n8n123",
  "from": "[email protected]",
  "to": "[email protected]",
  "subject": "New Purchase Request",
  "text": "Please process order #789...",
  "html": "

Please process order #789...

", "attachments": [ { "filename": "purchase-order.pdf", "contentType": "application/pdf", "size": 34567, "url": "https://files.mailhooks.dev/..." } ] }

Handler Code

// n8n Webhook Trigger Configuration
//
// 1. Add "Webhook" trigger node
// 2. Set HTTP Method: POST
// 3. Copy the webhook URL
// 4. Paste into Mailhooks inbox settings
//
// Access email data in subsequent nodes:
// - {{ $json.from }} - sender email
// - {{ $json.subject }} - email subject
// - {{ $json.text }} - plain text body
// - {{ $json.attachments[0].url }} - first attachment
//
// Use HTTP Request node to download attachments:
// URL: {{ $json.attachments[0].url }}
// Method: GET

Frequently Asked Questions

Every inbox can be configured with sender filtering rules. You can whitelist specific domains or email addresses, or use our webhook to implement your own spam filtering logic. Emails that don't match your rules are automatically rejected.

Webhooks are typically delivered within 100-500ms of email receipt. We process emails in real-time with no polling delays. For high-availability applications, we also offer webhook retries with exponential backoff.

Mailhooks is built specifically for inbound email. We offer simpler setup (no DNS changes required for testing), better attachment handling with direct download URLs, and a developer-first API for fetching emails programmatically—perfect for E2E testing.

Yes! You can connect your own domain with simple DNS configuration. We also provide free subdomains on inbox.mailhooks.dev for testing and development.

We automatically retry failed webhooks with exponential backoff for up to 24 hours. You can also use our API to fetch any missed emails. All emails are stored and accessible via the dashboard.

Get Started in 3 Steps

Takes ~2 minutes — no email infrastructure required.

1

Create a Mailhooks account

Sign up for free in seconds.

2

Create an inbox

Get a unique email address for your use case.

3

Add your webhook URL

Point to your endpoint and start receiving emails.

Connect email to n8n in minutes