Skip to content

Commit d88cc55

Browse files
authored
workflows: cpu time updates (cloudflare#21135)
1 parent 1a878eb commit d88cc55

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

src/content/docs/workflows/reference/limits.mdx

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar:
66

77
---
88

9-
import { Render } from "~/components"
9+
import { Render, WranglerConfig } from "~/components"
1010

1111
Limits that apply to authoring, deploying, and running Workflows are detailed below.
1212

@@ -16,7 +16,7 @@ Many limits are inherited from those applied to Workers scripts and as documente
1616
| ----------------------------------------- | ----------------------- | --------------------- |
1717
| Workflow class definitions per script | 3MB max script size per [Worker size limits](/workers/platform/limits/#account-plan-limits) | 10MB max script size per [Worker size limits](/workers/platform/limits/#account-plan-limits)
1818
| Total scripts per account | 100 | 500 (shared with [Worker script limits](/workers/platform/limits/#account-plan-limits) |
19-
| Compute time per step [^3] | 10 seconds | 30 seconds of [active CPU time](/workers/platform/limits/#cpu-time) |
19+
| Compute time per step [^3] | 10 seconds | 30 seconds (default) / configurable to 5 minutes of [active CPU time](/workers/platform/limits/#cpu-time) |
2020
| Duration (wall clock) per step [^3] | Unlimited | Unlimited - for example, waiting on network I/O calls or querying a database |
2121
| Maximum persisted state per step | 1MiB (2^20 bytes) | 1MiB (2^20 bytes) |
2222
| Maximum event [payload size](/workflows/build/events-and-parameters/) | 1MiB (2^20 bytes) | 1MiB (2^20 bytes) |
@@ -35,7 +35,7 @@ Many limits are inherited from those applied to Workers scripts and as documente
3535

3636
[^2]: Workflow state and logs will be retained for 3 days on the Workers Free plan and for 7 days on the Workers Paid plan.
3737

38-
[^3]: A Workflow instance can run forever, as long as each step does not take more than the CPU time limit and the maximum number of steps per Workflow is not reached.
38+
[^3]: A Workflow instance can run forever, as long as each step does not take more than the CPU time limit and the maximum number of steps per Workflow is not reached.
3939

4040
[^4]: Match pattern: _```^[a-zA-Z0-9_][a-zA-Z0-9-_]*$```_
4141

@@ -44,3 +44,25 @@ Many limits are inherited from those applied to Workers scripts and as documente
4444
[^6]: Workflows will return a HTTP 429 rate limited error if you exceed the rate of new Workflow instance creation.
4545

4646
<Render file="limits_increase" product="workers" />
47+
48+
### Increasing Workflow CPU limits
49+
50+
Workflows are Worker scripts, and share the same [per invocation CPU limits](/workers/platform/limits/#worker-limits) as any Workers do. Note that CPU time is active processing time: not time spent waiting on network requests, storage calls, or other general I/O, which don't count towards your CPU time or Workflows compute consumption.
51+
52+
By default, the maximum CPU time per Workflow invocation is set to 30 seconds, but can be increased for all invocations associated with a Workflow definition by setting `limits.cpu_ms` in your Wrangler configuration:
53+
54+
<WranglerConfig>
55+
56+
```jsonc
57+
{
58+
// ...rest of your configuration...
59+
"limits": {
60+
"cpu_ms": 300000, // 300,000 milliseconds = 5 minutes
61+
},
62+
// ...rest of your configuration...
63+
}
64+
```
65+
66+
</WranglerConfig>
67+
68+
To learn more about CPU time and limits, [review the Workers documentation](/workers/platform/limits/#cpu-time).

0 commit comments

Comments
 (0)