The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined

Hi everyone,

I’m trying to return a binary file from a Function node in n8n then send the selected file to an http endpoint.

But I got this error:

The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined

My workflow code looks like this:

Has anyone else run into this?

Thanks in advance!

Hello @vmarci21 welcome to the :n8n: community!
You can try something like this:

Give it a try and let me know how it goes..