Is it possible to run external custom code and fetch the results within n8n workflows? Specifically:
How can external code, like JavaScript or Python functions/scripts, be executed within n8n?
Is there a method to call these external functions from n8n nodes?
What’s the process for passing data between n8n workflows and external code?
Are there any limitations or considerations for integrating external code in n8n?
Seeking examples, tutorials, and best practices for this integration. Thanks!
n8n version: 1.27.3
Database (default: SQLite): No db was installed with it
n8n EXECUTIONS_PROCESS setting (default: own, main): clicking to execute
Running n8n via (Docker, npm, n8n cloud, desktop app): docker
Operating system: Windows 10 Version 22H2
n8n
February 26, 2024, 4:30am
2
It looks like your topic is missing some important information. Could you provide the following if applicable.
n8n version:
Database (default: SQLite):
n8n EXECUTIONS_PROCESS setting (default: own, main):
Running n8n via (Docker, npm, n8n cloud, desktop app):
Operating system:
Jon
March 1, 2024, 3:45pm
3
Hey @ege_selcuk ,
If you are not using the code node and want to run code from somewhere else or a local project folder you would need to use the execute command node assuming the Docker image you are using has everything you need installed on it. When running a command we will return stderr /stdout so you would need to parse that response for using any returned data.
It may be worth seeing if the code does what you need before going down the execute command node route though.
Can you input values into the external code, lets say if I wanted to pass JSON object as a parameter?
Jon
March 4, 2024, 4:47pm
5
Hey @ege_selcuk ,
It is just like running a non interactive command line process so you can pretty much do anything including passing args / params if needed.
system
Closed
March 11, 2024, 4:47pm
6
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.