
- 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’
| Resource | Purpose | Example |
|---|---|---|
| Script template | Produce a short textual result captured as outputs.result | Producer example above |
| Container template | Consume parameters passed via arguments | Consumer example above |
| Steps reference | Chain results between steps | {{steps.generate.outputs.result}} |