Hello everybody and thanks for your work!
Apologies if this topic exists, I did my best to search but couldn’t find it.
I have some code in a Gitea repository which I would like to execute as part of my n8n workflow (self-hosted in a docker container). Right now I am using a git pull node and an execute_command node to run the script on the machine. The scripts mainly reference a software API and manipulate files.
Is this the ideal way to do it? I also use code nodes for other things, but some things I really need to write and debug in my IDE…
Thank you!
1 Like
The git pull + Execute Command pattern you’re using is actually a solid approach for self-hosted Docker setups - it keeps your scripts version-controlled and separate from n8n’s core. One thing worth thinking about: if your scripts need to run in a specific environment (different Python version, packages installed, etc.), you might want to consider calling the script via a small HTTP wrapper or a separate container rather than running it directly inside the n8n container. That way you’re not polluting n8n’s runtime environment and your scripts stay independently testable from your IDE without touching n8n at all.
1 Like
Yeah that setup can work, but I’d be careful about doing git pull as part of every workflow run. I’d probably update the repo separately, then have n8n run a fixed script path with Execute Command, like /scripts/my-task.py .
If the script needs special packages, put those in the Docker image/container instead of installing them during the workflow run. That keeps n8n as the orchestrator instead of making the workflow manage its own code updates.