workflow 5.0.0-beta.42 → 5.0.0-beta.44

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.
Files changed (183) hide show
  1. package/README.md +6 -4
  2. package/dist/internal/builtins.d.ts +4 -4
  3. package/dist/internal/builtins.js +6 -6
  4. package/docs/ai/chat-session-modeling.mdx +23 -24
  5. package/docs/ai/defining-tools.mdx +5 -6
  6. package/docs/ai/human-in-the-loop.mdx +11 -11
  7. package/docs/ai/index.mdx +20 -20
  8. package/docs/ai/message-queueing.mdx +6 -6
  9. package/docs/ai/meta.json +1 -0
  10. package/docs/ai/resumable-streams.mdx +32 -28
  11. package/docs/ai/sleep-and-delays.mdx +9 -9
  12. package/docs/ai/streaming-updates-from-tools.mdx +4 -4
  13. package/docs/api-reference/vitest/index.mdx +8 -8
  14. package/docs/api-reference/workflow/create-hook.mdx +15 -15
  15. package/docs/api-reference/workflow/create-webhook.mdx +15 -15
  16. package/docs/api-reference/workflow/define-hook.mdx +10 -10
  17. package/docs/api-reference/workflow/fatal-error.mdx +2 -2
  18. package/docs/api-reference/workflow/fetch.mdx +7 -7
  19. package/docs/api-reference/workflow/get-step-metadata.mdx +2 -2
  20. package/docs/api-reference/workflow/get-workflow-metadata.mdx +3 -3
  21. package/docs/api-reference/workflow/get-writable.mdx +7 -7
  22. package/docs/api-reference/workflow/index.mdx +1 -1
  23. package/docs/api-reference/workflow/retryable-error.mdx +1 -1
  24. package/docs/api-reference/workflow/set-attributes.mdx +2 -2
  25. package/docs/api-reference/workflow/sleep.mdx +3 -3
  26. package/docs/api-reference/workflow-ai/durable-agent.mdx +42 -42
  27. package/docs/api-reference/workflow-ai/index.mdx +3 -3
  28. package/docs/api-reference/workflow-ai/workflow-chat-transport.mdx +28 -28
  29. package/docs/api-reference/workflow-api/get-hook-by-token.mdx +11 -11
  30. package/docs/api-reference/workflow-api/get-run.mdx +10 -10
  31. package/docs/api-reference/workflow-api/index.mdx +2 -4
  32. package/docs/api-reference/workflow-api/resume-hook.mdx +14 -14
  33. package/docs/api-reference/workflow-api/resume-webhook.mdx +4 -4
  34. package/docs/api-reference/workflow-api/start.mdx +16 -15
  35. package/docs/api-reference/workflow-astro/workflow.mdx +3 -3
  36. package/docs/api-reference/workflow-errors/entity-conflict-error.mdx +4 -4
  37. package/docs/api-reference/workflow-errors/hook-conflict-error.mdx +4 -4
  38. package/docs/api-reference/workflow-errors/hook-not-found-error.mdx +8 -8
  39. package/docs/api-reference/workflow-errors/index.mdx +6 -6
  40. package/docs/api-reference/workflow-errors/precondition-failed-error.mdx +9 -9
  41. package/docs/api-reference/workflow-errors/run-expired-error.mdx +2 -2
  42. package/docs/api-reference/workflow-errors/run-not-supported-error.mdx +4 -4
  43. package/docs/api-reference/workflow-errors/step-not-registered-error.mdx +5 -5
  44. package/docs/api-reference/workflow-errors/throttle-error.mdx +2 -2
  45. package/docs/api-reference/workflow-errors/too-early-error.mdx +2 -2
  46. package/docs/api-reference/workflow-errors/workflow-error.mdx +4 -4
  47. package/docs/api-reference/workflow-errors/workflow-not-registered-error.mdx +5 -6
  48. package/docs/api-reference/workflow-errors/workflow-run-cancelled-error.mdx +6 -6
  49. package/docs/api-reference/workflow-errors/workflow-run-failed-error.mdx +5 -5
  50. package/docs/api-reference/workflow-errors/workflow-run-not-completed-error.mdx +4 -4
  51. package/docs/api-reference/workflow-errors/workflow-run-not-found-error.mdx +4 -4
  52. package/docs/api-reference/workflow-errors/workflow-runtime-error.mdx +2 -2
  53. package/docs/api-reference/workflow-errors/workflow-world-error.mdx +8 -8
  54. package/docs/api-reference/workflow-globals.mdx +12 -11
  55. package/docs/api-reference/workflow-nest/configure-workflow-controller.mdx +2 -2
  56. package/docs/api-reference/workflow-nest/nest-local-builder.mdx +4 -4
  57. package/docs/api-reference/workflow-nest/workflow-controller.mdx +1 -1
  58. package/docs/api-reference/workflow-nest/workflow-module.mdx +4 -4
  59. package/docs/api-reference/workflow-next/with-workflow.mdx +16 -16
  60. package/docs/api-reference/workflow-nitro/index.mdx +6 -6
  61. package/docs/api-reference/workflow-nuxt/index.mdx +4 -4
  62. package/docs/api-reference/workflow-observability/hydrate-data.mdx +5 -5
  63. package/docs/api-reference/workflow-observability/hydrate-resource-io.mdx +4 -4
  64. package/docs/api-reference/workflow-observability/index.mdx +6 -8
  65. package/docs/api-reference/workflow-observability/observability-revivers.mdx +2 -2
  66. package/docs/api-reference/workflow-observability/parse-class-name.mdx +3 -3
  67. package/docs/api-reference/workflow-observability/parse-step-name.mdx +4 -4
  68. package/docs/api-reference/workflow-observability/parse-workflow-name.mdx +4 -4
  69. package/docs/api-reference/workflow-runtime/create-world.mdx +8 -8
  70. package/docs/api-reference/workflow-runtime/get-world-handlers.mdx +6 -6
  71. package/docs/api-reference/workflow-runtime/get-world.mdx +4 -4
  72. package/docs/api-reference/workflow-runtime/health-check.mdx +1 -1
  73. package/docs/api-reference/workflow-runtime/index.mdx +2 -4
  74. package/docs/api-reference/workflow-runtime/set-world.mdx +15 -13
  75. package/docs/api-reference/workflow-runtime/workflow-entrypoint.mdx +6 -5
  76. package/docs/api-reference/workflow-runtime/world/analytics.mdx +9 -9
  77. package/docs/api-reference/workflow-runtime/world/index.mdx +5 -3
  78. package/docs/api-reference/workflow-runtime/world/queue.mdx +11 -11
  79. package/docs/api-reference/workflow-runtime/world/storage.mdx +62 -28
  80. package/docs/api-reference/workflow-runtime/world/streams.mdx +7 -7
  81. package/docs/api-reference/workflow-serde/index.mdx +1 -1
  82. package/docs/api-reference/workflow-serde/workflow-deserialize.mdx +2 -2
  83. package/docs/api-reference/workflow-serde/workflow-serialize.mdx +7 -7
  84. package/docs/api-reference/workflow-sveltekit/workflow-plugin.mdx +3 -3
  85. package/docs/api-reference/workflow-vite/workflow.mdx +5 -5
  86. package/docs/changelog/attributes-mvp.mdx +39 -39
  87. package/docs/changelog/batched-event-writes.mdx +79 -0
  88. package/docs/changelog/eager-processing.mdx +63 -63
  89. package/docs/changelog/index.mdx +3 -3
  90. package/docs/changelog/lazy-event-creation.md +27 -27
  91. package/docs/changelog/meta.json +2 -1
  92. package/docs/changelog/resilient-resume.mdx +5 -5
  93. package/docs/changelog/resilient-start.mdx +14 -14
  94. package/docs/changelog/step-message-ownership.mdx +47 -47
  95. package/docs/changelog/turbo-mode.md +20 -20
  96. package/docs/comparisons/index.mdx +13 -13
  97. package/docs/comparisons/workflow-sdk-vs-aws-agentcore.mdx +15 -15
  98. package/docs/comparisons/workflow-sdk-vs-aws-step-functions.mdx +12 -12
  99. package/docs/comparisons/workflow-sdk-vs-cloudflare-workflows.mdx +11 -11
  100. package/docs/comparisons/workflow-sdk-vs-inngest.mdx +19 -19
  101. package/docs/comparisons/workflow-sdk-vs-temporal.mdx +23 -23
  102. package/docs/comparisons/workflow-sdk-vs-trigger-dev.mdx +18 -17
  103. package/docs/configuration/build-and-diagnostics.mdx +5 -5
  104. package/docs/configuration/cli-and-web-ui.mdx +4 -4
  105. package/docs/configuration/runtime-tuning.mdx +102 -21
  106. package/docs/configuration/worlds.mdx +34 -12
  107. package/docs/cookbook/advanced/child-workflows.mdx +25 -25
  108. package/docs/cookbook/advanced/publishing-libraries.mdx +40 -40
  109. package/docs/cookbook/advanced/serializable-steps.mdx +21 -21
  110. package/docs/cookbook/advanced/upgrading-workflows.mdx +31 -31
  111. package/docs/cookbook/agent-patterns/agent-cancellation.mdx +20 -20
  112. package/docs/cookbook/agent-patterns/human-in-the-loop.mdx +22 -22
  113. package/docs/cookbook/common-patterns/batching.mdx +14 -14
  114. package/docs/cookbook/common-patterns/idempotency.mdx +9 -9
  115. package/docs/cookbook/common-patterns/rate-limiting.mdx +3 -3
  116. package/docs/cookbook/common-patterns/saga.mdx +19 -19
  117. package/docs/cookbook/common-patterns/scheduling.mdx +23 -23
  118. package/docs/cookbook/common-patterns/sequential-and-parallel.mdx +26 -26
  119. package/docs/cookbook/common-patterns/timeouts.mdx +23 -23
  120. package/docs/cookbook/common-patterns/webhooks.mdx +6 -6
  121. package/docs/cookbook/common-patterns/workflow-composition.mdx +19 -19
  122. package/docs/cookbook/index.mdx +22 -22
  123. package/docs/cookbook/integrations/ai-sdk.mdx +43 -41
  124. package/docs/cookbook/integrations/chat-sdk.mdx +34 -34
  125. package/docs/cookbook/integrations/sandbox.mdx +46 -46
  126. package/docs/deploying.mdx +15 -15
  127. package/docs/errors/abort-signal-timeout-in-workflow.mdx +12 -12
  128. package/docs/errors/corrupted-event-log.mdx +13 -14
  129. package/docs/errors/deployment-mismatch.mdx +14 -14
  130. package/docs/errors/fetch-in-workflow.mdx +8 -8
  131. package/docs/errors/hook-conflict.mdx +11 -11
  132. package/docs/errors/index.mdx +1 -1
  133. package/docs/errors/node-js-module-in-workflow.mdx +5 -5
  134. package/docs/errors/replay-divergence.mdx +3 -3
  135. package/docs/errors/runtime-decryption-failed.mdx +12 -12
  136. package/docs/errors/serialization-failed.mdx +40 -12
  137. package/docs/errors/start-invalid-workflow-function.mdx +5 -5
  138. package/docs/errors/step-executed-multiple-times.mdx +2 -2
  139. package/docs/errors/step-not-registered.mdx +5 -5
  140. package/docs/errors/timeout-in-workflow.mdx +8 -8
  141. package/docs/errors/webhook-invalid-respond-with-value.mdx +18 -18
  142. package/docs/errors/webhook-response-not-sent.mdx +16 -16
  143. package/docs/errors/workflow-not-registered.mdx +5 -5
  144. package/docs/foundations/cancellation.mdx +31 -31
  145. package/docs/foundations/errors-and-retries.mdx +42 -11
  146. package/docs/foundations/hooks.mdx +37 -37
  147. package/docs/foundations/idempotency.mdx +9 -9
  148. package/docs/foundations/serialization.mdx +21 -22
  149. package/docs/foundations/starting-workflows.mdx +36 -37
  150. package/docs/foundations/streaming.mdx +68 -39
  151. package/docs/foundations/versioning.mdx +3 -3
  152. package/docs/foundations/workflows-and-steps.mdx +9 -9
  153. package/docs/getting-started/astro.mdx +16 -16
  154. package/docs/getting-started/express.mdx +8 -8
  155. package/docs/getting-started/fastify.mdx +8 -8
  156. package/docs/getting-started/hono.mdx +8 -8
  157. package/docs/getting-started/nestjs.mdx +18 -17
  158. package/docs/getting-started/next.mdx +11 -11
  159. package/docs/getting-started/nitro.mdx +16 -16
  160. package/docs/getting-started/nuxt.mdx +8 -8
  161. package/docs/getting-started/python.mdx +4 -4
  162. package/docs/getting-started/react-router/v7.mdx +1 -1
  163. package/docs/getting-started/react-router/v8.mdx +1 -1
  164. package/docs/getting-started/sveltekit.mdx +14 -14
  165. package/docs/getting-started/tanstack-start.mdx +12 -12
  166. package/docs/getting-started/vite.mdx +8 -8
  167. package/docs/how-it-works/cancellation.mdx +62 -62
  168. package/docs/how-it-works/code-transform.mdx +66 -54
  169. package/docs/how-it-works/encryption.mdx +25 -21
  170. package/docs/how-it-works/event-sourcing.mdx +84 -28
  171. package/docs/how-it-works/framework-integrations.mdx +12 -12
  172. package/docs/how-it-works/understanding-directives.mdx +21 -21
  173. package/docs/internal/index.mdx +6 -6
  174. package/docs/internal/nitro-native-build.mdx +2 -2
  175. package/docs/internal/nitro-web-ui.mdx +4 -4
  176. package/docs/internal/serializable-abort-controller.mdx +7 -7
  177. package/docs/observability/attributes.mdx +3 -3
  178. package/docs/observability/index.mdx +14 -10
  179. package/docs/observability/tracing.mdx +10 -10
  180. package/docs/testing/index.mdx +35 -35
  181. package/docs/testing/server-based.mdx +10 -10
  182. package/docs/whats-new.mdx +185 -0
  183. package/package.json +12 -12
