Skip to main content
Pipelines in Pipelines is a mechanism to define and execute Pipelines within Pipelines, alongside Tasks and Custom Tasks, enabling more complex workflow compositions.
Pipelines in Pipelines is not yet an alpha feature. While you can specify pipelineRef or pipelineSpec in a PipelineTask when enable-api-fields is set to "alpha", this feature is not yet supported or implemented. Specifying a pipelineRef or pipelineSpec will not cause the Pipeline to run at this time.

Overview

Pipelines in Pipelines allows you to compose complex workflows by nesting Pipeline definitions. This provides:
  • Better organization of complex workflows
  • Reusability of Pipeline definitions
  • Composition of Pipelines alongside Tasks and Custom Tasks
  • Hierarchical Pipeline structures
For more background and design details, refer to TEP-0056.

Specifying pipelineRef

Define Pipelines in Pipelines at authoring time by using the pipelineRef field in a PipelineTask, similar to how you use taskRef.
Reference an existing Pipeline by name:
In the clone-scan-notify Pipeline example above, the pipeline includes three tasks: git-clone (a regular Task), security-scans (a nested Pipeline that runs scorecards and codeql), and notification (a regular Task). Using pipelineSpec instead of pipelineRef embeds the Pipeline definition directly, avoids name collisions in the namespace, and enables fetching the entire Pipeline definition in a single API request.

Parameters

Pipelines in Pipelines consume parameters the same way as Tasks in Pipelines:
Parameters flow from the parent Pipeline to nested Pipelines just as they flow to Tasks.

Use Cases

Organizing Complex Workflows

Break down large Pipelines into logical sub-Pipelines:

Reusing Pipeline Logic

Define common Pipeline patterns once and reuse them:
Both frontend-build and backend-build reuse the same test-suite Pipeline.

Current Limitations

This feature is currently not implemented. The following limitations apply:
  • Specifying pipelineRef or pipelineSpec will not execute the nested Pipeline
  • The feature flag must be set to "alpha" to validate the syntax
  • No PipelineRuns will be created for nested Pipelines
  • Status reporting for nested Pipelines is not available
This documentation describes the intended design. Check the Tekton release notes for implementation status updates.

Future Capabilities

When implemented, Pipelines in Pipelines will support:
  • Passing workspaces to nested Pipelines
  • Consuming results from nested Pipelines
  • Conditional execution of nested Pipelines
  • Matrix execution of nested Pipelines
  • Finally tasks in nested Pipelines
  • Timeout and retry configuration for nested Pipelines