Skip to content

Switch

flowtask.components.Switch

Switch

Switch(loop=None, job=None, stat=None, **kwargs)

Bases: BaseLoop

Switch Component

Routes execution to a specific component based on user-defined conditions.

Defines a list of conditions and their corresponding components.

Each condition is a Python-style logical expression evaluated against self.data.

default: Specifies the fallback component if none of the conditions match.

run async

run()

Executes the appropriate component based on the conditions.

start async

start(**kwargs)

start.

Initialize (if needed) a task