
n8n email webhook triggers: how to give each agent its own inbox
Trigger n8n workflows from incoming emails using webhooks, Gmail triggers, or dedicated agent inboxes. Here's how each approach compares.
You built an n8n workflow that processes incoming emails. It worked fine during testing. Then you deployed it, and Gmail's trigger node started polling every two minutes instead of firing instantly. OAuth tokens expired over the weekend. And when you tried to give a second workflow its own email address, you realized Gmail doesn't work that way.
Most n8n email automation guides start with the Gmail Trigger node because it's the path of least resistance. Connect your Google account, pick a label, done. But the Gmail Trigger has real limitations that surface the moment you need reliability, speed, or isolation between workflows.
There's a better pattern: give each workflow (or each agent) its own dedicated email address that POSTs incoming messages directly to an n8n webhook. No OAuth. No polling. No shared inbox. No midnight token refreshes.
How to trigger an n8n workflow from email#
An email trigger starts an n8n workflow automatically when a message arrives at a specified address or endpoint. Here are the main approaches:
- Add a Gmail Trigger node as the workflow start and connect your Gmail OAuth2 credentials to poll for new messages.
- Use a Webhook node to receive HTTP POST requests from an external service that forwards inbound emails as JSON payloads.
- Configure an IMAP Email Trigger node to poll any IMAP-compatible mailbox at a set interval.
- Set up a dedicated inbound email address (sometimes called a mailhook) that converts incoming emails into webhook POSTs to your n8n instance.
- Test by sending a real email and verifying the workflow fires in the n8n execution log.
Each approach has different tradeoffs around latency, reliability, and the number of unique addresses you can create. The rest of this article breaks down when to use which.
Gmail trigger vs webhook trigger#
The Gmail Trigger node and the Webhook node solve the same problem (start a workflow when something happens) but they work in fundamentally different ways.
The Gmail Trigger polls your inbox on an interval. Every one to two minutes, it checks for new messages matching your filter criteria. When it finds one, the workflow runs. The upside: zero external setup. The downside: it's not real-time, it requires OAuth credentials that expire, and every workflow shares the same Gmail inbox.
The Webhook node listens for incoming HTTP POST requests at a unique URL that n8n generates. When a POST hits that URL, the workflow runs immediately. No OAuth, and each webhook gets its own URL. The catch: something else needs to send that POST. The Webhook node doesn't know about email on its own.
This is where the two approaches split. Gmail Trigger is self-contained but slow and fragile. Webhook is fast and reliable but needs an email-to-webhook bridge.
| Feature | Gmail Trigger | Webhook + email service |
|---|---|---|
| Latency | 1-2 minute polling delay | Sub-second (real-time POST) |
| Authentication | OAuth2 (tokens can expire) | Webhook URL + HMAC secret |
| Unique address per workflow | No (shared inbox) | Yes (one address per webhook) |
| Rate limits | Gmail API quota (250 units/sec) | Depends on email service |
| Setup effort | Low (connect Google account) | Medium (configure email bridge) |
For a side project that handles 10 emails a day, Gmail Trigger is fine. For an agent that needs to process inbound email reliably, around the clock, with per-workflow routing, the webhook approach wins. We covered the webhooks vs polling tradeoff in more detail if you want a deeper comparison.
Where Gmail triggers break down#
Three failure modes show up repeatedly in production n8n deployments.
The most common is OAuth token expiry. Google's refresh tokens can be revoked by security policy changes, password resets, or extended inactivity. When the token dies, your workflow silently stops processing email. n8n doesn't alert you when this happens. You find out when a client says your agent stopped replying two days ago.
Then there's polling lag. The Gmail Trigger checks for messages every one to two minutes. If n8n restarts or deploys during a poll window, emails that arrived during the gap get missed entirely. Unlike webhook delivery (which queues and retries), polling has no memory of what happened while the instance was offline.
The third problem is the inbox itself. You can't create a new Gmail address per workflow without creating a new Google account per workflow. If you're building a multi-tenant application where each user or agent instance needs its own inbox, Gmail becomes unmanageable fast. The n8n community has been requesting built-in mailhook support for exactly this reason.
The mailhook pattern: one inbox per workflow#
A mailhook is a unique email address that converts incoming messages into HTTP webhooks. Send an email to workflow-123@yourdomain.com, and your n8n webhook URL receives a POST with the sender, subject, body, and attachments as structured JSON.
This solves all three Gmail problems at once. No OAuth tokens to manage, because the email service authenticates via webhook signatures (HMAC) instead of expiring user tokens. Delivery is real-time, with built-in retry logic so messages aren't lost during restarts or deployments. And each n8n workflow gets its own address. Route support emails to one workflow, invoices to another, agent replies to a third. No label-based filtering gymnastics.
Make.com has supported this pattern natively for years (they call it "custom mailhooks"). n8n doesn't have it built in yet, but you can wire it up with any external email service that supports inbound webhook forwarding.
Setting this up with LobsterMail and n8n#
LobsterMail is built for this pattern. Your agent hatches its own inbox via API, registers a webhook URL, and starts receiving email as structured JSON at that endpoint. Here's the setup:
// 1. Agent creates its own inbox
const inbox = await lm.createInbox({
prefix: "support-workflow",
ttl: "30d"
});
// → support-workflow-abc123@lobstermail.ai
// 2. Agent registers the n8n webhook as delivery target
await lm.createWebhook({
url: "https://your-n8n.example.com/webhook/email-intake",
events: ["email.received"],
});
On the n8n side, your workflow starts with a standard Webhook node pointed at /webhook/email-intake. When an email arrives at the inbox, LobsterMail POSTs the message data (sender, subject, body, attachments, thread ID) to your webhook URL. Your workflow processes it from there: through AI nodes, classification logic, database writes, whatever you need.
No Google OAuth. No polling interval. Each workflow instance gets its own email address, created programmatically. And if you want to test this without touching production, the free tier gives you sandbox inboxes that behave identically to live ones.
For n8n deployments where email is a core trigger (customer support agents, invoice processors, scheduling assistants), this approach removes the most common points of failure. Your agent provisions its own email, receives messages in real time, and you never have to re-authorize a Google account at 3am. If you want to try this pattern, . The free tier covers 1,000 emails per month, enough to validate the workflow before you need to scale anything.
Frequently asked questions
What is the difference between an n8n Webhook trigger node and a Gmail trigger node?
The Gmail Trigger polls your inbox every 1-2 minutes and fires when new messages match your criteria. The Webhook node listens for incoming HTTP POST requests at a unique URL and fires instantly. Gmail Trigger is self-contained but slow; Webhook is real-time but requires an external service to send the POST.
Can I trigger an n8n workflow by sending an email to a specific address?
Yes, but not with built-in n8n nodes alone. You need an external email service (a mailhook) that receives the email and forwards it as an HTTP POST to your n8n Webhook URL. LobsterMail, Mailgun, and Postmark all support this pattern.
Does n8n have a built-in mailhook feature for email-triggered workflows?
Not yet. As of early 2026, n8n supports Gmail Trigger, IMAP Trigger, and Webhook nodes, but doesn't offer a native email address that converts messages to webhook events. The community has requested it, and Make.com already supports this feature under the name "custom mailhooks."
What OAuth permissions does the Gmail Trigger node require in n8n?
At minimum, the gmail.readonly scope. If your workflow also sends replies, you'll need gmail.send or gmail.modify. These tokens can expire or be revoked by Google's security policies, which silently breaks your workflow with no built-in alert.
How do I build a 24/7 email inbox agent in n8n?
Use a Webhook node (not Gmail Trigger) as your workflow start so you get real-time delivery with retry logic. Connect it to a dedicated inbound address from a service like LobsterMail. Add downstream AI nodes for processing and reply generation. This avoids the OAuth expiry and polling gaps that break Gmail-based agents overnight.
Can n8n process email attachments received through a webhook trigger?
Yes. When using the webhook approach, the email service includes attachments as base64-encoded fields or download URLs in the POST payload. You can then use n8n's binary data handling to parse PDFs, images, or spreadsheets in downstream nodes.
How do I route different email types to different n8n workflows?
With Gmail Trigger, you use label-based filtering, which gets complicated at scale. With the mailhook pattern, each workflow gets its own unique email address. Send support emails to support@yourdomain.com and invoices to invoices@yourdomain.com, with each address triggering a different n8n webhook URL.
What rate limits apply when using Gmail as an n8n email trigger?
Gmail API enforces a per-user quota of 250 quota units per second and a daily sending limit of 500 emails for consumer accounts (2,000 for Google Workspace). The polling trigger consumes quota on every check, even when no new email exists.
Can I give each user a unique email address that triggers a separate n8n workflow?
Yes, using a mailhook service. LobsterMail lets you create inboxes programmatically via API, each with a unique routable address. Each inbox can webhook into a different n8n workflow URL. This is how multi-tenant email agents work: one inbox per user, one workflow per inbox.
How do I avoid duplicate email processing in n8n?
For Gmail Trigger, n8n tracks processed message IDs internally, but this state can be lost during redeployments. For webhook triggers, check the emailId field in the incoming payload against a datastore of previously processed IDs before executing your workflow logic.
What happens if an email arrives while n8n is still processing a previous one?
n8n queues concurrent webhook executions, so each incoming POST creates a separate workflow run. With Gmail Trigger, emails arriving between polls are picked up on the next cycle. If n8n is fully offline, Gmail Trigger misses those emails entirely, while webhook services typically queue and retry delivery.
Can an n8n AI agent automatically reply to incoming emails?
Yes. After processing the inbound email through an AI node (OpenAI, Anthropic, or a local model), your workflow can send a reply via the Gmail node, an SMTP node, or an API call to your email service. The webhook pattern is more reliable for this because you receive full thread context in each POST.
What is the Respond to Webhook node in n8n?
It sends an HTTP response back to the service that triggered the webhook. This is useful when your email service expects a 200 OK confirmation before considering the message delivered. If you don't respond in time, some services will retry, which could cause duplicate processing.
What is the most reliable way to connect an email inbox to an n8n AI agent in production?
Use a dedicated inbound email service with webhook delivery instead of Gmail polling. This gives you real-time triggers, automatic retries on failure, per-workflow addresses, and zero OAuth token management. Pair it with idempotency checks in your workflow for edge case handling.


