outputs.result), allowing later steps to consume the result.
What this workflow demonstrates
- Using
metadata.generateNameto create a unique workflow name with the prefixrandom-number-. - Defining a single
entrypoint(random-number) that uses a script template. - Supplying an inline script via the
sourcefield; the script runs inside the specified container image. - Capturing the script stdout and exposing it as the template output.
| Field | Purpose | Example |
|---|---|---|
| metadata.generateName | Create a unique workflow name using a fixed prefix | random-number- |
| spec.entrypoint | The template that starts execution | random-number |
| script.image | Container image that runs the script | python:3.6-alpine |
| script.command | Command invoked to execute the script | [python] |
| script.source | Inline script text written to a file and executed inside the image; stdout is captured as the template output | The Python code shown above |
- The text in
script.sourceis written into a temporary file inside the container. - The container executes the script using the specified
commandandimage. - Anything printed to stdout by the script is captured by Argo and made available as
outputs.result, which you can reference in later templates using standard Argo templating.
- From the Argo Web UI: paste the YAML and submit. Optionally switch to the Graph view to see a single node representing the
random-numbertemplate. - From the cluster using kubectl:
- Using the Argo CLI (if installed):
- In the UI, open the workflow, click the node, then click Logs to inspect stdout.
- With the Argo CLI, you can stream logs (replace the workflow name as appropriate):

The stdout of a script template is captured and available as the template output (
outputs.result). Reference it in subsequent templates using Argo’s templating syntax to pass values between steps.