- All playbooks
- Size the agent pool to the widest layer of the build graph
Size the agent pool to the widest layer of the build graph
Allocate CI agents per commit from the build graph's widest layer, in place of a fixed count.
How DoorDash used this technique
Read what DoorDash changed and follow the original sources.
Size the agent pool to the widest layer of the build graph
Translated to GitHub Actions
- What DoorDash built
- DoorDash walks its operation graph layer by layer and allocates CI agents to the widest layer.
- Your GitHub Actions version
- Size the number of parallel jobs to the widest layer of the build graph.
DoorDash first ran a fixed ten agents per commit. It now walks the operation graph layer by layer, folding no-op operations into their consumers, and takes the widest layer (adjusted by weight) as the number of operations that can run in parallel. Together with the post's runtime improvements, allocating agents to that width cut its largest web project from 220 agent minutes per run to 30. DoorDash's Kotlin build service also scales its workers with the queue: more during U.S. working hours, and more when jobs wait for a machine with enough memory tokens.
For CWN, this results in a drop from 220 minutes per run to 30 minutes per run Source
- Use it when
- Every commit gets the same number of parallel jobs or runners, whatever the change's build graph needs.
- Before applying it
- A graph's width approximates how many runners stay busy; long single tasks still set the wall time, so check the critical path as well.
- GitHub Actions adaptation
- Compare the source system with your own workflow before applying this translation.
Company Playbooks
- Read Anthropic’s playbookRun only affected tests
- Read DoorDash’s playbookRun build and test in parallel, sharded across CI agents
- Read Linear’s playbookBenchmark the same job on faster hardware
- Read Mastra’s playbookStarSling runners for the slowest test workflow
- Read OpenAI’s playbookRank CI fixes by the minutes they save
- Read Ramp’s playbookMove a CPU-bound test suite to a faster CPU
- Read Shopify’s playbookLet an agent iterate against one CI metric
- Read Spotify’s playbookBuild arm64 on native arm64 runners
- Read Stripe’s playbookRun only the tests a change can reach
- Read Uber’s playbookBuild the merge-queue speculations most likely to be needed