Child pipeline step options

A child pipeline lets you define a step within a pipeline that triggers another pipeline, which can help to streamline more complex workflows into modular pieces and achieve greater parallelism within your pipeline. The following options are used to define a ‘pipeline within a pipeline step’. A child pipeline (or a pipeline within a pipeline) step uses type: pipeline.

The custom property

The custom option is used to define the custom pipeline that is executed when a child pipeline step is executed.

Propertystep

Required — Yes (when type: pipeline)

Data type — String (This should match the name of the custom pipeline.)

Allowed parent propertiesstep

Allowed child properties — none


The input variables property

The input-variables property is used to define variables that can be passed from the parent pipeline into the child pipeline. Once passed, these variables are considered pipeline variables for the child pipeline.

There is a limit of 20 input-variables for a pipeline step.

Propertyinput-variables

Required — No

Data type — Key-value pair (YAML spec - Block Mappings)

Allowed values — Valid variable names

  • Names can only contain ASCII letters, digits, and underscores

  • Names can't start with a digit

Allowed parent properties — step

Example: Using the input-variables option to define variables, which can be exposed to the child pipeline.

pipelines: custom: a-parent-pipeline: - variables: - name: parent_pipeline_variable default: "val1" allowed-values: - "val1" - "val2" - step: name: 'Child pipeline' type: pipeline custom: a-child-pipeline input-variables: var_1: $parent_pipeline_variable var_2: $repository_variable_name var_3: $workspace_variable_name var_4: "static-value-1" var_5: "static-value-2" a-child-pipeline: - step: name: 'Child Pipeline step' script: - echo "Parent Pipeline Step Variable -" $var_1 - echo "Parent Pipeline Step Variable -" $var_2

The script property

The script property should not be included for child pipeline steps, as it will not be executed. The steps in the child pipeline that is referenced by the custom property will be executed instead.


Restricted properties

Child pipeline steps are just a trigger to execute a separate pipeline within a pipeline. For instance, defining artifacts on a child pipeline step is not valid, as there are no artifacts produced from the child pipeline step; however, steps inside the child pipeline itself may produce artifacts.

The following properties are not supported by pipeline steps and should not be included when using type: pipeline. With the exclusion of deployment, which is not supported in child pipelines, these properties should be used inside the child pipeline itself instead.

  • deployment

  • stage

  • size

  • runtime

  • output-variables

  • caches

  • artifacts

  • runs-on

  • image

  • clone

  • oidc

  • services

Still need help?

The Atlassian Community is here for you.