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 0 → conditions[0]
  • Output index 1 → conditions[1]
  • Output index 2 → conditions[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

Choosing a row by number

Instead of booleans, run() can return a whole number: the condition row to route to, counting from 1. This is easier to maintain when a step has many rows, because adding a row doesn’t change the other returns.
  • return 1 → the first condition, return 3 → the third
  • return False (or 0) → the final "otherwise" condition
  • A number past the last row routes to the last row, and a note is written to the call’s system notes
  • A negative number is an error and routes to "otherwise"
Pick one style per return statement. A list or tuple that mixes booleans and numbers, such as return True, 2, is invalid.

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, an int row number, or list/tuple of bools

The return value isn’t a boolean, ordered booleans or a whole row number: for example a string, a decimal such as 1.0, or a tuple with a number in it. Wrap results in bool(...), or return a plain whole number to pick a row.

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, and a returned row number counts from 1 in the same order. Condition order controls the sort before routing — verify the stored order matches the intended array order.

Next Steps