Code Node
The code node is used to execute code within your workflows and provides full flexibility to connect to systems which aren't built-in integrations and to execute any custom functions.
Python Environment and Custom Packages
The code node provides a python environment and includes standard request-handling and commonly used libraries. It currently runs on Python 3.10.14. If a package is required which is not natively included in the python environment, you can install it using subprocess
:
Replace steamspypi
with the name of the package you want to install.
Referencing Code Node Outputs
There are 2 ways to reference output from your code node in downstream nodes:
Using Model Output in a Code Node
It's very common to take the output from a model node and pass it into a code node. This is often done to format the response, check for specific conditions or pass the response to custom integrations through APIs. The easiest way to do this is with the following:
Constraints
There is no total code execution time limitation at a workflow level; however, individual code nodes have a 30-second runtime timeout. To avoid any issues, separate code into distinct code nodes.
Last updated