Manual and Delayed Jobs
You'll learn how to pause pipelines for human approval and schedule automatic delays before deployments.
What Are Manual and Delayed Jobs?
In production-critical environments, you don't always want pipelines to rush straight to deployment. Manual jobs require a human to click "Play" in the GitLab interface before they run—perfect for approval gates before production releases. Delayed jobs wait a specified time period before starting automatically, giving teams a window to cancel problematic deployments.
Think of manual jobs like a pilot's pre-flight checklist: the plane won't take off until a human confirms everything's ready. Delayed jobs are like a microwave timer: once started, it counts down and automatically proceeds unless you hit "Stop."
Manual Jobs
Use when: manual to create an approval gate:
deploy_production:
stage: deploy
script:
- kubectl apply -f production/
when: manual
The pipeline pauses at this job until someone manually triggers it. The job won't block downstream jobs unless you also add allow_failure: false.
Delayed Jobs
Use when: delayed with a start_in duration:
rollback_check:
stage: verify
script:
- ./check_metrics.sh
when: delayed
start_in: 30 minutes
This job waits 30 minutes, then runs automatically. You can cancel during the countdown if monitoring catches issues. Common delays: 5 minutes, 1 hour, 2 hours.
Combining Patterns
Delayed jobs work great after automatic canary deployments—giving time to observe before promoting to full production. Manual jobs shine before destructive operations or regulated environments requiring documented approvals.
Key Takeaway: Manual jobs (when: manual) require human intervention, while delayed jobs (when: delayed + start_in) create automatic waiting periods—both essential for safe, controlled deployments.