GitLab CI/CD Multi-Project trigger:strategy:depend Orchestration Prompt
Chain pipelines across repositories with trigger: + strategy: depend so an upstream pipeline waits on and inherits the status of downstream projects — building reliable cross-repo release trains.
- Target user
- Platform engineers orchestrating builds across multiple repos
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a release engineer who orchestrates dependent builds across many repositories using GitLab multi-project pipelines, not a tangle of webhooks.
I will provide:
- The repos involved and their dependency direction (e.g. shared-lib → service-a, service-b → integration-tests)
- What "done" means at each stage and which failures should block upstream
- Current glue (manual triggers, webhooks, scheduled re-runs)
Your job:
1. **Model the graph** — which project triggers which, and where you need bridge jobs vs parallel fan-out. Call out cycles (forbidden) and where a single multi-project chain beats N webhooks.
2. **Author the trigger jobs** — `trigger: { project: group/downstream, branch: $REF }` with `strategy: depend` so the bridge job mirrors the downstream pipeline's status (red downstream = red upstream). Contrast with the default fire-and-forget behavior.
3. **Pass context** — forward variables to the downstream pipeline via `trigger:` `variables:` and `forward:`, including `PIPELINE_SOURCE` and a correlation/version ID, and explain inherited vs forwarded variables.
4. **Pass artifacts across projects** — use `needs:project:` to consume a downstream/upstream job's artifacts (with `ref` + `job` + `artifacts: true`) instead of re-building.
5. **Trigger tokens & permissions** — when a CI job token suffices vs when you need a pipeline trigger token, and how protected branches/`CI_JOB_TOKEN` allowlists gate cross-project access.
6. **Failure & visibility** — make failures surface on the parent pipeline graph, set `interruptible`, and avoid the "upstream green while downstream silently failed" trap.
7. **Validate** — a test plan: push to shared-lib, confirm the chain fans out, a deliberate downstream failure turns the whole train red, and artifacts flow as expected.
Output: (a) the cross-repo trigger graph (ASCII), (b) the trigger + `strategy: depend` job snippets per edge, (c) the `needs:project` artifact-passing example, (d) the CI_JOB_TOKEN allowlist settings each downstream repo needs, (e) the validation plan.
Bias toward: `strategy: depend` everywhere status matters, explicit variable forwarding, least-privilege job-token allowlists over broad tokens.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
GitLab CI/CD Downstream dotenv Variable Passing Prompt
Pass computed values (image tag, version, environment URL) from an upstream job into a downstream/child pipeline using dotenv artifacts and trigger inheritance, instead of fragile re-computation or hardcoding.
-
GitLab CI/CD k6 Load Test Performance Gate Prompt
Design a .gitlab-ci.yml stage that runs k6 load/performance tests against a review or staging environment, enforces threshold-based pass/fail gates, and surfaces results as artifacts and metrics reports in merge requests.
-
GitLab CI/CD Publish to the Package Registry (npm, Maven, generic) Prompt
Design .gitlab-ci.yml jobs that build and publish versioned artifacts to the project or group Package Registry using CI_JOB_TOKEN auth, with proper version gating, immutability, and consumer install config.
-
GitLab CI/CD Windows Runner & PowerShell Pipeline Prompt
Design .gitlab-ci.yml pipelines that run on Windows runners (shell or docker-windows executor) with correct PowerShell shell handling, tag targeting, path/quoting fixes, and mixed Linux/Windows stages.
More GitLab CI/CD prompts & error guides
Browse every GitLab CI/CD prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.