How do I trigger a pipeline in another GitLab project from CI?

By Melih Toksari, developer of MergeBell · Updated · 5 min read

Short answer

Add a trigger job: trigger: project: group/other-project starts a multi-project pipeline on that project's default branch, or on the branch you name with branch. The user who runs your pipeline must be allowed to start pipelines in the other project. By default the trigger job succeeds as soon as the downstream pipeline is created; add strategy: mirror to make it wait and take the downstream pipeline's status.

Your app’s pipeline should kick off the docs site’s deploy, or a monorepo should run each service’s tests as its own pipeline. In GitLab, a pipeline started by another pipeline is a downstream pipeline, and you start one with a job that has trigger instead of script.

How do you trigger a pipeline in another project?

Add a trigger job with trigger:project, the full path of the other project:

deploy-docs:
  stage: deploy
  trigger:
    project: mygroup/docs-site
    branch: main

When the job runs, GitLab creates a pipeline in mygroup/docs-site: a multi-project pipeline. Without branch it runs on that project’s default branch. The short form trigger: mygroup/docs-site works too.

A trigger job has no script. It can use only a short list of keywords: allow_failure, extends, needs, only and except, parallel, rules, stage, trigger, variables, when, resource_group and environment. when accepts only on_success, on_failure, always or manual, so a trigger job can be a manual button.

The user who runs your pipeline must have permission to start pipelines in the downstream project, and to run on the branch you name if it’s protected. If they don’t, the trigger job fails and no downstream pipeline appears.

Should the trigger job wait for the downstream pipeline?

By default it doesn’t: the trigger job is marked success as soon as the downstream pipeline is created, even if that pipeline fails a minute later. To make your pipeline wait and fail with it, add strategy: mirror:

deploy-docs:
  stage: deploy
  trigger:
    project: mygroup/docs-site
    strategy: mirror
strategy The trigger job’s status
Not set Success as soon as the downstream pipeline is created
mirror Mirrors the downstream pipeline’s status exactly
depend Failed, success or running, depending on the downstream pipeline; GitLab recommends mirror instead

Use mirror when later jobs in your pipeline depend on the downstream one finishing, such as a smoke test after the deploy.

How do you pass variables to the downstream pipeline?

Set them on the trigger job:

deploy-docs:
  stage: deploy
  variables:
    ENVIRONMENT: staging
    UPSTREAM_BRANCH: $CI_COMMIT_REF_NAME
  trigger:
    project: mygroup/docs-site

What reaches the downstream pipeline:

  • Forwarded by default: variables in the top-level variables section and in the trigger job itself (forward: yaml_variables: true is the default).
  • Not forwarded by default: pipeline variables, such as the ones entered when someone runs the pipeline by hand or sent through the API. Add forward: pipeline_variables: true under trigger to pass them.
  • Never available: variables defined only in other jobs.
  • Predefined variables, such as the branch name, are the downstream pipeline’s own. To pass yours, copy them into a job variable, as UPSTREAM_BRANCH does above.

Forwarded variables count as trigger variables, which have the highest precedence downstream. A value containing $ can’t be escaped with $$ on the way down: turn off variable expansion for it, or use variables:expand. If the downstream project’s configuration declares spec:inputs, set them with trigger:inputs (GitLab 17.11 and later).

What’s a child pipeline, and when should you use one?

A child pipeline is a downstream pipeline in the same project, built from another YAML file. It’s how you split a large .gitlab-ci.yml, or run one pipeline per directory in a monorepo:

trigger-backend:
  stage: test
  trigger:
    include:
      - local: backend/.gitlab-ci.yml
    strategy: mirror
  rules:
    - changes:
        - backend/**/*
Child pipeline Multi-project pipeline
Runs in The same project, ref and commit as the parent Another project, on the branch you choose
Configuration trigger:include: up to three files, merged The other project’s own .gitlab-ci.yml
In the pipeline list Not shown in the project’s list Shown in the downstream project’s list
Nesting Up to two levels of child pipelines No nesting limit

trigger:include also takes a file from another project, with project, ref and file, or a file a previous job generated, with artifact and job, which is how dynamic child pipelines work. A whole hierarchy can hold up to 1,000 downstream pipelines by default.

One trap: CI/CD variables in a trigger:include path don’t expand in the trigger job; they expand in the child pipeline’s context, so the path can come out empty. Use inputs with $[[ inputs.name ]] interpolation instead.

How do you trigger a pipeline from a script or another tool?

