Email for n8n Agents
Give every n8n workflow its own inbox. Trigger workflows from inbound email, send replies in thread, and handle full conversations — no SMTP config, no deliverability headaches.
How OpenMail works with n8n
Create an inbox with an HTTP Request node
Add an HTTP Request node to your n8n workflow. One call to the OpenMail API provisions a live inbox on your domain and returns the address immediately.
Method: POST
URL: https://api.openmail.sh/v1/inboxes
Headers:
Authorization: Bearer {{ $env.OPENMAIL_API_KEY }}
Content-Type: application/json
Body:
{ "mailboxName": "{{ $json.agentName }}" }
Response:
{ "id": "inb_8f3a1b2c", "address": "agent@yourdomain.com" }Store credentials in n8n environment variables
Save the inbox ID and address as n8n environment variables. The API key is shared across all agents — the inbox ID and address are unique per workflow.
OPENMAIL_API_KEY=om_...
OPENMAIL_INBOX_ID=inb_8f3a1b2c
OPENMAIL_ADDRESS=agent@yourdomain.comSend and reply from your workflow
Use an HTTP Request node to send email from your agent's inbox. Pass threadId to reply in the same thread — the reply arrives threaded correctly in the recipient's email client.
Method: POST
URL: https://api.openmail.sh/v1/inboxes/{{ $env.OPENMAIL_INBOX_ID }}/send
Headers:
Authorization: Bearer {{ $env.OPENMAIL_API_KEY }}
Content-Type: application/json
Body:
{
"to": "{{ $json.recipient }}",
"subject": "{{ $json.subject }}",
"body": "{{ $json.body }}",
"threadId": "{{ $json.threadId }}"
}Trigger your n8n workflow from inbound email
Register your n8n webhook URL in the OpenMail dashboard. Every inbound email fires a structured JSON POST to your workflow — parsed message body, full thread context, and extracted attachments included.
{
"event": "message.received",
"inbox_id": "inb_8f3a1b2c",
"thread_id": "thr_9d4e5f6a",
"message": {
"from": "customer@example.com",
"subject": "Re: Your order",
"body_text": "Thanks for following up...",
"attachments": [
{
"filename": "receipt.pdf",
"parsedText": "Order confirmation #1042"
}
]
}
}What n8n agents use email for
Customer support
Receive tickets, reply in thread, escalate when needed — no human in the loop for routine enquiries.
Invoice processing
Receive vendor emails, parse PDF attachments into structured data, and route line items to accounting automatically.
Sales follow-ups
Send personalised outbound sequences, receive replies in full thread context, and continue the conversation without leaving n8n.
Account verification
Receive OTP codes and confirmation links autonomously — complete signup and verification flows without human involvement.
Internal ops
HR and IT request handling via dedicated agent inboxes — employees email in, your workflow handles the rest.
What's included
Dedicated inbox per agent
Each n8n workflow gets its own address on your domain — no shared inboxes, no filtering logic required.
Webhook inbound delivery
Every inbound email fires a structured JSON POST into your n8n workflow in under 500ms. No polling, no IMAP.
Full thread history as structured JSON
Every inbound reply includes complete thread context — your workflow always has the full conversation available.
Attachment parsing
PDF, CSV, and DOCX files automatically extracted to plain text and included in the webhook payload.
Managed deliverability
SPF, DKIM, and DMARC configured automatically on provisioning. Primary inbox from day one.
Works with n8n Cloud and self-hosted
REST API and webhooks, no special setup. Works with any n8n deployment as long as your webhook endpoint is reachable.