Code node
A Code node lets you write custom JavaScript or Python code to perform complex data transformations, calculations, or logic that goes beyond what other nodes offer. Your code runs in a secure sandboxed environment, and the output becomes available to subsequent nodes in your flow.
Configure the Code node
Selecting a Code node opens a side panel with two tabs: Parameters and Test.
Add custom code
Select Edit code to open the code editor. Use the Language dropdown in the top-right corner to switch between JavaScript and Python.

Accessing data from previous nodes
Your code can access data from all preceding nodes in the flow. The runtime automatically loads results from ancestor nodes into a variable:
- JavaScript: Use
$nodes— an object keyed by node name, where each entry contains the node's results. - Python: Use
nodes— a dictionary keyed by node name, where each entry contains the node's results.
For example, to read a value from a preceding node named "Manually start":
- JavaScript
- Python
const startTime = Number($nodes["Manually start"][0].results[0].startTime)
start_time = int(nodes["Manually start"][0]["results"][0]["startTime"])

Returning data
Your code must return a value that can be serialized to JSON. The returned data becomes the output of the Code node and can be referenced by subsequent nodes.
- JavaScript
- Python
return { thirtyDaysAgo }
return {"thirty_days_ago": thirty_days_ago}
Referencing the output
Define how other nodes in your flow can reference the Code node's output:
-
Basic referencing: The output is referenced as a single field. Use this for simple return values.
-
Advanced referencing: Define a JSON schema so that specific fields in your output can be individually referenced by downstream nodes.
Included libraries
The Code node sandbox comes with pre-installed libraries for common tasks. You do not need to install them — they are available by default.
JavaScript (Node.js 22)
| Library | Version | Description |
|---|---|---|
| axios | 1.13 | Promise-based HTTP client |
| zod | 4.3 | Schema validation |
| lodash | 4.17 | Utility functions |
| jmespath | 0.14 | JSON query language |
| dayjs | 1.11 | Date manipulation |
Python (3.12)
| Library | Version | Description |
|---|---|---|
| requests | 2.32 | HTTP library |
| pydantic | 2.12 | Data validation |
| PyYAML | 6.0.1 | YAML parser |
| toolz | 1.1 | Functional utilities |
| pandas | 2.3.3 | Data analysis |
Execution limits
Code runs in a sandboxed environment with the following limits:
-
Maximum execution time: 60 seconds.
-
Network access: Disabled by default. Contact support if your use case requires making HTTP requests from the Code node.
Test the Code node
Use the Test tab to execute your code and validate the output before publishing your flow.