
- Producer: a script template that writes a message to stdout.
- Consumer: a container template that accepts an input parameter and prints it.
- Data flow: the producer’s output is captured as a template output and passed into the consumer via arguments.
- For script templates, Argo automatically captures the last line written to stdout as the default output parameter available at steps.<step-name>.outputs.result.
- You can pass that value into later steps using the expression
{{steps.\<step-name>.outputs.result}}.
For script templates, Argo captures the last line printed to stdout as the
default output parameter available at steps.<step-name>.outputs.result.
Use that expression to pass values directly from a producing step into a
consuming step.
- The following YAML demonstrates a main template that runs a
generatestep (producer) and then aconsumestep (consumer). The consumer receives the producer’s result through an argument parameter namedoutputMessage.
- The
producerscript prints:- hello from the producer step
- Argo captures the last printed line as
steps.generate.outputs.result. - The
maintemplate assigns that value to theconsumestep’soutputMessageparameter via:- value: "{{steps.generate.outputs.result}}" - The
consumercontainer reads the parameter asinputs.parameters.outputMessageand prints:- Received: ‘hello from the producer step’
References and further reading
Outputs are a fundamental mechanism for chaining templates and building dynamic, data-driven pipelines. By capturing the producer’s stdout and referencing it with steps.<name>.outputs.result, you can easily pass information between steps and build more complex workflows.