Outlook - Attachments
Download and manage email attachments from Microsoft Outlook via Microsoft Graph API.
Downloads the attachments of one Outlook message through Microsoft Graph, filters them by MIME type and size, and returns them as base64 content or as files on the orchestrator.
Dedicated attachment handler for corporate environments with high-volume email processing. Supports filtering by type, size, pagination for emails with many attachments, and streaming to disk for large files.
Operations:
- List: Get metadata of all attachments (name, type, size) without downloading content.
- Download: Download attachment content as base64 or write directly to temporary files.
- Download All: Download all attachments from a message with optional filtering.
How it works
- Resolves the node config and requires
connection_id. Gets a Graph token: withclient_id,client_secretandtenant_idin the credential secret it requests an app-only token (client credentials); otherwise it uses the secret'stokenoraccess_tokenas is. - Targets
/users/<mailbox_email>whenmailbox_modeisother, otherwise/me. - Takes the message id from
custom_message_idwhenmessage_sourceiscustom, otherwise from the incoming item'sid. - Lists every attachment of the message, following
@odata.nextLinkpages. - Keeps the attachments whose
contentTypestarts withfilter_content_typeand whosesizeis withinfilter_min_sizeandfilter_max_size. - Returns
no_attachmentswhen nothing is left. Otherwise returnssuccesswithcontent_bytes(base64) per attachment, or, infilemode, writes each one to a new temporary directory and returns itsfile_path.
In a workflow
The node as it appears in a workflow file (draft_nodes[]), and the envelope of a successful run.
{
"node_id": "node-get-pdfs",
"label": "Get PDF attachments",
"operator_slug": "connectors.microsoft.outlook.attachments",
"operator_version": "1.0.0",
"config": {
"connection_id": "pi-credential-xxxx",
"mailbox_mode": "other",
"mailbox_email": "[email protected]",
"message_source": "incoming",
"filter_content_type": "application/pdf",
"filter_min_size": 1024,
"output_mode": "content"
}
}{
"ok": true,
"data": {
"attachments": [
{
"id": "AAMkAGI2THVSAAA=",
"name": "invoice-2026-0418.pdf",
"content_type": "application/pdf",
"size": 48213,
"content_bytes": "JVBERi0xLjcKJc...",
"is_inline": false
}
],
"count": 1
},
"port": "success"
}Configuration
-
connection_idstring Required -
Credential for Microsoft Graph API access. Accepts credentials of type `oauth2` (access + refresh token), `service-account` (tenant id + client id + client secret), or `object` (advanced Graph config).
-
mailbox_modestring Optional -
mailbox_emailstring Optional Accepts expressions -
message_sourcestring Optional -
Incoming: uses the email ID from the previous node. Custom: specify a message ID manually.
-
custom_message_idstring Optional Accepts expressions -
filter_content_typestring Optional Accepts expressions -
Optional MIME type filter (e.g., "application/pdf", "image/"). Supports prefix matching.
-
filter_min_sizenumber Optional -
Minimum attachment size in bytes. Useful for filtering out inline images.
-
filter_max_sizenumber Optional -
Maximum attachment size in bytes.
-
output_modestring Optional -
Content: returns base64 in payload. File: writes to /tmp/ and returns file paths (recommended for large attachments).
Its configuration shows the shared execution settings, but this node does not apply retries (retryOnFail, maxTries) yet. continueOnFail is not applied by any node.
Behaviour in the code
What the implementation does with these keys beyond what the schema says.
-
mailbox_mode - App-only tokens (client credentials) have no
/me; useotherwithmailbox_emailfor them. -
filter_content_type - Case-sensitive prefix match on
contentType(for exampleimage/orapplication/pdf). -
output_mode filewrites under the orchestrator's temporary directory using the attachment name; two attachments with the same name overwrite each other, and the files are not cleaned up by the node.
Output ports
success default At least one attachment passed the filters. In file mode each item has file_path instead of content_bytes.
{
"attachments": [
{
"id": "AAMkAGI2THVSAAA=",
"name": "invoice-2026-0418.pdf",
"content_type": "application/pdf",
"size": 48213,
"content_bytes": "JVBERi0xLjcKJc...",
"is_inline": false
}
],
"count": 1
}no_attachments The message has no attachments, or none passed the filters.
{
"attachments": [],
"count": 0
}error A validation failed (the output is the envelope { ok, errors, port }) or a Graph call failed (the output is { error, response } with Graph's error body).
{
"ok": false,
"errors": [
"Failed to resolve Microsoft 365 access token"
],
"port": "error"
}In expressions
What a later node can read from this node's output with $("Outlook - Attachments").item.json.<path> (write your node's label instead of Outlook - Attachments). Editor marks the paths the workflow editor suggests under Previous Nodes (the output contract); Worker marks the paths the worker really returns through success, from the output shown in Ports.
| Expression | Editor | Worker |
|---|---|---|
$("Outlook - Attachments").item.json.attachmentsList of attachments with metadata and content/path. | ||
$("Outlook - Attachments").item.json.countNumber of attachments found. |
Errors
| Message | Port | Cause and fix |
|---|---|---|
Microsoft 365 credential is required | error | connection_id is empty. |
Failed to resolve Microsoft 365 access token | error | The credential could not be resolved, the token request failed, or the secret has neither client credentials nor a token. The underlying reason is not reported. |
Message ID is required. Ensure the previous node outputs an email with an ID, or select "Custom" and provide a Message ID. | error | The incoming item has no id and no custom id is set. |
Request failed with status code <status> | error | Graph rejected the call: 404 for an unknown message id or mailbox, 401/403 for an expired token or missing Mail.Read permission. See response for Graph's error. |
Input contract
-
idstring Optional -
Message ID from the trigger or previous node.
Output contract
-
attachmentsarray Optional -
List of attachments with metadata and content/path.
-
countnumber Optional -
Number of attachments found.
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": "connectors.microsoft.outlook.attachments",
"name": "Outlook - Attachments",
"category": "integrations",
"version": "1.0.0",
"description": "Download and manage email attachments from Microsoft Outlook via Microsoft Graph API.\n\n Dedicated attachment handler for corporate environments with high-volume email processing. Supports filtering by type, size, pagination for emails with many attachments, and streaming to disk for large files.\n\n **Operations:**\n - **List:** Get metadata of all attachments (name, type, size) without downloading content.\n - **Download:** Download attachment content as base64 or write directly to temporary files.\n - **Download All:** Download all attachments from a message with optional filtering.",
"capabilities": [
"email",
"attachments",
"microsoft",
"outlook",
"office365"
],
"group": [
{
"key": "microsoft",
"name": "Microsoft",
"icon_url": "/icons/integrations/microsoft/microsoft.svg"
},
{
"key": "microsoft365",
"name": "Microsoft 365",
"icon_url": "/icons/integrations/microsoft/microsoft365.svg"
}
],
"icon_url": "/icons/integrations/microsoft/outlook.svg",
"config_schema": {
"type": "object",
"properties": {
"connection_id": {
"type": "string",
"title": "Microsoft 365 Credential",
"description": "Credential for Microsoft Graph API access. Accepts credentials of type `oauth2` (access + refresh token), `service-account` (tenant id + client id + client secret), or `object` (advanced Graph config).",
"ui_widget": "connection_picker",
"ui_options": {
"credential_types": [
"oauth2",
"service-account",
"object"
],
"types": [
"outlook",
"microsoft365",
"oauth2"
]
}
},
"mailbox_mode": {
"type": "string",
"title": "Mailbox",
"enum": [
"token_owner",
"other"
],
"default": "token_owner"
},
"mailbox_email": {
"type": "string",
"title": "Mailbox Email",
"format": "expression",
"displayOptions": {
"show": {
"mailbox_mode": [
"other"
]
}
}
},
"message_source": {
"type": "string",
"title": "Message Source",
"enum": [
"incoming",
"custom"
],
"default": "incoming",
"description": "Incoming: uses the email ID from the previous node. Custom: specify a message ID manually."
},
"custom_message_id": {
"type": "string",
"title": "Message ID",
"format": "expression",
"displayOptions": {
"show": {
"message_source": [
"custom"
]
}
}
},
"filter_content_type": {
"type": "string",
"title": "Filter by Type",
"description": "Optional MIME type filter (e.g., \"application/pdf\", \"image/\"). Supports prefix matching.",
"format": "expression"
},
"filter_min_size": {
"type": "number",
"title": "Min Size (bytes)",
"description": "Minimum attachment size in bytes. Useful for filtering out inline images."
},
"filter_max_size": {
"type": "number",
"title": "Max Size (bytes)",
"description": "Maximum attachment size in bytes."
},
"output_mode": {
"type": "string",
"title": "Output Mode",
"enum": [
"content",
"file"
],
"default": "content",
"description": "Content: returns base64 in payload. File: writes to /tmp/ and returns file paths (recommended for large attachments)."
},
"execution": {
"type": "object",
"title": "Execution Settings",
"properties": {
"alwaysOutputData": {
"type": "boolean",
"title": "Always Output Data",
"description": "Always output data, even on error (if configured).",
"default": false
},
"retryOnFail": {
"type": "boolean",
"title": "Retry On Fail",
"description": "Retry the execution if it fails.",
"default": false
},
"maxTries": {
"type": "integer",
"title": "Max Retries",
"description": "Number of retries.",
"default": 3,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"waitBetweenTries": {
"type": "integer",
"title": "Wait Between Retries (ms)",
"default": 1000,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"continueOnFail": {
"type": "boolean",
"title": "Continue On Fail",
"description": "Do not crash workflow on error.",
"default": false
},
"timeout_ms": {
"type": "integer",
"title": "Timeout (ms)",
"description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
"default": 300000
}
}
}
},
"required": [
"connection_id"
]
},
"input_contract_schema": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Message ID from the trigger or previous node."
}
}
},
"output_contract_schema": {
"type": "object",
"properties": {
"attachments": {
"type": "array",
"description": "List of attachments with metadata and content/path."
},
"count": {
"type": "number",
"description": "Number of attachments found."
}
}
},
"ports": [
{
"port_id": "success",
"label": "Attachments Found",
"is_default": true,
"supports_condition": true
},
{
"port_id": "no_attachments",
"label": "No Attachments",
"supports_condition": true
},
{
"port_id": "error",
"label": "Error",
"supports_condition": false
}
],
"execution_mode": "async",
"tags": [
"email",
"attachments",
"microsoft",
"outlook",
"download"
],
"is_stateful": false,
"publisher": {
"identity": "org_sommatic_ai",
"profile": {
"name": "Sommatic AI",
"verified": true,
"url": "https://me.veripass.com/sommatic",
"logo_url": null
}
}
}{
"type": "object",
"properties": {
"connection_id": {
"type": "string",
"title": "Microsoft 365 Credential",
"description": "Credential for Microsoft Graph API access. Accepts credentials of type `oauth2` (access + refresh token), `service-account` (tenant id + client id + client secret), or `object` (advanced Graph config).",
"ui_widget": "connection_picker",
"ui_options": {
"credential_types": [
"oauth2",
"service-account",
"object"
],
"types": [
"outlook",
"microsoft365",
"oauth2"
]
}
},
"mailbox_mode": {
"type": "string",
"title": "Mailbox",
"enum": [
"token_owner",
"other"
],
"default": "token_owner"
},
"mailbox_email": {
"type": "string",
"title": "Mailbox Email",
"format": "expression",
"displayOptions": {
"show": {
"mailbox_mode": [
"other"
]
}
}
},
"message_source": {
"type": "string",
"title": "Message Source",
"enum": [
"incoming",
"custom"
],
"default": "incoming",
"description": "Incoming: uses the email ID from the previous node. Custom: specify a message ID manually."
},
"custom_message_id": {
"type": "string",
"title": "Message ID",
"format": "expression",
"displayOptions": {
"show": {
"message_source": [
"custom"
]
}
}
},
"filter_content_type": {
"type": "string",
"title": "Filter by Type",
"description": "Optional MIME type filter (e.g., \"application/pdf\", \"image/\"). Supports prefix matching.",
"format": "expression"
},
"filter_min_size": {
"type": "number",
"title": "Min Size (bytes)",
"description": "Minimum attachment size in bytes. Useful for filtering out inline images."
},
"filter_max_size": {
"type": "number",
"title": "Max Size (bytes)",
"description": "Maximum attachment size in bytes."
},
"output_mode": {
"type": "string",
"title": "Output Mode",
"enum": [
"content",
"file"
],
"default": "content",
"description": "Content: returns base64 in payload. File: writes to /tmp/ and returns file paths (recommended for large attachments)."
},
"execution": {
"type": "object",
"title": "Execution Settings",
"properties": {
"alwaysOutputData": {
"type": "boolean",
"title": "Always Output Data",
"description": "Always output data, even on error (if configured).",
"default": false
},
"retryOnFail": {
"type": "boolean",
"title": "Retry On Fail",
"description": "Retry the execution if it fails.",
"default": false
},
"maxTries": {
"type": "integer",
"title": "Max Retries",
"description": "Number of retries.",
"default": 3,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"waitBetweenTries": {
"type": "integer",
"title": "Wait Between Retries (ms)",
"default": 1000,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"continueOnFail": {
"type": "boolean",
"title": "Continue On Fail",
"description": "Do not crash workflow on error.",
"default": false
},
"timeout_ms": {
"type": "integer",
"title": "Timeout (ms)",
"description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
"default": 300000
}
}
}
},
"required": [
"connection_id"
]
}{
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Message ID from the trigger or previous node."
}
}
}{
"type": "object",
"properties": {
"attachments": {
"type": "array",
"description": "List of attachments with metadata and content/path."
},
"count": {
"type": "number",
"description": "Number of attachments found."
}
}
}[
{
"port_id": "success",
"label": "Attachments Found",
"is_default": true,
"supports_condition": true
},
{
"port_id": "no_attachments",
"label": "No Attachments",
"supports_condition": true
},
{
"port_id": "error",
"label": "Error",
"supports_condition": false
}
]Execution
- Execution
async- Stateful
- No
- Retries (
retryOnFail) - No
- Credentials
- Resolved on the server from
connection_id; the secret never reaches the workflow. - Capabilities
emailattachmentsmicrosoftoutlookoffice365- Tags
emailattachmentsmicrosoftoutlookdownload
Notes and limits
- An OAuth access token stored in the credential is used as is and never refreshed; when it expires Graph returns 401.
- Item and reference attachments carry no
contentBytes:content_bytesisnull, and infilemode no file is written althoughfile_pathis returned. contentmode puts every attachment in the workflow state as base64; preferfilefor large files. The node does not retry.
Reviewed against the orchestrator code · 31e874b · 2026-11-26