Validation
Contact email is available:JSON
Build and store a payload:Lists and Randomization
Build a numbered list in a random order withrange, enumerate, append, and random_shuffle:
Debugging With print
Write resolved values to the call’s system notes while the step runs:
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’sconditions 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
Counter example
This starts at1 and increments each time the step runs:
- First run →
(True, False)→ routes toconditions[0] - Second run →
(False, True)→ routes toconditions[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:
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. Conditionorder controls the sort before routing — verify the stored order matches the intended array order.
Next Steps
- Code Step overview — The
run()contract and variables - Allowed Functions — The full deny-by-default allow-list
- Tool Steps — How tool steps and conditions work

