Execute multiple command lines based on text file inputs
Needs changesWhat this workflow does
This workflow has 7 nodes and runs manually, when you click “Execute workflow”. It uses only n8n's built-in nodes.
How it runs
Trigger: Manually, when you click “Execute workflow”.
- Read Binary File: uses Read Binary File
- Move Binary Data (Convert to/from binary data): uses Convert to/from binary data
- Function: runs custom JavaScript (legacy Function node)
- Execute Command: runs a shell command on the n8n host
- If: checks a condition and branches into true / false
Before you upgrade to n8n 3.0
3 things in this workflow are removed in n8n 3.0. Fix them before you upgrade:
- Read Binary File: replace with Read/Write Files from Disk.
- Convert to/from binary data in Move Binary Data: replace with Convert to File or Extract from File.
- Function (legacy) in Function: replace with Code node, mode 'Run Once for All Items'.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
| Removed in 3.0 | Replace with |
|---|---|
| Read Binary File Read Binary File | Read/Write Files from Disk |
| Convert to/from binary data Move Binary Data | Convert to File or Extract from File |
| Function (legacy) Function | Code node, mode 'Run Once for All Items' |
Nodes used (7)
- Manual Trigger
n8n-nodes-base.manualTrigger - Read Binary File
n8n-nodes-base.readBinaryFile - Convert to/from binary data
n8n-nodes-base.moveBinaryData - Function
n8n-nodes-base.function - Execute Command
n8n-nodes-base.executeCommand - If
n8n-nodes-base.if - No Operation, do nothing
n8n-nodes-base.noOp
From the author
This workflow takes a text file as input. It pulls the information from the text file and used it as a parameter to execute a command for each text line. This workflow references a file /home/n8n/filelist.txt in the Read Binary File node which will need to be…