Downloading and Archiving Many Files Into A Single Archive

Hi @jhambach, depending on the file size this use case might not be suitable for being handled inside a workflow completely as you could easily hit memory limits. So my advise would be to also consider alternatives such as using the SSH or Execute Command nodes to download and zip a large number of files outside of n8n while still controlling the overall logic using n8n.

You can alleviate this to some extent by setting N8N_DEFAULT_BINARY_DATA_MODE=filesystem environment variable.

However, putting all memory considerations aside and looking purely at the logic, I don’t think you need a loop here. Downloading multiple files (if they exist) and then packing them into a single ZIP archive can be done like so:

This example workflows tries to download files from 3 different URLs of which only 2 work and then compresses them into a single ZIP file.

10 Likes