Integration Guide

n8n Integration

Trigger n8n workflows instantly when emails arrive. No IMAP polling, no complex parsing — just structured JSON delivered to your webhook trigger.

Why Use Mailhooks with n8n?

The built-in n8n IMAP node has limitations:

Polling delays

IMAP triggers check on intervals, not in real-time

Connection management

OAuth tokens expire, IMAP connections drop

Email parsing

MIME parsing is complex and error-prone

No delivery guarantees

If polling fails, emails can be missed with no retry

How It Works

  1. 1 Email arrives at your Mailhooks inbox
  2. 2 Mailhooks parses the email into structured JSON
  3. 3 Webhook delivers the payload to your n8n workflow
  4. 4 n8n processes the data with any nodes you choose

If n8n is temporarily unavailable, Mailhooks queues the webhook and retries automatically.

Setup Guide

Step 1: Install the Mailhooks Community Node

For the best experience, install the n8n-nodes-mailhooks community node. This gives you a native Mailhooks trigger node with built-in authentication and Hook selection.

  1. Open n8n and go to Settings → Community Nodes
  2. Click Install a community node
  3. Enter n8n-nodes-mailhooks
  4. Click Install and confirm
  5. You'll now find the Mailhooks trigger node in the node panel

Alternatively, you can use a generic Webhook trigger — see the steps below.

Step 2: Add a Mailhooks Trigger (or Webhook)

With the community node (recommended): Add a Mailhooks trigger node, enter your API key, and select your Hook. You're done — no URL copying needed.

With a generic Webhook node: Add a Webhook trigger node and configure it:

  1. Set HTTP Method to POST
  2. Set the Path to something like mailhooks
  3. Copy the Webhook URL (Production URL for live workflows)

Step 3: Create a Mailhooks Inbox

  1. Go to Dashboard → Domains
  2. Add a domain or use your existing one
  3. Go to Hooks and click Add Hook
  4. Select Webhook and paste your n8n webhook URL
  5. Click Create

You'll get an email address like orders@yourdomain.com

If you used the community node, you can skip pasting the webhook URL — the node connects directly.

Step 4: Test the Integration

  1. Send a test email to your new inbox address
  2. Check your n8n workflow execution history
  3. The email data will appear as JSON in the trigger output

Webhook Payload

Mailhooks sends this JSON structure to your n8n webhook:

Accessing Email Data in n8n

In subsequent nodes, access the email data using expressions:

Expression

Description

{{ $json.from }}

Sender email address

{{ $json.to }}

Recipient email address

{{ $json.subject }}

Email subject line

{{ $json.text }}

Plain text body

{{ $json.html }}

HTML body

{{ $json.attachments[0].url }}

First attachment download URL

Downloading Attachments

To download attachments in your workflow:

  1. 1 Add an HTTP Request node after your webhook trigger
  2. 2 Set Method to GET
  3. 3 Set URL to {{ $json.attachments[0].url }}
  4. 4 Set Response Format to File

The attachment will be available for further processing (e.g., upload to Google Drive, parse CSV, etc.).

Example Workflows

Forward Emails to Slack

  1. Webhook trigger (receives email)
  2. Slack node (send message)

Save Attachments to Google Drive

  1. Webhook trigger
  2. IF node (check attachments)
  3. HTTP Request (download)
  4. Google Drive (upload)

Create Notion Page from Email

  1. Webhook trigger
  2. Notion node (create page)

Process Order Emails

  1. Webhook trigger
  2. Code node (extract order #)
  3. HTTP Request (call API)
  4. Slack (notify team)

Advanced Configuration

Multiple Inboxes, One Workflow

Create multiple Mailhooks inboxes pointing to the same n8n webhook. Use the to field to route emails:

Domain-Specific Inboxes

Mailhooks supports catch-all addresses. Any email to *@yourdomain.com reaches your inbox, so:

  • orders@yourdomain.com
  • support@yourdomain.com
  • invoices@yourdomain.com

All trigger the same webhook — use the to field to differentiate.

Filtering Emails

Add conditions in n8n to filter which emails trigger actions:

Reliability

Webhook Retries

If your n8n instance is temporarily unavailable, Mailhooks queues the webhook, retries with exponential backoff, and continues retrying for up to 24 hours.

Webhook Logs

View delivery status in Dashboard → Hooks → Logs: Delivered, Pending, or Failed.

Troubleshooting

Webhook not triggering

  • Verify the webhook URL is correct in Mailhooks
  • Ensure n8n workflow is Active (not in test mode for production URL)
  • Check the n8n execution history for errors
  • Test with a simple email first

Missing attachments

  • Confirm Include Attachments is enabled in your inbox settings
  • Attachment URLs expire after 24 hours — download promptly
  • Check attachment size limits (50MB max per email)

Parsing issues

  • Use a Code node with regex or string methods
  • Use the HTML Extract node for HTML emails
  • Consider the Extract from File node for attachments

Comparison: Mailhooks vs IMAP Node

Feature

Mailhooks Webhook

n8n IMAP Node

Latency

Instant (< 10s)

Polling interval

Setup

2 minutes

Complex OAuth/IMAP

Attachments

Direct URLs

Manual extraction

Email parsing

Pre-parsed JSON

Raw MIME

Reliability

Queued + retries

Requires n8n uptime

Connection management

None required

Token refresh needed

Getting Started

Total setup time: ~5 minutes.

Create a Mailhooks account

View Quick Start Guide