Skip to main content
Earlier we covered the dependencies field inside a DAG task template. This lesson shows the enhanced depends expression, which adds conditional logic based on other tasks’ results so you can run tasks only when specific conditions are met. The depends expression uses the syntax:
  • taskName.Result — where Result is a status selector (e.g., Succeeded, Failed, Skipped, Error, Daemoned)
  • Or aggregate selectors like AnySucceeded and AllFailed
You can combine expressions with Boolean operators:
  • OR: ||
  • AND: &&
  • NOT: !
Basic examples:
  • Run task-2 only if task-1 succeeded:
  • A more complex expression:
Status selectors and their meanings: Example: a complete Argo Workflow demonstrating depends in a DAG with four tasks. Tasks A and B run in parallel; C runs if either A or B succeeds; D runs only if both A and B succeed.
How this workflow behaves:
  • The succeeds template echoes “I succeeded.” and exits with code 0, so tasks using it report Succeeded.
  • The fails template echoes “I failed.” and exits non-zero, so tasks using it report Failed.
  • The echo-message template prints the provided message parameter.
DAG behavior:
  • Tasks A and B have no dependencies and start in parallel.
  • Task C uses depends: "A.Succeeded || B.Succeeded" — it runs if either A or B succeeds.
  • Task D uses depends: "A.Succeeded && B.Succeeded" — it runs only if both A and B succeed.
If B fails and A succeeds:
  • C runs because at least one of A or B succeeded.
  • D is skipped because both did not succeed. The UI shows D as Skipped/Omitted with the message “depends condition not met.”
A screenshot of the Argo Workflows web UI showing a DAG with nodes A, B, C and D and status icons for each. The right-hand panel displays details for node D, marked Skipped/Omitted with the message "depends condition not met."
Additional valid depends expressions (patterns you can reuse):
Use quotes around the depends expression so YAML treats operators (||, &&, !) correctly. depends supports boolean operators and selectors like Succeeded, Failed, Skipped, Daemoned, AnySucceeded, AllFailed.
Do not use both dependencies and depends on the same task. To convert dependencies: [A, B, C] into depends, use: depends: "A && B && C".
Links and references:

Watch Video

Practice Lab