Execute multiple Command Lines based on Text File Inputs — n8n Workflow

Medium complexity Trigger7 nodes💎 Other👁 3,065 viewsby jason

Overview

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 changed to work properly. You can also edit the Execute Command node to modify what happens for each of these lines of text.

Note: This workflow requires the Execute Command node which is only available on the on-premise version of n8n.

Nodes used

On clicking 'execute'Read Binary FileMove Binary DataFunctionExecute CommandIFNoOp

Workflow Preview

O
On clicking 'execute'
R
Read Binary File
M
Move Binary Data
F
Function
E
Execute Command
I
IF
N
NoOp
7 nodes7 edges

How it Works

  1. 1

    Trigger

    The workflow starts with a trigger trigger.

  2. 2

    Process

    Data flows through 7 nodes, connecting executecommand, function, if.

  3. 3

    Output

    The workflow completes its automation and delivers the result to the configured destination.

Node Details (7)

ON

On clicking 'execute'

manualTrigger

#1
RE

Read Binary File

readBinaryFile

#2
MO

Move Binary Data

moveBinaryData

#3
FU

Function

function

#4
EX

Execute Command

executeCommand

#5
IF

IF

if

#6
NO

NoOp

noOp

#7

How to Import This Workflow

  1. 1Click Download JSON button on the right to save the workflow file.
  2. 2Open your n8n instance. Go to Workflows → New → Import from file.
  3. 3Select the downloaded execute-multiple-command-lines-based-on-text-file-inputs file and click Import.
  4. 4Set up credentials for each service node (API keys, OAuth, etc.).
  5. 5Click Test Workflow to verify everything works, then activate it.

Or paste directly in n8n → Import from JSON:

{ "name": "Execute multiple Command Lines based on Text File Inputs", "nodes": [...], ...}

Integrations

executecommandfunctionifmanualtriggermovebinarydatareadbinaryfile

Get This Workflow

Download and import in one click

Download JSONView on n8n.io
Nodes7
Complexitymedium
Triggertrigger
Views3,065
CategoryOther

Created by

jason

jason

@tephlon

Tags

executecommandfunctionifmanualtriggermovebinarydatareadbinaryfile

New to n8n?

n8n is a free, open-source workflow automation tool. Self-host it or use the cloud version.

Get n8n Free →