We raised $3M for agent-native runners

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