@@ -5,12 +5,10 @@ type: overview
5
5
  summary: Explore runtime functions for starting workflows, inspecting runs, and managing hooks.
6
6
  ---
7
7
 
8
- API reference for runtime functions from the `workflow/api` package.
8
+ The `workflow/api` package provides runtime functions to inspect runs, start new runs, and manage hooks.
9
9
 
10
10
  ## Functions
11
11
 
12
- The API package is for access and introspection of workflow data to inspect runs, start new runs, and manage hooks.
13
-
14
12
  <Cards>
15
13
  <Card href="/docs/api-reference/workflow-api/start" title="start()">
16
14
  Start/enqueue a new workflow run.
@@ -30,5 +28,5 @@ The API package is for access and introspection of workflow data to inspect runs
30
28
  </Cards>
31
29
 
32
30
  <Callout type="info">
33
- Looking for `getWorld()` and the World SDK? They are exported from `workflow/runtime` see the [`workflow/runtime` reference](/docs/api-reference/workflow-runtime).
31
+ Looking for `getWorld()` and the World SDK? They are exported from `workflow/runtime`. See the [`workflow/runtime` reference](/docs/api-reference/workflow-runtime).
34
32
  </Callout>
@@ -37,7 +37,7 @@ export async function POST(request: Request) {
37
37
  }
