Outlook - Attachments
Descarga y gestiona los adjuntos de correos de Microsoft Outlook mediante Microsoft Graph API.
Descarga los adjuntos de un mensaje de Outlook mediante Microsoft Graph, los filtra por tipo MIME y tamaño, y los devuelve como contenido base64 o como archivos en el orquestador.
Manejador de adjuntos dedicado para entornos corporativos con procesamiento de correo de alto volumen. Admite filtrado por tipo y tamaño, paginación para correos con muchos adjuntos y escritura en disco por streaming para archivos grandes.
Operaciones:
- List: Obtiene los metadatos de todos los adjuntos (nombre, tipo, tamaño) sin descargar el contenido.
- Download: Descarga el contenido del adjunto en base64 o lo escribe directamente en archivos temporales.
- Download All: Descarga todos los adjuntos de un mensaje con filtrado opcional.
Cómo funciona
- Resuelve la configuración del nodo y exige
connection_id. Obtiene un token de Graph: si el secreto de la credencial tieneclient_id,client_secretytenant_id, solicita un token de aplicación (client credentials); si no, usa tal cual eltokenoaccess_tokendel secreto. - Apunta a
/users/<mailbox_email>cuandomailbox_modeesother; si no, a/me. - Toma el id del mensaje de
custom_message_idcuandomessage_sourceescustom; si no, deliddel ítem de entrada. - Lista todos los adjuntos del mensaje, siguiendo las páginas de
@odata.nextLink. - Conserva los adjuntos cuyo
contentTypeempieza porfilter_content_typey cuyosizeestá entrefilter_min_sizeyfilter_max_size. - Devuelve
no_attachmentssi no queda ninguno. En otro caso devuelvesuccessconcontent_bytes(base64) por adjunto o, en modofile, escribe cada uno en un directorio temporal nuevo y devuelve sufile_path.
En un workflow
El nodo tal como aparece en un archivo de workflow (draft_nodes[]) y el envelope de una ejecución exitosa.
{
"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": "support@example.com",
"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"
}Configuración
-
connection_idstring Obligatorio -
Credencial de acceso a Microsoft Graph API. Acepta credenciales de tipo `oauth2` (token de acceso + token de actualización), `service-account` (tenant id + client id + client secret) u `object` (configuración avanzada de Graph).
-
mailbox_modestring Opcional -
mailbox_emailstring Opcional Acepta expresiones -
message_sourcestring Opcional -
Incoming: usa el ID del correo del nodo anterior. Custom: indica un ID de mensaje manualmente.
-
custom_message_idstring Opcional Acepta expresiones -
filter_content_typestring Opcional Acepta expresiones -
Filtro opcional por tipo MIME (p. ej., "application/pdf", "image/"). Admite coincidencia por prefijo.
-
filter_min_sizenumber Opcional -
Tamaño mínimo del adjunto en bytes. Útil para excluir imágenes incrustadas.
-
filter_max_sizenumber Opcional -
Tamaño máximo del adjunto en bytes.
-
output_modestring Opcional -
Content: devuelve base64 en el payload. File: escribe en /tmp/ y devuelve las rutas de los archivos (recomendado para adjuntos grandes).
Su configuración muestra los ajustes de ejecución compartidos, pero este nodo aún no aplica reintentos (retryOnFail, maxTries). Ningún nodo aplica continueOnFail.
Comportamiento en el código
Lo que hace la implementación con estas claves más allá de lo que dice el esquema.
-
mailbox_mode - Los tokens de aplicación (client credentials) no tienen
/me; con ellos usaotherymailbox_email. -
filter_content_type - Coincidencia por prefijo sobre
contentType, sensible a mayúsculas (por ejemploimage/oapplication/pdf). -
output_mode fileescribe en el directorio temporal del orquestador usando el nombre del adjunto; dos adjuntos con el mismo nombre se sobrescriben, y el nodo no limpia los archivos.
Puertos de salida
success por defecto Al menos un adjunto pasó los filtros. En modo file, cada elemento trae file_path en lugar de 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 El mensaje no tiene adjuntos o ninguno pasó los filtros.
{
"attachments": [],
"count": 0
}error Falló una validación (la salida es el sobre { ok, errors, port }) o falló una llamada a Graph (la salida es { error, response } con el cuerpo de error de Graph).
{
"ok": false,
"errors": [
"Failed to resolve Microsoft 365 access token"
],
"port": "error"
}En expresiones
Lo que un nodo posterior puede leer de la salida de este nodo con $("Outlook - Attachments").item.json.<ruta> (escribe la etiqueta de tu nodo en lugar de Outlook - Attachments). Editor marca las rutas que sugiere el editor de workflows en Previous Nodes (el contrato de salida); Worker marca las rutas que el worker devuelve de verdad por success, según la salida que muestra Puertos.
| Expresión | Editor | Worker |
|---|---|---|
$("Outlook - Attachments").item.json.attachmentsLista de adjuntos con metadatos y contenido o ruta. | ||
$("Outlook - Attachments").item.json.countNúmero de adjuntos encontrados. |
Errores
| Mensaje | Puerto | Causa y solución |
|---|---|---|
Microsoft 365 credential is required | error | connection_id está vacío. |
Failed to resolve Microsoft 365 access token | error | No se pudo resolver la credencial, falló la solicitud del token o el secreto no tiene ni client credentials ni token. La causa de fondo no se informa. |
Message ID is required. Ensure the previous node outputs an email with an ID, or select "Custom" and provide a Message ID. | error | El ítem de entrada no tiene id y no hay id personalizado. |
Request failed with status code <status> | error | Graph rechazó la llamada: 404 si el id del mensaje o el buzón no existen, 401/403 si el token venció o falta el permiso Mail.Read. Revisa response para ver el error de Graph. |
Contrato de entrada
-
idstring Opcional -
ID del mensaje que llega del trigger o del nodo anterior.
Contrato de salida
-
attachmentsarray Opcional -
Lista de adjuntos con metadatos y contenido o ruta.
-
countnumber Opcional -
Número de adjuntos encontrados.
Contratos (JSON Schema)
La definición exactamente como la declara el orquestador. All es el *.definition.js completo; compáralo con las secciones de arriba para ver diferencias entre la documentación y el esquema. Úsala para validar un nodo antes de publicar.
{
"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
}
]Ejecución
- Ejecución
async- Con estado
- No
- Reintentos (
retryOnFail) - No
- Credenciales
- Se resuelven en el servidor a partir de
connection_id; el secreto nunca llega al workflow. - Capacidades
emailattachmentsmicrosoftoutlookoffice365- Etiquetas
emailattachmentsmicrosoftoutlookdownload
Notas y límites
- Un token de acceso OAuth guardado en la credencial se usa tal cual y nunca se renueva; cuando vence, Graph devuelve 401.
- Los adjuntos de tipo elemento o referencia no traen
contentBytes:content_bytesesnully, en modofile, no se escribe archivo aunque se devuelvafile_path. - El modo
contentpone cada adjunto en el estado del workflow como base64; prefierefilepara archivos grandes. El nodo no reintenta.
Revisado contra el código del orquestador · 31e874b · 2026-11-26