Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
selector | Callable[[StepInput], ...] | Callable[[StepInput, list], ...] | Required | Function to select steps dynamically. Can optionally accept step_choices as second parameter |
choices | WorkflowSteps | Required | Available steps for selection. Supports nested lists (becomes Steps container) |
name | Optional[str] | None | Name of the router step |
description | Optional[str] | None | Description of the router step |
Selector Return Types
The selector function can return any of the following:| Return Type | Description |
|---|---|
str | Step name as string - Router resolves it from choices |
Step | Step object directly |
List[Step] | List of steps for chaining execution |
Selector Function Signatures
Basic Signature
Extended Signature (with step_choices)
step_choices parameter provides access to the prepared Step objects from Router.choices, enabling dynamic selection based on available options.