38
38
  ```
39
39
 
40
- ## API Signature
40
+ ## API signature
41
41
 
42
42
  ### Parameters
43
43
 
@@ -50,7 +50,7 @@ showSections={["parameters"]}
50
50
 
51
51
  ### Returns
52
52
 
53
- Returns a `Promise<ResumedHook>` a `Hook` extended with an optional `resilientResume` flag. Resolving means the resume was accepted and the workflow will continue, whether the `hook_received` event was written directly or, on the parallel fast path, delivered through the workflow queue for the runtime to materialize (see the [lazy hook resume changelog](/docs/changelog/resilient-resume)). `resilientResume` is `true` only when the direct event write failed transiently and the resume was recovered through the queue; on the happy path it is absent. The resolved hook:
53
+ Returns a `Promise<ResumedHook>`, a `Hook` extended with an optional `resilientResume` flag. Resolving means the resume was accepted and the workflow will continue, whether the `hook_received` event was written directly or, on the parallel fast path, delivered through the workflow queue for the runtime to materialize (see the [lazy hook resume changelog](/docs/changelog/resilient-resume)). `resilientResume` is `true` only when the direct event write failed transiently and the resume was recovered through the queue; on the happy path it is absent. The resolved hook:
54
54
 
55
55
  <TSDoc
56
56
  definition={`
@@ -61,7 +61,7 @@ showSections={["returns"]}
61
61
 
62
62
  ## Examples
63
63
 
64
- ### Basic API Route
64
+ ### Basic API route
65
65
 
66
66
  Using `resumeHook` in a basic API route to resume a hook:
67
67
 
@@ -84,7 +84,7 @@ export async function POST(request: Request) {
84
84
  }
85
85
  ```
86
86
 
87
- ### With Type Safety
87
+ ### With type safety
88
88
 
89
89
  Defining a payload type and using `resumeHook` to resume a hook with type safety:
90
90
 
@@ -112,7 +112,7 @@ export async function POST(request: Request) {
112
112
  }
113
113
  ```
114
114
 
115
- ### Server Action (Next.js)
115
+ ### Server action (Next.js)
116
116
 
117
117
  Using `resumeHook` in Next.js server actions to resume a hook:
118
118
 
@@ -131,7 +131,7 @@ export async function approveRequest(token: string, approved: boolean) {
131
131
  }
132
132
  ```
133
133
 
134
- ### Webhook Handler
134
+ ### Webhook handler
135
135
 
136
136
  Using `resumeHook` in a generic webhook handler to resume a hook:
137
137
 
@@ -158,11 +158,11 @@ export async function POST(request: Request) {
158
158
  }
159
159
  ```
160
160
 
161
- ### Resume or Start
161
+ ### Resume or start
162
162
 
163
- A common endpoint shape is "resume or start": one route that resumes the active workflow run for a business key if one exists, or starts a new run otherwise. This comes up when the workflow uses a deterministic hook token as its idempotency key for example, one active run per order or conversation.
163
+ A common endpoint shape is "resume or start": one route that resumes the active workflow run for a business key if one exists, or starts a new run otherwise. This comes up when the workflow uses a deterministic hook token as its idempotency key, for example, one active run per order or conversation.
164
164
 
165
- `resumeHook()` is the resume half of that flow. Try it first; if it throws `HookNotFoundError`, no active run owns the token yet, so start the workflow. One subtlety: `start()` returns before the new run executes and registers its hook, so you cannot resume immediately after starting. Retry the resume until the hook is registered if you drop the payload and only start the workflow, the data from this request is lost.
165
+ `resumeHook()` is the resume half of that flow. Try it first; if it throws `HookNotFoundError`, no active run owns the token yet, so start the workflow. One subtlety: `start()` returns before the new run executes and registers its hook, so you cannot resume immediately after starting. Retry the resume until the hook is registered: if you drop the payload and only start the workflow, the data from this request is lost.
166
166
 
