By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
A compiled graph is a library object. Production is the set of processes that build that object and the stores they share: an API service that accepts messages and serves reads, a worker pool that runs graph steps and consumes resume commands, a queue between them, a checkpoint database, a scheduler for deadlines and retries, and the vendor APIs the graph calls. The topology answers where each execution mode runs — new runs, resumes, scheduled re-checks — and every arrow in the drawing is a capacity boundary.
The single most common sizing mistake is to count runs. A run is not one unit of work: it is one checkpoint write per superstep, one model or tool call per node, and one stored thread while it is paused. A support graph with eight supersteps is eight checkpoint writes, and adding a node or a routing hop raises that number for every future run. Capacity planning therefore starts from supersteps per second, not conversations per day.
Two numbers decide whether the topology holds. The first is active supersteps per second: arrival rate divided by sixty, multiplied by the average step count. The second is the checkpoint store's sustainable write rate. Divide the second by the first and you get headroom — the burst factor the store can absorb before write latency becomes the graph's latency. Paused threads are a third number and a storage one: they consume no compute while waiting, but they must still be stored, expired and resumed.
from dataclasses import dataclass
@dataclass(frozen=True)
class Workload:
runs_per_minute: int
supersteps_per_run: int
paused_fraction: float
resume_days: float
def plan(workload: Workload, checkpoint_writes_per_second: float) -> dict[str, float]:
"""Turn an arrival rate into the capacity numbers that matter."""
runs_per_second = workload.runs_per_minute / 60
active_supersteps = runs_per_second * workload.supersteps_per_run
paused_per_day = workload.runs_per_minute * 1440 * workload.paused_fraction
stored_threads = paused_per_day * workload.resume_days
return {
"supersteps_per_second": round(active_supersteps, 3),
"paused_runs_per_day": round(paused_per_day, 1),
"stored_threads": round(stored_threads, 1),
"headroom_factor": round(checkpoint_writes_per_second / active_supersteps, 2),
}
for runs in (30, 90):
workload = Workload(
runs_per_minute=runs,
supersteps_per_run=8,
paused_fraction=0.25,
resume_days=3.0,
)
print(runs, plan(workload, checkpoint_writes_per_second=12))At thirty runs a minute the store needs four checkpoint writes a second and has a factor of three in reserve. At ninety runs a minute it needs twelve and has a factor of one: any burst, any backfill, any failover that pauses writes turns into queueing. The paused numbers are just as practical — a quarter of runs pausing for three days leaves 32,400 threads to retain at the lower rate, and retention is a database bill and an expiry job, not a compute line item.
With the workload in hand, each box gets a unit of capacity and a first saturation signal. The signal is what an alert watches; the fix is what the runbook says to do when it fires. Note that the API and the workers scale independently: the API is stateless because the thread lives in the checkpoint store, and the workers are the only tier that turns supersteps into money.
| Component | Capacity unit | First saturation signal | Fix |
|---|---|---|---|
| API replicas | Concurrent requests | p95 latency and connection count | Add replicas; threads already live in the store |
| Worker pool | Active supersteps per second | Queue depth and oldest message age | Add workers or queue partitions |
| Checkpoint store | Writes per second and connections | Write latency and pool wait time | Pooler, partitioning, smaller checkpoints |
| Queue | Unacknowledged messages | Age of the oldest message | More partitions and consumers |
| Vendor API | Calls per minute quota | 429 responses and retry storms | Token bucket, backoff, request coalescing |
| Trace exporter | Spans per second | Dropped spans at the exporter | Sampling and async export |
Paused workflows need their own capacity plan, because their load is bursty rather than smooth. A weekend of approvals can drain into Monday morning, and every resume is a worker task plus a checkpoint write at the same moment. Two defences are cheap: stagger deadline and expiry jobs so they never coincide with customer peak, and size resume workers for the burst of pending approvals rather than for the steady-state arrival rate.
Key takeaways
Production adds processes around the compiled graph — API, workers, queue, checkpoint store, scheduler, vendor APIs — and every arrow between them is a capacity boundary.
Size from active supersteps per second, not runs: arrival rate times average step count is the checkpoint write load, and adding nodes multiplies it.
Keep a headroom factor of at least two at peak; a store at factor one turns every deploy or bulk resume into queueing.
Paused workflows consume storage and create resume bursts, so plan retention, stagger expiry jobs and staff resume capacity separately from steady-state traffic.
Each component needs a named saturation signal and a runbook fix — queue depth for workers, write latency for the store, message age for the queue and 429s for vendor quotas.
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.
Don't lose this lesson
Create a free account to save your progress, keep your streak, and work toward a shareable certificate.