Variables set on the Run new pipeline page never reach the GitLab child pipeline
Your error
A variable entered on the Run new pipeline page prints an empty value in the child pipeline's jobs1 more line it can showFix it fast
Most common cause, 1 of 3Pipeline variables are not forwarded unless you ask for it
Turn on pipeline_variables in the trigger job.
trigger-child:
trigger:
include: .child-pipeline.yml
forward:
pipeline_variables: trueShort answer
GitLab does not pass pipeline variables (set on the Run new pipeline page, in a schedule or through the API) to a child pipeline by default; only YAML variables go down. Add forward: pipeline_variables: true to the trigger job, repeat it on nested triggers, and set values on the whole pipeline, not a manual trigger job. Applies to GitLab 19.6.
Which cause do you have?
Print the variable in one parent job and in one child job of the same pipeline run. Present in the parent but empty in the child means the trigger job is not forwarding it.
# parent .gitlab-ci.yml
show-in-parent:
script: echo "MYVAR in parent is '$MYVAR'"
# .child-pipeline.yml
show-in-child:
script: echo "MYVAR in child is '$MYVAR'"Then find the line you see in this list and open its fix:
- 1Pipeline variables are not forwarded unless you ask for it
Variables written in the YAML (top-level variables or the trigger job's variables) reach the child; values typed in the UI, a schedule or an API call do not - 2The value is needed in a grandchild pipeline
The child pipeline sees the variable, but a pipeline the child triggers does not - 3The variable was meant to be typed on a manual trigger job
The trigger job uses when: manual, and the plan was to enter the values when someone presses its play button
What does the error look like?
A variable entered on the Run new pipeline page prints an empty value in the child pipeline's jobsThe same variable works in the parent pipeline's jobs
Cause 1 of 3
Pipeline variables are not forwarded unless you ask for it
You seeVariables written in the YAML (top-level variables or the trigger job's variables) reach the child; values typed in the UI, a schedule or an API call do not
Check
The empty child value comes from the default forwarding rule. The CI/CD YAML reference lists two switches under trigger:forward: yaml_variables, true by default, and pipeline_variables, false by default. Values from manual runs, pipeline schedules and dotenv reports of jobs in needs count as pipeline variables, so they stay in the parent.
grep -n -A6 'trigger:' .gitlab-ci.ymlFix
Turn on pipeline_variables in the trigger job. Forwarded values have high precedence, so a variable of the same name defined in the child is usually overwritten by the parent's value.
trigger-child:
trigger:
include: .child-pipeline.yml
forward:
pipeline_variables: trueVerify
Run the pipeline again from the UI with MYVAR set. The child job prints the value.
grep -n -B2 -A2 'pipeline_variables: true' .gitlab-ci.ymlConfirmed by docs.gitlab.com
Cause 2 of 3
The value is needed in a grandchild pipeline
You seeThe child pipeline sees the variable, but a pipeline the child triggers does not
Check
Forwarding works one level at a time. GitLab's reference says forwarded variables are not forwarded again in nested downstream pipelines unless the nested trigger job also uses trigger:forward. Parent and child pipelines can nest at most two levels of child pipelines.
grep -rn -A6 'trigger:' .gitlab-ci.yml .child-pipeline.ymlFix
Add the same forward block to the trigger job inside the child pipeline's file.
# .child-pipeline.yml
trigger-grandchild:
trigger:
include: .grandchild-pipeline.yml
forward:
pipeline_variables: trueVerify
A job in the grandchild pipeline prints the value set on the Run new pipeline page.
grep -c 'pipeline_variables: true' .gitlab-ci.yml .child-pipeline.ymlConfirmed by docs.gitlab.com
Cause 3 of 3
The variable was meant to be typed on a manual trigger job
You seeThe trigger job uses when: manual, and the plan was to enter the values when someone presses its play button
Check
A manual job normally lets you enter variables before it runs, but trigger jobs are an exception. The reference states that you cannot manually specify CI/CD variables before running a manual trigger job, so nothing typed at that point can reach the child.
grep -n -B4 'when: manual' .gitlab-ci.ymlFix
Set the value when you start the whole pipeline on the Run new pipeline page, and forward pipeline variables from the manual trigger job. For values that only steer configuration, GitLab recommends pipeline inputs (spec:inputs with trigger:include:inputs) over variables.
trigger-child:
when: manual
trigger:
include: .child-pipeline.yml
forward:
pipeline_variables: trueVerify
Start a new pipeline with the variable set, press play on the trigger job, and the child job prints the value.
grep -n -A6 'trigger-child:' .gitlab-ci.ymlConfirmed by docs.gitlab.com
How do I stop it coming back?
- Add forward: pipeline_variables: true to every trigger job that depends on values chosen at run time, and leave a comment saying which variables it carries.
- Move run-time choices to spec:inputs, which GitLab recommends over pipeline variables from version 17.7 on.
- Keep one debug job in each child pipeline file that echoes the variables it expects, so a missing value shows up in the first job log.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.