Actions12
- Mailbox Actions
- Email Actions
Email → Set Flags
AI-generatedSummary
Set or modify standard IMAP flags and custom labels on one or more emails within a specified mailbox using provided IMAP credentials.
Inputs
- Credential Type — Select whether to authenticate using this node's IMAP credentials or existing credentials from an n8n IMAP Trigger node.
- Mailbox (required) — Specify the mailbox where the email(s) reside. Choose from a list or enter the full mailbox path.
- Email UID (required) — Provide the UID or comma-separated list of UIDs of the email(s) on which to set flags.
- Flags (required) — Select standard IMAP flags (such as \Answered, \Deleted, \Draft, \Flagged, \Seen) to apply to the email(s). Flags are boolean toggles.
- Custom Labels — Optionally add, remove, or set custom keyword labels on the email(s). Each label requires a name, a value (from predefined options or a custom string), and an action (add, remove, or set).
Output shape
a list where each entry corresponds to the result of setting flags on an email UID; may be empty or contain operation result data depending on IMAP server response
Operation connects to IMAP server using selected credentials, applies the requested flags and labels to specified email UIDs in the selected mailbox, then closes the connection. Errors throw NodeApiError exceptions. The output data shape depends on the IMAP server's response and node configuration; no guaranteed structured data is returned.
Examples
Example 1: Mark an email as seen and answered
Provide mailbox 'INBOX', email UID '12345', and set Flags with \Seen and \Answered as true.
Example 2: Add a custom label 'Important' with value 'true' to multiple emails
Provide mailbox path, UIDs like '12345,67890', and add a custom label named 'Important' with action 'add' and value 'true'.