Reference · Tools

Email Trigger (IMAP)

Starts workflow when new emails are received in an IMAP mailbox

Polling trigger Communication v1 Binary data

The Email Trigger (IMAP) node polls an IMAP mailbox on a schedule and fires a workflow run each time new messages arrive. It supports three output formats — Simple, Resolved, and Raw — so you can parse just the subject and body text, extract attachments, or capture the raw message source. A common use case is routing incoming support emails into a ticket-creation workflow the moment they land in your inbox.

Node type
Polling trigger
Parameters
9
Outputs
Output
Credentials
IMAP

Email Trigger (IMAP)

Trigger workflows when new emails arrive via IMAP

Overview

The Email Trigger (IMAP) node polls an IMAP mail server at a configurable interval using a connect-check-disconnect cycle. On each poll it connects to the IMAP server, selects the configured mailbox (default INBOX), searches for messages with a UID greater than the last processed UID, fetches those messages, optionally marks them as read, disconnects, and returns the new emails as workflow items. On the very first poll the node establishes a baseline by recording the current highest message UID and returning no items, preventing a flood of historical emails. Supports three output formats: Simple (parsed headers and body text), Resolved (full MIME-parsed output with attachments extracted), and Raw (unprocessed message source).

Category: Communication
Tool Name: email_imap_trigger
Version: 1

Appearance: Icon: lucide-MailOpen | Color: #6366f1

Node Type

Trigger — polling (checks for new data on a schedule)

Input / Output

DirectionPort(s)
InputNone (trigger node)
OutputOutput

Credentials

This tool requires IMAP credentials. See the Credentials Guide for setup instructions.

Parameters

ParameterTypeRequiredDefaultDescription
Mailbox NamestringNoINBOXThe IMAP mailbox/folder to monitor for new emails.
ActionoptionsNoreadWhat to do after the email has been received. If “Nothing” is selected, emails will be processed again on subsequent polls unless custom search criteria exclude them.
Options: read (Mark as Read), nothing (leave the message untouched)
FormatoptionsNosimpleThe format to return the email message in.
Options: simple (parsed headers and body text — best for most use cases), resolved (fully MIME-parsed email with attachments extracted), raw (the raw email source as a string, unparsed)
Download AttachmentsbooleanNofalseWhether attachments of emails should be downloaded. Only set if needed as it increases processing. (shown when Format is simple)
Property Prefix Name (dataPropertyAttachmentsPrefixName)stringNoattachment_Prefix for name of the attachment property. An index starting with 0 will be added. So if name is “attachment_” the first attachment is saved to “attachment_0”. (shown when Format is resolved)
Property Prefix Name (dataPropertyAttachmentsPrefixNameSimple)stringNoattachment_Prefix for name of the attachment property. An index starting with 0 will be added. So if name is “attachment_” the first attachment is saved to “attachment_0”. (shown when Format is simple and Download Attachments is true)
OptionscollectionNo{}Additional configuration options for email processing.
— Custom Email RulesstringNo["UNSEEN"]Custom IMAP search criteria as a JSON array. Examples: [“UNSEEN”], [“ALL”], [“UNSEEN”, [“FROM”, “boss@example.com”]], [“UNSEEN”, [“SUBJECT”, “invoice”]].
— Fetch Only New EmailsbooleanNotrueWhether to fetch only new emails since the last run (using UID tracking), or all emails that match the search criteria on every poll.
Poll IntervalnumberNo1How often to check the mailbox for new emails.
Poll Interval UnitoptionsNominutesUnit for the poll interval.
Options: seconds, minutes, hours

Output Data

Each new message becomes one output item. Every item carries attributes.uid (the IMAP UID of the message), _trigger (always email_imap_polling) and _timestamp (when the poll ran). The remaining shape depends on Format.

simple — headers from the message envelope plus the decoded body:

{
  "textHtml": "<p>Invoice attached.</p>",
  "textPlain": "Invoice attached.",
  "from": "Billing <billing@example.com>",
  "to": "accounts@mycompany.com",
  "cc": "",
  "date": "2026-08-15T09:00:00.000Z",
  "subject": "Invoice 4192",
  "metadata": {
    "message-id": "<4192@example.com>",
    "in-reply-to": ""
  },
  "attributes": { "uid": 1042 },
  "_trigger": "email_imap_polling",
  "_timestamp": "2026-08-15T09:01:00.000Z"
}

With Download Attachments on, the item also gets attachments — one entry per file with filename, contentType and size — and one binary property per file, named with the configured prefix plus a zero-based index (attachment_0, attachment_1, …).

resolved — the fully MIME-parsed message: from, to, cc, subject, date, html, text, textAsHtml, messageId, inReplyTo, references, headers (every header line keyed by name) and attributes.uid. Attachments are always written to binary properties using the configured prefix and a zero-based index.

rawraw (the unparsed message source as a string) and attributes.uid, nothing else.

Reference values downstream by expression, e.g. {{ $json.subject }}.

Usage Examples

  • Start a workflow when a new email arrives in your inbox
  • Monitor a shared mailbox for incoming support requests
  • Trigger automation when an email with a specific subject is received
  • Process incoming invoices by email automatically

