Passing Task Result This example shows how to pass the result output parameter between tasks. HeraYAML 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18from hera.workflows import DAG, Task, Workflow, script @script() def out(): print(42) @script() def in_(a): print(a) with Workflow(generate_name="script-param-passing-", entrypoint="d") as w: with DAG(name="d"): t1: Task = out() t2 = in_(arguments={"a": t1.result}) t1 >> t2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46apiVersion: argoproj.io/v1alpha1 kind: Workflow metadata: generateName: script-param-passing- spec: entrypoint: d templates: - name: d dag: tasks: - name: out template: out - name: in- depends: out template: in- arguments: parameters: - name: a value: '{{tasks.out.outputs.result}}' - name: out script: image: python:3.10 source: |- import os import sys sys.path.append(os.getcwd()) print(42) command: - python - name: in- inputs: parameters: - name: a script: image: python:3.10 source: |- import os import sys sys.path.append(os.getcwd()) import json try: a = json.loads(r'''{{inputs.parameters.a}}''') except: a = r'''{{inputs.parameters.a}}''' print(a) command: - python Comments