Skip to content

executionConditions

Specifies custom conditions for a task or a subflow to be executed or omitted. The conditions are provided as a list of flags. If no conditions are specified, a task or a subflow will execute normally.

Schema

YAML
conditions:
  run_on_flags: List[str] | None
  skip_on_flags: List[str] | None

Properties

| Property | Type | Description | | :-------------- | :--------- | :---------- | ----------------------------------------------------- | | run_on_flags | List[str] | None | List of flags that will trigger a task to be run. | | skip_on_flags | List[str] | None | List of flags that will trigger a task to be skipped. |

Remarks

Both the run_on_flags and skip_on_flags properties specify a logical disjunction. Hence if any of the flags present in the run_on_flags list is specified for the flow, the task will be executed. Similarly, if any of the flags present in the skip_on_flags list is specified for the flow, the task will be omitted.

If both run_on_flags and skip_on_flags contain the same entry, the execution condition is considered malformed. An attempt to run a flow containing such a condition will fail. Similarly, if a flow is run with flags present in both run_on_flags and skip_on_flags, its execution will fail.

Examples

Specifying only run_on_flags

Suppose you have a task that has to be run conditionally if either initial-calibration or weekly-calibration flags are set. The corresponding execution conditions object achieves this goal:

conditions:
  run_on_flags:
    - initial-calibration
    - weekly-calibration

Specifying only skip_on_flags

Suppose you have a long-running task that you want to omit if only a quick calibration run is performed. If you use a flag quick-calibration to denote quick calibration runs, you can use the following execution conditions:

conditions:
  skip_on_flags:
    - quick-calibration

Using both run_on_flags and skip_on_flags

You can combine both run_on_flags and skip_on_flags in a single executionConditions object. For instance, consider the following execution conditions:

conditions:
  run_on_flags:
    - daily-run
    - weekly-run
  skip_on_flags:
    - quick-calibration
    - monday

This specification will cause a task or subflow to run if either daily-run or weekly-run flags are specified, and omitted if quick-calibration or monday flags are present.