Send email with multiple attachment using Outlook Node

I’m struggling to send emails with multiple attachents in Outlook. The standard Send Email node works but I need to hard code the number of attachments. Ideally I would just send a message with 0, 1 or multiple attachments. I’m running into errors in the create draft or add attachment nodes that would allow this behavior, see my other post below.

It seems the “Outlook/Message/Send” node behaves different than the Outlook/Draft/Create node. When I add an attachment, the draft node fails.

and the error message:

details

{
  "errorMessage": "were unable to deserialize ",
  "errorDetails": {
    "rawErrorMessage": [
      "400 - {\"error\":{\"code\":\"UnableToDeserializePostBody\",\"message\":\"were unable to deserialize \"}}"
    ],
    "httpCode": "400"
  },
  "n8nDetails": {
    "nodeName": "Create a draft: Fails!",
    "nodeType": "n8n-nodes-base.microsoftOutlook",
    "nodeVersion": 2,
    "resource": "draft",
    "operation": "create",
    "itemIndex": 0,
    "time": "12/12/2025, 13:15:47",
    "n8nVersion": "2.0.1 (Cloud)",
    "binaryDataMode": "filesystem",
    "stackTrace": [
      "NodeApiError: were unable to deserialize ",
      "    at ExecuteContext.requestWithAuthentication (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/node-execution-context/utils/request-helper-functions.ts:1498:10)",
      "    at processTicksAndRejections (node:internal/process/task_queues:105:5)",
      "    at ExecuteContext.requestWithAuthentication (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/node-execution-context/utils/request-helper-functions.ts:1798:11)",
      "    at ExecuteContext.microsoftApiRequest (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_8da18263ca0574b0db58d4fefd8173ce/node_modules/n8n-nodes-base/nodes/Microsoft/Outlook/v2/transport/index.ts:52:10)",
      "    at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_8da18263ca0574b0db58d4fefd8173ce/node_modules/n8n-nodes-base/nodes/Microsoft/Outlook/v2/actions/draft/create.operation.ts:252:23)",
      "    at ExecuteContext.router (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_8da18263ca0574b0db58d4fefd8173ce/node_modules/n8n-nodes-base/nodes/Microsoft/Outlook/v2/actions/router.ts:51:21)",
      "    at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_8da18263ca0574b0db58d4fefd8173ce/node_modules/n8n-nodes-base/nodes/Microsoft/Outlook/v2/MicrosoftOutlookV2.node.ts:28:10)",
      "    at WorkflowExecute.executeNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1045:8)",
      "    at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1226:11)",
      "    at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1662:27",
      "    at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2274:11"
    ]
  }
}

The same error occurs with the add attachment node. My hypothesis is that n8n sends the wrong payload to the Microsoft Graph API when using the draft node. The same error occurs in the add attachment node.

@rutgerh

I’m getting an error in the code node:
Error: No attachments found at VmCodeWrapper (evalmachine.<anonymous>:3:9) at evalmachine.<anonymous>:14:2 at Script.runInContext (node:vm:149:12) at runInContext (node:vm:301:6) at result (/opt/runners/task-runner-javascript/dist/js-task-runner/js-task-runner.js:185:61) at new Promise (<anonymous>) at JsTaskRunner.runForAllItems (/opt/runners/task-runner-javascript/dist/js-task-runner/js-task-runner.js:178:34) at JsTaskRunner.executeTask (/opt/runners/task-runner-javascript/dist/js-task-runner/js-task-runner.js:128:26) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async Object.waitingForSettings (/opt/runners/task-runner-javascript/dist/task-runner.js:256:17)

Ok I found something super interesting. It seems the “Outlook/Message/Send” node behaves different than the Outlook/Draft/Create node. The

The draft Node fails with error code: were unable to deserialize

{
  "errorMessage": "were unable to deserialize ",
  "errorDetails": {
    "rawErrorMessage": [
      "400 - {\"error\":{\"code\":\"UnableToDeserializePostBody\",\"message\":\"were unable to deserialize \"}}"
    ],
    "httpCode": "400"
  },
  "n8nDetails": {
    "nodeName": "Create a draft",
    "nodeType": "n8n-nodes-base.microsoftOutlook",
    "nodeVersion": 2,
    "resource": "draft",
    "operation": "create",
    "itemIndex": 0,
    "time": "12/12/2025, 13:03:59",
    "n8nVersion": "2.0.1 (Cloud)",
    "binaryDataMode": "filesystem",
    "stackTrace": [
      "NodeApiError: were unable to deserialize ",
      "    at ExecuteContext.requestWithAuthentication (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/node-execution-context/utils/request-helper-functions.ts:1498:10)",
      "    at processTicksAndRejections (node:internal/process/task_queues:105:5)",
      "    at ExecuteContext.requestWithAuthentication (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/node-execution-context/utils/request-helper-functions.ts:1798:11)",
      "    at ExecuteContext.microsoftApiRequest (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_8da18263ca0574b0db58d4fefd8173ce/node_modules/n8n-nodes-base/nodes/Microsoft/Outlook/v2/transport/index.ts:52:10)",
      "    at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_8da18263ca0574b0db58d4fefd8173ce/node_modules/n8n-nodes-base/nodes/Microsoft/Outlook/v2/actions/draft/create.operation.ts:252:23)",
      "    at ExecuteContext.router (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_8da18263ca0574b0db58d4fefd8173ce/node_modules/n8n-nodes-base/nodes/Microsoft/Outlook/v2/actions/router.ts:51:21)",
      "    at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_8da18263ca0574b0db58d4fefd8173ce/node_modules/n8n-nodes-base/nodes/Microsoft/Outlook/v2/MicrosoftOutlookV2.node.ts:28:10)",
      "    at WorkflowExecute.executeNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1045:8)",
      "    at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1226:11)",
      "    at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1662:27",
      "    at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2274:11"
    ]
  }
}

The same error occurs with the add attachment node. My hyopthesis is that n8n sends the wrong payload to the Microsoft Graph API.

This issue is related but was closed without fixing the issue: Error on Outlook node/Create Draft when adding and attachment

It definitely is no Occam’s razor and a classic case of low-code being Nice from far, far from nice. But I managed to solve the bug this way:

If someone can give a cleaner solution that would be much appreciated. This makes my coding heart cry.