[HELP] Read/Write Files from Disk → “The file … is not writable.” in queue mode (Docker)
Context
-
Deployment: n8n self-hosted with Docker + docker-compose, EXECUTIONS_MODE=queue (UI + worker).
-
Images:
n8nandworkerare on the same tag (e.g.1.106.3). -
Volumes (identical on both
n8nandworker; sanitized placeholders):- /path/to/n8n_data:/home/node/.n8n - /path/to/ENCRYPTION_KEY:/home/node/.n8n/ENCRYPTION_KEY:ro - /path/to/n8n_files:/files -
Env vars (identical on both):
- EXECUTIONS_MODE=queue - N8N_RESTRICT_FILE_ACCESS_TO=/home/node/.n8n:/files # (Other env like DB/Redis creds exist but are not shown here)
Problem
The Read/Write Files from Disk node (operation: Write File to Disk) often returns:
The file "/files/file_YYYYMMDDHHmmss.json" is not writable.
This happens mostly when clicking Execute step in the editor.
What does work
-
Run workflow (
): when I run the whole workflow, the worker executes it and the file is written successfully into /path/to/n8n_files. -
Workaround that always works: using Execute Command to decode and write the binary:
/bin/sh -lc "printf %s '{{ $binary.data.data }}' | base64 -d > '/files/{{ $binary.data.fileName || ('file_' + $now.format('YYYYMMDD_HHmmss') + '.json') }}'"→ File appears in
/path/to/n8n_files.
What I’ve already verified
-
Unix permissions on host:
chown -R 1000:1000 /path/to/n8n_data /path/to/n8n_files chmod -R 2775 /path/to/n8n_data /path/to/n8n_files -
Write tests from inside containers:
-
From
n8ncontainer:echo ok > /files/probe_from_n8n echo ok > /home/node/.n8n/probe_from_n8n -
From
workercontainer:echo ok > /files/probe_from_worker
All succeed (so mounts + permissions are fine).
-
-
Env present in both containers:
printenv N8N_RESTRICT_FILE_ACCESS_TO => /home/node/.n8n:/files -
Same image tag on
n8nandworker(checked viadocker compose images).
Minimal repro workflow
- Code — ensure there’s a
databinary (strict n8n logic:$input.all()+return items;)
const items = $input.all();
for (const item of items) {
if (!item.binary?.data) {
const content = JSON.stringify(item.json ?? { ok: true }, null, 2);
const base64 = Buffer.from(content).toString('base64');
item.binary = item.binary || {};
item.binary.data = { data: base64 };
}
const ts = new Date().toISOString().replace(/[-:.TZ]/g,'').slice(0,14);
item.binary.data.fileName = item.binary.data.fileName || `file_${ts}.json`;
item.binary.data.fileExtension = 'json';
item.binary.data.mimeType = 'application/json';
}
return items;
- Read/Write Files from Disk — Write File to Disk
-
Input Binary Field:
data -
File Path and Name (FX):
/files/{{$binary.data.fileName}} -
/filesexists via the volume above.
Result
-
Execute step →
“not writable”. -
Run workflow (
) →
file is created in /path/to/n8n_files.
Questions for the community
-
Is this a known issue with Read/Write Files from Disk when using queue mode, especially via Execute step?
-
Any node options/flags (e.g., “Append to file”, “Create directories”, etc.) that reliably bypass this?
-
Recommended best practice to write files in queue mode (alternative nodes/patterns)?
-
If it’s a bug, is there a fixed tag or an existing GitHub issue I can follow?