code nodes run a small inline transform against the run context. Used when the logic is too compact to merit a vendor call but too compositional for rules.
Configuration
| Field | Notes |
|---|---|
language | python in production. Sandbox-restricted. |
code | The transform. Run context is bound in scope (no input prefix needed in code; just data, the variable names, etc). |
outputVariable | Where the return value lands. |
timeout | Milliseconds. Defaults small (2s) because code is local. |
Sandboxing
The Python sandbox restricts:- No filesystem access.
- No network calls (use
customApifor that). - No imports beyond a whitelist:
math,statistics,json,re,datetime,decimal. - CPU and memory limits enforced.
When to use code
Aggregation across array variables (
sum, len, any, all, max_by).Reshape arrays into a different schema before passing to AI synthesis.
Compute a derived field that’s too small for a vendor call (e.g. distance
between two coordinates).