Skip to main content
The step decorator will log steps based on the decorated function. By default, the arguments of the function will be used as the input of the step and the return value will be used as the output. Under the hood, the step decorator is using the cl.Step class.

Parameters

str
The name of the step. Default to the name of the decorated function.
str
default:"undefined"
The type of the step, useful for monitoring and debugging.
str
Union[bool, str]
default:false
By default only the output of the step is shown. Set this to True to also show the input. You can also set this to a language like json or python to syntax highlight the input.
bool
default:false
Whether the step should render expanded by default in the UI.
Since version 2.3.0. Requires a defaultOpen column in the steps table for SQL-based data layers. See the migration guide.
Dict
Custom metadata dictionary to attach to the step. Persisted with the step in the data layer.
List[str]
Tags to attach to the step for filtering and categorization.
str
Unique identifier for the step. Auto-generated as a UUID if not provided.
str
Name of a Lucide icon to display instead of the default step avatar. See https://lucide.dev/icons for available icons.
Since version 2.11.0.
str
ID of the parent step. Automatically resolved from the decorator nesting hierarchy if not provided.

Access the Current step

You can access the current step object using cl.context.current_step and override values.

Stream the Output

Nest Steps

If another step decorated function is called inside the decorated function, the child step will be nested under the parent step.