- Home
- Resources
- Integrations
- Execute Command
n8n Execute Command nodeConfigure Execute Command in n8n.
Sometimes the tool you need is already on the server, not behind an API. The n8n Execute Command node runs a shell command on the machine hosting n8n and returns its output as workflow data. Two parameters, nothing to authenticate, and a self-hosted instance.
Verified Trustpilot reviews · AI, automation & growth agency
What does the n8n Execute Command node actually do?
It takes a line of shell, runs it on the host machine that runs n8n, and passes what the command printed back into the workflow. The shell is whatever the host uses by default, cmd on Windows, zsh on macOS. It never starts a workflow on its own: a trigger comes first, a Schedule Trigger or a Webhook, an incoming HTTP call that n8n listens for at a URL.
Take a nightly backup. A Schedule Trigger fires, the node runs a dump command against the database, and the next node moves the file somewhere safe. Nothing in that chain needs an API, which is why the Postgres node would be the wrong tool: you want the binary that ships with the database, not a query.
Second case, a deploy hook. A workflow reacts to a push, then the node runs the checkout and build commands on the box. Chain them with && or put each one on its own line inside Command, and pair the workflow with the GitHub node so the branch name arrives as data rather than being hardcoded.
Third, batch file work. A folder of documents comes in as items, a converter runs once per item with an expression pulling the filename, and a single summary command runs at the end with Execute Once turned on. That switch between per item and once is the whole difference between the two parameters on this node.
Prefer something else when the job is not really a shell job. Anything that speaks HTTP belongs in HTTP Request, including the curl commands people reach for out of habit: curl is not even in the n8n Docker image, and putting it back means building your own image on top of the official one. Anything that has to run on a different machine belongs in Ssh, because this node only ever touches the host it lives on.
The limits are worth knowing before you build on it. The node is not available on n8n Cloud, so a self-hosted instance is the price of entry, and from n8n 2.0 it is disabled by default because a shell is a real risk on any instance with untrusted users. Under Docker the command runs inside the n8n container, not on the Docker host, so a tool installed on the server is invisible unless it is in the image. In queue mode the command runs on the worker that picked up the task in production mode, while manual runs stay on the main instance unless OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS is set to true. Our n8n review covers what self-hosting asks of you in practice.
Which parameters does the Execute Command node expose?
The Execute Command node has 2 parameters. For each one: the node as you configure it in n8n, what the parameter changes, and our field notes.
Parameters index
Execute Once
executeOnceWhat you see in n8n
Notes & use cases
This toggle decides how many times the command fires when several items reach the node. Turned on, it runs a single time no matter how many items arrived. Turned off, it runs once for every item, which is the default behavior of the node.
Key parameters
- Execute Once: a yes or no switch, whether to execute only once instead of once for each entry.
Command
commandWhat you see in n8n
Notes & use cases
The line handed to the shell. It is the only required field, and an empty value stops the node before anything runs. The placeholder shows the shape expected, echo "test".
Key parameters
- Command: text, required, the command to execute. Drop in a value from the previous node with an expression such as
{{ $json.field }}, the n8n syntax for reading a field off the incoming item.
&&, like cd bin && ls, or by writing each on a separate line. Two traps: on Windows a PowerShell command with line breaks gets cut after the first one, and a chatty command fails with a stdout maxBuffer error until you filter its output.Need help automating Execute Command with n8n?
A person reads every message.
Execute Command in n8n, the questions that come up next
01Is the n8n Execute Command node free, on Cloud and self-hosted?
02What do you need to set up before the node works?
03What are the limits of the Execute Command node?
04Execute Command, HTTP Request or Ssh, which one should you pick?
05n8n or Make for running scripts like this?
Get our weekly integration tips.
No spam. Unsubscribe anytime.

