IMAP Trigger icon

IMAP Trigger

Starts a workflow when a new email arrives (IDLE push, or polling fallback). Pairs with the IMAP (AI) action node for follow-up operations.

IMAP Trigger

AI-generated

Summary

Monitor a specified IMAP mailbox for configured events (new messages, expunged messages, flags changes) using either IDLE push or polling modes, and emit matching messages to the workflow with optional filtering and content fetching.

Inputs

  • Mailbox (required) — IMAP folder path to watch (e.g., 'INBOX').
  • Events (required) — List of mailbox events to trigger on: new message arrivals, message removals, or flag changes.
  • Mode (required) — Connection mode to detect events: Auto (use IDLE if supported, else poll), forced IDLE (push), or forced polling.
  • Poll Interval (Seconds) — Interval to check for new messages when polling mode is used (ignored in IDLE). Defaults to 60 seconds.
  • Filters — Client-side substring filters on email 'From', 'To', and 'Subject' headers, applied after receiving messages to emit only matching ones.
  • Fetch Options — Options to include body text, full headers, attachments (as binary data), and maximum attachment size to retrieve from new messages.
  • Manual Trigger Sample Size — Number of recent messages to emit when manually executing the node for testing.

Output shape

a list of items each representing an event in the mailbox (new message, expunged, or flags changed). For new messages, includes email metadata and optionally full parsed body, headers, and attachments as binary.

Supports emitting events for new messages, message removals, and flag changes. New messages can be filtered client-side by headers. The node maintains progress to avoid re-emitting processed messages. In Auto mode, uses IDLE if server supports; otherwise falls back to polling. Poll interval applies only in polling mode. Manual execution emits a sample of recent messages for testing.

Examples

Example 1: Trigger when new email arrives in INBOX containing 'urgent' in subject, fetching body and attachments.

Mailbox='INBOX'; Events=['newMessage']; Mode='auto'; Filters: Subject Contains='urgent'; Fetch Options: Include Body=true, Include Attachments=true

Example 2: Trigger on message deletions or flag changes in a folder 'Work'.

Mailbox='Work'; Events=['expunged','flagsChanged']; Mode='idle'; Poll Interval ignored.

Links

Discussion