Use the pipeline trigger API:

curl --request POST \
  --form "token=$TRIGGER_TOKEN" \
  --form "ref=main" \
  --form "variables[ENVIRONMENT]=staging" \
  "https://gitlab.com/api/v4/projects/<project_id>/trigger/pipeline"
  • From outside GitLab: create a pipeline trigger token in the target project under Settings › CI/CD › Pipeline trigger tokens, which needs the Maintainer or Owner role. The token acts with its owner’s access to the project.
  • From a job: send token=$CI_JOB_TOKEN instead. GitLab makes the new pipeline a downstream pipeline of the job’s pipeline.

The two arrive differently: $CI_PIPELINE_SOURCE is trigger for a trigger-token pipeline and pipeline for a multi-project pipeline, so check workflow:rules in the target project accepts the one you use.

Why does the trigger job fail?

You see What it means
The trigger job failed and no downstream pipeline exists The project wasn’t found, the user can’t start pipelines there, or the branch is protected and they can’t run on it
downstream pipeline can not be created, the resulting pipeline would have been empty. The downstream configuration’s rules left no job to run; add workflow:rules or job rules that match this pipeline source
downstream pipeline can not be created, Ref is ambiguous A tag and a branch share the name you triggered; use names that don’t collide
jobs:<job_name>:needs:need pipeline should be a string A dynamic child pipeline read a pipeline ID as a number; quote it, pipeline: "$UPSTREAM_PIPELINE_ID"
A downstream job gets 403 Forbidden downloading upstream artifacts The job token is scoped to the downstream project; add it to the upstream project’s job token allowlist
API: {"message":"404 Not Found"} You sent a personal access token instead of a trigger token, or used GET instead of POST
API: The requested URL returned error: 400 The ref doesn’t exist, or workflow:rules blocks pipelines whose source is trigger

When the pipeline won’t run at all in the target project, Pipeline will not run for the selected trigger covers workflow:rules in detail, and fetching files from the upstream pipeline is in how to pass artifacts between jobs.

On your phone

A multi-project pipeline shows up in the downstream project’s pipeline list, and that’s where MergeBell finds it too: MergeBell lists each project’s pipelines with their stages, jobs and logs, and can retry or cancel a pipeline on the free tier.

Frequently asked questions

How do I make the GitLab trigger job wait for the downstream pipeline?

Add strategy: mirror under trigger. By default the trigger job is marked success as soon as the downstream pipeline is created; with mirror it mirrors the downstream pipeline's status exactly, so the upstream pipeline fails when the downstream one fails. GitLab no longer recommends strategy: depend.

Why aren't my variables passed to the downstream pipeline?

Top-level variables and the trigger job's own variables are forwarded by default, but pipeline variables, such as the ones you enter when running a pipeline by hand or send through the API, are not. Add forward: pipeline_variables: true under trigger. Variables defined in other jobs are never available to a trigger job.

What is the difference between a child pipeline and a multi-project pipeline?

A child pipeline runs in the same project, on the same ref and commit as its parent, from a file named in trigger:include, and doesn't appear in the project's pipeline list. A multi-project pipeline runs in another project, on the branch you choose, and appears in that project's pipeline list.

What does "downstream pipeline can not be created, the resulting pipeline would have been empty" mean?

The downstream pipeline's rules left no job to run, so GitLab didn't create it. Give the child or downstream configuration workflow:rules or job rules that match a pipeline started by a trigger job; for a multi-project pipeline, CI_PIPELINE_SOURCE is pipeline.

Can I trigger a GitLab pipeline from a script instead of the trigger keyword?

Yes. Send a POST request to /api/v4/projects/<project_id>/trigger/pipeline with token and ref. Use a pipeline trigger token, created by a Maintainer or Owner under Settings › CI/CD › Pipeline trigger tokens, or $CI_JOB_TOKEN from inside a job, which makes the new pipeline a downstream pipeline of the job's pipeline.

Sources

Checked against these pages on 19 November 2026. GitLab changes quickly — if something here no longer matches, tell us and we will fix it.

Do this from your phone with MergeBell

Free for the whole review loop: the To-Do inbox, diffs and line comments, approve and merge, pipelines with retry, and push alerts for your To-Dos. Works with gitlab.com and self-managed GitLab 16.0+.

Get MergeBell for iPhoneGet MergeBell for Android

On the App Store for iOS 26 or later and on Google Play for Android 12 or later. An independent app, not affiliated with GitLab Inc.