Resources · n8n integration

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

Why automate

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.

Parameters

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.

01

Execute Once

executeOnce

What 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.
Use cases
a query returns forty rows and you want one archive command at the end, not forty. Turn it on. Leave it off when each row carries the filename the command has to act on.
02

Command

command

What 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.
Use cases
run two things in a row by joining them with &&, 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

Need help automating Execute Command with n8n?

A person reads every message.

FAQ

Execute Command in n8n, the questions that come up next

01Is the n8n Execute Command node free, on Cloud and self-hosted?
It is a core node, shipped with n8n, so there is no install step and no extra cost on the n8n side. The catch is where it runs: this node is not available on n8n Cloud. You need a self-hosted instance, on Docker or npm, running the Community Edition under the Sustainable Use licence. One more thing to plan for: from n8n 2.0 the node is disabled by default, because letting a workflow open a shell is a genuine risk on any instance shared with untrusted users. An administrator has to allow it again on the instance before the node will run.
02What do you need to set up before the node works?
Nothing on the account side. There is no credential to create, no Authentication selector, no token to paste, which makes this one of the few nodes you can drop into a canvas and run straight away. What matters instead is the host. The command has to exist in the PATH of the user running n8n, and if you run n8n with Docker it has to exist inside the n8n container rather than on the machine underneath. When a command is missing you get a shell error saying it was not found, and the fix is to test it inside the running container first.
03What are the limits of the Execute Command node?
It is a small node: version 1, two parameters, no options collection. It runs on the host it lives on and nowhere else, so a remote server is out of scope. Output has a ceiling, and a chatty command trips a stdout maxBuffer error, which you avoid by limiting or filtering what the command prints. On Windows a multi-line PowerShell command loses everything after the first break, so join statements with semicolons or run a script file instead. And the shell you get is the host default, not one you pick in the panel.
04Execute Command, HTTP Request or Ssh, which one should you pick?
Ask two questions: which machine, and which protocol. If the work has to happen somewhere other than the n8n host, take Ssh, since Execute Command cannot reach past its own machine. If the work is an HTTP call, take HTTP Request, even when your first instinct is a curl one-liner: curl is not in the official n8n image, and getting it there means building a custom image on top of it. Execute Command earns its place when the tool is a binary or a script already sitting on the n8n host, with no API in front of it.
05n8n or Make for running scripts like this?
Make is hosted only and billed per operation, and that settles it here: with no self-hosting option, there is no host machine of yours for a shell command to run on. Running commands means running your own instance, which is what n8n allows. The real question is broader than one node. Weigh where the data sits, how much of the platform you want to operate yourself, and whether per-operation billing or your own server bill suits your volume better. Make stays a solid visual builder for teams that would rather not run infrastructure.
Hack'celeration Lab

Get our weekly integration tips.

No spam. Unsubscribe anytime.