Hi, I’m new to using n8n and have been stuck for the last 2 days trying to figure this out.
I want to upload a youtube video with the http request node instead of the specific youtube-node. But I’m having problems since I have to both include binary data in the body as well as specify a lot of setting with JSON also in the body.
So after doing a lot of research and chatting with AI’s, it looks like I have to use the form data option. However, I’m missing some tutorials/examples on how fill out the JSON and binary data.
If I ask AI’s they say I have to prepare the data in a previous code node with something like "const FormData = require(‘form-data’);…]
However, I can’t find examples of this either and I get errors from the code that can’t find form-data.
So my question is:
what is the general way of handling my issue with having both binary and json text I need to put in the body of a http request node?
how do I install the needed dependency (form-data in this case)?
thanks!
Information on your n8n setup
n8n version: 1.84.1
Database (default: SQLite): default
n8n EXECUTIONS_PROCESS setting (default: own, main): note sure what this means?
Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
The general way is to fork from your node that has the binary into the node where you assemble JSON, and also directly to a merge with “combine” by “position”. Then add a link from the JSON node to the other input of the merge.
Maybe I was answering the wrong question. Getting both JSON data and and binary data into the same place in the workflow is usually the issue. So, I’m hoping this adds some context to your original question.
To set up the actual HTTP Request node for a YT video upload, I assume you are following this API documentation.
I don’t have an API client set up with Youtube APIs active, so I’ll have to do that and experiment more later, but already I have found it challenging to figure out what value to supply for the multipart “part” that isn’t the video content binary data.
Have you already tried setting up the HTTP Request node to use both a binary, and “Form Data”, like this?