167
167
  ```typescript lineNumbers
168
168
  import { resumeHook, start } from "workflow/api";
@@ -213,9 +213,9 @@ export async function POST(request: Request) {
213
213
 
214
214
  See [Run idempotency](/docs/foundations/idempotency#run-idempotency) for the full pattern, including how the workflow claims the token with `hook.getConflict()` and how concurrent starts converge on one active owner.
215
215
 
216
- ## Related Functions
216
+ ## Related functions
217
217
 
218
- - [`getHookByToken()`](/docs/api-reference/workflow-api/get-hook-by-token) - Get hook details before resuming.
219
- - [`createHook()`](/docs/api-reference/workflow/create-hook) - Create a hook in a workflow.
220
- - [`defineHook()`](/docs/api-reference/workflow/define-hook) - Type-safe hook helper.
221
- - [Idempotency](/docs/foundations/idempotency) - Deduplicate step side effects and workflow starts.
218
+ - [`getHookByToken()`](/docs/api-reference/workflow-api/get-hook-by-token): Get hook details before resuming.
219
+ - [`createHook()`](/docs/api-reference/workflow/create-hook): Create a hook in a workflow.
220
+ - [`defineHook()`](/docs/api-reference/workflow/define-hook): Type-safe hook helper.
221
+ - [Idempotency](/docs/foundations/idempotency): Deduplicate step side effects and workflow starts.
@@ -37,7 +37,7 @@ export async function POST(request: Request) {
37
37
  }
38
38
  ```
39
39
 
40
- ## API Signature
40
+ ## API signature
41
41
 
42
42
  ### Parameters
43
43
 
@@ -58,10 +58,10 @@ Returns a `Promise<Response>` that resolves to one of:
58
58
 
59
59
  Throws [`HookNotFoundError`](/docs/api-reference/workflow-errors/hook-not-found-error) if the token does not match an active webhook.
60
60
 
61
- ## Usage Note
61
+ ## Usage note
62
62
 
63
63
  <Callout type="warn">
64
- In most cases, you should not need to call `resumeWebhook()` directly. When you use `createWebhook()`, the framework automatically generates a random webhook token and provides a public URL at `/.well-known/workflow/v1/webhook/:token`. External systems can send HTTP requests directly to that URL.
64
+ In most cases, you should not need to call `resumeWebhook()` directly. When you use `createWebhook()`, the framework automatically generates a webhook token and provides a public URL at `/.well-known/workflow/v1/webhook/:token`. External systems can send HTTP requests directly to that URL.
65
65
 
66
66
  For server-side hook resumption with deterministic tokens, use [`resumeHook()`](/docs/api-reference/workflow-api/resume-hook) with [`createHook()`](/docs/api-reference/workflow/create-hook) instead.
67
67
  </Callout>
@@ -90,7 +90,7 @@ export async function POST(request: Request) {
90
90
  }
91
91
  ```
92
92
 
93
- ## Related Functions
93
+ ## Related functions
94
94
 
95
95
  - [`createWebhook()`](/docs/api-reference/workflow/create-webhook) - Create a webhook in a workflow
96
96
  - [`resumeHook()`](/docs/api-reference/workflow-api/resume-hook) - Resume a hook with arbitrary payload
@@ -18,7 +18,7 @@ import { myWorkflow } from "./workflows/my-workflow";
18
18
  const run = await start(myWorkflow); // [!code highlight]
19
19
  ```
20
20
 
21
- ## API Signature
21
+ ## API signature
22
22
 
23
23
  ### Parameters
24
24
 
@@ -50,24 +50,25 @@ showSections={["returns"]}
50
50
 
