Pass binary data between workflows

Describe the problem/error/question

I have a workflow (child) with an “Execute Workflow Trigger” that take in input a binary data, it process it and outputs a result.
I call this workflow from another workflow (parent) and pass it a binary data.

The binary data is not present in the child workflow.

Why ?
How to pass binary data between two workflows ?

Alternative solution

I could:

  • Write the file on the disk
  • Call the child workflow with the path to the file
  • Read the file

But I want to avoid that.

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:

Hey @LucBerge , check out this post for the available solutions, [onedrive via Graph HTTP] why binary don't upload if not exactly previous node? - #2 by ihortom.

Hello @ihortom, thank you for the answer.

In the post, you give workarounds : fine. So the best option for me would be to convert the file to base64 in order to pass it as a string. But in my case the binary data exists in the previous node. So why isn’t it visible in the child workflow ?

What technically prevents a user from getting the binary data from previous node with {{ $('Step name').item.binary }} ?

Hey @LucBerge , if the node that has the binary is immediately preceding the node you want to access it then you should be able to do it. If it does not work for you that likely means you are not doing it right.

Reading your original post I realized that you are trying to pass the binary between workflows, not the nodes and the post I mentioned does not give an example of this specific use case. However, it does work and I didn’t think a special demo needed.

Try running the below workflow to see how passing the binary from child workflow to the parent works (do update the workflow ID to see the demo in action).

Here’s how binary file (“Binary” node) looks like. I used Set node to demonstrate it where the important option to note is “Include Other Input Fields”.

2 Likes

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