Skip to content

Code

Step · Stable

Run a small sandboxed Python transform over declared inputs to declared outputs.

Execute a short Python snippet inside the workflow sandbox. Declare the context keys the snippet reads via input_ports and the keys it writes back via output_ports. The sandbox provides no network, filesystem, or database access — it is a pure-compute environment for deterministic transforms. Output values are available to every downstream step under the declared output_port names. A Code step is PROBATION, NOT RESIDENCE: it is the right way to spike logic you are still working out, and the wrong place for logic to live once it works. Code inside a flow is customer data, not code — it is invisible to the skill registry, absent from the docs, unreachable by the drafter, un-versioned, and fixed by hand-editing every flow that copied it. Anything that survives into a customer Job graduates to a registered skill or to declarative rules on a recipe.

Deterministic transforms that templates cannot express cleanly — e.g. regex extraction, arithmetic bucketing, string slicing, list filtering, or structured data reshaping where an LLM is overkill and a Map step is too coarse-grained. Also the right tool for spiking logic whose shape is still unknown — then promote it once it settles.

Anything that needs network access, file I/O, a database, or shared state — use a dedicated node for that. If the transform is a single Jinja expression a Map step is simpler. If the logic is non-deterministic or requires an LLM, use an AI step instead. Do NOT use a Code step for logic that will ship in a customer Job, or for anything a second flow would want to copy: verifying that extracted numbers add up belongs in the extraction recipe’s checks block, and reusable behaviour belongs in a registered skill. If you find yourself pasting the same snippet into a second flow, that snippet is overdue for promotion.

Configured per use: code, input_ports, output_ports.


Auto-generated from the skill registry (load_skills()). Do not edit by hand.