workflow 5.2.3 → 5.4.0
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/api.d.ts +1 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +1 -1
- package/dist/internal/errors.d.ts +1 -1
- package/dist/internal/errors.d.ts.map +1 -1
- package/dist/internal/errors.js +2 -2
- package/docs/api-reference/workflow/create-hook.mdx +8 -0
- package/docs/api-reference/workflow/create-webhook.mdx +1 -1
- package/docs/api-reference/workflow/fetch.mdx +2 -0
- package/docs/api-reference/workflow-api/get-hook-by-token.mdx +5 -1
- package/docs/api-reference/workflow-api/get-run.mdx +4 -0
- package/docs/api-reference/workflow-api/resume-hook.mdx +58 -2
- package/docs/api-reference/workflow-api/start.mdx +70 -3
- package/docs/api-reference/workflow-errors/hook-conflict-error.mdx +6 -3
- package/docs/api-reference/workflow-errors/in-band-superseded-error.mdx +68 -0
- package/docs/api-reference/workflow-errors/index.mdx +6 -0
- package/docs/api-reference/workflow-errors/meta.json +2 -0
- package/docs/api-reference/workflow-errors/precondition-failed-error.mdx +2 -0
- package/docs/api-reference/workflow-errors/workflow-start-error.mdx +58 -0
- package/docs/api-reference/workflow-errors/workflow-world-error.mdx +12 -1
- package/docs/api-reference/workflow-runtime/world/storage.mdx +1 -1
- package/docs/changelog/eager-processing.mdx +4 -0
- package/docs/changelog/index.mdx +1 -0
- package/docs/changelog/lazy-event-creation.md +1 -1
- package/docs/changelog/meta.json +1 -0
- package/docs/changelog/spec-9.mdx +4019 -0
- package/docs/changelog/turbo-mode.md +4 -0
- package/docs/configuration/cli-and-web-ui.mdx +4 -2
- package/docs/configuration/runtime-tuning.mdx +68 -2
- package/docs/configuration/worlds.mdx +13 -1
- package/docs/cookbook/advanced/child-workflows.mdx +127 -187
- package/docs/cookbook/common-patterns/batching.mdx +3 -1
- package/docs/cookbook/common-patterns/idempotency.mdx +11 -12
- package/docs/cookbook/common-patterns/sequential-and-parallel.mdx +1 -1
- package/docs/cookbook/common-patterns/workflow-composition.mdx +5 -5
- package/docs/errors/fetch-in-workflow.mdx +15 -29
- package/docs/foundations/errors-and-retries.mdx +6 -0
- package/docs/foundations/hooks.mdx +3 -1
- package/docs/foundations/idempotency.mdx +190 -60
- package/docs/foundations/starting-workflows.mdx +3 -7
- package/docs/how-it-works/event-sourcing.mdx +6 -0
- package/docs/whats-new.mdx +3 -1
- package/docs/worlds/building-a-world.mdx +28 -3
- package/docs/worlds/local.mdx +6 -0
- package/docs/worlds/postgres.mdx +208 -146
- package/docs/worlds/upgrading-to-v5.mdx +7 -1
- package/docs/worlds/vercel.mdx +9 -7
- package/package.json +11 -11
package/docs/worlds/vercel.mdx
CHANGED
|
@@ -77,13 +77,13 @@ For self-hosted deployments, use the [Postgres World](/worlds/postgres). For loc
|
|
|
77
77
|
|
|
78
78
|
## Per-run limits
|
|
79
79
|
|
|
80
|
-
The Vercel World
|
|
80
|
+
The Vercel World supplies a per-run [event limit](/docs/how-it-works/event-sourcing). Each step adds events to that log, so the event budget also constrains how many steps a run can execute. See [Workflow run limits](https://vercel.com/docs/workflows/pricing#workflow-run-limits) for the published default limits and sizing guidance. A run that exhausts its event budget fails with `MAX_EVENTS_EXCEEDED` and cannot be continued.
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
On the default runtime, replay cost can grow with the event log. For workflows with many steps or frequent resumes, consider the experimental [QuickJS runtime](/docs/configuration/runtime-tuning#workflow_vm). Set `WORKFLOW_VM=quickjs` in your project's environment variables and redeploy. Only runs started after the change use the new runtime.
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
QuickJS runs are exempt from the default event cap, allowing larger event logs and more steps. They restore workflow state and replay only events recorded since the last snapshot, reducing replay overhead as the log grows. This does not speed up the work inside individual steps or remove payload, storage, and request rate limits. See [max-events-exceeded](/docs/errors/max-events-exceeded) for eligibility and compatibility details.
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
Use [child workflows](/cookbook/advanced/child-workflows) when independent units of work benefit from separate run histories and failure boundaries. To write fewer events, [process multiple items within each step](/cookbook/common-patterns/batching#tips), accounting for retries of the whole group.
|
|
87
87
|
|
|
88
88
|
## Multi-region
|
|
89
89
|
|
|
@@ -158,7 +158,7 @@ The route serves `world.createQueueHandler("__agent_wkf_workflow_", handler)`. T
|
|
|
158
158
|
## Limitations
|
|
159
159
|
|
|
160
160
|
- **No run migration**: A run's region is fixed at creation. Existing runs cannot be moved to a different region.
|
|
161
|
-
- **Hook minimum retention**:
|
|
161
|
+
- **Hook minimum retention**: `experimental_minRetention` cannot exceed 30 days, on both [`createHook()`](/docs/api-reference/workflow/create-hook#keep-a-token-unavailable-after-the-run-ends) and [`start({ experimental_hook })`](/docs/api-reference/workflow-api/start#prevent-duplicate-starts).
|
|
162
162
|
|
|
163
163
|
## Observability
|
|
164
164
|
|
|
@@ -176,7 +176,7 @@ npx workflow inspect runs --backend vercel
|
|
|
176
176
|
npx workflow web --backend vercel
|
|
177
177
|
```
|
|
178
178
|
|
|
179
|
-
The CLI automatically retrieves authentication from the Vercel CLI (`vercel login`) and infers project/team IDs from your local Vercel project linking.
|
|
179
|
+
The CLI automatically retrieves authentication from the Vercel CLI (`vercel login`) and infers project/team IDs from your local Vercel project linking. In a monorepo, it uses the nearest `.vercel/project.json`.
|
|
180
180
|
|
|
181
181
|
To use the local observability UI instead of the Vercel dashboard:
|
|
182
182
|
|
|
@@ -184,7 +184,7 @@ To use the local observability UI instead of the Vercel dashboard:
|
|
|
184
184
|
npx workflow web --backend vercel --localUi
|
|
185
185
|
```
|
|
186
186
|
|
|
187
|
-
To override the automatic configuration:
|
|
187
|
+
To override the automatic configuration, pass the values explicitly. `--project` and `--team` take precedence over the linked project:
|
|
188
188
|
|
|
189
189
|
```bash
|
|
190
190
|
npx workflow inspect runs \
|
|
@@ -374,6 +374,8 @@ Vercel team ID.
|
|
|
374
374
|
|
|
375
375
|
Custom base URL for the Vercel workflow API proxy. Default: `https://api.vercel.com/v1/workflow`.
|
|
376
376
|
|
|
377
|
+
The Vercel World doesn't follow HTTP redirects on workflow API requests, so point custom URLs at an endpoint that answers directly. A `3xx` response fails the request.
|
|
378
|
+
|
|
377
379
|
### `VERCEL_WORKFLOW_SERVER_URL`
|
|
378
380
|
|
|
379
381
|
Custom workflow-server URL for direct runtime requests, or for the proxy to forward to via `WORKFLOW_VERCEL_BACKEND_URL`. Default: unset; normal deployments should not need this.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "workflow",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.0",
|
|
4
4
|
"description": "Workflow SDK - Build durable, resilient, and observable workflows",
|
|
5
5
|
"main": "dist/typescript-plugin.cjs",
|
|
6
6
|
"type": "module",
|
|
@@ -58,19 +58,19 @@
|
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@workflow/astro": "5.0.
|
|
62
|
-
"@workflow/cli": "5.0.
|
|
63
|
-
"@workflow/core": "5.
|
|
64
|
-
"@workflow/errors": "5.0
|
|
61
|
+
"@workflow/astro": "5.0.8",
|
|
62
|
+
"@workflow/cli": "5.0.8",
|
|
63
|
+
"@workflow/core": "5.4.0",
|
|
64
|
+
"@workflow/errors": "5.1.0",
|
|
65
65
|
"@workflow/typescript-plugin": "5.0.0",
|
|
66
66
|
"@workflow/utils": "5.0.2",
|
|
67
67
|
"ms": "2.1.3",
|
|
68
|
-
"@workflow/next": "5.0.
|
|
69
|
-
"@workflow/nest": "5.1.
|
|
70
|
-
"@workflow/nitro": "5.0.
|
|
71
|
-
"@workflow/nuxt": "5.0.
|
|
72
|
-
"@workflow/sveltekit": "5.0.
|
|
73
|
-
"@workflow/rollup": "5.0.
|
|
68
|
+
"@workflow/next": "5.0.8",
|
|
69
|
+
"@workflow/nest": "5.1.6",
|
|
70
|
+
"@workflow/nitro": "5.0.8",
|
|
71
|
+
"@workflow/nuxt": "5.0.8",
|
|
72
|
+
"@workflow/sveltekit": "5.0.8",
|
|
73
|
+
"@workflow/rollup": "5.0.8"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@types/ms": "2.1.0",
|