A GitLab pipeline is made of jobs grouped into stages, and the stages run in order: jobs in a stage may run alongside one another, and the next stage begins when the stage before it has finished. That machinery is simple. The design question hiding inside it is not: what decides the order?

In most inherited pipelines, the honest answer is archaeology. The order is the order in which the jobs were added, by different people, in different years, each new job prudently placed after everything that already existed. The result is a pipeline in which nearly every job waits for nearly every other job, not because the work requires it, but because nobody ever asked what the work requires. The pipeline's duration becomes the sum of its jobs, when the work itself only ever demanded a fraction of that sum.

Design from the dependency graph, not the stage list

The corrective is to ask, for each job, the only question that creates a legitimate wait: what does this job consume that another job must first produce?

A test job consumes the built application, so it must wait for the build. A packaging job consumes the tested artifact, so it waits for the tests whose verdict it carries. But a style check consumes only the source; it waits for nothing. Two test suites that exercise different parts of the system consume the same build and nothing of each other's; neither waits for the other.

Draw those consumption lines honestly and the pipeline's true shape appears: usually a short spine of genuine sequence, with wide fans of work that can proceed in parallel hanging off it. The shape was there all along. The stage list was covering it.

GitLab gives you two instruments for expressing that shape, and the judgment is knowing which fits. Stages order whole groups and suit the broad phases of the argument. Job-level dependency, the mechanism GitLab calls needs, lets a job declare exactly the earlier jobs whose outputs it consumes, and start the moment they finish rather than when an entire stage drains. Stages communicate the argument to a human reader. Job-level dependencies recover the time the stage boundaries waste. Mature pipelines use both: stages for legibility, explicit dependencies for the waits that stages would impose without cause.

The arithmetic of waiting

Do the arithmetic on the running case, because this is where the idea stops being philosophy. The dispatch pipeline runs its four blocks strictly in sequence: 9 + 14 + 12 + 7 = 42 minutes.

Suppose Clara's audit finds what audits usually find: the integration suite's 12 minutes consume the build but not the unit suite's verdict. Integration and unit failures are independent signals, and neither suite reads the other's output. Run the two suites in parallel after the build and the elapsed time becomes 9 plus the longer of 14 and 12, plus 7, which is 30 minutes.

Twelve minutes, over a quarter of the pipeline, were never work. They were waiting, purchased by a stage boundary nobody had questioned. Note also what did not change: every check still runs, every verdict still gates packaging, and the promise the pipeline makes is intact word for word. Parallelism that preserves the argument is free time. Parallelism that drops checks to buy speed is a different transaction, and never to be confused with this one.

This is also where the common misconception costs real money. Stages are often treated as the pipeline's table of contents: you put jobs in the order you would explain them, and the pipeline runs top to bottom. The explanation order and the execution order are different goods. Stages and dependencies are execution machinery; they decide what waits for what, and every unjustified wait is multiplied by every run, every day, by every engineer standing idle in front of it. Explain the pipeline in the order that teaches best. Run it in the order the dependencies require. Where those differ, it is the running that spends the money.

A dependency is a claim, and false claims corrupt both ways

Two disciplines keep dependency design honest.

First, a dependency is a claim about consumption, and false claims corrupt in both directions. Declare a dependency that does not exist and you buy delay for nothing. Fail to declare one that does exist — a job that quietly reads an artifact, a file, or a state an earlier job produces — and you get the pipeline engineer's most poisonous failure: the job that passes or fails depending on timing, on whether the producing job happened to finish first. When a job flakes only under parallel running, suspect an undeclared dependency before you suspect the test.

Second, the graph is a living document of the system's real structure. When two jobs genuinely cannot run until a third finishes, that is information about coupling in the software itself, and a pipeline that keeps exposing painful coupling is doing diagnostic work for the architecture. Read your dependency graph the way you would read an X-ray: the waits you cannot remove are a map of the system you actually have.

So the audit habit is simple and repeatable. Take one job at a time. Name what it consumes. Name who produces that. Let it wait for those producers and for nothing else. Then look at what remains sequential and ask whether the sequence describes the work, or merely the history of who added what, in which year, being careful. Let the work say what waits.

Experience it, don’t just read about it

Stages following dependencies, not habit, so a job waits only for what it consumes is Concept 2 of GitLab CI in Practice (Course No. 573), from Cognosco Learning, a learning company powered by AI. The course builds pipeline practice beyond this distinction — Fast Feedback First — Signal Value per Minute, Cache, Artifacts, and the Handoff Between Jobs — Rebuild, Reuse, Preserve, and Speed Is a Budget — The Arithmetic of Waiting — each worked through with an Agentic Socratic AI coach, one learner at a time. Try a Free Preview at cognoscolearning.com.

Try a Free PreviewAll Signature CoursesThe Corporate License

Navigate your own course.

← All Insights

© 2026 Cognosco Learning. All rights reserved.