MicroticaMicrotica

Trigger Pipeline

Start another pipeline from within a pipeline using the trigger-pipeline step. Split your automation across pipelines and filter triggers by branch or tag.

Start the execution of one pipeline from another pipeline.

Use this step to split your automation across two or more pipelines for better management and reusability.

This step initiates the pipeline execution and does not wait for it to finish. The triggered pipeline continues running asynchronously.

Syntax

microtica.yaml
steps:
  step-name:
    type: trigger-pipeline
    pipeline: "2efeaf06-7d87-4092-ba66-94877c6f2d47" # pipeline ID
    branch_filter: master # optional
    ref: refs/heads/master # optional
ParameterDescriptionRequired
titleThe display name of the step.No
typeThe type of the Microtica built-in step.
Should always be trigger-pipeline for this type of step.
Yes
pipelineThe ID of an existing pipeline to be triggered.Yes
branch_filterInitiate pipeline execution only for commit/manual trigger on specified branch.
If not specified, pipeline will be triggered on every pipeline execution.
E.g. develop, feature/upgrade-eks etc.
No
refBranch or tag ref the triggered pipeline should pull the code from.

Default: refs/heads/master
No

Trigger a pipeline on commits to a specific branch

You can trigger another pipeline only when the parent pipeline was triggered from a specific branch or tag.

This is useful when you want to split pipeline logic across two or more pipelines. For example, one pipeline can run the build, test, and packaging, then trigger another pipeline that deploys the code to a specific environment (dev, test, prod) based on the branch the parent pipeline was triggered from.

microtica.yaml
steps:
  Clone:
    title: Clone my source code from Git
    type: git-clone

  BuildAndTest:
    title: Build and test my service
    image: node:12-alpine
    commands:
     - npm install
     - npm run build

  TriggerAnotherPipeline:
    title: Trigger my deployment pipeline
    type: trigger-pipeline
    pipeline: "2efeaf06-7d87-4092-ba66-94877c6f2d47" # pipeline ID
    branch_filter: develop
    ref: refs/heads/develop

With this configuration, the pipeline triggers another pipeline with ID 2efeaf06-7d87-4092-ba66-94877c6f2d47 only if the parent pipeline was triggered from the develop branch.

Setting the ref value to the develop branch tells the triggered pipeline to pull the code from the develop branch.

Next steps

On this page