Steps
Execute Command missing? Remove it from NODES_EXCLUDE
n8n 2.x turns off the Execute Command and Local File Trigger nodes by default. With default settings, our imported workflow failed before running with
Unrecognized node type: n8n-nodes-base.executeCommand, and the node doesn't show up in the editor. Start n8n withNODES_EXCLUDE='[]'(or a list that leaves outn8n-nodes-base.executeCommand) and restart it. In Docker, set it as an environment variable on the container.A failing command shows only its stderr
When the command exits with a non-zero code, the node fails and the message is just what the command printed to stderr, for example
ls: cannot access '/nope': No such file or directory, with no exit code. Text on stderr alone doesn't fail the node:echo warn 1>&2; echo outsucceeded with both fields filled. To keep going after a failure, add|| true, end with; echo "exit=$?", or set the node's On Error setting to continue.It runs once, not once per item
With 3 input items, Execute Command (version 1) ran a single time and output 1 item, with or without Execute Once. If you need one run per item, put it inside Loop Over Items, or build a single command that handles all the values.
Quote values from expressions, and avoid apostrophes
Expressions are pasted into the command as plain text and run by
/bin/sh, not bash. A filenamea b.txtbecame two arguments (wc -wsaid 2). A value with an apostrophe inside single quotes broke the command:/bin/sh: 1: Syntax error: Unterminated quoted string. Wrap values in double quotes, replace'first in a Set or Code node, or write the value to a file and read it from the command.Know where the command runs
The working directory was the folder n8n was started from, and
$HOMEwas the OS user's home, notN8N_USER_FOLDER. Environment variables come from the n8n process:$MYSECRETwas empty until n8n itself was started with it. Programs must exist where n8n runs (inside the container in Docker). The output is text:echo '{"a":1}'gave the string{"a":1}, so parse it withJSON.parsein a Code node.'Access to the file is not allowed.'? Check the allowed folder
Read/Write Files from Disk only works inside
N8N_RESTRICT_FILE_ACCESS_TO, which defaults to~/.n8n-files. The~means the OS user's home folder, notN8N_USER_FOLDER: a file inside our n8n user folder's.n8n-fileswas refused withAccess to the file is not allowed.until HOME pointed to the same folder. In the official Docker image that folder is/home/node/.n8n-files. To allow other folders, setN8N_RESTRICT_FILE_ACCESS_TOto absolute paths separated by;and restart; reads and writes outside it fail with the same message.0 items and no error? Use an absolute path, and create folders first
A file that doesn't exist, a relative path like
a.txtand a path starting with~/all succeeded with 0 items and no error, so the next node silently didn't run (see next node not running). Use full absolute paths; globs like/home/node/.n8n-files/*.txtwork and return one item per file. When writing, the input must carry a binary field (use Convert to File first), and the target folder must already exist: n8n won't create it and fails withThe file or directory does not exist.
What we ran
On 23 October 2026 we ran 61 executions of 24 small workflows with n8n execute on n8n 2.43.7 (Execute Command node version 1, Read/Write Files from Disk node version 1), as a normal Linux user, in four setups: default settings, NODES_EXCLUDE='[]', HOME set to N8N_USER_FOLDER, and a custom N8N_RESTRICT_FILE_ACCESS_TO list. Every message below is copied from those runs.
| Setup | Result |
|---|---|
| Execute Command node, default n8n 2.43.7 settings | Workflow fails before running: Unrecognized node type: n8n-nodes-base.executeCommand |
Same workflow after starting n8n with NODES_EXCLUDE='[]' | Runs |
echo hello | 1 item: exitCode 0, stderr empty, stdout hello |
ls /nope (exit code 2) | Node error, the message is just the stderr text: ls: cannot access '/nope': No such file or directory |
echo warn 1>&2; echo out (exit 0, something on stderr) | Success: stderr warn, stdout out |
| 3 input items, Execute Command v1 | Ran once and output 1 item (same with Execute Once on) |
echo {{ $json.f }} | wc -w with f = a b.txt | stdout 2: the value is pasted unquoted, so the space splits it |
echo '{{ $json.t }}' with t = it's | /bin/sh: 1: Syntax error: Unterminated quoted string |
pwd; echo $HOME | Working directory = the folder n8n was started from; HOME = the OS user's home, not N8N_USER_FOLDER |
echo $MYSECRET, n8n started without it / with MYSECRET=abc | Empty / abc: the command inherits n8n's own environment |
sleep 3; echo done | Waited 3 seconds, then done |
python3 -c 'print(1+1)' | 2 (the program must exist where n8n runs, or in its container) |
echo '{"a":1}' | stdout is the text {"a":1}, not a JSON object |
Read Files from Disk, file in N8N_USER_FOLDER/.n8n-files, HOME is a different folder | Access to the file is not allowed. |
Same file after starting n8n with HOME = N8N_USER_FOLDER | Read fine |
Read a file outside the allowed folder (/tmp/…/files/a.txt) | Access to the file is not allowed. |
| Write a file outside the allowed folder | Access to the file is not allowed. |
N8N_RESTRICT_FILE_ACCESS_TO set to two folders separated by ; | Reads and writes in both folders worked |
Glob /…/.n8n-files/*.txt | One item per file, each with binary property data |
| Path to a file that doesn't exist | Success, 0 items, no error |
Relative path a.txt | Success, 0 items, no error |
Path starting with ~/.n8n-files/ | Success, 0 items, no error (~ is not expanded in the path) |
| Write Files with no binary input | This operation expects the node's input data to contain a binary file 'data', but none was found [item 0] |
| Write into a subfolder that doesn't exist | The file or directory does not exist (ENOENT: no such file or directory, realpath) |
| Write with Append on | File appended (2 bytes became 4) |
Good to know
- Writing JSON items to disk? Turn them into a file first with Convert to File (all items go into one file, named
File.csvby default): see n8n Convert to File not working. - Only turn on Execute Command if you trust everyone who can edit workflows: it runs any shell command with n8n's permissions.
- More n8n fixes from real runs: Postgres, MongoDB, Redis, and the n8n error message index with every message we reproduced.
What we didn't test
- The Docker image itself (the
/home/nodepath comes from its default HOME), Windows, Execute Command on queue-mode workers, the Local File Trigger node, and theN8N_BLOCK_FILE_PATTERNSandN8N_BLOCK_FILE_ACCESS_TO_N8N_FILESsettings.
Start from a working agent
FAQ
Why is the Execute Command node missing in n8n?
n8n 2.x excludes it by default. Imported workflows fail with Unrecognized node type: n8n-nodes-base.executeCommand. Set NODES_EXCLUDE='[]' (or a list without it) and restart n8n.
Why does n8n say Access to the file is not allowed?
The path is outside N8N_RESTRICT_FILE_ACCESS_TO, which defaults to ~/.n8n-files in the OS user's home (/home/node/.n8n-files in Docker), not in N8N_USER_FOLDER. Move the file there or add its folder to that variable, separated by ;.
Why does Read Files from Disk return no items?
In our tests a missing file, a relative path and a path starting with ~ all returned 0 items with no error. Use an absolute path.
Why does Execute Command only run once for several items?
Version 1 of the node ran once for 3 input items. Use Loop Over Items to run it per item.
How do I get the exit code of a command in n8n?
A non-zero exit fails the node with only the stderr text. Append ; echo "exit=$?" to the command, or set On Error to continue.
Related guides
- n8n broke after updating to 2.x? Upgrade and migration errors, 20 tests
- n8n binary data not found? Fix 'none was found' and 'no binary field', 25 tests
- n8n Switch node not working: missing items, wrong output and type errors, 30 runs
- n8n Filter node not working: items removed, type errors and empty checks, 32 runs
- n8n Convert to File not working: empty CSV, lost fields and broken base64, 38 runs
New guides
- GitHub release notifications in Slack (any public repo, stable releases only)
- Send RSS feeds to Slack with a keyword filter (free, incoming webhook)
- Forward emails to a Slack channel (Gmail, Outlook, any IMAP), free with an incoming webhook
- n8n Google Sheets Trigger not working: not firing, activation errors and fixes