Skip to main content
Results allow Tasks and Pipelines to output values that can be used by subsequent Tasks or surfaced to users.

TaskResult

Defines a result produced by a Task.
string
required
Name of the result.Must be a valid identifier.
ResultsType
default:"string"
Type of the result.Values:
  • string - Single string value
  • array - Array of strings
  • object - Key-value pairs
string
Human-readable description of the result.
map[string]PropertySpec
For object-type results, defines the structure of keys.
ResultValue
Expression to retrieve the result value from a Step.Example: $(steps.stepName.results.resultName)

StepResult

Defines a result produced by a Step.
string
required
Name of the step result.
ResultsType
default:"string"
Type of the result: string, array, or object.
string
Description of the result.
map[string]PropertySpec
For object results, property definitions.

TaskRunResult

Represents the actual result value in a TaskRun status.
string
Name of the result.
ResultsType
Type of the result.
ResultValue
The actual value produced.Can be string, array, or object depending on type.

PipelineResult

Defines a result produced by a Pipeline.
string
required
Name of the pipeline result.
ResultsType
default:"string"
Type of the result.
string
Description of the result.
ResultValue
required
Expression referencing a task result.Example: $(tasks.taskName.results.resultName)

Writing Results

Results are written to files in the container filesystem:

String Results

Array Results

Object Results

Reading Results

In Subsequent Tasks

Reference results from previous tasks:

In Pipeline Results

Surface task results as pipeline results:

In Finally Tasks

Finally tasks can access results from DAG tasks:

Result Size Limits

Results have size limits:
  • String results: 4096 bytes (4 KB) by default
  • Array/Object results: Configured per installation
Results exceeding limits cause task failure with reason TaskRunResultLargerThanAllowedLimit.

Step Results

Steps can produce results that tasks aggregate:

Example: Complete Task with Results

Best Practices

  1. Keep results small - Use results for metadata, not large data
  2. Use descriptive names - Make result purpose clear
  3. Document result format - Describe expected structure
  4. Validate result content - Check that written values are valid
  5. Use appropriate types - Choose string/array/object based on data
  6. Write atomically - Write complete result value in one operation