2.2. Workflow Structure
💡 First Principle: A workflow's structure is a dependency graph, not a script — jobs are parallel by default and only become sequential when you declare needs:, so the shape you write directly determines wall-clock time, billing, and whether failures stop the right things.
Why care: structure is where most real-world money and most exam scenarios live. Serialize everything and a ten-minute pipeline becomes forty. Parallelize carelessly and your deploy job races your build job. Add a matrix without understanding fail-fast and one flaky variant cancels nineteen healthy ones. The structural keys below — needs, if, strategy, services, anchors, contexts — are the vocabulary for expressing exactly the graph you intend.
⚠️ Common Misconception: needs: is often read as "run on the same machine, after." It is only ordering plus an outputs channel. The dependent job still starts on a brand-new runner with none of the previous job's files, tools, or environment variables — a point Phase 1 made and Phase 2.3 makes actionable.