Bursty Temporal workloads: spread them out, or pay for headroom
Before: When a burst gets throttled, buy more throughput.
After: If the work isn't time-sensitive, spread it out with jitter and long timeouts. Pay for throughput only when it has a deadline.
Some workloads arrive all at once. A fleet-wide change, a backfill or a nightly fan-out can create hundreds of thousands of workflows in a few minutes, and millions of activities behind them. On Temporal Cloud, that burst runs straight into the namespace rate limit.
There are two ways out. Which one is right depends on a single question: does this work need to be done soon, or just done?
How big a burst really is
Temporal Cloud meters a namespace in Actions per second (APS). Starting and completing a workflow, starting or retrying an activity, a heartbeat, a timer and a signal are all Actions. The default limit is 500 APS.
Take 200,000 workflows at about 20 Actions each: a start and a completion, five or so activities, a timer, the occasional retry. That’s 4 million Actions. At 500 APS, that’s a little over two hours of the namespace’s full capacity. If it all shows up in ten minutes, you’re asking for around 6,700 APS, thirteen times the limit.
On-Demand capacity won’t save you here. It raises the limit based on the past day of usage: the lesser of four times the average APS or twice the P90. That works well for steady growth. A burst that happens once a day barely moves the average, so the limit never gets near the peak.
What throttling actually does
When you go over the limit, Temporal Cloud throttles. The server returns ResourceExhausted, the SDK retries, and work slows down. Temporal’s own guidance is that throttling means added latency, not lost work.
That’s true until a timeout fires. Throttling adds waiting time, so the timeouts at risk are the ones that count waiting:
- An activity’s Schedule-To-Start timeout covers the time a task sits in the queue before a worker picks it up. Throttling grows that queue, and this timeout is never retried, whatever the retry policy says.
- An activity’s Schedule-To-Close timeout covers every attempt, including the time spent queued between them.
- A workflow’s execution or run timeout covers everything from the moment it starts, waiting included.
Say a workflow normally takes 20 minutes and has a 30-minute execution timeout. Add 15 minutes of throttling and it needs 35, so it times out with the work half done. The retry costs more Actions and joins the same queue. Most of the damage in a burst comes from timeouts that were sized for a quiet system, not from the throttling itself.
If it just has to get done: jitter and long timeouts
Most bulk work doesn’t have a real deadline. If it’s fine for everything to finish within a day, don’t fight the limit. Spread the work across a window that fits under it.
Pick a target rate below the limit, leaving room for everything else in the namespace. Then divide:
window = total Actions / target APS
= 4,000,000 / 250
≈ 4.5 hours
Give each workflow a random Start Delay inside that window. Temporal generally recommends not setting workflow timeouts at all. If you do set one, remember that it starts counting when the workflow is created, not when the delay ends, so it has to be longer than the window plus the run time:
window := 6 * time.Hour
opts := client.StartWorkflowOptions{
ID: "reconcile-" + resourceID,
TaskQueue: "bulk",
// Spread starts evenly across the window.
StartDelay: time.Duration(rand.Int63n(int64(window))),
// Optional. If set, it counts from creation, so it must cover
// the delay, the work and any throttling along the way.
WorkflowExecutionTimeout: 24 * time.Hour,
}
Inside the workflow, bound each activity attempt with a Start-To-Close timeout and let retries with exponential backoff handle failures. Leave Schedule-To-Start unset, and keep any Schedule-To-Close generous, so a throttled stretch slows activities down instead of failing them.
One catch: Start Delay defers the workflow’s first task, not the start request. Two hundred thousand start calls in one loop still hit the API together. Put a simple rate limiter in front of the starter as well.
You pay for exactly the Actions you use, and the burst never shows up as an incident.
If it has a deadline: provision for it
Sometimes the work does need to finish soon. A customer is waiting, or the next stage can’t start until this one is done. Then you need real headroom, and on Temporal Cloud that’s Provisioned Capacity.
You buy capacity in Temporal Resource Units (TRUs). Each TRU gives 500 APS, and you can choose 2, 3, 4, 6, 8, 10 or 12 of them. Temporal aims to provision new capacity within about two minutes, and you can change the count hourly.
Size it from the deadline:
required APS = total Actions / deadline
= 4,000,000 / 1,800 s
≈ 2,200 APS → 5 TRUs → round up to 6
Provisioning isn’t free when idle. Every TRU after the first carries a minimum of 360,000 Actions per hour. So raise capacity just before a planned burst and bring it back down after, rather than leaving it on.
Keep a little jitter even here. A few seconds of spread stops every workflow from hitting the API in the same instant.
The rule I use
| The work… | Do this |
|---|---|
| Can finish any time within hours or a day | Random Start Delay over a window, long timeouts, a rate-limited starter |
| Has a deadline measured in minutes | Provisioned Capacity sized as Actions ÷ deadline, raised ahead of time, plus a little jitter |
| Grows steadily rather than spiking | Leave it on On-Demand; it will follow you up |
Throughput costs money, and time is often cheaper. Before reaching for more capacity, ask whether anyone needs the answer before tomorrow.
The same post as plain Markdown, with the takeaways first. Copy it into an AI tool, or point the tool at /posts/temporal-bursts-jitter-vs-provisioned-capacity.md.
# Bursty Temporal workloads: spread them out, or pay for headroom
> When hundreds of thousands of workflows land at once, the right fix depends on one question: does the work have a deadline?
- Author: Sharan Singh
- URL: https://sharansingh.me/posts/temporal-bursts-jitter-vs-provisioned-capacity
- Published: 2026-11-23
- Updated: 2026-11-23
- Tags: temporal, distributed-systems, reliability
## The lesson
- Before: When a burst gets throttled, buy more throughput.
- After: If the work isn't time-sensitive, spread it out with jitter and long timeouts. Pay for throughput only when it has a deadline.
## Rules
- Throttling in Temporal Cloud delays work; it does not drop it, as long as no timeout that counts waiting time fires first.
- On-Demand capacity follows your recent usage, so it will not absorb a rare, sudden burst.
- If the work only has to finish within hours or a day, randomize Start Delay across a window. Leave workflow timeouts unset, or make them longer than the window plus the work.
- Avoid activity Schedule-To-Start timeouts on bursty work; they count time spent waiting in the queue and are never retried.
- Pace the client that starts workflows too; Start Delay defers the work, not the start requests.
- If the work has a deadline, size Provisioned Capacity as total Actions divided by the deadline, and raise it before the burst.
- Keep some jitter even with Provisioned Capacity, to avoid a thundering herd at the start of each second.
## Full text
Some workloads arrive all at once. A fleet-wide change, a backfill or a nightly fan-out can create hundreds of thousands of workflows in a few minutes, and millions of activities behind them. On Temporal Cloud, that burst runs straight into the namespace rate limit.
There are two ways out. Which one is right depends on a single question: **does this work need to be done soon, or just done?**
## How big a burst really is
Temporal Cloud meters a namespace in [Actions per second (APS)](https://docs.temporal.io/cloud/capacity-modes). Starting and completing a workflow, starting or retrying an activity, a heartbeat, a timer and a signal are all Actions. The [default limit is 500 APS](https://docs.temporal.io/cloud/limits).
Take 200,000 workflows at about 20 Actions each: a start and a completion, five or so activities, a timer, the occasional retry. That's 4 million Actions. At 500 APS, that's a little over two hours of the namespace's full capacity. If it all shows up in ten minutes, you're asking for around 6,700 APS, thirteen times the limit.
On-Demand capacity won't save you here. It [raises the limit based on the past day of usage](https://docs.temporal.io/cloud/capacity-modes): the lesser of four times the average APS or twice the P90. That works well for steady growth. A burst that happens once a day barely moves the average, so the limit never gets near the peak.
## What throttling actually does
When you go over the limit, Temporal Cloud throttles. The server returns `ResourceExhausted`, the SDK retries, and work slows down. Temporal's own guidance is that throttling means [added latency, not lost work](https://docs.temporal.io/best-practices/managing-aps-limits).
That's true until a timeout fires. Throttling adds waiting time, so the timeouts at risk are the ones that count waiting:
- An activity's **Schedule-To-Start** timeout covers the time a task sits in the queue before a worker picks it up. Throttling grows that queue, and this timeout is [never retried](https://docs.temporal.io/encyclopedia/detecting-activity-failures), whatever the retry policy says.
- An activity's **Schedule-To-Close** timeout covers every attempt, including the time spent queued between them.
- A workflow's **execution or run timeout** covers everything from the moment it starts, waiting included.
Say a workflow normally takes 20 minutes and has a 30-minute execution timeout. Add 15 minutes of throttling and it needs 35, so it times out with the work half done. The retry costs more Actions and joins the same queue. Most of the damage in a burst comes from timeouts that were sized for a quiet system, not from the throttling itself.
## If it just has to get done: jitter and long timeouts
Most bulk work doesn't have a real deadline. If it's fine for everything to finish within a day, don't fight the limit. Spread the work across a window that fits under it.
Pick a target rate below the limit, leaving room for everything else in the namespace. Then divide:
```
window = total Actions / target APS
= 4,000,000 / 250
≈ 4.5 hours
```
Give each workflow a random [Start Delay](https://docs.temporal.io/workflow-execution/timers-delays) inside that window. Temporal [generally recommends not setting workflow timeouts at all](https://docs.temporal.io/encyclopedia/detecting-workflow-failures). If you do set one, remember that it starts counting when the workflow is created, not when the delay ends, so it has to be longer than the window plus the run time:
```go
window := 6 * time.Hour
opts := client.StartWorkflowOptions{
ID: "reconcile-" + resourceID,
TaskQueue: "bulk",
// Spread starts evenly across the window.
StartDelay: time.Duration(rand.Int63n(int64(window))),
// Optional. If set, it counts from creation, so it must cover
// the delay, the work and any throttling along the way.
WorkflowExecutionTimeout: 24 * time.Hour,
}
```
Inside the workflow, bound each activity attempt with a Start-To-Close timeout and let retries with exponential backoff handle failures. Leave Schedule-To-Start unset, and keep any Schedule-To-Close generous, so a throttled stretch slows activities down instead of failing them.
One catch: Start Delay defers the workflow's first task, not the start request. Two hundred thousand start calls in one loop still hit the API together. Put a simple rate limiter in front of the starter as well.
You pay for exactly the Actions you use, and the burst never shows up as an incident.
## If it has a deadline: provision for it
Sometimes the work does need to finish soon. A customer is waiting, or the next stage can't start until this one is done. Then you need real headroom, and on Temporal Cloud that's [Provisioned Capacity](https://docs.temporal.io/cloud/capacity-modes).
You buy capacity in Temporal Resource Units (TRUs). Each TRU gives 500 APS, and you can choose 2, 3, 4, 6, 8, 10 or 12 of them. Temporal aims to provision new capacity within about two minutes, and you can change the count hourly.
Size it from the deadline:
```
required APS = total Actions / deadline
= 4,000,000 / 1,800 s
≈ 2,200 APS → 5 TRUs → round up to 6
```
Provisioning isn't free when idle. Every TRU after the first carries a [minimum of 360,000 Actions per hour](https://docs.temporal.io/cloud/capacity-modes). So raise capacity just before a planned burst and bring it back down after, rather than leaving it on.
Keep a little jitter even here. A few seconds of spread stops every workflow from hitting the API in the same instant.
## The rule I use
| The work… | Do this |
| --- | --- |
| Can finish any time within hours or a day | Random Start Delay over a window, long timeouts, a rate-limited starter |
| Has a deadline measured in minutes | Provisioned Capacity sized as Actions ÷ deadline, raised ahead of time, plus a little jitter |
| Grows steadily rather than spiking | Leave it on On-Demand; it will follow you up |
Throughput costs money, and time is often cheaper. Before reaching for more capacity, ask whether anyone needs the answer before tomorrow.