Email Trigger (IMAP)
The Email Trigger checks an IMAP mailbox folder on an interval and starts one run for each new message. Use it to process support requests, invoices sent to a shared inbox, alerts, or replies.
Polling starts when you publish the workflow. Changes take effect on the next publish.
Settings
| Name | Required | Default | Description |
|---|---|---|---|
| IMAP connection | Yes* | — | An IMAP connection with the server and mailbox login. See Connection. |
| IMAP Host | Yes* | — | Inline settings, for existing workflows: the mail server, for example imap.gmail.com. |
| Security | No | SSL/TLS (port 993) | Inline: SSL/TLS (port 993), STARTTLS (port 143) or None (unencrypted). |
| Port | No | 993 for SSL/TLS, else 143 | Inline: only needed for a non-standard port. |
| Username | No | — | Inline: the mailbox login. |
| Password | No | — | Inline: a project secret holding the password. |
| Folder | No | INBOX | The folder to watch, for example INBOX or Invoices. |
| Only unread messages | No | Off | Ignore new messages that are already marked as read. |
| Mark as read after triggering | No | Off | Mark each message as read once its run has been started. |
| Save attachments to storage | No | On | Store attachments so later steps can use them as files. |
| Max attachment size (MB) | No | 25 | Larger attachments are listed but not stored (1–100). |
| Poll Interval (seconds) | No | 60 | How often to check. Raised to your plan's minimum if lower. |
* Select an IMAP connection, or fill in the inline settings (existing workflows).
Many providers (Gmail, Microsoft 365, iCloud) require an app password for IMAP instead of your normal password.
Connection
Pick an IMAP connection in IMAP connection. The picker only lists IMAP connections, and New IMAP connection creates one without leaving the editor. Host, port, security, username and password all come from the connection, so the inline fields are ignored. See Database, SFTP, IMAP and SMTP connections.
Sign-in details resolve in the trigger's environment, so each environment can watch a different mailbox.
Inline settings (legacy)
Workflows created before IMAP connections keep working unchanged. Without an IMAP connection, the trigger uses IMAP Host, Security, Port, Username and Password (a secret, resolved in the trigger's environment). A username and password are required.
A Basic Auth connection selected in an older workflow still works: it supplies the username and password, and the server comes from the inline fields. It is deprecated, so publishing shows a warning (not an error): "'…' is a Basic Auth connection. It still works but is deprecated here: create a Imap connection instead." Switch the trigger to an IMAP connection when you can.
In the workflow JSON the connection is stored as connectionId. Steps saved with the older connection key still
work.
How it works
- First poll. The trigger fires for messages that arrive since you published it; messages that were already in the folder don't start runs. If the first checks fail (for example a wrong password you then fix), the first successful check still starts runs for messages received since publishing, up to the last 24 hours and the newest 50 messages.
- Republishing. Publishing again without changing the trigger keeps its place in the folder. If you change its settings or connection (or turn the workflow off and on), it starts again from the new publish time.
- New messages are found by their IMAP UID, in order. Each check picks up to 50 new messages; any others are picked up by the next checks.
- No duplicates. Each message starts at most one run. Blokkio remembers handled messages (for 30 days), so a repeated check after a crash doesn't start a second run.
- Mark as read happens after the runs have been started, in the same check.
- Mailbox reset. If the server resets the folder's UIDs (its
UIDVALIDITYchanges, for example after a mailbox migration), the trigger starts again from the current end of the folder instead of replaying old mail.
Poll interval
Poll Interval (seconds) defaults to 60. Your plan sets the minimum, from 5 minutes on the smallest plan down to 15 seconds on the largest (see
Plans and limits).
A lower value shows a warning in the editor, and the trigger checks at your plan's minimum instead. See Plan limits.
Trigger output
{
"messageId": "<CAF3x9k2@mail.example.com>",
"uid": 4182,
"uidValidity": 1699000000,
"folder": "INBOX",
"subject": "Invoice INV-2026-0117",
"from": ["Acme Billing <billing@acme.example>"],
"to": ["accounts@yourcompany.example"],
"cc": [],
"replyTo": ["billing@acme.example"],
"date": "2026-11-11T08:14:03.0000000+00:00",
"receivedAt": "2026-11-11T08:14:03.0000000+00:00",
"text": "Hi, please find attached invoice INV-2026-0117 ...",
"html": "<p>Hi, please find attached invoice <b>INV-2026-0117</b> ...</p>",
"headers": {
"message-id": "<CAF3x9k2@mail.example.com>",
"content-type": "multipart/mixed; boundary=\"b1\""
},
"attachments": [
{
"fileName": "INV-2026-0117.pdf",
"contentType": "application/pdf",
"size": 48213,
"file": {
"providerId": "11111111-1111-1111-1111-111111111111",
"fileId": "6b0d9f3e-2c41-4a7b-9e55-1f8a7c3d2e10",
"fileName": "INV-2026-0117.pdf",
"contentType": "application/pdf"
}
}
]
}
| Field | Description |
|---|---|
messageId | The Message-ID header. |
uid, uidValidity | The message's IMAP UID and the folder's UIDVALIDITY. |
folder | The watched folder. |
subject | The subject line. |
from, to, cc, replyTo | Lists of addresses, as Name <address> or just address. |
date, receivedAt | The message's Date header in UTC (ISO 8601). Both currently hold the same value. null if the header is missing. |
text, html | The plain-text and HTML bodies. Either can be null. |
headers | A subset of headers, with lowercase names: message-id, in-reply-to, references, reply-to, return-path, list-id, list-unsubscribe, content-type (only those present). |
attachments | One entry per attachment: fileName, contentType, size (bytes; when the attachment isn't saved, the size the email gives or an estimate) and file. |
file is a file reference you can pass to steps that accept files, such as Parse CSV or
HTTP Request. It is null when Save attachments to storage is off. When an
attachment is larger than Max attachment size, file is null and the entry has a skipped message.
Attachments are kept in the project's temporary storage (see Storage).
Examples:
{{ $trigger.subject }}
{{ $trigger.from[0] }}
{{ $trigger.attachments.filter(a => a.contentType === 'application/pdf').length }}
{{ $nodes['Email Trigger'].text }}
Testing
Click Test run in the editor header and pick the Email Trigger to start a run from the last saved draft. A test
run doesn't read the mailbox. To test later steps with a message, paste a sample object in the dialog's
Trigger data box (same shape as the trigger output); it becomes $trigger and the trigger
step's output, so {{ $trigger.subject }} and $nodes['Email Trigger'].subject work as in a real run. To reuse
the same sample in every test run, you can instead pin it on the
trigger's output; pinned data is only used in test runs.