Skip to main content
A pipeline chains together multiple tasks to create a workflow. This example shows a simple pipeline with dependent tasks.

Example

How It Works

1

First Task Executes

The first-add task runs first, adding the first two parameters (2 + 10 = 12) and emitting the result.
2

Second Task Uses First Task's Result

The second-add task automatically waits for first-add to complete because it references its result using $(tasks.first-add.results.sum). It then adds this result to the third parameter (12 + 10 = 22).
3

Pipeline Results are Computed

After all tasks complete, the pipeline computes its own results by referencing task results. These become available in the PipelineRun status.

Task Dependencies

Tekton automatically creates dependencies between tasks when:
  • A task references another task’s result: $(tasks.TASK_NAME.results.RESULT_NAME)
  • A task explicitly uses runAfter to specify ordering
In this example, second-add implicitly depends on first-add because it uses its result.

Expected Output

With the provided parameters (2, 10, 10):
  • first-add outputs: 12
  • second-add outputs: 22
Pipeline results:

Key Concepts

  • Pipeline: A collection of tasks that execute in a defined order
  • Task References: Use taskRef to reference an existing task by name
  • Implicit Dependencies: Tasks automatically wait for tasks whose results they reference
  • Pipeline Results: Pipelines can aggregate results from multiple tasks
  • Parameter Passing: Pipeline parameters can be passed to tasks, and task results can be passed to other tasks

Next Steps