Grammar element · workflow.steps.when
step.when gates one workflow node
Three safe boolean guards. A true guard runs the node; a false guard skips it and its dependants.
workflow.yaml4 steps
What the runner decides
Whether one ready node may execute after its dependencies have completed.
What workflow.steps.when is
step.when is a safe boolean guard evaluated after dependencies are complete and before one workflow node runs.
It is not Python eval. Hydra parses an allow-listed AST of comparisons, boolean operators, literals, lists, tuples, and parameter/environment placeholders.
What it contains
- Comparisons — Equality and ordered comparisons, with numeric coercion when appropriate.
- Boolean logic —
and,or, andnot. - Safe values — Literals plus
{{ param:NAME }}and{{ env:NAME }}placeholders.
Ready does not always mean run
Dependencies decide when a node is ready. when makes the final admission decision for that node without changing the topology of the graph.
Run the complete example
Copy this manifest from the verified documentation project, then run it from the repository root.
workflow:
version: "1.0"
name: docs_workflow
description: Two actions used by the DSL documentation.
trigger: {type: manual}
steps:
- name: prepare
type: action
action: log
params: {message: "Preparation complete."}
retry: {max: 2, delay: 0, backoff: fixed}
- name: publish
type: action
action: log
params: {message: "Publication complete."}
depends_on: [prepare]
when: "1 == 1"
on_failure: fail
hdrctl workflow run examples/tutorial/dsl-elements/workflow.yaml
✓ Step 'prepare' OK (0.0s) ✓ Step 'publish' OK (0.0s) ✅ Workflow 'docs_workflow' completed in 0.0s — 2/2 steps OK
The relevant command syntax, copied from hdrctl workflow run --help:
hdrctl workflow run PATH PATH path to workflow.yaml --lang LANG interface language -h, --help show command help