Complex HTTP Request with File and Other Data problems

Hello everyone,

I am quite new to N8N and I have a lot of troubles to make a simple Workflow that Get a Signed Document From Docuseal and then Upload It to kDrive.

My problem is that kDrive API request for the upload the size of the file, so I have to pass two parameters: size in bytes of the file in a query parameter and the file itself as bynary data in the body of the request.

Through browsing the multiple questions related to this issue on the forum I understood that to “bring back” the file as inputData and be able to call it I had to use “Merge” but it doesn’t work and I get the following error in the final http call to upload the file:

This operation expects the node’s input data to contain a binary file ‘data’, but none was found [item 0]
Make sure that the previous node outputs a binary file

{
  "errorMessage": "This operation expects the node's input data to contain a binary file 'data', but none was found [item 0]",
  "errorDescription": "Make sure that the previous node outputs a binary file",
  "errorDetails": {},
  "n8nDetails": {
    "nodeName": "Upload_Signed_Document_To_Kdrive",
    "nodeType": "n8n-nodes-base.httpRequest",
    "nodeVersion": 4.2,
    "itemIndex": 0,
    "time": "25/04/2024, 19:14:05",
    "n8nVersion": "1.38.1 (Self Hosted)",
    "binaryDataMode": "default",
    "stackTrace": [
      "NodeOperationError: This operation expects the node's input data to contain a binary file 'data', but none was found [item 0]",
      "    at assertBinaryData (/app/code/node_modules/n8n-core/src/NodeExecuteFunctions.ts:1058:9)",
      "    at Object.assertBinaryData (/app/code/node_modules/n8n-core/src/NodeExecuteFunctions.ts:3712:6)",
      "    at Object.execute (/app/code/node_modules/n8n-nodes-base/nodes/HttpRequest/V3/HttpRequestV3.node.ts:1483:42)",
      "    at processTicksAndRejections (node:internal/process/task_queues:95:5)",
      "    at Workflow.runNode (/app/code/node_modules/n8n-workflow/src/Workflow.ts:1378:8)",
      "    at /app/code/node_modules/n8n-core/src/WorkflowExecute.ts:1050:29",
      "    at /app/code/node_modules/n8n-core/src/WorkflowExecute.ts:1726:11"
    ]
  }
}

Information on your n8n setup

  • n8n version: 1.38.1
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Cloudron Server
  • Operating system: Cloudron Server

Thank you very much in advance for all the help you can provide

Best regards

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

@Ilovechocolate , your Merge node is not in the right mode. Switch it to Combine > Merge by Position and your kDrive node can use much simpler references too (adjust my config according to your needs).

1 Like

Hello @ihortom,

Thank you very much it works fine.

Although when I test the whole workflow the last step “UploadFile to KDrive” times out, but when I test only this last step or in production it works fine, a bit weird but not really an issue as long as it works in prod.

I still can’t understand why Append and Merge By Position differs in this particular case maybe I should try to deep dive the code of HTTP Request to get a better understanding of what is expected there!

Anyway thanks again I am not stuck anymore :slight_smile:

Best regards

They produce different results. “Append” adds items from the 2nd input to the list of items from the first input. That is, if you have one item in each input, you will get 2 items at the output of Merge node. “Merge By Position” on the other hand retains the number of items the same as in the 1st input adding the properties from the 2nd input to the corresponding item in the 1st input.

Therefore your fileSize was the 1st item while your “data” ended up in the place of the 2nd item. They were separate (not part of the same item).

That is, graphically “Append” produced

[
  {
   fileSize: 12345
  },
  {
   data: binary
  }
]

instead of

[
  {
   fileSize: 12345,
   data: binary
  }
]
1 Like

Thanks a lot for the detailed explanation it makes sense now!

Best regards

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.