Skip to content

How to condition the execution of a component?

You can control whether a component is executed or not using a dsl.Condition.

In the following example, flip_coin and my_comp are both component objects.

@dsl.pipeline
def my_pipeline():
    coin_flip_task = flip_coin()
    with dsl.Condition(coin_flip_task.output == 'heads'):
        conditional_task = my_comp()

Reference