Pass several files with HTTP node

I spent over a hour with google but cannot find the answer or related case. Is it possible to send vary number of attachments/binary files with HTTP Request node?

My usecase: I’m using a PDF-converter service to combine several individual files into the single one. n8n get several files at webhook node and then should pass it to the PDF-service.

There is only option to pass binary data in HTTP Request node - use hardcoded names. In my case the number of files can vary.

Is the only solution - the Code node + axios or somethig?

Best regards,

Hi @Nick_K_H, does your service accept these files in individual requests? If so, you can split our files into individual n8n items with one file each:

If your service requires all files in a single request in separate fields I am afraid you’d have to create multiple routes in your workflow that handle the different possible options. You could use a Filter node here checking if {{ Object.keys($binary).length }} equals 2, if so connect an HTTP Request node processing attachment_0 and attachment_1. Another Filter node checking if {{ Object.keys($binary).length }} equals 3, if so connect to an HTTP Request node processing attachment_0, attachment_1, and attachment_2 and so on until you have covered the expected cases.

In theory you could alternatively use a bit of code (which allows calling the http request functionality in n8n) though I do unfortunately not have a snippet ready for this.

Thanks for your answer! I’m already use “split out” snippet in another process. This one requires several fields within single request. Different rows - it is possible but it can be barely called “automation” after that.

So you answer my question - “only solution is the Code node + axios or somethig”.

Best regards,

1 Like

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