Integrating External Code Execution with n8n

Is it possible to run external custom code and fetch the results within n8n workflows? Specifically:

  1. How can external code, like JavaScript or Python functions/scripts, be executed within n8n?
  2. Is there a method to call these external functions from n8n nodes?
  3. What’s the process for passing data between n8n workflows and external code?
  4. 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

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:

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?

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.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.