apiVersion: argoproj.io/v1alpha1 kind: Workflow metadata: generateName: dag-conditional-parameter- labels: workflows.argoproj.io/test: "true" annotations: workflows.argoproj.io/description: | Conditional parameters provide a way to choose the output parameters based on expression. In this example DAG template has two task which will run conditionally based on `when`. Based on this condition one of task may not execute. The template's output parameter will be set to the executed taks's output result. workflows.argoproj.io/version: '>= 3.1.0' spec: entrypoint: main templates: - name: main dag: tasks: - name: flip-coin template: flip-coin - name: heads depends: flip-coin template: heads when: "{{tasks.flip-coin.outputs.result}} == heads" - name: tails depends: flip-coin template: tails when: "{{tasks.flip-coin.outputs.result}} == tails" outputs: parameters: - name: stepresult valueFrom: expression: "tasks['flip-coin'].outputs.result == 'heads' ? tasks.heads.outputs.result : tasks.tails.outputs.result" - name: flip-coin script: image: python:alpine3.6 command: [python] source: | import random print("heads" if random.randint(0,1) == 0 else "tails") - name: heads script: image: python:alpine3.6 command: [python] source: | print("heads") - name: tails script: image: python:alpine3.6 command: [python] source: | print("tails")