liveBook · Manning

Conditional syntax

As explained in Distributed Machine Learning Patterns

Conditional syntax is a workflow-language feature that controls whether a step executes based on a condition.

Conditional syntax controls whether a workflow step executes by evaluating a condition in Argo Workflows’ when clause. A preceding step produces a result, and dependent steps branch from that value. section 8.4.1

Coin-flip branching

A flip-coin script prints either heads or tails. The heads step runs only when its condition matches the output; otherwise, the tails step runs. The completed workflow contains the flip-coin Pod and the selected branch Pod. section 8.4.1

How Distributed Machine Learning Patterns covers it

How deep it goes
Defines the when clause through one branching example, staying within Argo Workflows’ basic syntax.
Examples
Uses a Python coin-flip script with heads and tails templates as mutually exclusive conditional steps.
What it assumes
Assumes familiarity with basic Argo workflow steps and script outputs.
What you can do after
Operate/configure Argo Workflows by adding when clauses that select steps from preceding outputs.
How it connects
Connects workflow steps, script templates, output results, DAG dependencies, and Kubernetes Pods.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Distributed Machine Learning Patterns. The section links point to the parts of the book it draws on.