Trigger one pipeline after another (classic)

Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019

Large products have several components that are dependent on each other. These components are often independently built. When an upstream component (a library, for example) changes, the downstream dependencies have to be rebuilt and revalidated.

In situations like these, add a pipeline trigger to run your pipeline upon the successful completion of the triggering pipeline.

Add a build completion trigger

In the classic editor, pipeline triggers are called build completion triggers. You can select any other build in the same project to be the triggering pipeline.

After you add a build completion trigger, select the triggering build. If the triggering build is sourced from a Git repo, you can also specify branch filters. If you want to use wildcard characters, then type the branch specification (for example, features/modules/*) and then press Enter.


Keep in mind that in some cases, a single multi-job build could meet your needs. However, a build completion trigger is useful if your requirements include different configuration settings, options, or a different team to own the dependent pipeline.

Download artifacts from the triggering build

In many cases, you'll want to download artifacts from the triggering build. To do this:

  1. Edit your build pipeline.

  2. Add the Download Build Artifacts task to one of your jobs under Tasks.

  3. For Download artifacts produced by, select Specific build.

  4. Select the team Project that contains the triggering build pipeline.

  5. Select the triggering Build pipeline.

  6. Select When appropriate, download artifacts from the triggering build.

  7. Even though you specified that you want to download artifacts from the triggering build, you must still select a value for Build. The option you choose here determines which build will be the source of the artifacts whenever your triggered build is run because of any other reason than BuildCompletion (e.g. Manual, IndividualCI, Schedule, and so on).

  8. Specify the Artifact name and make sure it matches the name of the artifact published by the triggering build.

  9. Specify the Destination directory to which you want to download the artifacts. For example: $(Build.BinariesDirectory)