workflow 5.8.0 → 5.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/api-reference/workflow/rate-limit.mdx +1 -1
- package/docs/api-reference/workflow-errors/in-band-superseded-error.mdx +5 -1
- package/docs/api-reference/workflow-errors/precondition-failed-error.mdx +6 -4
- package/docs/api-reference/workflow-runtime/world/queue.mdx +5 -1
- package/docs/configuration/runtime-tuning.mdx +468 -168
- package/docs/cookbook/integrations/chat-sdk.mdx +1 -1
- package/docs/performance.mdx +93 -59
- package/docs/worlds/building-a-world.mdx +2 -1
- package/docs/worlds/local.mdx +6 -2
- package/docs/worlds/postgres.mdx +7 -3
- package/docs/worlds/vercel.mdx +2 -2
- package/package.json +11 -11
|
@@ -12,218 +12,409 @@ The runtime reads these variables where workflows execute. Set them on the deplo
|
|
|
12
12
|
|
|
13
13
|
## Client polling
|
|
14
14
|
|
|
15
|
+
| Variable | Default | What it does |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| [`WORKFLOW_RETURN_VALUE_POLL_INTERVAL_MS`](#workflow_return_value_poll_interval_ms) | `1000` ms | Delay between `Run.returnValue` status requests |
|
|
18
|
+
| [`WORKFLOW_RETURN_VALUE_WAIT_MS`](#workflow_return_value_wait_ms) | `50000` ms | Longest a single wait for a terminal run status may block |
|
|
19
|
+
| [`WORKFLOW_RETURN_VALUE_MAX_LONG_POLLS`](#workflow_return_value_max_long_polls) | `10` | Waits before `Run.returnValue` falls back to interval polling |
|
|
20
|
+
| [`WORKFLOW_CHILD_RUN_COMPLETION_HOOK`](#workflow_child_run_completion_hook) | enabled | Parent waits on a child run through a hook instead of polling |
|
|
21
|
+
|
|
15
22
|
### `WORKFLOW_RETURN_VALUE_POLL_INTERVAL_MS`
|
|
16
23
|
|
|
17
24
|
- Default: `1000`
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
|
|
26
|
+
Delay, in milliseconds, between status requests made by [`Run.returnValue`](/docs/api-reference/workflow-api/get-run) while a workflow run is not yet complete. Minimum `1`.
|
|
27
|
+
|
|
28
|
+
Change it when: you want less polling traffic. Increase it, at the cost of noticing completion later.
|
|
29
|
+
|
|
30
|
+
This variable is read by the process awaiting `Run.returnValue`, such as an E2E test runner, rather than by the workflow deployment.
|
|
31
|
+
|
|
32
|
+
Applies whenever the World cannot hold a read open. When it can, the wait below replaces most of this polling and the interval only paces retries.
|
|
33
|
+
|
|
34
|
+
It is also the first delay after a status read fails with a transient World error (a timeout, a 5xx, or a 429). The delay doubles with each consecutive failure up to 30 seconds (or this interval, if longer), and a `Retry-After` from the World raises it, up to 5 minutes. After 10 failures in a row, `Run.returnValue` rejects with the last error. When `Run.returnValue` is awaited inside a step, these retries run within one attempt of that step, which can therefore keep running for about three minutes at the default interval before the step's own retries start.
|
|
23
35
|
|
|
24
36
|
### `WORKFLOW_RETURN_VALUE_WAIT_MS`
|
|
25
37
|
|
|
26
38
|
- Default: `50000`
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
-
|
|
39
|
+
|
|
40
|
+
How long, in milliseconds, a single wait for a terminal run status may block, when the World supports waiting (`world.runs.waitForTerminalStatus()`). Minimum `1`.
|
|
41
|
+
|
|
42
|
+
`Run.returnValue` re-issues the wait until the run finishes, so this bounds one request rather than the total wait.
|
|
43
|
+
|
|
44
|
+
`50000` is the largest value the Vercel World can actually request: it clamps the ask to its 60s per-request HTTP timeout minus 10s of headroom, so the budget always expires as a response carrying the run's current status rather than as a client-side timeout. Raising this alone has no effect; raise [`WORKFLOW_REQUEST_TIMEOUT_MS`](/worlds/vercel#workflow_request_timeout_ms) as well.
|
|
45
|
+
|
|
46
|
+
Read by the process awaiting `Run.returnValue`, like the interval above.
|
|
31
47
|
|
|
32
48
|
### `WORKFLOW_RETURN_VALUE_MAX_LONG_POLLS`
|
|
33
49
|
|
|
34
50
|
- Default: `10`
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
51
|
+
|
|
52
|
+
How many consecutive waits `Run.returnValue` issues before falling back to interval polling for the rest of the await. A wait that fails with a transient World error does not count. Minimum `1`.
|
|
53
|
+
|
|
54
|
+
Change it when: you routinely await long runs. Raise it.
|
|
55
|
+
|
|
56
|
+
It never ends the await. A run that outlives the cap continues waiting on `WORKFLOW_RETURN_VALUE_POLL_INTERVAL_MS` instead. Runs longer than roughly `WORKFLOW_RETURN_VALUE_MAX_LONG_POLLS` x `WORKFLOW_RETURN_VALUE_WAIT_MS` therefore spend most of their life interval polling, which costs more requests than continuing to wait would.
|
|
57
|
+
|
|
58
|
+
Read by the process awaiting `Run.returnValue`, like the interval above.
|
|
40
59
|
|
|
41
60
|
### `WORKFLOW_CHILD_RUN_COMPLETION_HOOK`
|
|
42
61
|
|
|
43
62
|
- Default: enabled
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
63
|
+
|
|
64
|
+
Whether, inside a workflow, awaiting `returnValue` of a run that workflow started suspends the parent on a system hook the child resumes when it finishes, instead of polling. See [Child Workflows](/cookbook/advanced/child-workflows#how-the-parent-waits).
|
|
65
|
+
|
|
66
|
+
Set to `0` or `false` to stop `start()` from marking new child runs for the hook, so their parents poll `returnValue` inside a step on the variables above.
|
|
67
|
+
|
|
68
|
+
Read by the deployment calling `start()` from a workflow. A child already marked keeps resuming its parent, so a parent waiting on it is never stranded.
|
|
47
69
|
|
|
48
70
|
## Replay and queue delivery
|
|
49
71
|
|
|
72
|
+
| Variable | Default | What it does |
|
|
73
|
+
| --- | --- | --- |
|
|
74
|
+
| [`WORKFLOW_REPLAY_TIMEOUT_MS`](#workflow_replay_timeout_ms) | `240000` ms | Replay and orchestration time budget per handler invocation |
|
|
75
|
+
| [`WORKFLOW_REPLAY_TIMEOUT_MAX_RETRIES`](#workflow_replay_timeout_max_retries) | `3` | Replay timeouts before the run fails with `REPLAY_TIMEOUT` |
|
|
76
|
+
| [`WORKFLOW_MAX_QUEUE_DELIVERIES`](#workflow_max_queue_deliveries) | `48` | Orchestrator delivery attempts before a run fails |
|
|
77
|
+
| [`WORKFLOW_QUEUE_AUTH`](#workflow_queue_auth) | `on` | Local and loopback Worlds only: flow route accepts only the app's own deliveries |
|
|
78
|
+
| [`WORKFLOW_MAX_EVENTS`](#workflow_max_events) | `25000` | Local World event limit and default `events.list()` page size |
|
|
79
|
+
| [`WORKFLOW_REPLAY_DIVERGENCE_MAX_RETRIES`](#workflow_replay_divergence_max_retries) | `3` | Recovery replays before replay divergence is recorded as corruption |
|
|
80
|
+
| [`WORKFLOW_DEPLOYMENT_MISMATCH_MAX_RETRIES`](#workflow_deployment_mismatch_max_retries) | `3` | Re-routes to a run's pinned deployment before the run fails |
|
|
81
|
+
| [`WORKFLOW_OPEN_WAIT_CLOCK_SKEW_MS`](#workflow_open_wait_clock_skew_ms) | `30000` ms | Clock-skew allowance when a pending wait decides whether the orchestrator runs ahead |
|
|
82
|
+
| [`WORKFLOW_PRECONDITION_MAX_INPROCESS_RESTARTS`](#workflow_precondition_max_inprocess_restarts) | `3` | In-process replay restarts after a rejected event creation |
|
|
83
|
+
| [`WORKFLOW_PRECONDITION_MAX_REINVOCATIONS`](#workflow_precondition_max_reinvocations) | `5` | Re-invocations per run after rejected event creations |
|
|
84
|
+
| [`WORKFLOW_PRECONDITION_REINVOKE_DELAY_SECONDS`](#workflow_precondition_reinvoke_delay_seconds) | `2` s | Delay before such a re-invocation |
|
|
85
|
+
|
|
50
86
|
### `WORKFLOW_REPLAY_TIMEOUT_MS`
|
|
51
87
|
|
|
52
88
|
- Default: `240000`
|
|
53
|
-
- Clamp: `30000` to `780000`
|
|
54
|
-
- Charged time budget for replay and orchestration work in one handler invocation.
|
|
55
|
-
- Covers loading events, re-running the workflow function, resolving suspensions, and scheduling follow-up work.
|
|
56
|
-
- Does not include time spent inside inline `"use step"` bodies. Steps are bounded by the platform function duration instead.
|
|
57
89
|
|
|
58
|
-
|
|
90
|
+
Charged time budget, in milliseconds, for replay and orchestration work in one handler invocation. Clamped to `30000`-`780000`.
|
|
91
|
+
|
|
92
|
+
Covers loading events, re-running the workflow function, resolving suspensions, and scheduling follow-up work.
|
|
93
|
+
|
|
94
|
+
Does not include time spent inside inline `"use step"` bodies. Steps are bounded by the platform function duration instead. For example, a workflow can run a 10-minute inline step even with `WORKFLOW_REPLAY_TIMEOUT_MS=300000`, because the replay budget is paused while the step body runs.
|
|
59
95
|
|
|
60
96
|
### `WORKFLOW_REPLAY_TIMEOUT_MAX_RETRIES`
|
|
61
97
|
|
|
62
98
|
- Default: `3`
|
|
63
|
-
|
|
99
|
+
|
|
100
|
+
Queue deliveries that may hit the replay timeout before the run is failed with `REPLAY_TIMEOUT`.
|
|
64
101
|
|
|
65
102
|
### `WORKFLOW_MAX_QUEUE_DELIVERIES`
|
|
66
103
|
|
|
67
104
|
- Default: `48`
|
|
68
|
-
|
|
69
|
-
|
|
105
|
+
|
|
106
|
+
Delivery attempts of a run's [orchestrator](#orchestrator) messages before the run is failed gracefully.
|
|
107
|
+
|
|
108
|
+
A delivery the [in-band fence](/docs/api-reference/workflow-errors/in-band-superseded-error) refuses counts, so a run whose every write is refused fails instead of looping. A step's queue message retries in place and is bounded by the step's `maxRetries` instead. Past this cap, a step that shows no activity for an hour (every delivery fails before the step starts, for example because its input cannot be read) fails with a catchable `FatalError` naming `MAX_DELIVERIES_EXCEEDED`.
|
|
109
|
+
|
|
110
|
+
Can only be lowered. Workflow calibrates the default to record failure before the queue expires the message.
|
|
111
|
+
|
|
112
|
+
<Spec8Note>
|
|
113
|
+
every delivery of a run's or a step's queue message counts, and the run or step is failed gracefully once it reaches the cap.
|
|
114
|
+
</Spec8Note>
|
|
70
115
|
|
|
71
116
|
### `WORKFLOW_QUEUE_AUTH`
|
|
72
117
|
|
|
73
118
|
- Default: `on`
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
119
|
+
|
|
120
|
+
On the [Local World](/worlds/local) and any World that declares `queueAuthMode: 'loopback'`, whether the Workflow SDK's flow route (`POST /.well-known/workflow/v1/flow`) accepts only deliveries sent by the app's own processes. Other Worlds are not protected by it. Any value other than `off` leaves the check on.
|
|
121
|
+
|
|
122
|
+
A World that declares nothing is not checked; the runtime logs a warning when its flow route starts (once, then at most once a minute when routes restart). Worlds that declare `queueAuthMode: 'skip'` are not checked and are not affected. A queue consumer's own route (built with `world.createQueueHandler()` and registered with `registerRoute()`) is not checked; it must authenticate deliveries itself, or sit behind the network edge.
|
|
123
|
+
|
|
124
|
+
The [Vercel World](/worlds/vercel) delivers to a route only Vercel Queues can trigger (see its [security section](/worlds/vercel#security)). The [Postgres World](/worlds/postgres) relies on its database credentials to control who can enqueue, and its flow route accepts any well-formed request, so protect that route at the network edge, as its [security section](/worlds/postgres#protect-the-queue-route) describes.
|
|
125
|
+
|
|
126
|
+
Change it when: a process that cannot read the app's data directory has to send deliveries. If the sender is the CLI or the web UI, point it at the app's data directory (`WORKFLOW_LOCAL_DATA_DIR`) instead. Set `off` on the app only when that isn't possible. `off` accepts unauthenticated deliveries, so use it only for local development or on a trusted network. The runtime logs a warning when a route starts with `off`.
|
|
127
|
+
|
|
128
|
+
`off` is refused while [dynamic workflows](/docs/advanced/dynamic-workflows) are enabled (`WORKFLOW_EXPERIMENTAL_DYNAMIC_WORKFLOWS`). Both variables are read on every delivery, so the check comes back on as soon as dynamic workflows are enabled.
|
|
129
|
+
|
|
130
|
+
Every delivery the Local World sends carries the app's queue key. The route refuses a request that does not carry the key with a `401`, before it reads the body, and does not touch any run. A request from outside the app therefore cannot start a run, fail a running one, re-trigger a step, or replay a delivery.
|
|
131
|
+
|
|
132
|
+
The key is a random value in the file `queue-auth-key` in the Local World's data directory, readable only by its owner (Windows does not enforce that the same way). The app writes a new key each time it starts, before it sends any delivery, and the data directory gets a `.gitignore` that keeps the key out of git. See [the Local World's data directory](/worlds/local#data-directory-layout).
|
|
133
|
+
|
|
134
|
+
The usual setups need nothing: the app's own queue, the CLI, the web UI, a script calling `start()` or `resumeHook()`, and several app processes all use the same data directory, so they send a key the app accepts. Point the CLI and the web UI at the app's data directory (`WORKFLOW_LOCAL_DATA_DIR`).
|
|
135
|
+
|
|
136
|
+
The `401` is marked as the runtime's own refusal (an `x-workflow-auth-refused: 1` header). The Local World's queue then reads the key file again: if another process wrote a new key, it retries at once with that key. Otherwise it retries a few times with its short backoff, then logs one line and gives the message up. A refused delivery reaches no handler and touches no run, so retrying it is safe and it does not count as an attempt. A given-up message's run is left as it was. A `401` without the marker, for example from a proxy, gets the queue's normal retries.
|
|
137
|
+
|
|
138
|
+
Each refusal increments the OpenTelemetry counter `workflow.queue.delivery.refused` (when a meter provider is registered). Its attributes are `workflow.world`, `http.route`, and `workflow.queue.refusal_reason` (`no-key` or `wrong-key`). A refusal right after the app, the CLI or a script starts is expected: it wrote a new key, and the sender reloads it and retries on its own. Alert on refusals that persist, which mean forged requests or a sender that cannot get the app's key. The refusal log is rate-limited to one line a minute per process; the counter counts every refusal.
|
|
83
139
|
|
|
84
140
|
### `WORKFLOW_MAX_EVENTS`
|
|
85
141
|
|
|
86
142
|
- Default: `25000`
|
|
87
|
-
|
|
88
|
-
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
143
|
+
|
|
144
|
+
Positive-integer event limit reported by the Local World and enforced by the runtime as `MAX_EVENTS_EXCEEDED`. Invalid or non-positive values fall back to the default.
|
|
145
|
+
|
|
146
|
+
The Local and Postgres Worlds also use it as the maximum number of events returned when `events.list()` is called without a limit. If more events exist, the response includes `hasMore: true` and a continuation cursor.
|
|
147
|
+
|
|
148
|
+
The Vercel World receives its event limit from the service; this environment variable does not override that service-owned value. See [Vercel World limits](/worlds/vercel#per-run-limits).
|
|
149
|
+
|
|
150
|
+
Runs started on the QuickJS engine with snapshotting enabled (see [`WORKFLOW_SNAPSHOT_THRESHOLD`](#workflow_snapshot_threshold)) are exempt from this limit on the Local and Vercel Worlds. See [max-events-exceeded](/docs/errors/max-events-exceeded).
|
|
92
151
|
|
|
93
152
|
### `WORKFLOW_REPLAY_DIVERGENCE_MAX_RETRIES`
|
|
94
153
|
|
|
95
154
|
- Default: `3`
|
|
96
|
-
|
|
155
|
+
|
|
156
|
+
Recovery replays before replay divergence is recorded as corruption.
|
|
157
|
+
|
|
158
|
+
On the Node.js VM engine, a recovery replay reloads the event log and replays from scratch in a fresh VM in the same delivery. Once the budget is spent, the run fails with [`CORRUPTED_EVENT_LOG`](/docs/errors/corrupted-event-log). A redelivery starts the count again, and `WORKFLOW_MAX_QUEUE_DELIVERIES` bounds it.
|
|
159
|
+
|
|
160
|
+
<Spec8Note>
|
|
161
|
+
each recovery replay is queued as a new delivery of the run.
|
|
162
|
+
</Spec8Note>
|
|
97
163
|
|
|
98
164
|
### `WORKFLOW_DEPLOYMENT_MISMATCH_MAX_RETRIES`
|
|
99
165
|
|
|
100
166
|
- Default: `3`
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
-
|
|
167
|
+
|
|
168
|
+
Times a delivery that reached a deployment other than the one its run is pinned to is re-routed to that deployment before the run is failed with [`DEPLOYMENT_MISMATCH`](/docs/errors/deployment-mismatch). Set to `0` to fail the run on the first misrouted delivery.
|
|
169
|
+
|
|
170
|
+
Re-routed deliveries back off exponentially (1s, 2s, 4s).
|
|
171
|
+
|
|
172
|
+
Only applies to Worlds with atomic, immutable deployments (the Vercel World). A run whose pinned deployment cannot be reached at all fails immediately regardless of this value.
|
|
173
|
+
|
|
174
|
+
Transient or unknown queue publishing failures use normal queue redelivery and do not consume this budget.
|
|
105
175
|
|
|
106
176
|
### `WORKFLOW_OPEN_WAIT_CLOCK_SKEW_MS`
|
|
107
177
|
|
|
108
178
|
- Default: `30000` (30 seconds)
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
179
|
+
|
|
180
|
+
Allowance for clock skew between the runtime and the wait timer, used when deciding whether a pending wait stops the orchestrator from [running ahead](#workflow_run_ahead_depth) of its writes. Must be a finite integer; `Infinity` is rejected and falls back to the default.
|
|
181
|
+
|
|
182
|
+
A pending wait (a `sleep()` whose timer has not fired, including one that lost a `Promise.race()` against a hook) stops run-ahead at a boundary only if its target time falls within this allowance of now (at least 1 second), and before the end of the invocation's inline window ([`WORKFLOW_V2_TIMEOUT_MS`](#workflow_v2_timeout_ms), which is otherwise derived from the platform's function deadline and tops out at 10 minutes) plus this allowance. A wait due later still completes on time; its `wait_completed` is written after the writes in flight. A `wait_created` whose target time cannot be read is treated as due now.
|
|
183
|
+
|
|
184
|
+
Turbo's forced optimistic start is unaffected: any open wait keeps it off, whatever the target time.
|
|
185
|
+
|
|
186
|
+
<Spec8Note>
|
|
187
|
+
a pending wait whose target time falls before the end of the inline window plus this allowance keeps the per-step event-log delta optimization off instead, and a wait due later does not cost the extra `events.list()` per step. Before an invocation parks on a wait over a log it last extended from a step's inline delta, it re-reads the log once, so a wait completed early through `run.wakeUp()` (the dashboard's "cancel sleeps" action) is acted on then rather than when the wait's own timer would have fired. `31536000000` (one year) gates on any pending wait. Open hooks gate regardless of this setting.
|
|
188
|
+
</Spec8Note>
|
|
113
189
|
|
|
114
190
|
### Stale reads, and why nothing has to be rejected
|
|
115
191
|
|
|
116
192
|
- Not a variable: this is how a replay working from an out-of-date event log stays correct, and why no World needs a precondition guard to make it so.
|
|
117
193
|
- Three properties work together. A reader's log is always a **prefix** of the run's log, never a prefix with a hole in it. The World allocates positions at commit, so nothing lands behind a position a reader has already passed. Replay is **deterministic on a prefix**: the same prefix always yields the same decisions, so a shorter log does not mean a different run, only a run that has not caught up. Every write **reports what it missed**: a creation names the position it replayed from (`eventCount`), and the World returns the events occupying the positions it was pushed past. The replay merges those and continues, correcting itself on the write rather than on a read.
|
|
118
194
|
- So a stale replay costs a merge, not a rejection. None of the shipped Worlds refuses a write for being stale.
|
|
119
|
-
-
|
|
120
|
-
|
|
121
|
-
|
|
195
|
+
- One orchestrator invocation at a time writes a run's decisions. The World refuses a write only from an invocation another one has superseded, with [`InBandSupersededError`](/docs/api-reference/workflow-errors/in-band-superseded-error), and the runtime handles that refusal itself.
|
|
196
|
+
|
|
197
|
+
<Spec8Note>
|
|
198
|
+
every queue delivery replays the run and writes its own decisions, and a World *may* refuse a stale write with 412 ([`PreconditionFailedError`](/docs/api-reference/workflow-errors/precondition-failed-error)). This is appropriate when it allocates positions somewhere other than the commit and cannot report a gap reliably. A World that does refuse should only ever do so on evidence, and accept the write in every other case: a rejection then always means the position was stale, while the absence of one proves nothing about currency. The runtime restarts the replay in the same invocation from a corrected event log, and falls back to a re-invocation with a fresh replay after spending the restart budget below. It never retries the rejected write as-is, because a replay working from a corrected log derives different events.
|
|
199
|
+
|
|
200
|
+
Two runtime behaviors follow from the properties above rather than from any fence. The per-step event-log delta optimization (consuming the delta returned by a step's terminal write instead of issuing an extra `events.list` per step) stays active while the run has an open hook: a `hook_received` event missed by the delta window is observed one iteration later, and the next write brings it back. While a hook is open, inline steps take the await-then-run path even when optimistic inline start is enabled. Several invocations race for one step's claim there, and awaiting it means the body runs only for the writer that won.
|
|
201
|
+
</Spec8Note>
|
|
202
|
+
|
|
203
|
+
The `WORKFLOW_PRECONDITION_*` settings below have no effect on runs that use the in-band fence.
|
|
204
|
+
|
|
205
|
+
<Spec8Note>
|
|
206
|
+
the runtime reads the `WORKFLOW_PRECONDITION_*` settings when a World refuses a stale write.
|
|
207
|
+
</Spec8Note>
|
|
122
208
|
|
|
123
209
|
### `WORKFLOW_PRECONDITION_MAX_INPROCESS_RESTARTS`
|
|
124
210
|
|
|
125
211
|
- Default: `3`
|
|
126
|
-
|
|
127
|
-
|
|
212
|
+
|
|
213
|
+
How many times a single invocation restarts its replay in-process after an event creation is [rejected as stale](#stale-reads-and-why-nothing-has-to-be-rejected) before it falls back to a re-invocation. No shipped World rejects one, so this budget is reserved for a World that chooses to.
|
|
214
|
+
|
|
215
|
+
A restart reloads the event log and rebuilds the workflow from scratch, so it costs a replay but no queue round trip. A World may attach the missing events to its rejection, in which case the first restart needs no event-log request at all.
|
|
128
216
|
|
|
129
217
|
### `WORKFLOW_PRECONDITION_MAX_REINVOCATIONS`
|
|
130
218
|
|
|
131
219
|
- Default: `5`
|
|
132
|
-
|
|
133
|
-
|
|
220
|
+
|
|
221
|
+
How many re-invocations one run may spend on rejected event creations before it is failed with `RUNTIME_ERROR`.
|
|
222
|
+
|
|
223
|
+
Counted on the run's queue messages rather than per invocation, because a re-invocation enqueues a fresh message and so restarts the ordinary delivery count. Without this budget a run whose event log keeps growing faster than it can be read would cycle indefinitely.
|
|
134
224
|
|
|
135
225
|
### `WORKFLOW_PRECONDITION_REINVOKE_DELAY_SECONDS`
|
|
136
226
|
|
|
137
227
|
- Default: `2`
|
|
138
|
-
|
|
139
|
-
|
|
228
|
+
|
|
229
|
+
Delay, in seconds, before a re-invocation caused by a rejected event creation.
|
|
230
|
+
|
|
231
|
+
Unlike an in-process restart, which re-reads immediately, a re-invocation only happens after the in-process budget fails to catch up. The delay gives the other writers time to quiesce.
|
|
140
232
|
|
|
141
233
|
## Inline execution
|
|
142
234
|
|
|
235
|
+
| Variable | Default | What it does |
|
|
236
|
+
| --- | --- | --- |
|
|
237
|
+
| [`WORKFLOW_V2_TIMEOUT_MS`](#workflow_v2_timeout_ms) | derived from the runtime deadline (`120000`-`600000` ms) | Wall-clock guard for the inline replay loop |
|
|
238
|
+
| [`WORKFLOW_MAX_INLINE_STEPS`](#workflow_max_inline_steps) | `3` | New steps one invocation runs inline in parallel |
|
|
239
|
+
| [`WORKFLOW_TURBO`](#workflow_turbo) | enabled | Fast path for a run's first delivery |
|
|
240
|
+
| [`WORKFLOW_OPTIMISTIC_INLINE_START`](#workflow_optimistic_inline_start) | unset | `0` makes first-delivery and run-ahead step bodies wait for their start to commit |
|
|
241
|
+
| [`WORKFLOW_OPTIMISTIC_BACKGROUND_START`](#workflow_optimistic_background_start) | unset | Starts background step bodies before `step_started` commits |
|
|
242
|
+
| [`WORKFLOW_INLINE_STEP_DEADLINE_MARGIN_MS`](#workflow_inline_step_deadline_margin_ms) | `60000` ms | When the orchestrator stops starting inline steps |
|
|
243
|
+
| [`WORKFLOW_RUN_AHEAD_DEPTH`](#workflow_run_ahead_depth) | `10` | Unconfirmed inline step outcomes allowed at once |
|
|
244
|
+
| [`WORKFLOW_RETAINED_VM`](#workflow_retained_vm) | enabled | Keeps the Node.js workflow VM alive across inline steps |
|
|
245
|
+
| [`WORKFLOW_INLINE_OWNERSHIP_LEASE_SECONDS`](#workflow_inline_ownership_lease_seconds) | `860` s | How long an inline step's owner is assumed to still be running it |
|
|
246
|
+
|
|
143
247
|
### `WORKFLOW_V2_TIMEOUT_MS`
|
|
144
248
|
|
|
145
249
|
- Default: derived from the runtime deadline. The value is `600000` when the invocation has 25 minutes or more left, `300000` when it has 10 minutes or more, and `120000` otherwise.
|
|
146
|
-
|
|
147
|
-
- Once elapsed, the handler requeues the workflow instead of continuing to run more inline work in the same invocation.
|
|
148
|
-
|
|
250
|
+
|
|
251
|
+
Wall-clock guard, in milliseconds, for the inline replay loop. Once elapsed, the handler requeues the workflow instead of continuing to run more inline work in the same invocation.
|
|
252
|
+
|
|
253
|
+
The default comes from `World.getRuntimeDeadline()`, so raising a function's `maxDuration` widens the inline budget without configuration. Worlds that do not report a deadline get the flat `120000`. Setting this variable to a finite positive number overrides the tiering entirely.
|
|
149
254
|
|
|
150
255
|
### `WORKFLOW_MAX_INLINE_STEPS`
|
|
151
256
|
|
|
152
257
|
- Default: `3`
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
258
|
+
|
|
259
|
+
Number of newly-created steps one invocation runs inline in parallel before queueing the rest. Inline steps already open or running count against it. Values above `16` are clamped to `16`; a negative value or a non-integer uses the default. `0` queues every step.
|
|
260
|
+
|
|
261
|
+
Steps created while a new hook waits on its registration (`hook.getConflict()`), or within [`WORKFLOW_INLINE_STEP_DEADLINE_MARGIN_MS`](#workflow_inline_step_deadline_margin_ms) of the end of the inline window, are queued. A step runs inline at most once: its retry runs from its own queue message.
|
|
262
|
+
|
|
263
|
+
<Spec8Note>
|
|
264
|
+
the runtime treats `0` as unset and uses the default. Steps started beside an awaited hook registration count against the same cap. They are held for the pass that observes the registration and then run inline on it, so the registration still precedes them; only the steps past the cap are queued.
|
|
265
|
+
</Spec8Note>
|
|
156
266
|
|
|
157
267
|
### `WORKFLOW_TURBO`
|
|
158
268
|
|
|
159
269
|
- Default: enabled
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
270
|
+
|
|
271
|
+
Fast path for a run's first delivery. Set `0` or `false` to disable, including for runs started with `start({ experimental_hook })`.
|
|
272
|
+
|
|
273
|
+
Applies only while that delivery's queue message is at most 15 seconds old. An older one, such as a platform re-running a crashed invocation, loads the event log first.
|
|
274
|
+
|
|
275
|
+
It stops forcing optimistic inline step start once the run creates a hook or wait.
|
|
276
|
+
|
|
277
|
+
A run started with `start({ experimental_hook })` never runs steps before `run_started` returns, but its first delivery still writes `run_started` without loading the event log first.
|
|
278
|
+
|
|
279
|
+
<Spec8Note>
|
|
280
|
+
the queue message's age is not checked.
|
|
281
|
+
</Spec8Note>
|
|
165
282
|
|
|
166
283
|
### `WORKFLOW_OPTIMISTIC_INLINE_START`
|
|
167
284
|
|
|
168
|
-
- Default:
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
285
|
+
- Default: unset
|
|
286
|
+
|
|
287
|
+
Inline step bodies start before their `step_started` event is confirmed only on a run's first delivery under `WORKFLOW_TURBO`, and while the orchestrator [runs ahead](#workflow_run_ahead_depth) of its writes. Set `0` or `false` to make those bodies wait for their start to commit, and to override [`WORKFLOW_OPTIMISTIC_BACKGROUND_START`](#workflow_optimistic_background_start). No other value has an effect.
|
|
288
|
+
|
|
289
|
+
Those are the only cases where the runtime knows no other writer can change the run.
|
|
290
|
+
|
|
291
|
+
<Spec8Note>
|
|
292
|
+
`1` or `true` starts every inline step body before its `step_started` is confirmed. Use it only when step side effects are idempotent.
|
|
293
|
+
</Spec8Note>
|
|
294
|
+
|
|
295
|
+
### `WORKFLOW_OPTIMISTIC_BACKGROUND_START`
|
|
296
|
+
|
|
297
|
+
- Default: unset
|
|
298
|
+
|
|
299
|
+
Starts a background step's body before its `step_started` commits, on its message's first delivery, saving one round trip. Set `1` or `true` to enable it. Use only when background step bodies are idempotent.
|
|
300
|
+
|
|
301
|
+
A step queued before `run.cancel()` then still runs its body. Steps with `maxRetries: 0` and redeliveries always wait for their start to commit.
|
|
302
|
+
|
|
303
|
+
<Spec8Note>
|
|
304
|
+
the runtime ignores this setting.
|
|
305
|
+
</Spec8Note>
|
|
306
|
+
|
|
307
|
+
### `WORKFLOW_INLINE_STEP_DEADLINE_MARGIN_MS`
|
|
308
|
+
|
|
309
|
+
- Default: `60000`
|
|
310
|
+
|
|
311
|
+
How long, in milliseconds, before the inline window ([`WORKFLOW_V2_TIMEOUT_MS`](#workflow_v2_timeout_ms)) ends the orchestrator stops starting inline steps. Steps created inside the margin are queued.
|
|
312
|
+
|
|
313
|
+
<Spec8Note>
|
|
314
|
+
the runtime ignores this setting.
|
|
315
|
+
</Spec8Note>
|
|
316
|
+
|
|
317
|
+
### `WORKFLOW_RUN_AHEAD_DEPTH`
|
|
318
|
+
|
|
319
|
+
- Default: `10`
|
|
320
|
+
|
|
321
|
+
Maximum number of inline step outcomes that may be unconfirmed at once while the orchestrator runs ahead of its writes. Clamped to `0`-`16`; `0` disables run-ahead. Node.js VM engine only.
|
|
322
|
+
|
|
323
|
+
When no other writer could change what the workflow does next (no awaited hook, no `AbortController`, no step running elsewhere, no wait due), an inline step's outcome reaches the workflow when its body returns, before its write commits. Writes still land in order.
|
|
324
|
+
|
|
325
|
+
<Spec8Note>
|
|
326
|
+
the orchestrator never runs ahead of its writes, and the runtime ignores this setting.
|
|
327
|
+
</Spec8Note>
|
|
172
328
|
|
|
173
329
|
### `WORKFLOW_RETAINED_VM`
|
|
174
330
|
|
|
175
331
|
- Default: enabled
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
332
|
+
|
|
333
|
+
Node.js VM engine only. Keeps the suspended workflow VM alive across inline steps within one invocation, so each iteration of the inline loop appends only the newly written events instead of replaying the whole event log in a fresh VM. Set `0` or `false` to replay the Node.js workflow from scratch in a fresh VM on every iteration.
|
|
334
|
+
|
|
335
|
+
QuickJS manages its own retained inline loop independently of this setting.
|
|
336
|
+
|
|
337
|
+
A step- or attribute-driven suspension can keep the VM retained even when hooks or waits are open or created at the same boundary. Hook- or wait-only suspensions park the invocation because nothing in the current delivery can advance them, with one exception: when the hook's own create is what the workflow is waiting on (a `hook.getConflict()` awaiter, or a create whose token is already claimed), the invocation resumes the retained VM over the committed `hook_created` or `hook_conflict` instead of re-invoking through the queue. Any replay divergence falls back to a full replay.
|
|
338
|
+
|
|
339
|
+
Step inputs made of plain data (objects, arrays, primitives) and standard built-ins (`Map`, `Set`, `Date`, `RegExp`, typed arrays, `ArrayBuffer`, `URL`, `Headers`) keep the VM retained. Patching or polyfilling built-in prototypes doesn't change that because serialization never calls them. A boundary falls back to a full replay only when serializing its arguments runs code the workflow controls, such as a getter, a proxy, or a custom class serializer, or computes an `Error`'s stack trace.
|
|
180
340
|
|
|
181
341
|
### `WORKFLOW_INLINE_OWNERSHIP_LEASE_SECONDS`
|
|
182
342
|
|
|
183
343
|
- Default: `860`
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
344
|
+
|
|
345
|
+
How long, in seconds, after an inline step's latest `step_started` other invocations assume its owner may still be executing the body. Clamped to `1`-`900`.
|
|
346
|
+
|
|
347
|
+
Change it when: your self-hosted multi-instance deployment runs inline steps longer than the default. Raise it. The default is sized for Vercel's function duration ceiling.
|
|
348
|
+
|
|
349
|
+
Within the lease, other invocations defer the step's backstop message; past it they enqueue immediately.
|
|
350
|
+
|
|
351
|
+
<Spec8Note>
|
|
352
|
+
the runtime reads this setting only for these runs. Runs that use the in-band fence have no backstop messages, because an inline step belongs to the orchestrator invocation that created it.
|
|
353
|
+
</Spec8Note>
|
|
187
354
|
|
|
188
355
|
## Workflow VM engine
|
|
189
356
|
|
|
357
|
+
| Variable | Default | What it does |
|
|
358
|
+
| --- | --- | --- |
|
|
359
|
+
| [`WORKFLOW_VM`](#workflow_vm) | `node` | Engine that runs workflow functions: `node` or `quickjs` |
|
|
360
|
+
| [`WORKFLOW_QUICKJS_BASELINE_SNAPSHOT`](#workflow_quickjs_baseline_snapshot) | enabled | Restores a snapshot of the evaluated bundle instead of re-evaluating it |
|
|
361
|
+
| [`WORKFLOW_SNAPSHOT_THRESHOLD`](#workflow_snapshot_threshold) | `1000` with QuickJS | Events between QuickJS VM-memory snapshots; `0` disables |
|
|
362
|
+
| [`WORKFLOW_SNAPSHOT_ALLOW_UNENCRYPTED`](#workflow_snapshot_allow_unencrypted) | disabled | Snapshots runs without an encryption key |
|
|
363
|
+
|
|
190
364
|
### `WORKFLOW_VM`
|
|
191
365
|
|
|
192
366
|
- Default: `node`
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
-
|
|
367
|
+
|
|
368
|
+
Selects the sandboxed VM engine that executes workflow functions (`"use workflow"`): `node` or `quickjs`. An unknown value throws when `start()` creates a run, or when the workflow handler picks the engine for a run that has none stamped. Step functions are unaffected and always run with full Node.js access.
|
|
369
|
+
|
|
370
|
+
Change it when: you run long-running workflows. Use `quickjs` for agents, chat sessions, and loops that wait on hooks or sleeps, or any run with many steps. To switch, set `WORKFLOW_VM=quickjs` in the environment that starts runs, and runs started after that use QuickJS.
|
|
371
|
+
|
|
372
|
+
`node` (default) runs workflow code in a [`node:vm`](https://nodejs.org/api/vm.html) context. Every resume replays the run's full event log, so resume cost grows with the log, and runs are subject to the World's default [per-run event limit](/docs/errors/max-events-exceeded).
|
|
373
|
+
|
|
374
|
+
`quickjs` runs workflow code in a [QuickJS](https://github.com/quickjs-ng/quickjs) VM compiled to WebAssembly (via [`quickjs-wasi`](https://github.com/vercel-labs/quickjs-wasi)). With snapshotting (on by default for encrypted runs, see [`WORKFLOW_SNAPSHOT_THRESHOLD`](#workflow_snapshot_threshold); on world-local and world-postgres also set [`WORKFLOW_SNAPSHOT_ALLOW_UNENCRYPTED`](#workflow_snapshot_allow_unencrypted)), a run resumes from a VM-memory snapshot and replays only the events recorded since, so resume cost stays roughly flat as the log grows, and the run is exempt from the default per-run event limit on the Local and Vercel Worlds. It also runs on platforms that do not implement `node:vm`.
|
|
375
|
+
|
|
376
|
+
Both engines implement the same event-replay execution model (seeded PRNG, deterministic clock, and correlation-ID sequences are identical), so workflow code that sticks to plain JavaScript and the Workflow APIs runs unchanged. The few globals QuickJS does not provide in workflow functions are listed below.
|
|
377
|
+
|
|
378
|
+
Global-surface differences under `quickjs` apply to workflow functions only. Step functions always have full Node.js, so the fix for each is to move that call into a step:
|
|
379
|
+
|
|
380
|
+
- `crypto.getRandomValues()` and `crypto.randomUUID()` are provided and deterministic (seeded like the node engine's). All `crypto.subtle.*` methods, including `digest`, throw with guidance to move to a step function. The node engine supports `digest`.
|
|
381
|
+
- `Intl` is not available (QuickJS has no ICU). The `Intl.*` constructors throw, and `toLocaleString`-family methods (including `localeCompare`) throw when called **with an explicit locale**. Calling them without arguments keeps the engine default. Perform locale-sensitive formatting in a step function.
|
|
382
|
+
- `WebAssembly` and `Atomics` are not available.
|
|
383
|
+
- `process` exposes only a frozen copy of `env`, matching the node engine.
|
|
384
|
+
|
|
385
|
+
The engine choice is stamped into the run's `executionContext` when the run starts, so a run keeps executing on the engine it started on even if the deployment's `WORKFLOW_VM` changes. Runs without a stamped engine use the handler's `WORKFLOW_VM` value.
|
|
205
386
|
|
|
206
387
|
### `WORKFLOW_QUICKJS_BASELINE_SNAPSHOT`
|
|
207
388
|
|
|
208
389
|
- Default: enabled
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
390
|
+
|
|
391
|
+
Evaluates the workflow bundle once per function instance, snapshots the resulting VM, and restores that snapshot at the start of every invocation instead of re-evaluating the bundle. Only read when `WORKFLOW_VM=quickjs`. Set `0` or `false` to always evaluate the bundle per invocation.
|
|
392
|
+
|
|
393
|
+
This is the dominant share of QuickJS VM startup: roughly 77 ms to 3 ms to first suspension for a 1.3 MB bundle.
|
|
394
|
+
|
|
395
|
+
A bundle whose module scope consumes randomness, reads the clock, or replaces a serialization intrinsic cannot be snapshotted safely. The runtime detects these cases when preparing the snapshot and falls back to per-invocation evaluation.
|
|
213
396
|
|
|
214
397
|
### `WORKFLOW_SNAPSHOT_THRESHOLD`
|
|
215
398
|
|
|
216
399
|
- Default: `1000` when the QuickJS engine is selected
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
400
|
+
|
|
401
|
+
When above `0`, the runtime persists a **VM-memory snapshot** at a suspension once at least this many events have been processed since the last snapshot. A non-negative integer; `0` disables snapshotting, and `1` snapshots at every qualifying suspension.
|
|
402
|
+
|
|
403
|
+
Change it when: you want to opt out and always replay the full event log. Set `0`. To tune the threshold instead, see *Choosing a value* below.
|
|
404
|
+
|
|
405
|
+
Only used by the QuickJS engine (`WORKFLOW_VM=quickjs`), and only with a World that provides snapshot storage (world-local, world-postgres, and world-vercel do).
|
|
406
|
+
|
|
407
|
+
Subsequent invocations restore the VM from the snapshot and replay only the events recorded since, instead of re-executing the workflow from the top against the full event log. Short-lived runs below the threshold never pay the snapshot cost; long-running or unbounded runs stop scaling their resume cost with total event-log length.
|
|
408
|
+
|
|
409
|
+
Choosing a value: a restore costs roughly the same regardless of log length (tens of milliseconds to decompress and restore the heap, plus fetching the snapshot), while a full replay grows with the log (tens of milliseconds at a few hundred events, seconds at several thousand). Restoring starts to pay off at a few hundred events, so values in the hundreds suit most long-running workflows. Very low values mostly add snapshot saves to runs that replay quickly anyway.
|
|
410
|
+
|
|
411
|
+
Snapshots are an optimization, not a source of truth: the event log remains authoritative, and a missing, corrupt, oversized, or incompatible snapshot automatically falls back to a full replay. Snapshots over 32 MB uncompressed are not saved.
|
|
412
|
+
|
|
413
|
+
Like `WORKFLOW_VM`, the policy is stamped into the run's `executionContext` at start, so a run keeps the snapshot policy it started with. Runs started with `WORKFLOW_VM=quickjs` are stamped with this value, or the default when unset. Runs without a stamped policy use the handler's value, or the default. `start()` rejects an invalid value. An invalid value on the workflow handler disables snapshotting with a warning.
|
|
414
|
+
|
|
415
|
+
Runs stamped with `workflowVm: "quickjs"` and a positive threshold are exempt from the default [per-run event limit](/docs/errors/max-events-exceeded) on the Local and Vercel Worlds.
|
|
416
|
+
|
|
417
|
+
A snapshot can only be restored by the exact QuickJS engine build that captured it. On Vercel, runs keep executing on the deployment they started on, so deploys don't affect in-flight snapshots. If your deployment serves in-flight runs from new code (for example, a self-hosted rolling update), an upgrade that changes the embedded engine or the snapshot format makes every in-flight run fall back to a full replay at its next resume, all at once, before re-snapshotting at its next qualifying suspension. Plan for that one-time replay load when upgrading.
|
|
227
418
|
|
|
228
419
|
What a snapshot contains, and how it is protected:
|
|
229
420
|
|
|
@@ -236,55 +427,81 @@ What a snapshot contains, and how it is protected:
|
|
|
236
427
|
### `WORKFLOW_SNAPSHOT_ALLOW_UNENCRYPTED`
|
|
237
428
|
|
|
238
429
|
- Default: disabled
|
|
239
|
-
|
|
430
|
+
|
|
431
|
+
Whether the QuickJS engine persists VM snapshots for runs without an encryption key. Set `1` or `true` on the workflow handler to allow it. Those snapshots include the handler's environment variables in plaintext.
|
|
432
|
+
|
|
433
|
+
See [`WORKFLOW_SNAPSHOT_THRESHOLD`](#workflow_snapshot_threshold) for what that stores.
|
|
240
434
|
|
|
241
435
|
## Dynamic workflows
|
|
242
436
|
|
|
437
|
+
| Variable | Default | What it does |
|
|
438
|
+
| --- | --- | --- |
|
|
439
|
+
| [`WORKFLOW_EXPERIMENTAL_DYNAMIC_WORKFLOWS`](#workflow_experimental_dynamic_workflows) | disabled | Lets this deployment start and execute dynamic workflows |
|
|
440
|
+
|
|
243
441
|
### `WORKFLOW_EXPERIMENTAL_DYNAMIC_WORKFLOWS`
|
|
244
442
|
|
|
245
443
|
- Default: disabled
|
|
246
|
-
|
|
247
|
-
-
|
|
248
|
-
|
|
444
|
+
|
|
445
|
+
Whether this deployment may start [dynamic workflows](/docs/advanced/dynamic-workflows), execute their stored code on delivery, and advertise dynamic support in its health check. Set `1` or `true` (case-insensitive) to enable it. Any other value leaves it disabled.
|
|
446
|
+
|
|
447
|
+
Dynamic source runs with the full privileges of the deployment's functions. Enable it only on deployments whose dynamic source you trust as much as your own code.
|
|
448
|
+
|
|
449
|
+
When disabled, `start()` with source throws before writing anything, and a delivered dynamic run fails instead of executing.
|
|
249
450
|
|
|
250
451
|
## Compression and tracing
|
|
251
452
|
|
|
453
|
+
| Variable | Default | What it does |
|
|
454
|
+
| --- | --- | --- |
|
|
455
|
+
| [`WORKFLOW_DISABLE_COMPRESSION`](#workflow_disable_compression) | compression enabled | Turns off compression when writing payloads |
|
|
456
|
+
| [`WORKFLOW_COMPRESSION_CODEC`](#workflow_compression_codec) | automatic | Forces the write-side codec to `zstd` or `gzip` |
|
|
457
|
+
| [`WORKFLOW_TRACE_MODE`](#workflow_trace_mode) | `linked` | OpenTelemetry span topology for runs |
|
|
458
|
+
| [`DEBUG`](#debug) | unset | Debug log filter |
|
|
459
|
+
|
|
252
460
|
### `WORKFLOW_DISABLE_COMPRESSION`
|
|
253
461
|
|
|
254
462
|
- Default: compression enabled
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
463
|
+
|
|
464
|
+
Set `1` to disable compression when writing payloads. Reads still decompress existing payloads.
|
|
465
|
+
|
|
466
|
+
To skip compression only for one run's arguments, pass `compressArguments: false` to [`start()`](/docs/api-reference/workflow-api/start) instead.
|
|
258
467
|
|
|
259
468
|
### `WORKFLOW_COMPRESSION_CODEC`
|
|
260
469
|
|
|
261
470
|
- Default: automatic
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
471
|
+
|
|
472
|
+
Forces the write-side codec to `zstd` or `gzip`. Invalid values are ignored.
|
|
473
|
+
|
|
474
|
+
Automatic mode prefers `zstd` when the current Node.js runtime supports it, otherwise it falls back to `gzip`.
|
|
475
|
+
|
|
476
|
+
Writes for a run on another deployment (for example `resumeHook()` reaching a run that started before the project moved to a newer Node.js version) use `zstd` only when that run's deployment runs Node.js 22.15+ (or 23.8+), and `gzip` otherwise, since older Node.js versions cannot decode `zstd`. Runs created before `@workflow/core` recorded the Node.js version always receive `gzip`. Setting this to `zstd` does not override that check.
|
|
265
477
|
|
|
266
478
|
### `WORKFLOW_TRACE_MODE`
|
|
267
479
|
|
|
268
480
|
- Default: `linked`
|
|
269
|
-
|
|
270
|
-
|
|
481
|
+
|
|
482
|
+
OpenTelemetry span topology for runs. Accepts `linked` or `continuous`.
|
|
271
483
|
|
|
272
484
|
### `DEBUG`
|
|
273
485
|
|
|
274
486
|
- Default: unset
|
|
275
|
-
|
|
276
|
-
|
|
487
|
+
|
|
488
|
+
Debug log filter with wildcards and negation. Examples: `workflow:*`, `workflow:*,-workflow:telemetry:*`.
|
|
277
489
|
|
|
278
490
|
## Transport
|
|
279
491
|
|
|
280
492
|
The Vercel World's own transport settings (HTTP/2 multiplexing and the queue client's deadline and connection pool) are listed under [Vercel World](/docs/configuration/worlds#vercel-world).
|
|
281
493
|
|
|
494
|
+
| Variable | Default | What it does |
|
|
495
|
+
| --- | --- | --- |
|
|
496
|
+
| [`WORKFLOW_NODE_HTTP`](#workflow_node_http) | disabled | Vercel and Local World requests through Node's built-in HTTP modules |
|
|
497
|
+
|
|
282
498
|
### `WORKFLOW_NODE_HTTP`
|
|
283
499
|
|
|
284
500
|
- Default: disabled
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
501
|
+
|
|
502
|
+
Makes the Vercel and Local Worlds issue their HTTP requests through Node's built-in `node:http` and `node:https` modules, instead of the HTTP client library those Worlds normally use. Set `1` to switch to Node's modules.
|
|
503
|
+
|
|
504
|
+
Change it when: that library is not an option, such as with a bundler that mangles it, a runtime that does not ship a working copy of it, or a transport-level fault you want to rule out. It is not reached by way of `fetch()` either, so a runtime whose `fetch()` is built on the same library is still covered. Read the trade-offs below first: they cost throughput on every deployment, which is why this is opt-in.
|
|
288
505
|
|
|
289
506
|
Node's own modules do less than the client they replace, so enabling this drops the per-call-site tuning the Worlds configure:
|
|
290
507
|
|
|
@@ -298,148 +515,231 @@ A `dispatcher` passed to `createWorld()` still wins over this variable. The vari
|
|
|
298
515
|
|
|
299
516
|
## Queue namespace
|
|
300
517
|
|
|
518
|
+
| Variable | Default | What it does |
|
|
519
|
+
| --- | --- | --- |
|
|
520
|
+
| [`WORKFLOW_QUEUE_NAMESPACE`](#workflow_queue_namespace) | none | Queue topic namespace shared by build output and Worlds |
|
|
521
|
+
|
|
301
522
|
### `WORKFLOW_QUEUE_NAMESPACE`
|
|
302
523
|
|
|
303
524
|
- Default: none
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
525
|
+
|
|
526
|
+
Queue topic namespace shared by build output and Worlds. Must match `^[a-z][a-z0-9]*$`.
|
|
527
|
+
|
|
528
|
+
Set it consistently at build and runtime.
|
|
307
529
|
|
|
308
530
|
## Streams and waits
|
|
309
531
|
|
|
310
532
|
These variables are primarily for tests, debugging, or unusual deployments.
|
|
311
533
|
|
|
534
|
+
| Variable | Default | What it does |
|
|
535
|
+
| --- | --- | --- |
|
|
536
|
+
| [`WORKFLOW_STREAM_FLUSH_INTERVAL_MS`](#workflow_stream_flush_interval_ms) | `0` ms | Group-commit window for the leading chunk of an idle stream |
|
|
537
|
+
| [`WORKFLOW_STEP_STREAM_DRAIN_TIMEOUT_MS`](#workflow_step_stream_drain_timeout_ms) | `30000` ms | Wait for released stream writes before `step_completed` |
|
|
538
|
+
| [`WORKFLOW_STREAM_MAX_INFLIGHT_CHUNKS`](#workflow_stream_max_inflight_chunks) | `1000` | Chunks read but not yet durably written before the producer pauses |
|
|
539
|
+
| [`WORKFLOW_STREAM_MAX_CHUNKS_PER_BATCH`](#workflow_stream_max_chunks_per_batch) | `1000` | Chunks per coalesced multi-write request |
|
|
540
|
+
| [`WORKFLOW_STREAM_MAX_BYTES_PER_BATCH`](#workflow_stream_max_bytes_per_batch) | `1048576` bytes (1 MiB) | Bytes per coalesced multi-write request |
|
|
541
|
+
| [`WORKFLOW_STREAM_MAX_BUFFERED_BYTES`](#workflow_stream_max_buffered_bytes) | `8388608` bytes (8 MiB) | Bytes buffered before `write()` applies backpressure |
|
|
542
|
+
| [`WORKFLOW_FRAMED_STREAM_MAX_RECONNECTS`](#workflow_framed_stream_max_reconnects) | `50` | Consecutive reconnects for framed stream readers |
|
|
543
|
+
| [`WORKFLOW_FRAMED_STREAM_MAX_TOTAL_RECONNECTS`](#workflow_framed_stream_max_total_reconnects) | `1000` | Total reconnects per stream session |
|
|
544
|
+
| [`WORKFLOW_WAIT_CONTINUATION_MAX_DELAY_SECONDS`](#workflow_wait_continuation_max_delay_seconds) | `82800` s (23 hours) | Longest single queue delay for `sleep()` continuations |
|
|
545
|
+
| [`WORKFLOW_NEAR_ELAPSED_WAIT_THRESHOLD_SECONDS`](#workflow_near_elapsed_wait_threshold_seconds) | `2` s | Clock-skew tolerance for wait continuations |
|
|
546
|
+
| [`WORKFLOW_DEFERRED_CHECK_DELAY_MS`](#workflow_deferred_check_delay_ms) | `100` ms | Delay before the unconsumed-event check |
|
|
547
|
+
| [`WORKFLOW_LOCK_POLL_INTERVAL_MS`](#workflow_lock_poll_interval_ms) | `10` ms | Poll interval for stream lock release |
|
|
548
|
+
|
|
312
549
|
### `WORKFLOW_STREAM_FLUSH_INTERVAL_MS`
|
|
313
550
|
|
|
314
551
|
- Default: `0` (dispatch the first chunk of an idle stream immediately)
|
|
315
|
-
|
|
316
|
-
-
|
|
552
|
+
|
|
553
|
+
Group-commit window, in milliseconds, for the *leading* chunk of an idle stream. `0` sends it at once; a positive value holds it up to that many milliseconds to collect a group.
|
|
554
|
+
|
|
555
|
+
This opt-in setting trades first-chunk latency for larger batches and can benefit slow-but-steady producers. Chunks arriving while a request is already in flight always coalesce into the next group regardless of this setting.
|
|
556
|
+
|
|
557
|
+
Also available as `streamFlushIntervalMs` on Worlds that expose it (the env var, when set, takes precedence over the World option).
|
|
317
558
|
|
|
318
559
|
### `WORKFLOW_STEP_STREAM_DRAIN_TIMEOUT_MS`
|
|
319
560
|
|
|
320
561
|
- Default: `30000` (30 seconds)
|
|
321
|
-
|
|
562
|
+
|
|
563
|
+
Maximum time a step waits for writes queued by a released workflow stream writer to be acknowledged by the Workflow server before recording `step_completed`.
|
|
564
|
+
|
|
565
|
+
A timeout fails the step instead of exposing a completion while released-writer data remains client-side. A writer intentionally kept locked does not trigger this durability wait.
|
|
322
566
|
|
|
323
567
|
### `WORKFLOW_STREAM_MAX_INFLIGHT_CHUNKS`
|
|
324
568
|
|
|
325
569
|
- Default: `1000`
|
|
326
|
-
|
|
570
|
+
|
|
571
|
+
Flow-control bound: how many stream chunks may be read-but-not-yet-durably-written while writes are coalesced.
|
|
572
|
+
|
|
573
|
+
Once this many are outstanding, the producer pauses reading until a batch is written. Bounds in-memory buffering; distinct from the per-request batch caps below.
|
|
327
574
|
|
|
328
575
|
### `WORKFLOW_STREAM_MAX_CHUNKS_PER_BATCH`
|
|
329
576
|
|
|
330
577
|
- Default: `1000`
|
|
331
|
-
|
|
578
|
+
|
|
579
|
+
Wire limit: maximum number of chunks sent in a single coalesced multi-write.
|
|
580
|
+
|
|
581
|
+
Larger bursts are split across requests so one request can't exceed the server's per-multi-write chunk cap.
|
|
332
582
|
|
|
333
583
|
### `WORKFLOW_STREAM_MAX_BYTES_PER_BATCH`
|
|
334
584
|
|
|
335
585
|
- Default: `1048576` (1 MiB)
|
|
336
|
-
|
|
586
|
+
|
|
587
|
+
Wire limit: maximum cumulative bytes in a single coalesced multi-write, so large chunks don't produce a request body that platform limits reject.
|
|
588
|
+
|
|
589
|
+
A single chunk larger than this is still sent on its own.
|
|
337
590
|
|
|
338
591
|
### `WORKFLOW_STREAM_MAX_BUFFERED_BYTES`
|
|
339
592
|
|
|
340
593
|
- Default: `8388608` (8 MiB)
|
|
341
|
-
|
|
594
|
+
|
|
595
|
+
Flow-control bound: maximum cumulative bytes accepted into the stream writer's group-commit buffer before `write()` applies backpressure.
|
|
596
|
+
|
|
597
|
+
The byte-denominated counterpart of `WORKFLOW_STREAM_MAX_INFLIGHT_CHUNKS`; distinct from `WORKFLOW_STREAM_MAX_BYTES_PER_BATCH`, which only splits how much goes out in one request.
|
|
342
598
|
|
|
343
599
|
### `WORKFLOW_FRAMED_STREAM_MAX_RECONNECTS`
|
|
344
600
|
|
|
345
601
|
- Default: `50`
|
|
346
|
-
|
|
602
|
+
|
|
603
|
+
Consecutive reconnect cap for framed stream readers.
|
|
347
604
|
|
|
348
605
|
### `WORKFLOW_FRAMED_STREAM_MAX_TOTAL_RECONNECTS`
|
|
349
606
|
|
|
350
607
|
- Default: `1000`
|
|
351
|
-
|
|
608
|
+
|
|
609
|
+
Total reconnect cap per stream session.
|
|
352
610
|
|
|
353
611
|
### `WORKFLOW_WAIT_CONTINUATION_MAX_DELAY_SECONDS`
|
|
354
612
|
|
|
355
613
|
- Default: `82800` (23 hours)
|
|
356
|
-
|
|
357
|
-
|
|
614
|
+
|
|
615
|
+
Longest single queue delay, in seconds, used for `sleep()` continuations.
|
|
616
|
+
|
|
617
|
+
If a wait is longer than this, Workflow queues one continuation for the maximum delay, then queues another continuation after that message fires, repeating until the wait's target time is reached.
|
|
358
618
|
|
|
359
619
|
### `WORKFLOW_NEAR_ELAPSED_WAIT_THRESHOLD_SECONDS`
|
|
360
620
|
|
|
361
621
|
- Default: `2`
|
|
362
|
-
|
|
622
|
+
|
|
623
|
+
Clock-skew tolerance, in seconds, for wait continuations that arrive near their target time.
|
|
363
624
|
|
|
364
625
|
### `WORKFLOW_DEFERRED_CHECK_DELAY_MS`
|
|
365
626
|
|
|
366
627
|
- Default: `100`
|
|
367
|
-
|
|
368
|
-
- Minimum
|
|
628
|
+
|
|
629
|
+
Delay, in milliseconds, before the unconsumed-event check fires. Minimum `10`.
|
|
369
630
|
|
|
370
631
|
### `WORKFLOW_LOCK_POLL_INTERVAL_MS`
|
|
371
632
|
|
|
372
633
|
- Default: `10`
|
|
373
|
-
|
|
634
|
+
|
|
635
|
+
Poll interval, in milliseconds, for detecting stream lock release.
|
|
374
636
|
|
|
375
637
|
## Limits
|
|
376
638
|
|
|
639
|
+
| Variable | Default | What it does |
|
|
640
|
+
| --- | --- | --- |
|
|
641
|
+
| [`WORKFLOW_MAX_EVENTS_OVERRIDE`](#workflow_max_events_override) | unset | Lowers the World's per-run event ceiling |
|
|
642
|
+
|
|
377
643
|
### `WORKFLOW_MAX_EVENTS_OVERRIDE`
|
|
378
644
|
|
|
379
645
|
- Default: unset
|
|
380
|
-
- Lowers the per-run event ceiling supplied by the World. A run whose event log reaches the ceiling fails with `MAX_EVENTS_EXCEEDED`, which stops a runaway loop from growing its log without bound.
|
|
381
|
-
- Clamp-down only: it never raises the World's limit, and it applies even when the World supplies none. With no World limit and no override, nothing is enforced.
|
|
382
|
-
- The Local and Vercel Worlds both supply a limit; the Local World defaults to 25,000 and is configurable with [`WORKFLOW_MAX_EVENTS`](/docs/configuration/worlds#workflow_max_events). The Vercel World's ceiling is documented under [Workflow run limits](https://vercel.com/docs/workflows/pricing#workflow-run-limits).
|
|
383
|
-
- QuickJS runs with snapshotting are exempt from the World's default limit, but this override still applies to them.
|
|
384
646
|
|
|
385
|
-
|
|
647
|
+
Lowers the per-run event ceiling supplied by the World. A run whose event log reaches the ceiling fails with `MAX_EVENTS_EXCEEDED`, which stops a runaway loop from growing its log without bound.
|
|
386
648
|
|
|
387
|
-
|
|
649
|
+
Clamp-down only: it never raises the World's limit, and it applies even when the World supplies none. With no World limit and no override, nothing is enforced.
|
|
388
650
|
|
|
389
|
-
|
|
651
|
+
The Local and Vercel Worlds both supply a limit; the Local World defaults to 25,000 and is configurable with [`WORKFLOW_MAX_EVENTS`](/docs/configuration/worlds#workflow_max_events). The Vercel World's ceiling is documented under [Workflow run limits](https://vercel.com/docs/workflows/pricing#workflow-run-limits).
|
|
652
|
+
|
|
653
|
+
QuickJS runs with snapshotting are exempt from the World's default limit, but this override still applies to them.
|
|
654
|
+
|
|
655
|
+
## Orchestrator
|
|
656
|
+
|
|
657
|
+
One orchestrator invocation at a time drives each run: it replays the run, runs inline steps, and writes every decision. A background step's own invocation only runs its body and reports the outcome. These settings tune how the orchestrator picks up events that other writers commit, and how long it stays live waiting for them.
|
|
390
658
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
659
|
+
<Spec8Note>
|
|
660
|
+
the runtime ignores the settings in this section, because every queue delivery replays the run and writes its own decisions.
|
|
661
|
+
</Spec8Note>
|
|
662
|
+
|
|
663
|
+
| Variable | Default | What it does |
|
|
664
|
+
| --- | --- | --- |
|
|
665
|
+
| [`WORKFLOW_ORCHESTRATOR_RATE_WAIT_MS`](#workflow_orchestrator_rate_wait_ms) | `5000` ms | How far ahead of a rate limit slot the orchestrator waits in the same invocation |
|
|
666
|
+
| [`WORKFLOW_ORCHESTRATOR_POLL_INTERVAL_MS`](#workflow_orchestrator_poll_interval_ms) | `2000` ms | Log-tail poll interval without a live event feed |
|
|
667
|
+
| [`WORKFLOW_ORCHESTRATOR_FEED_POLL_INTERVAL_MS`](#workflow_orchestrator_feed_poll_interval_ms) | `10000` ms | Log-tail poll interval while the live event feed is up |
|
|
668
|
+
| [`WORKFLOW_ORCHESTRATOR_LINGER_MS`](#workflow_orchestrator_linger_ms) | `5000` ms | How long an idle orchestrator stays live while a background step runs |
|
|
669
|
+
| [`WORKFLOW_ORCHESTRATOR_HOOK_LINGER_MS`](#workflow_orchestrator_hook_linger_ms) | `5000` ms, capped at `WORKFLOW_ORCHESTRATOR_LINGER_MS` | How long an idle orchestrator stays live on open hooks only |
|
|
670
|
+
| [`WORKFLOW_ORCHESTRATOR_WAIT_LINGER_MS`](#workflow_orchestrator_wait_linger_ms) | `WORKFLOW_ORCHESTRATOR_LINGER_MS` (`5000` ms), capped at it | How far ahead a `sleep()` may end for an idle orchestrator to stay live until it does |
|
|
671
|
+
| [`WORKFLOW_ORCHESTRATOR_READ_TIMEOUT_MS`](#workflow_orchestrator_read_timeout_ms) | `5000` ms | Deadline for one incremental event-log read |
|
|
395
672
|
|
|
396
673
|
### `WORKFLOW_ORCHESTRATOR_RATE_WAIT_MS`
|
|
397
674
|
|
|
398
675
|
- Default: `5000`
|
|
399
|
-
|
|
676
|
+
|
|
677
|
+
How far ahead, in milliseconds, of an [`experimental_rateLimit()`](/docs/api-reference/workflow/rate-limit) call's slot the orchestrator waits for it in the same invocation. `0` turns it off, and a waiting call is woken by the queue at its slot.
|
|
678
|
+
|
|
679
|
+
A call whose slot is further out is woken this far before it and waits the rest the same way, so it goes ahead at its slot instead of a second or more after. A queued wake for the slot itself is still scheduled, in case the invocation ends first. Each wait can keep an invocation idle for up to this long.
|
|
400
680
|
|
|
401
681
|
### `WORKFLOW_ORCHESTRATOR_POLL_INTERVAL_MS`
|
|
402
682
|
|
|
403
683
|
- Default: `2000`
|
|
404
|
-
|
|
684
|
+
|
|
685
|
+
Log-tail poll interval, in milliseconds, of a busy orchestrator while no live event feed covers the run. `0` turns polling off.
|
|
405
686
|
|
|
406
687
|
### `WORKFLOW_ORCHESTRATOR_FEED_POLL_INTERVAL_MS`
|
|
407
688
|
|
|
408
689
|
- Default: `10000`
|
|
409
|
-
|
|
690
|
+
|
|
691
|
+
Log-tail poll interval, in milliseconds, while the World's live event feed is up.
|
|
410
692
|
|
|
411
693
|
### `WORKFLOW_ORCHESTRATOR_LINGER_MS`
|
|
412
694
|
|
|
413
695
|
- Default: `5000`
|
|
414
|
-
|
|
696
|
+
|
|
697
|
+
How long, in milliseconds, an orchestrator with nothing left to run stays live on the event feed while the run waits on a background step. `0` turns it off, for hooks and sleeps too.
|
|
698
|
+
|
|
699
|
+
A step that takes longer ends the invocation, and its outcome starts a new one.
|
|
415
700
|
|
|
416
701
|
### `WORKFLOW_ORCHESTRATOR_HOOK_LINGER_MS`
|
|
417
702
|
|
|
418
703
|
- Default: `5000`, and never more than [`WORKFLOW_ORCHESTRATOR_LINGER_MS`](#workflow_orchestrator_linger_ms)
|
|
419
|
-
|
|
704
|
+
|
|
705
|
+
How long, in milliseconds, an orchestrator with nothing left to run stays live on the event feed while the run waits only on open hooks. `0` turns it off.
|
|
706
|
+
|
|
707
|
+
Change it when: you want background steps on a longer window than hooks. Set it below `WORKFLOW_ORCHESTRATOR_LINGER_MS`.
|
|
708
|
+
|
|
709
|
+
Any hook that is created and not disposed counts, however rarely it is resumed.
|
|
420
710
|
|
|
421
711
|
### `WORKFLOW_ORCHESTRATOR_WAIT_LINGER_MS`
|
|
422
712
|
|
|
423
713
|
- Default: [`WORKFLOW_ORCHESTRATOR_LINGER_MS`](#workflow_orchestrator_linger_ms) (`5000`), and never more than it
|
|
424
|
-
|
|
714
|
+
|
|
715
|
+
How far ahead, in milliseconds, a `sleep()` may end for an orchestrator with nothing left to run to stay live on the event feed until it does, instead of ending the invocation and starting a new one when the sleep's timer fires. `0` turns it off.
|
|
716
|
+
|
|
717
|
+
A sleep up to 1 second longer than this still counts, so a sleep as long as the window lingers despite small clock differences. Only for a sleep that ends before the invocation's inline window less [`WORKFLOW_INLINE_STEP_DEADLINE_MARGIN_MS`](#workflow_inline_step_deadline_margin_ms), and only on a World with a live event feed (such as world-vercel and world-postgres; world-local has none, so it never lingers). On those Worlds, a `run.wakeUp()` sent during such a sleep is not applied, so the sleep runs its full length.
|
|
425
718
|
|
|
426
719
|
### `WORKFLOW_ORCHESTRATOR_READ_TIMEOUT_MS`
|
|
427
720
|
|
|
428
721
|
- Default: `5000`
|
|
429
|
-
- Deadline for one incremental read of the event log before the orchestrator sends it again. `0` turns the deadline off.
|
|
430
722
|
|
|
431
|
-
|
|
723
|
+
Deadline, in milliseconds, for one incremental read of the event log before the orchestrator sends it again. `0` turns the deadline off.
|
|
432
724
|
|
|
433
|
-
|
|
434
|
-
- How long before the inline window ends the orchestrator stops starting inline steps.
|
|
725
|
+
## Spec version
|
|
435
726
|
|
|
436
|
-
|
|
727
|
+
| Variable | Default | What it does |
|
|
728
|
+
| --- | --- | --- |
|
|
729
|
+
| [`WORKFLOW_SPEC_VERSION`](#workflow_spec_version) | unset (newest the World supports) | Spec version of new runs |
|
|
437
730
|
|
|
438
|
-
|
|
439
|
-
- `1` or `true` starts a background step's body before its `step_started` commits. Use only when background step bodies are idempotent.
|
|
731
|
+
### `WORKFLOW_SPEC_VERSION`
|
|
440
732
|
|
|
441
|
-
|
|
733
|
+
- Default: unset. New runs use the newest spec version the World supports: 10 on the Vercel, Local and Postgres Worlds.
|
|
442
734
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
-
|
|
735
|
+
Spec version of runs created by this process. `8` opts out: new runs use the earlier execution model, where every queue delivery replays the run and writes its own decisions. Pages that describe a difference for such runs say so in a note.
|
|
736
|
+
|
|
737
|
+
A third-party World creates spec 9 runs if it implements the [in-band fence](/worlds/building-a-world#optional-the-in-band-writer-fence) but not [rate limits](/docs/api-reference/workflow/rate-limit), and spec 8 runs if it implements neither (see [Supporting spec 9 runs](/worlds/building-a-world#supporting-spec-9-runs)).
|
|
738
|
+
|
|
739
|
+
`6` to `10` select that version, but never one above what the World supports: `9` or `10` on a World without the fence creates spec 8 runs, and `10` on a World without rate limits creates spec 9 runs. Any other value is ignored with a one-time warning and creates spec 8 runs, so a typo in an opt-out never opts in.
|
|
740
|
+
|
|
741
|
+
`6` creates new runs on the scheme from before the [sealed log](/docs/how-it-works/event-sourcing), where each event position is allocated by the write that occupies it. Use it in an environment shared with a runtime that cannot read sealed logs yet, such as one that pins its own accepted spec range (the Python runtime). Runs below `8` cannot have their hook tokens taken over with [`experimental_force`](/docs/api-reference/workflow/create-hook#take-over-a-token-another-run-holds): a forced hook in another run gets `HookConflictError` instead.
|
|
742
|
+
|
|
743
|
+
A run keeps the version it was created with.
|
|
744
|
+
|
|
745
|
+
Upgrade every deployment and process that shares the World together, setting `8` on the upgraded ones until all of them run v5.8.0 or later. Do not roll back below v5.8.0 once runs at spec 9 or later exist: an older release fails writes to them.
|