Only First File Downloads, Others are Empty (0 bytes) – Execute Command Node with wget & Multiple Items

Hi team,

Describe the bug

When using the Execute Command node in n8n (with the command wget -O "/tmp/video_N.mp4" "<URL>") on multiple items (for downloading multiple videos), only the first video is actually downloaded with content. The other files are created but remain empty (0 bytes), even though all the commands are correct and work perfectly when run manually in the shell.

Steps to Reproduce

  1. Prepare a workflow that sends an array of URLs to the Execute Command node, using a command like:

nginx

CopierModifier

wget -O "/tmp/video_{{ $json.index }}.mp4" "{{ $json.video_url }}"
  1. Run the workflow.
  2. Observe that only /tmp/video_1.mp4 has content. The other files (/tmp/video_2.mp4, /tmp/video_3.mp4, etc.) are created but are empty (0 bytes).
  3. Running the exact same wget command for the other files manually via SSH downloads them correctly.

What I have tried

  • Confirmed the input items and command are correct in the node.
  • Each wget command (for each video URL) works 100% when executed directly via SSH in the same environment/container.
  • No error or non-zero exit code is reported by the node for the empty files.
  • Tried toggling “Execute Once” options and different settings in the node.

Expected behavior

Each input item should result in a correctly downloaded file, not an empty file.

Screenshots and logs

  • [Include screenshots of the workflow, node configs, and file stats if helpful. Describe the output and file sizes.]
  • Only the first file is valid. All others: size 0, but no errors.

Environment

  • n8n version: 1.101.2
  • Docker/VPS
  • OS: Alpine Linux edge (version 3.23.0_alpha20250612)

Additional context

  • The bug seems to only occur when running the command node in n8n.
  • Manual execution of the same commands works as expected for all files.
  • Workflow and test links/logs available upon request.

Thanks for your help and suggestions! Let me know if you need more details or workflow export.

Hello @Redowintowin, welcome to community.
Because n8n will call the data one by one, what you can do is using loop logic, or use loop node. (n8n have two methods for looping)

Dear @Redowintowin How’s everything going on with you !

You can use Loop node as show in the following workflow.

Still after this if you are not clear about how to use it, please feel free to share your workflow, will solve it out togther.

Happy to help.

(If the answer solves your problem, then please make sure to mark it as solution as this will help other in community too.)