51
51
  Learn more about [`WorkflowReadableStreamOptions`](/docs/api-reference/workflow-api/get-run#workflowreadablestreamoptions).
52
52
 
53
- ## Good to Know
53
+ ## Good to know
54
54
 
55
- * The `start()` function is used in runtime contexts to programmatically trigger workflow executions.
56
- * In v5, `start()` can also be called directly from a workflow function to spawn a child run or continue work in a new run. See [Workflow Composition](/cookbook/common-patterns/workflow-composition) and [Versioning](/docs/foundations/versioning).
55
+ * Use the `start()` function in runtime contexts to programmatically trigger workflow executions.
56
+ * In v5, you can also call `start()` directly from a workflow function to spawn a child run or continue work in a new run. See [Workflow Composition](/cookbook/common-patterns/workflow-composition) and [Versioning](/docs/foundations/versioning).
57
57
  * This is different from calling workflow functions directly, which is the typical pattern in Next.js applications.
58
- * The function returns immediately after enqueuing the workflow - it doesn't wait for the workflow to complete.
59
- * Each call to `start()` creates a new workflow run. If retried requests must route to one active workflow, have the workflow create a deterministic hook token and use [`getHookByToken()`](/docs/api-reference/workflow-api/get-hook-by-token) to reuse an already-registered active hook. The lookup is not atomic with `start()`, so concurrent callers can still create extra runs before the hook is registered; handle that race inside the workflow by checking `await hook.getConflict()` before duplicate-sensitive work on a conflict it resolves with the run that owns the token, so the duplicate can return the active owner to the caller. If duplicates must be rejected before a workflow body runs, keep a durable request record until native atomic start-and-hook registration exists. See [Idempotency](/docs/foundations/idempotency#run-idempotency).
58
+ * The function returns immediately after enqueuing the workflow. It doesn't wait for the workflow to complete.
59
+ * Each call to `start()` creates a new workflow run. If retried requests must route to one active workflow, have the workflow create a deterministic hook token and use [`getHookByToken()`](/docs/api-reference/workflow-api/get-hook-by-token) to reuse an already-registered active hook. The lookup is not atomic with `start()`, so concurrent callers can still create extra runs before the hook is registered. Handle that race inside the workflow by checking `await hook.getConflict()` before duplicate-sensitive work. On a conflict, it resolves with the run that owns the token, so the duplicate can return the active owner to the caller. If duplicates must be rejected before a workflow body runs, keep a durable request record until native atomic start-and-hook registration exists. See [Idempotency](/docs/foundations/idempotency#run-idempotency).
60
60
  * All arguments must be [serializable](/docs/foundations/serialization).
61
- * When `deploymentId` is provided, the argument types and return type become `unknown` since there is no guarantee the workflow function's types will be consistent across different deployments.
61
+ * When you provide `deploymentId`, the argument types and return type become `unknown` because the workflow function's types may differ across deployments.
62
62
  * `attributes` seeds plaintext run metadata as part of creation and requires a World implementing spec version 4 or later. Keys that start with `$` are reserved for framework and library code; framework-level callers can pass `allowReservedAttributes: true` to seed reserved keys, with the same semantics as the [`setAttributes`](/docs/api-reference/workflow/set-attributes) option of the same name.
63
+ * `region` pins the new run to a specific region on Worlds with a regional dimension. The [Vercel World](/worlds/vercel#explicit-region-selection) then serves the run's storage, queue dispatch, and streams from that region. When you omit `region`, the run is pinned to the region where it was created. Worlds without regions ignore the option.
63
64
 
64
65
  <Callout type="info">
65
- If `start()` throws `'start' received an invalid workflow function. Ensure the Workflow SDK is configured correctly and the function includes a 'use workflow' directive.`, the passed function was not transformed as a workflow. The two most common causes are a missing `"use workflow"` directive or missing framework integration. See [start-invalid-workflow-function](/docs/errors/start-invalid-workflow-function).
66
+ If `start()` throws `'start' received an invalid workflow function. Ensure the Workflow SDK is configured correctly and the function includes a 'use workflow' directive.`, the compiler did not transform the passed function as a workflow. The two most common causes are a missing `"use workflow"` directive or missing framework integration. See [start-invalid-workflow-function](/docs/errors/start-invalid-workflow-function).
66
67
  </Callout>
67
68
 
68
69
  ## Examples
69
70
 
70
- ### With Arguments
71
+ ### With arguments
71
72
 
72
73
  ```typescript
73
74
  import { start } from "workflow/api";
@@ -102,7 +103,7 @@ const run = await start(myWorkflow, ["arg1", "arg2"], { // [!code highlight]
102
103
  ```
103
104
 
104
105
  <Callout type="info">
105
- The `deploymentId` option is currently a Vercel-specific feature. Other Worlds may implement this option differently to match their own deployment runtimes, and the World spec may rename it from `deploymentId` to `version` in a future SDK version. On Vercel, `"latest"` resolves to the most recent deployment matching your current environment the same production target for production deployments, or the same git branch for preview deployments.
106
+ The `deploymentId` option is currently a Vercel-specific feature. Other Worlds may implement this option differently to match their own deployment runtimes, and the World spec may rename it from `deploymentId` to `version` in a future SDK version. On Vercel, `"latest"` resolves to the most recent deployment matching your current environment: the same production target for production deployments, or the same git branch for preview deployments.
106
107
 
107
108
  In Worlds without atomic, immutable deployments (such as local development or self-hosted Postgres), there is no notion of multiple deployments to resolve between, so `deploymentId: "latest"` has no effect: the SDK logs a warning and the run targets the current deployment. This means a workflow that opts into `"latest"` on Vercel still runs unchanged in local development.
108
109
  </Callout>
@@ -110,13 +111,13 @@ In Worlds without atomic, immutable deployments (such as local development or se
110
111
  <Callout type="warn">
111
112
  When using `deploymentId: "latest"`, the workflow run will execute on a potentially different deployment than the one calling `start()`. Be mindful of forward and backward compatibility:
112
113
 
113
- - **Workflow identity**: The workflow ID is derived from the function name and file path. If the latest deployment has renamed the workflow function or moved it to a different directory, the workflow ID will no longer match and the run will fail to start.
114
- - **Input and output compatibility**: The arguments passed to `start()` are serialized by the calling deployment but deserialized by the target deployment. Similarly, the workflow's return value is serialized by the target deployment but deserialized by the caller. If the workflow's expected arguments or return type have changed (e.g. added required fields, removed fields, or changed types), the run may fail or behave unexpectedly. Ensure that input and output schemas remain backward-compatible across deployments.
114
+ - **Workflow identity**: The function name and file path determine the workflow ID. If the latest deployment has renamed the workflow function or moved it to a different directory, the workflow ID will no longer match and the run will fail to start.
115
+ - **Input and output compatibility**: The calling deployment serializes the arguments passed to `start()`, and the target deployment deserializes them. Similarly, the target deployment serializes the workflow's return value, and the caller deserializes it. If the workflow's expected arguments or return type have changed (for example, added required fields, removed fields, or changed types), the run may fail or behave unexpectedly. Ensure that input and output schemas remain backward-compatible across deployments.
115
116
  </Callout>
116
117
 
117
- ### Inside a Workflow Function
118
+ ### Inside a workflow function
118
119
 
119
- `start()` can be called directly from a workflow function to spawn a child run. It is step-backed, so the spawn records a deterministic step boundary in the parent's event log.
120
+ Call `start()` directly from a workflow function to spawn a child run. It is step-backed, so the spawn records a deterministic step boundary in the parent's event log.
120
121
 
121
122
  ```typescript
122
123
  import { start } from "workflow/api";
@@ -136,5 +137,5 @@ The returned `Run` object is fully functional inside a workflow. Each property a
136
137
  </Callout>
137
138
 
138
139
  <Callout type="warn">
139
- `returnValue` polls the child run every second and holds the polling step's worker slot open for as long as the child takes to finish. For long-running children, spawn without awaiting `returnValue` and have the child resume a [hook](/docs/foundations/hooks) when it completes see the [`startAndWait()` pattern](/cookbook/advanced/child-workflows).
140
+ `returnValue` polls the child run every second and holds the polling step's worker slot open for as long as the child takes to finish. For long-running children, spawn without awaiting `returnValue` and have the child resume a [hook](/docs/foundations/hooks) when it completes. See the [`startAndWait()` pattern](/cookbook/advanced/child-workflows).
140
141
  </Callout>
@@ -24,9 +24,9 @@ export default defineConfig({
24
24
  });
25
25
  ```
26
26
 
27
- The integration registers the workflow Vite transform plugins during `astro:config:setup` and builds the workflow bundles locally during config setup, or via the Vercel builder after `astro:build:done` when deploying to Vercel.
27
+ The integration registers the workflow Vite transform plugins during `astro:config:setup` and builds the workflow bundles: locally during config setup, or via the Vercel builder after `astro:build:done` when deploying to Vercel.
28
28
 
29
- ## API Signature
29
+ ## API signature
30
30
 
31
31
  ### Parameters
32
32
 
@@ -38,7 +38,7 @@ The integration registers the workflow Vite transform plugins during `astro:conf
38
38
 
39
39
  | Option | Type | Default | Description |
40
40
  | --- | --- | --- | --- |
41
- | `sourcemap` | `boolean \| 'inline' \| 'linked' \| 'external' \| 'both'` | `'inline'` (dev) / `false` (prod) | Controls source maps on generated workflow bundles. Accepts the same values as esbuild's `sourcemap` option. Defaults to `'inline'` in development and `false` in production (smaller function bundles helps stay under the Vercel 250MB function size limit). Set it explicitly, or use the `WORKFLOW_SOURCEMAP` environment variable, to override in either environment. |
41
+ | `sourcemap` | `boolean \| 'inline' \| 'linked' \| 'external' \| 'both'` | `'inline'` (dev) / `false` (prod) | Controls source maps on generated workflow bundles. Accepts the same values as esbuild's `sourcemap` option. Defaults to `'inline'` in development and `false` in production (smaller function bundles, which helps stay under the Vercel 250 MB function size limit). Set it explicitly, or use the `WORKFLOW_SOURCEMAP` environment variable, to override in either environment. |
42
42
 
43
43
  ### Returns
44
44
 
@@ -26,12 +26,12 @@ try {
26
26
  await world.events.create(runId, event);
27
27
  } catch (error) {
28
28
  if (EntityConflictError.is(error)) { // [!code highlight]
29
- // Event already exists safe to ignore during replay
29
+ // Event already exists, safe to ignore during replay
30
30
  }
31
31
  }
32
32
  ```
33
33
 
34
- ## API Signature
34
+ ## API signature
35
35
 
36
36
  ### Properties
37
37
 
@@ -44,11 +44,11 @@ interface EntityConflictError {
44
44
  export default EntityConflictError;`}
45
45
  />
46
46
 
47
- ### Static Methods
47
+ ### Static methods
48
48
 
49
49
  #### `EntityConflictError.is(value)`
50
50
 
51
- Type-safe check for `EntityConflictError` instances. Preferred over `instanceof` because it works across module boundaries and VM contexts.
51
+ Type-safe check for `EntityConflictError` instances. Preferred over `instanceof` because it works across module boundaries and virtual machine contexts.
52
52
 
53
53
  ```typescript
54
54
  import { EntityConflictError } from "workflow/errors"
@@ -9,7 +9,7 @@ related:
9
9
  - /docs/errors/hook-conflict
10
10
  ---
11
11
 
12
- `HookConflictError` is thrown when creating a hook with a token that is already in use by another active workflow run. Hook tokens must be unique across all running workflows see the [hook-conflict](/docs/errors/hook-conflict) error guide for resolution strategies.
12
+ `HookConflictError` is thrown when creating a hook with a token that is already in use by another active workflow run. Hook tokens must be unique across all running workflows. See the [hook-conflict](/docs/errors/hook-conflict) error guide for resolution strategies.
13
13
 
14
14
  ```typescript lineNumbers
15
15
  import { HookConflictError } from "workflow/errors"
@@ -27,7 +27,7 @@ try {
27
27
  }
28
28
  ```
29
29
 
30
- ## API Signature
30
+ ## API signature
31
31
 
32
32
  ### Properties
33
33
 
@@ -44,11 +44,11 @@ interface HookConflictError {
44
44
  export default HookConflictError;`}
45
45
  />
46
46
 
47
- ### Static Methods
47
+ ### Static methods
48
48
 
49
49
  #### `HookConflictError.is(value)`
50
50
 
51
- Type-safe check for `HookConflictError` instances. Preferred over `instanceof` because it works across module boundaries and VM contexts.
51
+ Type-safe check for `HookConflictError` instances. Preferred over `instanceof` because it works across module boundaries and virtual machine contexts.
52
52
 
53
53
  ```typescript
54
54
  import { HookConflictError } from "workflow/errors"
@@ -10,9 +10,9 @@ related:
10
10
 
11
11
  `HookNotFoundError` is thrown when calling `resumeHook()` or `resumeWebhook()` with a token that does not match any active hook. This typically happens when:
12
12
 
13
- - The hook has expired (past its TTL)
14
- - The hook was already consumed and disposed
15
- - The workflow has not started yet, so the hook does not exist
13
+ - The hook's time to live (TTL) has expired.
14
+ - The hook was already consumed and disposed.
15
+ - The workflow has not started yet, so the hook does not exist.
16
16
 
17
17
  ```typescript lineNumbers
18
18
  import { HookNotFoundError } from "workflow/errors"
@@ -29,7 +29,7 @@ try {
29
29
  }
30
30
  ```
31
31
 
32
- ## API Signature
32
+ ## API signature
33
33
 
34
34
  ### Properties
35
35
 
@@ -44,11 +44,11 @@ interface HookNotFoundError {
44
44
  export default HookNotFoundError;`}
45
45
  />
46
46
 
47
- ### Static Methods
47
+ ### Static methods
48
48
 
49
49
  #### `HookNotFoundError.is(value)`
50
50
 
51
- Type-safe check for `HookNotFoundError` instances. Preferred over `instanceof` because it works across module boundaries and VM contexts.
51
+ Type-safe check for `HookNotFoundError` instances. Preferred over `instanceof` because it works across module boundaries and virtual machine contexts.
52
52
 
53
53
  ```typescript
54
54
  import { HookNotFoundError } from "workflow/errors"
@@ -66,7 +66,7 @@ if (HookNotFoundError.is(error)) {
66
66
  A common pattern for idempotent workflows is to try resuming a hook, and if it doesn't exist yet, start a new workflow run with the input data.
67
67
 
68
68
  <Callout>
69
- This "resume or start" pattern is not atomic there is a small window where a race condition is possible. A better native approach is being worked on, but this pattern works well for many use cases.
69
+ This "resume or start" pattern is not atomic: there is a small window where a race condition is possible. A better native approach is being worked on, but this pattern works well for many use cases.
70
70
  </Callout>
71
71
 
72
72
  ```typescript lineNumbers
@@ -80,7 +80,7 @@ async function handleIncomingEvent(token: string, data: unknown) {
80
80
  await resumeHook(token, data);
81
81
  } catch (error) {
82
82
  if (HookNotFoundError.is(error)) { // [!code highlight]
83
- // Hook doesn't exist yet start a new workflow run
83
+ // Hook doesn't exist yet, so start a new workflow run
84
84
  await startWorkflow("processEvent", data); // [!code highlight]
85
85
  } else {
86
86
  throw error;
@@ -11,7 +11,7 @@ API reference for the error classes exported from the `workflow/errors` package.
11
11
 
12
12
  All errors extend [`WorkflowError`](/docs/api-reference/workflow-errors/workflow-error), so you can catch any SDK error with a single `instanceof` check, or narrow to a specific class for fine-grained handling.
13
13
 
14
- ## Base Classes
14
+ ## Base classes
15
15
 
16
16
  <Cards>
17
17
  <Card href="/docs/api-reference/workflow-errors/workflow-error" title="WorkflowError">
@@ -22,7 +22,7 @@ All errors extend [`WorkflowError`](/docs/api-reference/workflow-errors/workflow
22
22
  </Card>
23
23
  </Cards>
24
24
 
25
- ## Registration Errors
25
+ ## Registration errors
26
26
 
27
27
  <Cards>
28
28
  <Card href="/docs/api-reference/workflow-errors/workflow-not-registered-error" title="WorkflowNotRegisteredError">
@@ -33,7 +33,7 @@ All errors extend [`WorkflowError`](/docs/api-reference/workflow-errors/workflow
33
33
  </Card>
34
34
  </Cards>
35
35
 
36
- ## Run Errors
36
+ ## Run errors
37
37
 
38
38
  <Cards>
39
39
  <Card href="/docs/api-reference/workflow-errors/workflow-run-not-found-error" title="WorkflowRunNotFoundError">
@@ -43,7 +43,7 @@ All errors extend [`WorkflowError`](/docs/api-reference/workflow-errors/workflow
43
43
  Thrown when awaiting the return value of a failed workflow run.
44
44
  </Card>
45
45
  <Card href="/docs/api-reference/workflow-errors/workflow-run-cancelled-error" title="WorkflowRunCancelledError">
46
- Thrown when awaiting the return value of a cancelled workflow run.
46
+ Thrown when awaiting the return value of a canceled workflow run.
47
47
  </Card>
48
48
  <Card href="/docs/api-reference/workflow-errors/workflow-run-not-completed-error" title="WorkflowRunNotCompletedError">
49
49
  Thrown when requesting the result of a workflow run that has not completed yet.
@@ -59,7 +59,7 @@ All errors extend [`WorkflowError`](/docs/api-reference/workflow-errors/workflow
59
59
  </Card>
60
60
  </Cards>
61
61
 
62
- ## Hook Errors
62
+ ## Hook errors
63
63
 
64
64
  <Cards>
65
65
  <Card href="/docs/api-reference/workflow-errors/hook-not-found-error" title="HookNotFoundError">
@@ -70,7 +70,7 @@ All errors extend [`WorkflowError`](/docs/api-reference/workflow-errors/workflow
70
70
  </Card>
71
71
  </Cards>
72
72
 
73
- ## Backend Errors
73
+ ## Backend errors
74
74
 
75
75
  <Cards>
76
76
  <Card href="/docs/api-reference/workflow-errors/throttle-error" title="ThrottleError">
@@ -1,24 +1,24 @@
1
1
  ---
2
2
  title: PreconditionFailedError
3
- description: Thrown when an event creation is rejected because the client's event-log snapshot is stale.
3
+ description: World implementations throw this error when they reject an event creation because the client's event-log snapshot is stale.
4
4
  type: reference
5
- summary: Catch PreconditionFailedError when a world rejects an event creation made from a stale event-log snapshot.
5
+ summary: Catch PreconditionFailedError when a World rejects an event creation made from a stale event-log snapshot.
6
6
  related:
7
7
  - /docs/api-reference/workflow-errors/workflow-world-error
8
8
  - /docs/api-reference/workflow-errors/entity-conflict-error
9
9
  ---
10
10
 
11
- `PreconditionFailedError` is thrown by world implementations when an event creation is rejected because the client's event-log snapshot is stale: the log already held more events than the position the creation named. It corresponds to HTTP 412 Precondition Failed semantics.
11
+ World implementations throw `PreconditionFailedError` when they reject an event creation because the client's event-log snapshot is stale: the log already held more events than the position the creation named. It corresponds to HTTP 412 Precondition Failed semantics.
12
12
 
13
- No world in this repository throws it. A stale replay does not need to be refused: its log is a prefix rather than a prefix with a hole in it, replay is deterministic on a prefix, and the write it makes next comes back carrying the events it was pushed past (see [Stale reads](/docs/configuration/runtime-tuning#stale-reads-and-why-nothing-has-to-be-rejected)). The error and the runtime's handling of it remain for a world that would rather refuse than report one that allocates positions somewhere other than the commit, and so cannot report a gap reliably. Event creations that carry no position are never rejected with it.
13
+ No World in this repository throws it. A stale replay does not need to be refused: its log is a prefix rather than a prefix with a hole in it, replay is deterministic on a prefix, and the write it makes next comes back carrying the events it was pushed past (see [Stale reads](/docs/configuration/runtime-tuning#stale-reads-and-why-nothing-has-to-be-rejected)). The error and the runtime's handling of it remain for a World that would rather refuse than report. Such a World allocates positions somewhere other than the commit, so it cannot report a gap reliably. Event creations that carry no position are never rejected with it.
14
14
 
15
- A world rejects only on evidence and accepts the creation whenever it cannot decide, so this error always means the snapshot really was stale but not receiving it does not prove the snapshot was current.
15
+ A World rejects only on evidence and accepts the creation whenever it cannot decide. This error always means the snapshot was stale, but not receiving it does not prove the snapshot was current.
16
16
 
17
17
  <Callout>
18
- The Workflow runtime handles this error automatically: it restarts the replay in the same invocation from a corrected event log, and re-invokes the run for a fresh replay only once its in-process restart budget is spent. It never retries the rejected creation as-is, because a replay working from a corrected log derives different events. You will only encounter it when interacting with world storage APIs directly.
18
+ The Workflow runtime handles this error by restarting the replay in the same invocation from a corrected event log. It re-invokes the run for a fresh replay only after spending its in-process restart budget. It never retries the rejected creation as-is because a replay working from a corrected log derives different events. You will only encounter it when interacting with World storage APIs directly.
19
19
  </Callout>
20
20
 
21
- A world may attach the events the client was missing to the rejection as `details`, which lets the runtime restart without re-reading the event log. Doing so is optional, and the runtime falls back to a full reload when the details are absent or unusable.
21
+ A World may attach the events the client was missing to the rejection as `details`, which lets the runtime restart without re-reading the event log. This is optional, and the runtime falls back to a full reload when the details are absent or unusable.
22
22
 
23
23
  ```typescript lineNumbers
24
24
  import { PreconditionFailedError } from "workflow/errors"
@@ -35,7 +35,7 @@ try {
35
35
  }
36
36
  ```
37
37
 
38
- ## API Signature
38
+ ## API signature
39
39
 
40
40
  ### Properties
41
41
 
@@ -52,7 +52,7 @@ interface PreconditionFailedError {
52
52
  export default PreconditionFailedError;`}
53
53
  />
54
54
 
55
- ### Static Methods
55
+ ### Static methods
56
56
 
57
57
  #### `PreconditionFailedError.is(value)`
58
58
 
@@ -29,7 +29,7 @@ try {
29
29
  }
30
30
  ```
31
31
 
32
- ## API Signature
32
+ ## API signature
33
33
 
34
34
  ### Properties
35
35
 
@@ -42,7 +42,7 @@ interface RunExpiredError {
42
42
  export default RunExpiredError;`}
43
43
  />
44
44
 
45
- ### Static Methods
45
+ ### Static methods
46
46
 
47
47
  #### `RunExpiredError.is(value)`
48
48
 
@@ -7,7 +7,7 @@ related:
7
7
  - /docs/foundations/versioning
8
8
  ---
9
9
 
10
- `RunNotSupportedError` is thrown when reading a workflow run whose data was written with a newer workflow spec version than the running SDK supports. This typically means the run was created by a newer version of the `workflow` package upgrade the package to process it.
10
+ `RunNotSupportedError` is thrown when reading a workflow run whose data was written with a newer workflow spec version than the running SDK supports. This typically means the run was created by a newer version of the `workflow` package. Upgrade the package to process it.
11
11
 
12
12
  ```typescript lineNumbers
13
13
  import { RunNotSupportedError } from "workflow/errors"
@@ -25,7 +25,7 @@ try {
25
25
  }
26
26
  ```
27
27
 
28
- ## API Signature
28
+ ## API signature
29
29
 
30
30
  ### Properties
31
31
 
@@ -42,11 +42,11 @@ interface RunNotSupportedError {
42
42
  export default RunNotSupportedError;`}
43
43
  />
44
44
 
45
- ### Static Methods
45
+ ### Static methods
46
46
 
47
47
  #### `RunNotSupportedError.is(value)`
48
48
 
49
- Type-safe check for `RunNotSupportedError` instances. Preferred over `instanceof` because it works across module boundaries and VM contexts.
49
+ Type-safe check for `RunNotSupportedError` instances. Preferred over `instanceof` because it works across module boundaries and virtual machine contexts.
50
50
 
51
51
  ```typescript
52
52
  import { RunNotSupportedError } from "workflow/errors"
@@ -8,7 +8,7 @@ related:
8
8
  - /docs/api-reference/workflow-errors/workflow-not-registered-error
9
9
  ---
10
10
 
11
- `StepNotRegisteredError` is thrown when the runtime tries to execute a step function that is not registered in the current deployment. This is an infrastructure error not a user code error. It typically indicates a build or bundling issue that caused the step to not be included in the deployment.
11
+ `StepNotRegisteredError` is thrown when the runtime tries to execute a step function that is not registered in the current deployment. This is an infrastructure error, not a user code error. It typically indicates a build or bundling issue that caused the step to not be included in the deployment.
12
12
 
13
13
  When this error occurs, the step fails (like a `FatalError`) and control is passed back to the workflow function, which can handle the failure gracefully.
14
14
 
@@ -21,7 +21,7 @@ if (StepNotRegisteredError.is(error)) { // [!code highlight]
21
21
  }
22
22
  ```
23
23
 
24
- ## API Signature
24
+ ## API signature
25
25
 
26
26
  ### Properties
27
27
 
@@ -36,14 +36,14 @@ interface StepNotRegisteredError {
36
36
  export default StepNotRegisteredError;`}
37
37
  />
38
38
 
39
- ### Static Methods
39
+ ### Static methods
40
40
 
41
41
  #### `StepNotRegisteredError.is(value)`
42
42
 
43
- Type-safe check for `StepNotRegisteredError` instances. Preferred over `instanceof` because it works across module boundaries and VM contexts.
43
+ Type-safe check for `StepNotRegisteredError` instances. Preferred over `instanceof` because it works across module boundaries and virtual machine contexts.
44
44
 
45
45
  <Callout>
46
- The `.is()` method works in server-side Node.js code (API routes, middleware, hooks). Inside `"use workflow"` functions, step errors arrive deserialized from the event log and won't be actual `StepNotRegisteredError` instances use `error.message` matching instead. See the [troubleshooting page](/docs/errors/step-not-registered) for workflow-side error handling examples.
46
+ The `.is()` method works in server-side Node.js code (API routes, middleware, hooks). Inside `"use workflow"` functions, step errors arrive deserialized from the event log and won't be actual `StepNotRegisteredError` instances. Use `error.message` matching instead. See the [troubleshooting page](/docs/errors/step-not-registered) for workflow-side error handling examples.
47
47
  </Callout>
48
48
 
49
49
  ```typescript
@@ -31,7 +31,7 @@ try {
31
31
  }
32
32
  ```
33
33
 
34
- ## API Signature
34
+ ## API signature
35
35
 
36
36
  ### Properties
37
37
 
@@ -46,7 +46,7 @@ interface ThrottleError {
46
46
  export default ThrottleError;`}
47
47
  />
48
48
 
49
- ### Static Methods
49
+ ### Static methods
50
50
 
51
51
  #### `ThrottleError.is(value)`
52
52
 
@@ -31,7 +31,7 @@ try {
31
31
  }
32
32
  ```
33
33
 
34
- ## API Signature
34
+ ## API signature
35
35
 
36
36
  ### Properties
37
37
 
@@ -46,7 +46,7 @@ interface TooEarlyError {
46
46
  export default TooEarlyError;`}
47
47
  />
48
48
 
49
- ### Static Methods
49
+ ### Static methods
50
50
 
51
51
  #### `TooEarlyError.is(value)`
52
52
 
@@ -17,7 +17,7 @@ const error = new WorkflowError("something went wrong", {
17
17
  });
18
18
  ```
19
19
 
20
- ## API Signature
20
+ ## API signature
21
21
 
22
22
  ### Properties
23
23
 
@@ -32,14 +32,14 @@ interface WorkflowError {
32
32
  export default WorkflowError;`}
33
33
  />
34
34
 
35
- ### Static Methods
35
+ ### Static methods
36
36
 
37
37
  #### `WorkflowError.is(value)`
38
38
 
39
- Type-safe check for `WorkflowError` instances. Preferred over `instanceof` because it works across module boundaries and VM contexts.
39
+ Type-safe check for `WorkflowError` instances. Preferred over `instanceof` because it works across module boundaries and virtual machine contexts.
40
40
 
41
41
  <Callout type="warn">
42
- `WorkflowError.is()` matches only direct `WorkflowError` instances not subclasses, which override the error name it checks. To handle a specific error type, use that subclass's own `.is()` method (e.g. `WorkflowRunFailedError.is(error)`).
42
+ `WorkflowError.is()` matches only direct `WorkflowError` instances, not subclasses, which override the error name it checks. To handle a specific error type, use that subclass's own `.is()` method (e.g. `WorkflowRunFailedError.is(error)`).
43
43
  </Callout>
44
44
 
45
45
  ```typescript