Skip to main content
CEL (Common Expression Language) lets you write evaluators, end conditions, and selectors as strings instead of Python functions. CEL expressions are fully serializable, making them editable in Studio and storable in the database.

Overview

Three step types accept CEL expressions: Each step type exposes different context variables to the expression:

Conditions

Condition evaluators receive step input context and must return a boolean. True runs steps, False runs else_steps.

Route on input content

Branch on previous step output

Run a classifier first, then route based on its output:

Branch on additional data

Branch on session state

Loops

Loop end conditions receive loop output context and must return a boolean. True exits the loop.

Exit after N iterations

Exit on output keyword

Compound exit condition

Routers

Router selectors receive step input context and must return a string matching a step name from choices.

Route on session state

Ternary routing on input

Route using step_choices index

Reference steps by position instead of hardcoding names:

Developer Resources