Pass a binary file to an agent

Hi everyone,

I’m a UiPath beginner and I’m currently stuck. I’ve made an HTTP request to a URL to retrieve an invoice PDF. It returns the PDF in binary format, and I’d like to pass it to an agent so it can analyze it using its multimodal capabilities.

Do you have any idea of how to it ?

Thank you ! :slight_smile:

Hi @Theo_l,

You can’t pass raw binary data directly to an agent.

Do this instead:

Save the HTTP response as a PDF file

Pass the file (or file path) to the agent for analysis

Agents support files/text inputs, not byte arrays. This is the supported approach in Agent Builder

@Theo_l

Welcome to the community

better approach would be to add a tool to convert binary data to file and pass the file or read the file and pass the data

cheers

Thank you for your feedback ! Just for you to know i’m on UiPath studio cloud and i’m not sure where the file is stored to pass it to the agent, find bellow the node configuration :

@Theo_l

In Studio Cloud, the file is saved in the job’s working directory, not on your local machine.

To pass it to the agent:

Set Output file target folder to a known path (e.g. project folder)

Use the same file path string (e.g. invoice.pdf or full path variable) as the agent input

You don’t need to browse the file manually
just pass the exact path you used in the HTTP Request to the agent.

Hi @Theo_l

  • Save the HTTP response binary content to a PDF file using Write File.
  • Pass the file path to the AI agent (or use Read File / Document Understanding input).
  • Agents can’t analyze raw binary directly — they need a file or text/image input.

So your flow is: HTTP Request → Save PDF → Send file to agent for analysis.

Hi everyone,

I found the solution thanks to everyone !

I created a tool “get_attachement” with an array input
Then loop over urls and get all the files, and finally returns a file array to the agent directly. After I can analyze the content with “Analyse Files” tool

Have a good day :slight_smile: