Skip to main content
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

Sandboxing

The Python sandbox restricts:
  • No filesystem access.
  • No network calls (use customApi for 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).

When NOT to use code

If the transform is a single comparison or boolean — use rule or condition instead. Code nodes are harder to reason about in a regulator walk-through.
If the transform calls an external service — use customApi. Code nodes can’t reach the network.