workflow 5.0.0-beta.35 → 5.0.0-beta.36
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/dist/nest-builder.d.ts +2 -0
- package/dist/nest-builder.d.ts.map +1 -0
- package/dist/nest-builder.js +2 -0
- package/dist/nest-vercel-builder.d.ts +2 -0
- package/dist/nest-vercel-builder.d.ts.map +1 -0
- package/dist/nest-vercel-builder.js +2 -0
- package/docs/api-reference/workflow/create-hook.mdx +43 -2
- package/docs/api-reference/workflow/define-hook.mdx +26 -24
- package/docs/api-reference/workflow/fatal-error.mdx +29 -7
- package/docs/api-reference/workflow/fetch.mdx +3 -4
- package/docs/api-reference/workflow/sleep.mdx +1 -1
- package/docs/api-reference/workflow-api/get-hook-by-token.mdx +2 -0
- package/docs/api-reference/workflow-api/resume-hook.mdx +2 -0
- package/docs/api-reference/workflow-api/resume-webhook.mdx +6 -4
- package/docs/api-reference/workflow-api/start.mdx +1 -1
- package/docs/api-reference/workflow-nest/nest-local-builder.mdx +1 -1
- package/docs/comparisons/index.mdx +66 -0
- package/docs/comparisons/meta.json +11 -0
- package/docs/comparisons/workflow-sdk-vs-aws-agentcore.mdx +55 -0
- package/docs/comparisons/workflow-sdk-vs-aws-step-functions.mdx +111 -0
- package/docs/comparisons/workflow-sdk-vs-cloudflare-workflows.mdx +71 -0
- package/docs/comparisons/workflow-sdk-vs-inngest.mdx +102 -0
- package/docs/comparisons/workflow-sdk-vs-temporal.mdx +123 -0
- package/docs/comparisons/workflow-sdk-vs-trigger-dev.mdx +103 -0
- package/docs/configuration/runtime-tuning.mdx +22 -3
- package/docs/configuration/worlds.mdx +4 -4
- package/docs/cookbook/common-patterns/idempotency.mdx +1 -1
- package/docs/{deploying/index.mdx → deploying.mdx} +6 -8
- package/docs/foundations/hooks.mdx +1 -1
- package/docs/foundations/idempotency.mdx +16 -9
- package/docs/getting-started/astro.mdx +1 -1
- package/docs/getting-started/express.mdx +1 -1
- package/docs/getting-started/fastify.mdx +1 -1
- package/docs/getting-started/hono.mdx +1 -1
- package/docs/getting-started/index.mdx +3 -3
- package/docs/getting-started/meta.json +2 -1
- package/docs/getting-started/nestjs.mdx +63 -2
- package/docs/getting-started/next.mdx +2 -2
- package/docs/getting-started/nitro.mdx +1 -1
- package/docs/getting-started/nuxt.mdx +1 -1
- package/docs/getting-started/sveltekit.mdx +1 -1
- package/docs/getting-started/vite.mdx +1 -1
- package/docs/how-it-works/encryption.mdx +3 -3
- package/docs/how-it-works/event-sourcing.mdx +6 -6
- package/docs/how-it-works/framework-integrations.mdx +2 -2
- package/docs/meta.json +1 -1
- package/package.json +13 -11
- package/docs/deploying/building-a-world.mdx +0 -251
- package/docs/deploying/meta.json +0 -4
- package/docs/deploying/world/local-world.mdx +0 -105
- package/docs/deploying/world/meta.json +0 -4
- package/docs/deploying/world/postgres-world.mdx +0 -288
- package/docs/deploying/world/vercel-world.mdx +0 -270
- package/docs/migration-guides/index.mdx +0 -34
- package/docs/migration-guides/meta.json +0 -9
- package/docs/migration-guides/migrating-from-aws-step-functions.mdx +0 -362
- package/docs/migration-guides/migrating-from-inngest.mdx +0 -308
- package/docs/migration-guides/migrating-from-temporal.mdx +0 -317
- package/docs/migration-guides/migrating-from-trigger-dev.mdx +0 -332
|
@@ -96,7 +96,7 @@ export async function processOrder(orderId: string): Promise<OrderResult> {
|
|
|
96
96
|
}
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
-
The runtime creates the hook atomically. At most one
|
|
99
|
+
The runtime creates the hook atomically. At most one hook can own `order:${orderId}`, so duplicate workflow runs converge on one owner. A duplicate run observes `getConflict()` resolving with the owner's `Run` and returns before it reaches `chargeOrder()`. The conflicting run's accessors (`status`, `returnValue`, `cancel()`, …) are durable steps, so the duplicate run can do more than report the owner — see [conflict-handling strategies](#conflict-handling-strategies) below.
|
|
100
100
|
|
|
101
101
|
Outside the workflow, try to resume the hook first. If the hook is not registered yet, start the workflow and retry the resume until the new run creates the hook:
|
|
102
102
|
|
|
@@ -149,7 +149,7 @@ export async function POST(request: Request) {
|
|
|
149
149
|
This avoids creating a new run only after the first run has registered its hook. Because `start()` returns before the run body executes and calls `createHook()`, two concurrent requests can both observe "no hook yet" and each call `start()`. The race is resolved inside the workflow body, where the losing run observes `getConflict()` resolving with the active owner and returns without doing duplicate-sensitive work — and the route detects it by comparing the resumed hook's `runId` against the run it just started, without waiting for either run to finish. A native API for atomically starting a run and registering a hook is in the works. Until then, model recovery inside the workflow by checking `hook.getConflict()`.
|
|
150
150
|
</Callout>
|
|
151
151
|
|
|
152
|
-
This
|
|
152
|
+
This coordinates active runs by default: the token becomes available when its workflow ends. Set `experimental_minRetention` to keep it unavailable to late duplicates. After the workflow ends, the Hook can still be found with `getHookByToken()` until retention ends, but it cannot be resumed. See [`createHook()` minimum retention](/docs/api-reference/workflow/create-hook#keep-a-token-unavailable-after-the-run-ends) for examples and supported values.
|
|
153
153
|
|
|
154
154
|
### Conflict-handling strategies
|
|
155
155
|
|
|
@@ -182,7 +182,7 @@ export async function processOrder(orderId: string) {
|
|
|
182
182
|
}
|
|
183
183
|
```
|
|
184
184
|
|
|
185
|
-
**Inspect the owner before deciding.**
|
|
185
|
+
**Inspect the owner before deciding.** Reuse a completed owner's result, but reject other duplicates:
|
|
186
186
|
|
|
187
187
|
```typescript lineNumbers
|
|
188
188
|
import { createHook } from "workflow";
|
|
@@ -200,17 +200,17 @@ export async function processOrder(orderId: string) {
|
|
|
200
200
|
const conflict = await request.getConflict();
|
|
201
201
|
if (conflict) {
|
|
202
202
|
const status = await conflict.status; // [!code highlight]
|
|
203
|
-
if (status === "
|
|
204
|
-
return
|
|
203
|
+
if (status === "completed") {
|
|
204
|
+
return await conflict.returnValue;
|
|
205
205
|
}
|
|
206
|
-
|
|
206
|
+
return { status: "duplicate" as const, runId: conflict.runId };
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
return await processOwnedOrder(orderId);
|
|
210
210
|
}
|
|
211
211
|
```
|
|
212
212
|
|
|
213
|
-
**Signal the owner instead of doing the work.**
|
|
213
|
+
**Signal the owner instead of doing the work.** A conflict can refer to a finished run when `experimental_minRetention` is set, so check its status before sending data to its Hook:
|
|
214
214
|
|
|
215
215
|
```typescript lineNumbers
|
|
216
216
|
import { createHook } from "workflow";
|
|
@@ -230,16 +230,19 @@ export async function processOrder(orderId: string, confirmed: boolean) {
|
|
|
230
230
|
using request = createHook<OrderRequest>({ token });
|
|
231
231
|
|
|
232
232
|
const conflict = await request.getConflict();
|
|
233
|
-
if (conflict) {
|
|
233
|
+
if (conflict && ["pending", "running"].includes(await conflict.status)) {
|
|
234
234
|
await forwardToOwner(token, { confirmed }); // [!code highlight]
|
|
235
235
|
return { status: "forwarded" as const, runId: conflict.runId };
|
|
236
236
|
}
|
|
237
|
+
if (conflict) {
|
|
238
|
+
return { status: "duplicate" as const, runId: conflict.runId };
|
|
239
|
+
}
|
|
237
240
|
|
|
238
241
|
// ... own the token and do the work
|
|
239
242
|
}
|
|
240
243
|
```
|
|
241
244
|
|
|
242
|
-
**Supersede the owner.**
|
|
245
|
+
**Supersede the owner.** Without minimum retention, cancel the active run, then claim the released token. The retry loop covers the window where cancellation cleanup has not propagated yet:
|
|
243
246
|
|
|
244
247
|
```typescript lineNumbers
|
|
245
248
|
import { createHook } from "workflow";
|
|
@@ -272,6 +275,10 @@ export async function processOrderNewestWins(orderId: string) {
|
|
|
272
275
|
}
|
|
273
276
|
```
|
|
274
277
|
|
|
278
|
+
<Callout type="warn">
|
|
279
|
+
This pattern does not work with `experimental_minRetention`: cancelling the old run does not make its token available early.
|
|
280
|
+
</Callout>
|
|
281
|
+
|
|
275
282
|
If duplicate requests should only reuse the active run without sending data, use [`getHookByToken()`](/docs/api-reference/workflow-api/get-hook-by-token) as an advisory pre-check before calling `start()`. The workflow should still check `hook.getConflict()`, because the lookup and `start()` are not atomic.
|
|
276
283
|
|
|
277
284
|
Because this pattern uses hooks for idempotency, duplicate requests can also inject additional data and steer the existing run. The route example above uses `resumeHook()` for that: if the hook already exists, the duplicate request resumes the active workflow; if the hook is not registered yet, the route starts the workflow and retries `resumeHook()` so the payload is not dropped.
|
|
@@ -252,7 +252,7 @@ Additionally, check the [Deploying](/docs/deploying) section to learn how your w
|
|
|
252
252
|
If you see this error:
|
|
253
253
|
|
|
254
254
|
```
|
|
255
|
-
'start' received an invalid workflow function. Ensure the Workflow
|
|
255
|
+
'start' received an invalid workflow function. Ensure the Workflow SDK is configured correctly and the function includes a 'use workflow' directive.
|
|
256
256
|
```
|
|
257
257
|
|
|
258
258
|
Check both of these first:
|
|
@@ -273,7 +273,7 @@ Check the [Deploying](/docs/deploying) section to learn how your workflows can b
|
|
|
273
273
|
If you see this error:
|
|
274
274
|
|
|
275
275
|
```
|
|
276
|
-
'start' received an invalid workflow function. Ensure the Workflow
|
|
276
|
+
'start' received an invalid workflow function. Ensure the Workflow SDK is configured correctly and the function includes a 'use workflow' directive.
|
|
277
277
|
```
|
|
278
278
|
|
|
279
279
|
Check both of these first:
|
|
@@ -260,7 +260,7 @@ Check the [Deploying](/docs/deploying) section to learn how your workflows can b
|
|
|
260
260
|
If you see this error:
|
|
261
261
|
|
|
262
262
|
```
|
|
263
|
-
'start' received an invalid workflow function. Ensure the Workflow
|
|
263
|
+
'start' received an invalid workflow function. Ensure the Workflow SDK is configured correctly and the function includes a 'use workflow' directive.
|
|
264
264
|
```
|
|
265
265
|
|
|
266
266
|
Check both of these first:
|
|
@@ -255,7 +255,7 @@ Check the [Deploying](/docs/deploying) section to learn how your workflows can b
|
|
|
255
255
|
If you see this error:
|
|
256
256
|
|
|
257
257
|
```
|
|
258
|
-
'start' received an invalid workflow function. Ensure the Workflow
|
|
258
|
+
'start' received an invalid workflow function. Ensure the Workflow SDK is configured correctly and the function includes a 'use workflow' directive.
|
|
259
259
|
```
|
|
260
260
|
|
|
261
261
|
Check both of these first:
|
|
@@ -83,11 +83,11 @@ import { SiReactrouter } from "@icons-pack/react-simple-icons";
|
|
|
83
83
|
<Badge variant="secondary">Beta</Badge>
|
|
84
84
|
</div>
|
|
85
85
|
</Card>
|
|
86
|
-
<Card
|
|
86
|
+
<Card href="/docs/getting-started/nestjs">
|
|
87
87
|
<div className="flex flex-col items-center justify-center gap-2">
|
|
88
|
-
<Nest className="size-16 dark:invert
|
|
88
|
+
<Nest className="size-16 dark:invert" />
|
|
89
89
|
<span className="font-medium">NestJS</span>
|
|
90
|
-
<Badge variant="secondary">
|
|
90
|
+
<Badge variant="secondary">Experimental</Badge>
|
|
91
91
|
</div>
|
|
92
92
|
</Card>
|
|
93
93
|
</Cards>
|
|
@@ -16,7 +16,8 @@ related:
|
|
|
16
16
|
This guide will walk through setting up your first workflow in a NestJS app. Along the way, you'll learn more about the concepts that are fundamental to using the Workflow SDK in your own projects.
|
|
17
17
|
|
|
18
18
|
<Callout>
|
|
19
|
-
NestJS integration is experimental
|
|
19
|
+
NestJS integration is experimental. Deployment to Vercel is supported via the
|
|
20
|
+
`workflow-nest build --vercel` command — see [Deploy to Vercel](#deploy-to-vercel) below.
|
|
20
21
|
</Callout>
|
|
21
22
|
|
|
22
23
|
---
|
|
@@ -361,6 +362,66 @@ npx workflow inspect runs
|
|
|
361
362
|
|
|
362
363
|
</Step>
|
|
363
364
|
|
|
365
|
+
<Step>
|
|
366
|
+
|
|
367
|
+
## Deploy to Vercel
|
|
368
|
+
|
|
369
|
+
Because NestJS is not a Vercel-native framework, the Workflow SDK produces a
|
|
370
|
+
[Build Output API](https://vercel.com/docs/build-output-api) directory for you. This emits the
|
|
371
|
+
workflow queue-consumer function (registered with `experimentalTriggers` so Vercel's queue can
|
|
372
|
+
discover it) alongside your NestJS app as a catch-all function. Without it, workflow runs stay
|
|
373
|
+
`pending` because nothing consumes the queue.
|
|
374
|
+
|
|
375
|
+
Add a Vercel-specific entry module that default-exports your Nest app's underlying Node handler:
|
|
376
|
+
|
|
377
|
+
```typescript title="_vercel/entry.ts" lineNumbers
|
|
378
|
+
import 'reflect-metadata';
|
|
379
|
+
import { NestFactory } from '@nestjs/core';
|
|
380
|
+
import type { NestExpressApplication } from '@nestjs/platform-express';
|
|
381
|
+
import express from 'express';
|
|
382
|
+
import { AppModule } from '../dist/app.module.js';
|
|
383
|
+
|
|
384
|
+
let ready: Promise<express.Express> | undefined;
|
|
385
|
+
|
|
386
|
+
async function createHandler() {
|
|
387
|
+
const app = await NestFactory.create<NestExpressApplication>(AppModule, {
|
|
388
|
+
bodyParser: false,
|
|
389
|
+
});
|
|
390
|
+
app.use(express.json());
|
|
391
|
+
await app.init();
|
|
392
|
+
return app.getHttpAdapter().getInstance();
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
export default async function handler(req: express.Request, res: express.Response) {
|
|
396
|
+
ready ??= createHandler();
|
|
397
|
+
return (await ready)(req, res);
|
|
398
|
+
}
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
Skip the in-process build on Vercel (the bundles are pre-built) by passing `skipBuild` when
|
|
402
|
+
`VERCEL` is set:
|
|
403
|
+
|
|
404
|
+
{/* @skip-typecheck - config snippet, WorkflowModule imported above */}
|
|
405
|
+
```typescript title="src/app.module.ts"
|
|
406
|
+
WorkflowModule.forRoot({ skipBuild: Boolean(process.env.VERCEL) });
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
Then set your build command so the Build Output is produced after `nest build`:
|
|
410
|
+
|
|
411
|
+
```json title="package.json" lineNumbers
|
|
412
|
+
{
|
|
413
|
+
"scripts": {
|
|
414
|
+
"vercel-build": "workflow-nest init --force && nest build && workflow-nest build --vercel --dirs src/workflows --entry _vercel/entry.ts"
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
Deploy as usual. `workflow-nest build --vercel` runs automatically on Vercel (it also detects the
|
|
420
|
+
`VERCEL` environment variable), writing `.vercel/output` with the consumer function so your runs
|
|
421
|
+
execute instead of staying `pending`.
|
|
422
|
+
|
|
423
|
+
</Step>
|
|
424
|
+
|
|
364
425
|
</Steps>
|
|
365
426
|
|
|
366
427
|
---
|
|
@@ -409,7 +470,7 @@ WorkflowModule.forRoot({
|
|
|
409
470
|
If you see this error:
|
|
410
471
|
|
|
411
472
|
```
|
|
412
|
-
'start' received an invalid workflow function. Ensure the Workflow
|
|
473
|
+
'start' received an invalid workflow function. Ensure the Workflow SDK is configured correctly and the function includes a 'use workflow' directive.
|
|
413
474
|
```
|
|
414
475
|
|
|
415
476
|
Check both of these first:
|
|
@@ -7,7 +7,7 @@ prerequisites:
|
|
|
7
7
|
- /docs/getting-started
|
|
8
8
|
related:
|
|
9
9
|
- /docs/api-reference/workflow-next
|
|
10
|
-
- /
|
|
10
|
+
- /worlds/vercel
|
|
11
11
|
---
|
|
12
12
|
|
|
13
13
|
<CopyPrompt
|
|
@@ -316,7 +316,7 @@ Without this configuration, you may experience intermittent issues where workflo
|
|
|
316
316
|
If you see this error:
|
|
317
317
|
|
|
318
318
|
```
|
|
319
|
-
'start' received an invalid workflow function. Ensure the Workflow
|
|
319
|
+
'start' received an invalid workflow function. Ensure the Workflow SDK is configured correctly and the function includes a 'use workflow' directive.
|
|
320
320
|
```
|
|
321
321
|
|
|
322
322
|
Check both of these first:
|
|
@@ -261,7 +261,7 @@ Check the [Deploying](/docs/deploying) section to learn how your workflows can b
|
|
|
261
261
|
If you see this error:
|
|
262
262
|
|
|
263
263
|
```
|
|
264
|
-
'start' received an invalid workflow function. Ensure the Workflow
|
|
264
|
+
'start' received an invalid workflow function. Ensure the Workflow SDK is configured correctly and the function includes a 'use workflow' directive.
|
|
265
265
|
```
|
|
266
266
|
|
|
267
267
|
Check both of these first:
|
|
@@ -240,7 +240,7 @@ Check the [Deploying](/docs/deploying) section to learn how your workflows can b
|
|
|
240
240
|
If you see this error:
|
|
241
241
|
|
|
242
242
|
```
|
|
243
|
-
'start' received an invalid workflow function. Ensure the Workflow
|
|
243
|
+
'start' received an invalid workflow function. Ensure the Workflow SDK is configured correctly and the function includes a 'use workflow' directive.
|
|
244
244
|
```
|
|
245
245
|
|
|
246
246
|
Check both of these first:
|
|
@@ -245,7 +245,7 @@ Check the [Deploying](/docs/deploying) section to learn how your workflows can b
|
|
|
245
245
|
If you see this error:
|
|
246
246
|
|
|
247
247
|
```
|
|
248
|
-
'start' received an invalid workflow function. Ensure the Workflow
|
|
248
|
+
'start' received an invalid workflow function. Ensure the Workflow SDK is configured correctly and the function includes a 'use workflow' directive.
|
|
249
249
|
```
|
|
250
250
|
|
|
251
251
|
Check both of these first:
|
|
@@ -245,7 +245,7 @@ Check the [Deploying](/docs/deploying) section to learn how your workflows can b
|
|
|
245
245
|
If you see this error:
|
|
246
246
|
|
|
247
247
|
```
|
|
248
|
-
'start' received an invalid workflow function. Ensure the Workflow
|
|
248
|
+
'start' received an invalid workflow function. Ensure the Workflow SDK is configured correctly and the function includes a 'use workflow' directive.
|
|
249
249
|
```
|
|
250
250
|
|
|
251
251
|
Check both of these first:
|
|
@@ -7,7 +7,7 @@ prerequisites:
|
|
|
7
7
|
- /docs/how-it-works/event-sourcing
|
|
8
8
|
related:
|
|
9
9
|
- /docs/observability
|
|
10
|
-
- /
|
|
10
|
+
- /worlds/vercel
|
|
11
11
|
---
|
|
12
12
|
|
|
13
13
|
<Callout>
|
|
@@ -38,7 +38,7 @@ Metadata such as workflow names, step names, entity IDs, timestamps, and lifecyc
|
|
|
38
38
|
|
|
39
39
|
Each workflow run is encrypted with its own unique key, provided by the `World` implementation via `getEncryptionKeyForRun()`. How the key is generated and stored is up to the `World`.
|
|
40
40
|
|
|
41
|
-
For example, the [Vercel World](/
|
|
41
|
+
For example, the [Vercel World](/worlds/vercel) provides unique keys per run and execution environment, ensuring that a given run can only decrypt data from that run itself.
|
|
42
42
|
|
|
43
43
|
### Encryption Algorithm
|
|
44
44
|
|
|
@@ -127,4 +127,4 @@ async function lookupRunKey(
|
|
|
127
127
|
}
|
|
128
128
|
```
|
|
129
129
|
|
|
130
|
-
The [Vercel World](/
|
|
130
|
+
The [Vercel World](/worlds/vercel) implementation uses HKDF derivation from a deployment-scoped key, but any consistent key management scheme will work.
|
|
@@ -121,15 +121,15 @@ flowchart TD
|
|
|
121
121
|
|
|
122
122
|
**Hook states:**
|
|
123
123
|
|
|
124
|
-
- `active`: Ready to receive payloads
|
|
125
|
-
- `disposed`: No longer accepting payloads
|
|
124
|
+
- `active`: Ready to receive payloads
|
|
125
|
+
- `disposed`: No longer accepting payloads
|
|
126
126
|
- `conflicted`: Hook creation failed because the token is already in use by another workflow
|
|
127
127
|
|
|
128
|
-
Unlike other entities, hooks don't have a `status` field—the states above are conceptual.
|
|
128
|
+
Unlike other entities, hooks don't have a `status` field—the states above are conceptual. When a `hook_disposed` event is created, the hook record is removed rather than updated.
|
|
129
129
|
|
|
130
|
-
While a hook is active, its token is reserved and cannot be used by other workflows. If a workflow attempts to create a hook with a token
|
|
130
|
+
While a hook is active, its token is reserved and cannot be used by other workflows. If a workflow attempts to create a hook with a token reserved by another run — either by an active hook or by `experimental_minRetention` after its run ended — a `hook_conflict` event is recorded instead of `hook_created`. Current worlds include the token and the run ID that owns it, though older persisted events or world implementations may only include the token. This causes `hook.getConflict()` to resolve with the conflicting run and the hook's payload promise to reject with a `HookConflictError`, which you can detect with `HookConflictError.is(error)`. See the [hook-conflict error](/docs/errors/hook-conflict) documentation for more details.
|
|
131
131
|
|
|
132
|
-
When a
|
|
132
|
+
When a workflow ends, its Hooks can no longer be resumed. They are normally removed and their tokens become available again. With `experimental_minRetention`, a Hook remains readable and its token remains unavailable until retention ends. A `hook_disposed` event removes the Hook and makes its token available immediately.
|
|
133
133
|
|
|
134
134
|
See [Hooks & Webhooks](/docs/foundations/hooks) for more on how hooks and webhooks work.
|
|
135
135
|
|
|
@@ -188,7 +188,7 @@ Events are categorized by the entity type they affect. Each event contains metad
|
|
|
188
188
|
| Event | Description |
|
|
189
189
|
|-------|-------------|
|
|
190
190
|
| `hook_created` | Creates a new hook in `active` state. Contains the hook token and optional metadata. |
|
|
191
|
-
| `hook_conflict` | Records that hook creation failed because
|
|
191
|
+
| `hook_conflict` | Records that hook creation failed because another run owns the token. Contains the token and, for current worlds, the owner's run ID. The hook is not created: `hook.getConflict()` resolves with the conflicting run, and awaiting the hook payload rejects with a `HookConflictError`. |
|
|
192
192
|
| `hook_received` | Records that a payload was delivered to the hook. The hook remains `active` and can receive more payloads. |
|
|
193
193
|
| `hook_disposed` | Deletes the hook from storage (conceptually transitioning to `disposed` state). The token is released for reuse by future workflows. |
|
|
194
194
|
|
|
@@ -6,7 +6,7 @@ summary: Build a custom framework integration using the Workflow SDK compiler an
|
|
|
6
6
|
prerequisites:
|
|
7
7
|
- /docs/foundations/workflows-and-steps
|
|
8
8
|
related:
|
|
9
|
-
- /
|
|
9
|
+
- /worlds/building-a-world
|
|
10
10
|
---
|
|
11
11
|
|
|
12
12
|
<Callout>
|
|
@@ -425,7 +425,7 @@ For self-hosted or non-Vercel deployments, you are responsible for securing the
|
|
|
425
425
|
- **Network-level security** — Deploy handlers behind a VPC, private network, or firewall rules so only your queue infrastructure can reach them
|
|
426
426
|
- **Rate limiting** — Add request validation and rate limiting to prevent abuse
|
|
427
427
|
|
|
428
|
-
Learn more about [building custom Worlds](/
|
|
428
|
+
Learn more about [building custom Worlds](/worlds/building-a-world).
|
|
429
429
|
|
|
430
430
|
## Testing Your Integration
|
|
431
431
|
|
package/docs/meta.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "workflow",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.36",
|
|
4
4
|
"description": "Workflow SDK - Build durable, resilient, and observable workflows",
|
|
5
5
|
"main": "dist/typescript-plugin.cjs",
|
|
6
6
|
"type": "module",
|
|
@@ -49,6 +49,8 @@
|
|
|
49
49
|
"./astro": "./dist/astro.js",
|
|
50
50
|
"./vite": "./dist/vite.js",
|
|
51
51
|
"./nest": "./dist/nest.js",
|
|
52
|
+
"./nest/builder": "./dist/nest-builder.js",
|
|
53
|
+
"./nest/vercel-builder": "./dist/nest-vercel-builder.js",
|
|
52
54
|
"./runtime": "./dist/runtime.js",
|
|
53
55
|
"./observability": {
|
|
54
56
|
"types": "./dist/observability.d.ts",
|
|
@@ -57,18 +59,18 @@
|
|
|
57
59
|
},
|
|
58
60
|
"dependencies": {
|
|
59
61
|
"ms": "2.1.3",
|
|
60
|
-
"@workflow/astro": "5.0.0-beta.
|
|
61
|
-
"@workflow/cli": "5.0.0-beta.
|
|
62
|
-
"@workflow/core": "5.0.0-beta.
|
|
63
|
-
"@workflow/errors": "5.0.0-beta.11",
|
|
62
|
+
"@workflow/astro": "5.0.0-beta.36",
|
|
63
|
+
"@workflow/cli": "5.0.0-beta.36",
|
|
64
|
+
"@workflow/core": "5.0.0-beta.36",
|
|
64
65
|
"@workflow/typescript-plugin": "5.0.0-beta.5",
|
|
66
|
+
"@workflow/errors": "5.0.0-beta.12",
|
|
65
67
|
"@workflow/utils": "5.0.0-beta.6",
|
|
66
|
-
"@workflow/next": "5.0.0-beta.
|
|
67
|
-
"@workflow/nest": "5.0.0-beta.
|
|
68
|
-
"@workflow/nitro": "5.0.0-beta.
|
|
69
|
-
"@workflow/nuxt": "5.0.0-beta.
|
|
70
|
-
"@workflow/sveltekit": "5.0.0-beta.
|
|
71
|
-
"@workflow/rollup": "5.0.0-beta.
|
|
68
|
+
"@workflow/next": "5.0.0-beta.36",
|
|
69
|
+
"@workflow/nest": "5.0.0-beta.36",
|
|
70
|
+
"@workflow/nitro": "5.0.0-beta.36",
|
|
71
|
+
"@workflow/nuxt": "5.0.0-beta.36",
|
|
72
|
+
"@workflow/sveltekit": "5.0.0-beta.36",
|
|
73
|
+
"@workflow/rollup": "5.0.0-beta.36"
|
|
72
74
|
},
|
|
73
75
|
"devDependencies": {
|
|
74
76
|
"@types/ms": "2.1.0",
|