Hello, n8n community.
I’m building an n8n workflow in a Docker environment and have run into an issue I’d like to ask about.
Goal:
-
Download a
.zipfile (a stock master file) from an external URL using the HTTP Request node. -
In the following Code Node (Python), receive this
.zipfile, unzip it, and parse the.mstfile inside to extract a list of stocks.
Current Environment:
-
n8n: Running directly via Docker at
http://localhost:5678(based on the officialn8nio/n8nAlpine image). -
Dockerfile: All necessary system dependencies are installed (e.g.,
py3-pip,python3-dev,build-base,wget,zip,llvm15-dev). TA-Lib has been compiled from source.requirements.txt(includingpykis,pandas,TA-Lib,pandas-ta) is successfully installed usingpip install --break-system-packages. The build completes successfully. -
docker-compose.yml: The following environment variables are set:
-
N8N_PYTHON_EXECUTABLE=/usr/bin/python3 -
N8N_ALLOW_CODE_NODE_EXTERNAL_ACCESS=true -
N8N_CODE_NODE_FILESYSTEM_ACCESS_MODE=readWriteAll
-
The Problem:
-
The HTTP Request node successfully downloads the
.zipfile (I can confirmMime Type: application/zipand a correct File Size in the output). -
However, I’m facing an issue in the Code Node:
-
When my Python code tries to directly access the
binary.dataproperty from the input (_items), Base64 decode it, and save it to/tmp/filename.zip, the process fails. This triggers my custom error:"ValueError: Could not extract any MST file. Check logs for binary saving errors."
Questions:
-
What is the correct/most reliable method within a Python Code Node (in this Docker setup) to save the binary data (
.zipfile) received from the HTTP Request node to a temporary file (e.g.,/tmp/filename.zip) so I can unzip and parse it? -
I searched with an LLM, and it recommended nodes like “Write Binary File” to specify a path, but such a node doesn’t seem to exist.
-
If I must process the binary data directly in the Code Node (e.g., from
items[0].binary.data), what is the exact property or method I should use to safely save it as a file? (Does this differ by n8n version?)
Any advice would be greatly appreciated. Thank you!
