How to Trigger a GitLab CI Pipeline Manually
GitLab gates jobs behind a play button with when: manual, turning any job into an on-demand action.
Set when: manual on a job so it waits for a click. Use the Run pipeline form (Pipelines > Run pipeline) to launch a pipeline with custom variables.
Manual gate before deploy
The deploy job will not run until someone clicks play; allow_failure: false makes it block the pipeline.
.gitlab-ci.yml
deploy:prod:
stage: deploy
when: manual
allow_failure: false
environment: production
script:
- ./deploy.sh production
rules:
- if: $CI_COMMIT_BRANCH == "main"Gotchas
- By default a manual job is
allow_failure: true(optional). Set it tofalseto make it a true blocking gate. - With
rules:, combinewhen: manualinside a rule rather than at the top level for conditional manual jobs. - Protected environments restrict who can click play - use them for production gates.
Related guides
How to Trigger a GitHub Actions Workflow ManuallyTrigger a GitHub Actions workflow manually with workflow_dispatch - add an input form, run from the UI or gh…
How to Schedule a Pipeline in GitLab CISchedule a GitLab CI pipeline with pipeline schedules and the $CI_PIPELINE_SOURCE == "schedule" rule to run n…