Using Binaries with AI Agents

Hi all, can’t figure out how to have binary data of an image being used by an AI Agent. I’d thought I could pass the binary to the agent from the HTTP Request, but that doesn’t seem to be working. Then thought about using the HTTP Request for Agents node, but that doesn’t support binary data.

Use case
Receive PDF’s - convert to jpegs (done by Stirling PDF) - send to AI (ChatGPT, Claude, Gemini etc) for OCR and evaluation through agent

The tool error is:
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 The binary data is definitely there.

Any solutions?


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:

Can anyone help with this please?

Hi @elliott

Thanks for posting here and welcome to the community! :tada:

Could you share your whole workflow so we can see your nodes configurations?
You can share your workflow here by pasting them as JSON in between two block quotes (```).

Thanks!

Hi @ria

Thanks for getting back to me :slight_smile:

Here’s the workflow JSON. I’ve removed the prompt and a specific URL. The main issue is I have no idea how to make the agent pass the image binary on to the call workflow tool.

I’ve tried:

  1. Adding a merge from the node that has the image
  2. Switching on “Automatically passthrough binary images” on the agent
  3. Making sure the agent prompt includes instructions to passthrough the binary image

Can’t find anything in the docs that goes over handling binary image data in Agents/Agent Tools either.

Tool JSON:

Hey @ria - Any ideas? :blush:

bumping this as this is a big flaw in this platform

Hi @elliott

Very sorry for the long response time!

I think the problem might actually be the If node because it doesn’t directly pass on the binary data.

I also just wanted to share a similar use case of our community member Jim Le - he recently published a pretty nice template that does something similar. Maybe you can find some inspiration :slight_smile:

I understand it is not desirable to inject binaries into AI Agent chat threads, as that is not intended. It should not be made possible in the first place, but I suggested something to alleviate (improve?) this: tool that returns binary borks AI Agent: add option to expect File type and make it return "OK" as text · Issue #11069 · n8n-io/n8n · GitHub