I’m running into a challenge with my n8n workflow when dealing with large video files (around 1GB or more). My goal is to upload these videos to YouTube, but I’m hitting memory issues that I’d love some help with.
The Problem
In my current setup, I use the “Read File from Disk” node to load video files that are generated by FFmpeg and saved to a local folder on my VPS-hosted n8n instance. However, this node loads the entire file into memory, which causes crashes or performance issues for files over 1GB due to Node.js memory limitations. I need a way to handle these large files without loading them fully into memory—ideally by streaming them directly from disk during the upload process. Or is there a way to remove these file size limits.
Is there a way I can use file paths instead of loading file contents into memory? This could allow me to stream the file directly from disk. This seems like a promising solution, but I’m unsure how to implement it in n8n, especially with the upload nodes for YouTube.
My Questions
How can I adjust my workflow to avoid loading large video files into memory?
Can I use file paths directly in the YouTube node, HTTP Request node, or other upload nodes to stream files from disk? If so, how?
Could someone share an example of how to configure these nodes to handle large files efficiently?
So if you running the webserver already, you can expose your files and call ure URL for the file itself so no need to load into n8n to just upload, you can just provide the URL.
My first question is, what spec server are you using? This will help understand what restraints are in place, too.
You could also s3 bucker or another storage place, via mount if running locally.
I’d love to try this out, so feel free to share your workflow, I can let you know my results too, I’m running locally on a decent stack.
Thanks for your quick and helpful response! I really appreciate your suggestions.
Server Specs
To answer your question about my server specs: I’m running n8n on a Hostinger VPS with 4 vCPUs, 8GB RAM, and 200GB SSD storage.
Exposing Files via URL
I love the idea of exposing the video files via a URL instead of loading them into n8n’s memory with the “Read File from Disk” node. My n8n instance is already behind an Nginx reverse proxy, so I will try this.
S3 Bucket Option
The S3 bucket suggestion is intriguing too. I could store the videos in cloud storage and generate a pre-signed URL to pass to the upload nodes, offloading the serving to a scalable provider. I’d prefer to keep things local to avoid extra costs if I can, but I’m open to this if it’s the most reliable solution. I already use some buckets on Google Cloud Storage. I will try this too.
Yes exactly, let me know how it goes also I see some people using FTP node in n8n, but I don’t think too relevant here maybe more for backend processing.
I can’t seem to figure out how to correctly implement the URL apporach. Would you be able to help me with this? I did some research and I think YouTube does not even provide an API to upload videos from a URL. Correct me if I am wrong but this would mean that both suggested apporaches would fail in this case.
Yes your right YouTube’s API doesn’t support direct uploads from a URL, which unfortunately rules out the simpler streaming approach if using the youtube node, I got this mixed up with the below using external platforms such as mixpost etc.
For handling large files (1GB+), trying to load the entire file into memory within n8n will consistently cause issues espeically with only 8gb ram avaible, I’am running 32gb, I don’t see to many issues with bin data inside, but I’ve not pushed to to 1gb+ yet.
In similar scenarios, I typically recommend offloading video uploads to platforms like Blotato or Mixpost. These are purpose-built for scheduling and publishing content efficiently, and they remove the heavy lifting from your workflow so n8n can focus on orchestration rather than direct file handling. This is where the URL comes in, applogies.
That said, if you do prefer to stay within n8n and keep things local, setting:
N8N_DEFAULT_BINARY_DATA_MODE=filesystem -updated
in your environment will ensure large binary files are stored on disk rather than in memory, which dramatically improves stability.
Best regards,
Samuel
This template is using the youtube node with bin data thought to share also
Thank you very much for the quick answer. I have upgraded my VPS to 16GB RAM so hopefully this will also help. I will try setting the env variable now. I will let you know if it worked
Just going to try on my side, downloading file atm
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
2 1721M 2 45.6M 0 0 2544k 0 0:11:32 0:00:18 0:11:14 2889k
I have changed the way of saving so it is like yours into .n8n/ but the problem persists
Yes my VPS is linux and I am using Docker.
What else could I try to make this work? I am running out of ideas and hope. I don’t get it what is different in my case that it doesn’t work like it does in your case. What else could be the difference in our setup?