Read Email (IMAP)
Read emails from IMAP server.
Connects to an IMAP mailbox, searches one folder with IMAP criteria and returns the matching messages with subject, sender, date, raw text body and attributes; no match leaves through empty.
How it works
- Resolves the config.
connection_id,box(defaultINBOX),searchCriteria(default["UNSEEN"]) andmarkSeen(default true) fall back to the same keys of the incoming payload; an emptyboxor empty criteria array counts as not set. - Resolves the credential:
host,port(default 993) andtls(default true) from its config;username(oruser) andpassword(orpass) from its secret. Authentication waits up to 10 s. - Opens
box, runs the search and fetches theHEADERandTEXTparts of every match. WithmarkSeen, fetched messages are flagged as read. - Maps each message to
{ subject, from, date, body, attributes }and closes the connection. - At least one message leaves through
outas{ emails }; none leaves throughemptywith{}.
In a workflow
The node as it appears in a workflow file (draft_nodes[]), and the envelope of a successful run.
{
"node_id": "node-read-invoices",
"label": "Read invoice mailbox",
"operator_slug": "io.imap",
"operator_version": "1.0.0",
"config": {
"connection_id": "pi-credential-xxxx",
"box": "INBOX",
"searchCriteria": [
"UNSEEN"
],
"markSeen": true
}
}{
"ok": true,
"data": {
"emails": [
{
"subject": "Invoice INV-2026-0042",
"from": "Billing <billing@example.com>",
"date": "Wed, 25 Nov 2026 14:12:09 +0000",
"body": "Hello,\r\nPlease find the invoice attached.\r\n",
"attributes": {
"uid": 1842,
"flags": [
"\\Seen"
],
"date": "2026-11-25T14:12:09.000Z"
}
}
]
},
"port": "out"
}Configuration
-
connection_idstring Required -
Credential for the IMAP mail server. Accepts credentials of type `basic-auth` (username + password + host + port).
-
boxstring Optional -
searchCriteriaarray Optional -
Criteria like UNSEEN, ALL, or ['SINCE', date]
-
markSeenboolean Optional
Behaviour in the code
What the implementation does with these keys beyond what the schema says.
-
searchCriteria - IMAP search criteria as an array, for example
["UNSEEN"],["ALL"]or["UNSEEN", ["SINCE", "2026-11-01"]]. An empty array falls back to the payload, then to["UNSEEN"]. -
markSeen - Only an explicit
falsekeeps messages unread. With the defaultUNSEENcriteria, this is what keeps the next run from returning the same messages. -
connection_id - Accepts
basic-authcredentials. A value containing:or a JSON object is treated as a rawhost:portfor local tests, with the user and password read from the incoming payload.
Output ports
out default The search matched at least one message. subject, from and date are the first value of each header; body is the raw TEXT part (MIME source for multipart messages); attributes holds the IMAP uid, flags and date.
{
"emails": [
{
"subject": "Invoice INV-2026-0042",
"from": "Billing <billing@example.com>",
"date": "Wed, 25 Nov 2026 14:12:09 +0000",
"body": "Hello,\r\nPlease find the invoice attached.\r\n",
"attributes": {
"uid": 1842,
"flags": [
"\\Seen"
],
"date": "2026-11-25T14:12:09.000Z"
}
}
]
}empty The search matched no messages.
{}error Missing connection_id, credential, connection, login, folder or search failure. Data is { error, details }, where details carries the error code, stack and its raw serialization.
{
"error": "Invalid credentials (Failure)",
"details": {
"code": null,
"stack": "<stack>",
"raw": "<serialized error>"
}
}In expressions
What a later node can read from this node's output with $("Read Email (IMAP)").item.json.<path> (write your node's label instead of Read Email (IMAP)). Editor marks the paths the workflow editor suggests under Previous Nodes (the output contract); Worker marks the paths the worker really returns through out, from the output shown in Ports.
| Expression | Editor | Worker |
|---|---|---|
$("Read Email (IMAP)").item.json.emailsList of found emails |
Errors
| Message | Port | Cause and fix |
|---|---|---|
connection_id is required (check config or config.payload) | error | No credential in the config nor in the incoming payload. Select an IMAP credential. |
<IMAP server error> | error | Wrong user or password, the folder in box does not exist, or the criteria are invalid. For mail providers that require app passwords, store one in the credential. |
Failed to resolve connection <connection_id>: <detail> | error | The credential does not exist or this workflow cannot use it. |
Input contract
-
connection_idstring Required -
boxstring Optional -
searchCriteriaarray Optional -
markSeenboolean Optional
Output contract
-
emailsarray Optional -
List of found emails
Contracts (JSON Schema)
The definition exactly as the orchestrator declares it. All is the whole *.definition.js; compare it with the sections above to spot differences between the documentation and the schema. Use it to validate a node before you publish.
{
"slug": "io.imap",
"name": "Read Email (IMAP)",
"category": "io",
"version": "1.0.0",
"description": "Read emails from IMAP server.",
"capabilities": [
"email",
"imap",
"communication"
],
"config_schema": {
"type": "object",
"properties": {
"connection_id": {
"type": "string",
"title": "IMAP Credential",
"description": "Credential for the IMAP mail server. Accepts credentials of type `basic-auth` (username + password + host + port).",
"ui_widget": "connection_picker",
"ui_options": {
"credential_types": [
"basic-auth"
],
"types": [
"imap"
]
}
},
"box": {
"type": "string",
"default": "INBOX"
},
"searchCriteria": {
"type": "array",
"default": [
"UNSEEN"
],
"description": "Criteria like UNSEEN, ALL, or ['SINCE', date]"
},
"markSeen": {
"type": "boolean",
"default": true
}
},
"required": [
"connection_id"
]
},
"input_contract_schema": {
"type": "object",
"properties": {
"connection_id": {
"type": "string"
},
"box": {
"type": "string"
},
"searchCriteria": {
"type": "array"
},
"markSeen": {
"type": "boolean"
}
},
"required": [
"connection_id"
]
},
"output_contract_schema": {
"type": "object",
"properties": {
"emails": {
"type": "array",
"description": "List of found emails"
}
}
},
"ports": [
{
"port_id": "out",
"label": "Emails",
"description": "List of found emails",
"is_default": true,
"supports_condition": true
},
{
"port_id": "empty",
"label": "No Emails",
"description": "No emails found matching criteria",
"is_default": false,
"supports_condition": true
},
{
"port_id": "error",
"label": "Error",
"description": "Connection or fetch error",
"is_default": false,
"supports_condition": false
}
],
"execution_mode": "async",
"required_resources": [],
"compatible_worker_pools": [
"standard-io"
],
"tags": [
"email",
"communication"
],
"is_stateful": false,
"publisher": {
"identity": "org_link_loom",
"profile": {
"name": "Link Loom",
"verified": true,
"url": "https://me.veripass.com/link-loom",
"logo_url": null
}
}
}{
"type": "object",
"properties": {
"connection_id": {
"type": "string",
"title": "IMAP Credential",
"description": "Credential for the IMAP mail server. Accepts credentials of type `basic-auth` (username + password + host + port).",
"ui_widget": "connection_picker",
"ui_options": {
"credential_types": [
"basic-auth"
],
"types": [
"imap"
]
}
},
"box": {
"type": "string",
"default": "INBOX"
},
"searchCriteria": {
"type": "array",
"default": [
"UNSEEN"
],
"description": "Criteria like UNSEEN, ALL, or ['SINCE', date]"
},
"markSeen": {
"type": "boolean",
"default": true
}
},
"required": [
"connection_id"
]
}{
"type": "object",
"properties": {
"connection_id": {
"type": "string"
},
"box": {
"type": "string"
},
"searchCriteria": {
"type": "array"
},
"markSeen": {
"type": "boolean"
}
},
"required": [
"connection_id"
]
}{
"type": "object",
"properties": {
"emails": {
"type": "array",
"description": "List of found emails"
}
}
}[
{
"port_id": "out",
"label": "Emails",
"description": "List of found emails",
"is_default": true,
"supports_condition": true
},
{
"port_id": "empty",
"label": "No Emails",
"description": "No emails found matching criteria",
"is_default": false,
"supports_condition": true
},
{
"port_id": "error",
"label": "Error",
"description": "Connection or fetch error",
"is_default": false,
"supports_condition": false
}
]Execution
- Execution
async- Stateful
- No
- Credentials
- Resolved on the server from
connection_id; the secret never reaches the workflow. - Capabilities
emailimapcommunication- Tags
emailcommunication
Notes and limits
- All matching messages are fetched in one run, with no limit or pagination; narrow
searchCriteriaon large mailboxes. - Attachments are not extracted: they stay inside the raw MIME
body. - Not idempotent with
markSeen: true: a run changes the mailbox state.
Reviewed against the orchestrator code · 31e874b · 2026-11-26