How to Upload an Image to Chat and Use It in a Sub-Workflow in n8n?

I want to upload an image to a chat in n8n and then pass it to a sub-workflow for further processing (e.g., cropping, filtering, or analysis). However, it seems like the image is not being passed correctly to the sub-workflow.

What is the error message (if any)?

Here’s what I’m trying to do:

  1. Upload an image to the chat.
  2. Pass the uploaded image to a sub-workflow for processing

The problem is that when I pass the image to the sub-workflow, it doesn’t seem to retain the binary data. Instead, I only get metadata or an empty response.

How do I do it?

Share the output returned by the last node

Information on your n8n setup

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

This may help:

I’m trying to solve this issue here too, but this documentation doesn’t help.
Do you have an example workflow?

I believe there is a correct way with binary data if you are using the save file to local directory node and read file node in the sub workflow.

Or another idea is to convert the file to base64, pass that entire string to the following workflow and parse that as the correct file there.

Yeah, both options work. But the ideal solution would be to pass binary images to subworkflows and AI tools.

Thanks for the reply

I was able to send the image to the subworkflow using base64:

Now I’m trying to figure out how to send binary files to the AI Agent, because I don’t want to make it consume all those base64 tokens.

@Xenia_Zhukova are you using self-hosted or cloud?

Hey @Xenia_Zhukova,

After testing this for some time, I see only two solutions:

1. Using base64 (turning image into text) just like I showed above

This allows to send images to sub-workflows, but would consume a lot of token to send it back to the AI. So one-way is fine for this solution.

2. Storing and retrieving the images

I’m not sure if this works in cloud plan, but surely works in the self-hosted version:

.

:point_right: If my reply answers your question, please remember to mark it as a solution.