Jobs in later stages wait for the whole earlier stage even if their dependency finished.

IntermediateScenarioGitLab CI
Answer

Situation read → Stage ordering hides a DAG.

What I'd do →

  1. Add needs: to jobs: needs: [build-api] so they start as soon as the dependency finishes.
  2. Add needs: { job: build, artifacts: false } when artifacts are not needed.
  3. Keep stages for readability.

Why → DAG pipelines cut critical path time.

Interview tip → needs also controls which artifacts are downloaded.

All CI/CD questions Roadmap: GitLab CI/CD

More on GitLab CI