Example Configuration

Watch INBOX for unread mail and mark each processed message as read:

{
  "type": "email_imap_trigger",
  "parameters": {
    "mailbox": "INBOX",
    "postProcessAction": "read",
    "format": "simple",
    "pollInterval": 1,
    "pollIntervalUnit": "minutes",
    "options": {
      "customEmailConfig": "[\"UNSEEN\"]",
      "trackLastMessageId": true
    }
  }
}

Watch a folder and download attachments alongside the parsed body:

{
  "type": "email_imap_trigger",
  "parameters": {
    "mailbox": "Important",
    "postProcessAction": "read",
    "format": "simple",
    "downloadAttachments": true,
    "dataPropertyAttachmentsPrefixNameSimple": "email_attachment_",
    "pollInterval": 1,
    "pollIntervalUnit": "minutes",
    "options": {
      "customEmailConfig": "[\"UNSEEN\"]",
      "trackLastMessageId": true
    }
  }
}

Fully parse each message and leave the mailbox untouched, filtered by subject:

{
  "type": "email_imap_trigger",
  "parameters": {
    "mailbox": "INBOX",
    "postProcessAction": "nothing",
    "format": "resolved",
    "dataPropertyAttachmentsPrefixName": "file_",
    "pollInterval": 30,
    "pollIntervalUnit": "seconds",
    "options": {
      "customEmailConfig": "[\"UNSEEN\", [\"SUBJECT\", \"urgent\"]]",
      "trackLastMessageId": false
    }
  }
}

Hand the raw message source to a downstream node for custom parsing:

{
  "type": "email_imap_trigger",
  "parameters": {
    "mailbox": "Processing",
    "postProcessAction": "read",
    "format": "raw",
    "pollInterval": 10,
    "pollIntervalUnit": "minutes",
    "options": {
      "customEmailConfig": "[\"ALL\"]",
      "trackLastMessageId": true
    }
  }
}

Trigger Behavior

  • Activation: Polling starts when the workflow is activated. There is no poll at the moment of activation — the first check runs one full interval later.
  • Schedule: The trigger polls for new data based on the configured polling interval.
  • State: Maintains internal state (the highest message UID processed so far) so each poll returns only messages that arrived since the last check.
  • First Run: The first poll records the current highest UID and returns no items, so activating the workflow never replays the existing mailbox.
  • Testing: Running the node from the editor emits a single sample email so you can build the rest of the workflow; real mail arrives only while the workflow is activated.

Tips

Configure your IMAP server credentials (host, port, user, password). Select the mailbox to monitor (default: INBOX). Choose what to do with processed emails (mark as read or leave unchanged). The trigger connects to your mail server on each poll cycle, fetches new messages, and disconnects. On first activation it establishes a baseline and will only trigger on emails received afterward.

Parameter Relationships

The attachment-related parameters have conditional dependencies:

  1. Simple format with attachments:

    • Set format to "simple"
    • Set downloadAttachments to true
    • Optionally set dataPropertyAttachmentsPrefixNameSimple
  2. Resolved format (attachments included automatically):

    • Set format to "resolved"
    • Optionally set dataPropertyAttachmentsPrefixName
  3. Raw format (no attachment processing):

    • Set format to "raw"
    • No attachment parameters available

Notes

  • Turning Fetch Only New Emails off makes every poll return all messages matching the search criteria, so pair it with criteria that stop matching once a message is processed — for example ["UNSEEN"] together with the Mark as Read action.
  • A single poll returns at most 500 messages; anything beyond that is picked up on the following poll.

Frequently asked questions

Will it process all existing emails in my inbox when I first activate it?

No. On the very first poll the node records the highest message UID currently in the mailbox and returns nothing. Only emails that arrive after that baseline is set will trigger workflow runs. This prevents a flood of historical messages from being processed on activation.

What is the difference between the Simple, Resolved, and Raw output formats?

Simple parses the headers and body text and optionally downloads attachments if you enable the downloadAttachments parameter. Resolved performs full MIME parsing and extracts attachments automatically — no extra toggle needed. Raw passes through the unprocessed message source and does not support any attachment processing. Choose based on how much pre-processing you want the node to do before your next workflow step.

What happens if more than 500 new emails arrive between polls?

The node returns at most 500 messages per poll cycle. Any messages beyond that limit are picked up on the next poll. If your mailbox can receive high volumes in a short window, set a more frequent poll interval to keep the queue from growing.

If I turn off 'Fetch Only New Emails', will the node re-process the same messages on every poll?

Yes, it will return all messages matching your search criteria on every poll — not just new ones. To avoid duplicates, pair this setting with a search filter like UNSEEN and also enable the Mark as Read action, so each message stops matching the criteria once it has been processed.

What credentials does this node require, and which mailbox does it monitor?

The node uses IMAP credentials: server host, port, username, and password. It connects to whichever mailbox you configure, defaulting to INBOX. The connection is opened only during each poll cycle — the node does not maintain a persistent IMAP connection between polls.

Build with the Email Trigger (IMAP) node

Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need IMAP credentials first.

Open BusyBot

Last updated . Spotted something wrong? Tell us.