Needs vs Dependencies in GitLab CI
When people look at a pipeline graph, they often assume every arrow means the same thing. GitLab CI does not work that way. needs primarily changes execution timing, while dependencies focuses on artifact downloads.
Why the distinction matters
If you render both relationships as the same visual edge, teams stop trusting the diagram. The safe approach is to keep separate edge styles:
- Use solid arrows for
needs. - Use dashed arrows for
dependencies. - Add an artifact badge when a
needsentry explicitly requests artifacts.
Practical reading model
Think of needs as "this job cannot realistically start until that job finishes". Think of dependencies as "this job wants files from that upstream job".
A job can depend on artifacts without sharing the same scheduling behavior you would infer from a pure DAG arrow.
In Pipeline Studio
The editor keeps the raw YAML visible while the graph translates those keywords into distinct edges. That makes code review easier because the visual model stays faithful to the file you will actually commit.