Skip to main content

Validation

Contact email is available:
Contact phone is SMS capable:
Email regex check:
Strict ISO date check:

JSON

Build and store a payload:
Parse a webhook response and route on it:

Lists and Randomization

Build a numbered list in a random order with range, enumerate, append, and random_shuffle:
Sum a range:

Debugging With print

Write resolved values to the call’s system notes while the step runs:
Unquoted placeholders print the resolved value; quoted placeholders stay literal. Each print(...) becomes a system note before the final run success note.

Routing With Multiple Conditions

A Code Step can return more than one boolean. Returned booleans map to the step’s conditions array by index:
  • Output index 0conditions[0]
  • Output index 1conditions[1]
  • Output index 2conditions[2]
  • The final condition should be "otherwise" and acts as the fallback
If all returned booleans are false, the step routes to the final condition. If multiple are true, the first true output index wins.

Counter example

This starts at 1 and increments each time the step runs:
  • First run → (True, False) → routes to conditions[0]
  • Second run → (False, True) → routes to conditions[1]
  • Third run → (False, False) → routes to the final "otherwise" condition

Single-boolean tools

All tools use the same condition-array routing. For a single boolean output, True routes to the first condition and False routes to the final one. Return multiple booleans only when a step needs more than true/otherwise routing.

Troubleshooting

Code Step must contain exactly one top-level def run():

Missing def run():, extra top-level statements, or more than one function. Move setup inside run():

unindent does not match any outer indentation level

Inconsistent indentation, or leading spaces before def run():. def run(): must start at the first column.

name 'input_1' is not defined

The code references input_1, but that input isn’t mapped on the step. Map the additional input, or remove the reference.

Function 'x' is not allowed / Method 'x' is not allowed

The code called something off the allow-list. Use an allowed equivalent:
See Allowed Functions for the full list.

run() must return bool or list/tuple of bools

The return value isn’t a boolean or ordered booleans. Wrap results in bool(...).

Counter does not increment

Make sure the same variable placeholder is used for both the read and the write. If the read and write paths differ, the counter appears to reset.

Branch goes to the wrong step

Multi-output routing uses condition-array indexes, not matching values. Condition order controls the sort before routing — verify the stored order matches the intended array order.

Next Steps