Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/bound-decoded-collections.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@workflow/core": patch
---

Reject compact sparse-array payloads with logical lengths above 100,000 during hydration.
24 changes: 22 additions & 2 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
"@workflow/vitest": "4.0.0",
"@workflow/vitest-workbench": "4.0.0",
"tarballs": "0.0.0",
"@workflow/example-tanstack-start": "0.0.0"
"@workflow/example-tanstack-start": "0.0.0",
"@workflow/world-sim": "0.0.0",
"@workflow/sim-world-workbench": "0.0.1"
},
"changesets": [
"abort-e2e-flakes",
Expand Down Expand Up @@ -97,6 +99,7 @@
"bundle-aliased-project-local-helpers",
"byte-stream-wire-framing",
"cache-step-port-discovery",
"calm-dodos-retry",
"calm-events-guard",
"calm-geese-observe",
"cancel-v4-frame-stream",
Expand All @@ -117,6 +120,7 @@
"cold-lines-change",
"compression-telemetry-attributes",
"compute-instance-event-field",
"continue-run-started-preload",
"cookbook-child-workflows-hook-resume",
"cool-cups-greet",
"copyable-data-block-tests",
Expand All @@ -129,6 +133,7 @@
"curvy-dingos-cry",
"cyan-impalas-drop",
"data-inspector-expanded-brackets",
"date-subclass-vm",
"decouple-vm-seed-from-startedat",
"dedupe-otel-api",
"dense-stream-viewer",
Expand Down Expand Up @@ -173,6 +178,7 @@
"event-log-race-repro-infra",
"event-log-race-repro-local",
"event-precondition-guard",
"events-create-cursor-delta",
"events-exact-id-search",
"experimental-attributes-docs",
"extend-cn-tailwind-merge",
Expand All @@ -181,6 +187,7 @@
"fail-cross-deployment-runs",
"fast-next-workflow-hmr",
"fast-workflow-discovery",
"fatal-hook-world-validation",
"fatal-retryable-error-serialization",
"features-encryption-metadata",
"few-cups-share",
Expand Down Expand Up @@ -294,6 +301,7 @@
"lazy-hook-resumption",
"lazy-inline-step-start",
"lazy-next-step-imports",
"lazy-resume-deployment-affinity",
"lazy-stream-key-request-diagnostics",
"leading-edge-dispatch",
"little-sites-cover",
Expand All @@ -303,6 +311,7 @@
"local-port-cache",
"local-world-vercel-warning",
"log-queue-handler-retries",
"loud-pugs-recycle",
"lucky-windows-smash",
"many-peas-jog",
"mean-cameras-hope",
Expand Down Expand Up @@ -341,14 +350,14 @@
"olive-hands-repeat",
"olive-lions-measure",
"olive-pandas-brush",
"olive-pugs-repeat",
"optional-input-on-snapshots",
"orphan-ui-chunks-on-resume",
"otel-api-optional-peer-external",
"otel-linked-trace-mode",
"outcome-event-workflowname",
"parallel-inline-optimistic-start",
"pending-trace-viewer-gray-indicator",
"per-kind-correlation-ids",
"perf-cached-workflow-script",
"perf-memoize-step-hydration",
"perf-prepare-replay-payloads",
Expand All @@ -370,12 +379,15 @@
"queue-namespace-primitive",
"queued-for-uses-first-step-started",
"quick-local-replay",
"quickjs-baseline-snapshot",
"quickjs-hook-capability",
"quickjs-hook-retention",
"quickjs-host-serde",
"quickjs-inline-steps",
"quickjs-vm-engine",
"quiet-analytics-readers",
"quiet-build-logs",
"quiet-donkeys-repeat",
"quiet-events-merge",
"quiet-lamps-parse",
"quiet-marker-shadow",
Expand Down Expand Up @@ -450,6 +462,7 @@
"skip-changeset-release-deploys",
"skip-community-worlds-main",
"skip-world-local-nov-ghosts",
"slot-event-ids",
"slow-bottles-pull",
"small-cycles-rest",
"smart-baths-make",
Expand All @@ -475,10 +488,12 @@
"step-delivery-ordering",
"step-maxretries-timeout",
"step-run-required",
"stream-all-replay-events",
"stream-close-retry",
"stream-failure-diagnostics",
"stream-otel-spans",
"stream-read-v3-reconnect",
"stream-run-started-page",
"stream-write-flush-span",
"stream-writemulti-batching",
"strong-cups-sip",
Expand All @@ -501,6 +516,8 @@
"test-limit-env-config",
"test-promise-race-prefix-determinism",
"tidy-badgers-build",
"tidy-buttons-swim",
"tidy-dodos-observe",
"tidy-hoops-open",
"tidy-lamps-sort",
"timeline-queued-connector",
Expand All @@ -525,6 +542,7 @@
"turbo-next-workbench-vercel-output",
"turbo-setattr-run-ready",
"turbo-skip-run-started-preload",
"type-event-create-results",
"typography-system-tokens",
"update-queue-client-version",
"update-vercel-queue",
Expand All @@ -538,6 +556,7 @@
"v4-trace-propagation",
"validate-step-id-duplicates",
"vast-oranges-fail",
"vercel-hook-min-retention",
"vercel-world-custom-dispatcher",
"vercel-world-missing-deployment-id",
"versioning-docs",
Expand Down Expand Up @@ -588,6 +607,7 @@
"world-vercel-trusted-sources",
"world-zod-dependency",
"writable-group-commit",
"ws-events-transport",
"yellow-pianos-relax",
"zstd-step-error-display",
"zstd-web-decoder"
Expand Down
7 changes: 7 additions & 0 deletions .changeset/resilient-step-dispatch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@workflow/world': minor
'@workflow/world-vercel': minor
'@workflow/core': minor
---

Resilient step dispatch: newly created steps are published to the queue in parallel with their `step_created` event write, with the serialized input carried on the message (`stepInput`) so the consumer re-ensures the event if the direct write failed transiently — mirroring resilient start (`runInput`) and resilient hook resume (`hookInput`). Worlds that enforce the precondition guard keep the sequential create-then-publish dispatch (only sequencing gives the message a happens-after edge over the create's guard verdict); step-dispatch idempotency keys are now step-identity-scoped. Disable via `WORKFLOW_RESILIENT_STEP_DISPATCH=0`.
7 changes: 7 additions & 0 deletions .changeset/stream-expired-errors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@workflow/core': patch
'@workflow/errors': patch
'@workflow/world-vercel': patch
---

Surface typed terminal errors when stream retention expires.
8 changes: 8 additions & 0 deletions docs/content/docs/v5/configuration/runtime-tuning.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ For example, a workflow can run a 10-minute inline step even with `WORKFLOW_REPL
- 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.
- Transient or unknown queue publishing failures use normal queue redelivery and do not consume this budget.

### `WORKFLOW_RESILIENT_STEP_DISPATCH`

- Default: enabled
- When a suspension hands newly created steps to the queue, the runtime publishes each step's execution message in parallel with its `step_created` event write instead of sequencing them, cutting a round trip per dispatched step. The message also carries the serialized step input (`stepInput`), so a transient `step_created` write failure (429 / 5xx / transport) still executes the step — the queue consumer idempotently re-ensures the event before running it, converging with the producer's write on the step's correlation ID. This mirrors resilient start (`runInput`) and the lazy hook resume (`hookInput`).
- The runtime falls back to the sequential create-then-publish dispatch automatically when the step input is too large to inline on the queue message, when the run's queue transport cannot carry binary payloads (pre-CBOR spec versions), or — on the `node` VM engine, whose suspension writes carry the [precondition guard](#workflow_precondition_guard) snapshot — when the World enforces that guard (`capabilities.preconditionGuard`; the Vercel World does): a guard-rejected `step_created` must not be materializable through the queue side-channel, and only sequencing the publish after the create gives the message a happens-after edge over the create's guard verdict. The `quickjs` engine's suspension writes are unguarded, so it uses resilient dispatch against every World.
- Producer-side recoveries are reported on the suspension span as `workflow.step.resilient_dispatch_recovered`; a consumer that materialized the event reports `workflow.step.resilient_dispatch_materialized`.
- Set `0` to force the sequential dispatch as a kill switch.

### `WORKFLOW_PRECONDITION_GUARD`

- Default: enabled
Expand Down
9 changes: 9 additions & 0 deletions packages/astro/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @workflow/astro

## 5.0.0-beta.41

### Patch Changes

- Updated dependencies [[`4ec7aca`](https://github.com/vercel/workflow/commit/4ec7acaa7196a6f2f5025a65f05d5bdaaf5705ba), [`264ddff`](https://github.com/vercel/workflow/commit/264ddff67b3cfceea24235ee6d865c48e7982727)]:
- @workflow/builders@5.0.0-beta.41
- @workflow/rollup@5.0.0-beta.41
- @workflow/vite@5.0.0-beta.41

## 5.0.0-beta.40

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@workflow/astro",
"version": "5.0.0-beta.40",
"version": "5.0.0-beta.41",
"description": "Astro integration for Workflow SDK",
"type": "module",
"main": "dist/index.js",
Expand Down
14 changes: 14 additions & 0 deletions packages/builders/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# @workflow/builders

## 5.0.0-beta.41

### Minor Changes

- [#3163](https://github.com/vercel/workflow/pull/3163) [`4ec7aca`](https://github.com/vercel/workflow/commit/4ec7acaa7196a6f2f5025a65f05d5bdaaf5705ba) Thanks [@lucamaraschi](https://github.com/lucamaraschi)! - Add an optional observer for accepted workflow SWC transform results.

### Patch Changes

- [#3084](https://github.com/vercel/workflow/pull/3084) [`264ddff`](https://github.com/vercel/workflow/commit/264ddff67b3cfceea24235ee6d865c48e7982727) Thanks [@shalabhc](https://github.com/shalabhc)! - Add an opt-in WebSocket transport for event writes during step execution, enabled with `WORKFLOW_EVENTS_TRANSPORT=ws`. Defaults to HTTP; no behavior change unless explicitly enabled.

- Updated dependencies [[`74dbf81`](https://github.com/vercel/workflow/commit/74dbf81d327b8574cca429b56757c7322a26b4ef), [`65139ac`](https://github.com/vercel/workflow/commit/65139acfd7118d3b73672435a6e1c47115f6e23f), [`1a64f68`](https://github.com/vercel/workflow/commit/1a64f684723757c5a839abb94189b953dd3ac536), [`a8db185`](https://github.com/vercel/workflow/commit/a8db185c3b19b3dab971f51aa076aead81ed26ea), [`4bb86d3`](https://github.com/vercel/workflow/commit/4bb86d305423a2da813cbef8b7d6fe4421288bba), [`439a495`](https://github.com/vercel/workflow/commit/439a495a715b9426ef4dbcf8d928a8fc50ffb040), [`eb9e13f`](https://github.com/vercel/workflow/commit/eb9e13fd23eb12e353cd8f53ed4357da06f8e5ac), [`19b5b85`](https://github.com/vercel/workflow/commit/19b5b85c8b78cfd6c8ebbdf62ae7b8241a109595), [`fbebf71`](https://github.com/vercel/workflow/commit/fbebf7104d97219b73b6a51b0e77e42c45cdd99c), [`6786db9`](https://github.com/vercel/workflow/commit/6786db99538ef57c872d861ecfb28d99ae857d6d), [`22349e9`](https://github.com/vercel/workflow/commit/22349e95fd85a112cbec3f425900b74bf5ccc77f), [`69c30ff`](https://github.com/vercel/workflow/commit/69c30ff49eb89c0c4c4b2642c37985fdf64fa9fd), [`65139ac`](https://github.com/vercel/workflow/commit/65139acfd7118d3b73672435a6e1c47115f6e23f)]:
- @workflow/core@5.0.0-beta.41
- @workflow/errors@5.0.0-beta.16

## 5.0.0-beta.40

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/builders/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@workflow/builders",
"version": "5.0.0-beta.40",
"version": "5.0.0-beta.41",
"description": "Shared builder infrastructure for Workflow SDK",
"type": "module",
"main": "./dist/index.js",
Expand Down
13 changes: 13 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# @workflow/cli

## 5.0.0-beta.41

### Patch Changes

- Updated dependencies [[`74dbf81`](https://github.com/vercel/workflow/commit/74dbf81d327b8574cca429b56757c7322a26b4ef), [`65139ac`](https://github.com/vercel/workflow/commit/65139acfd7118d3b73672435a6e1c47115f6e23f), [`1a64f68`](https://github.com/vercel/workflow/commit/1a64f684723757c5a839abb94189b953dd3ac536), [`a8db185`](https://github.com/vercel/workflow/commit/a8db185c3b19b3dab971f51aa076aead81ed26ea), [`4bb86d3`](https://github.com/vercel/workflow/commit/4bb86d305423a2da813cbef8b7d6fe4421288bba), [`439a495`](https://github.com/vercel/workflow/commit/439a495a715b9426ef4dbcf8d928a8fc50ffb040), [`bf4dda6`](https://github.com/vercel/workflow/commit/bf4dda64780f5f8e13840871960cf2a647cdd329), [`eb9e13f`](https://github.com/vercel/workflow/commit/eb9e13fd23eb12e353cd8f53ed4357da06f8e5ac), [`19b5b85`](https://github.com/vercel/workflow/commit/19b5b85c8b78cfd6c8ebbdf62ae7b8241a109595), [`fbebf71`](https://github.com/vercel/workflow/commit/fbebf7104d97219b73b6a51b0e77e42c45cdd99c), [`6786db9`](https://github.com/vercel/workflow/commit/6786db99538ef57c872d861ecfb28d99ae857d6d), [`22349e9`](https://github.com/vercel/workflow/commit/22349e95fd85a112cbec3f425900b74bf5ccc77f), [`665110b`](https://github.com/vercel/workflow/commit/665110b3a255c920a3612dec521234efcf34d4f8), [`69c30ff`](https://github.com/vercel/workflow/commit/69c30ff49eb89c0c4c4b2642c37985fdf64fa9fd), [`4ec7aca`](https://github.com/vercel/workflow/commit/4ec7acaa7196a6f2f5025a65f05d5bdaaf5705ba), [`65139ac`](https://github.com/vercel/workflow/commit/65139acfd7118d3b73672435a6e1c47115f6e23f), [`4bb86d3`](https://github.com/vercel/workflow/commit/4bb86d305423a2da813cbef8b7d6fe4421288bba), [`264ddff`](https://github.com/vercel/workflow/commit/264ddff67b3cfceea24235ee6d865c48e7982727)]:
- @workflow/core@5.0.0-beta.41
- @workflow/world@5.0.0-beta.26
- @workflow/world-vercel@5.0.0-beta.37
- @workflow/world-local@5.0.0-beta.35
- @workflow/builders@5.0.0-beta.41
- @workflow/web@5.0.0-beta.41
- @workflow/errors@5.0.0-beta.16

## 5.0.0-beta.40

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@workflow/cli",
"version": "5.0.0-beta.40",
"version": "5.0.0-beta.41",
"description": "Command-line interface for Workflow SDK",
"type": "module",
"bin": {
Expand Down
36 changes: 36 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
# @workflow/core

## 5.0.0-beta.41

### Patch Changes

- [#3385](https://github.com/vercel/workflow/pull/3385) [`74dbf81`](https://github.com/vercel/workflow/commit/74dbf81d327b8574cca429b56757c7322a26b4ef) Thanks [@NathanColosimo](https://github.com/NathanColosimo)! - Retry replay timeouts through normal queue redelivery instead of exiting the process, and keep Postgres jobs retryable through Core's terminal delivery limit.

- [#3124](https://github.com/vercel/workflow/pull/3124) [`65139ac`](https://github.com/vercel/workflow/commit/65139acfd7118d3b73672435a6e1c47115f6e23f) Thanks [@NathanColosimo](https://github.com/NathanColosimo)! - Continue partial `run_started` event preloads from their cursor instead of reloading the event log from the beginning.

- [#3372](https://github.com/vercel/workflow/pull/3372) [`1a64f68`](https://github.com/vercel/workflow/commit/1a64f684723757c5a839abb94189b953dd3ac536) Thanks [@ar-tama](https://github.com/ar-tama)! - Fix `Date` subclassing inside workflow functions. The deterministic `Date` override in the workflow VM now forwards `new.target` via `Reflect.construct`, so subclasses like `TZDate` from `@date-fns/tz` keep their identity, methods, and fields. Calling `Date()` without `new` now returns the (fixed) time string per spec, instead of a `Date` object.

- [#3382](https://github.com/vercel/workflow/pull/3382) [`a8db185`](https://github.com/vercel/workflow/commit/a8db185c3b19b3dab971f51aa076aead81ed26ea) Thanks [@VaguelySerious](https://github.com/VaguelySerious)! - Fold new events returned by `events.create` into the replay log so a completed wait no longer needs a follow-up `events.list` round trip

- [#3286](https://github.com/vercel/workflow/pull/3286) [`4bb86d3`](https://github.com/vercel/workflow/commit/4bb86d305423a2da813cbef8b7d6fe4421288bba) Thanks [@NathanColosimo](https://github.com/NathanColosimo)! - Fail a workflow when its World deterministically rejects Hook creation.

- [#3374](https://github.com/vercel/workflow/pull/3374) [`439a495`](https://github.com/vercel/workflow/commit/439a495a715b9426ef4dbcf8d928a8fc50ffb040) Thanks [@karthikscale3](https://github.com/karthikscale3)! - Carry the run's pinned deployment on lazy resume messages so misrouted deliveries re-route before the `hook_received` write.

- [#3342](https://github.com/vercel/workflow/pull/3342) [`eb9e13f`](https://github.com/vercel/workflow/commit/eb9e13fd23eb12e353cd8f53ed4357da06f8e5ac) Thanks [@TooTallNate](https://github.com/TooTallNate)! - QuickJS engine: start invocations by restoring a bundle-hydrated VM-memory snapshot instead of re-evaluating the workflow bundle (~25× faster VM startup; bundles with module-scope randomness or clock reads automatically fall back to fresh evaluation). Disable with `WORKFLOW_QUICKJS_BASELINE_SNAPSHOT=0`.

- [#3263](https://github.com/vercel/workflow/pull/3263) [`19b5b85`](https://github.com/vercel/workflow/commit/19b5b85c8b78cfd6c8ebbdf62ae7b8241a109595) Thanks [@TooTallNate](https://github.com/TooTallNate)! - QuickJS engine: move serialization out of the VM onto the host, replacing the in-VM serde bundle with side-effect-free handle introspection (same wire format, 2–100× faster).

- [#3406](https://github.com/vercel/workflow/pull/3406) [`fbebf71`](https://github.com/vercel/workflow/commit/fbebf7104d97219b73b6a51b0e77e42c45cdd99c) Thanks [@VaguelySerious](https://github.com/VaguelySerious)! - Fix replay divergence when a step result overtook an earlier sleep or hook delivery that was parked behind an unread hook's payload

- [#3389](https://github.com/vercel/workflow/pull/3389) [`6786db9`](https://github.com/vercel/workflow/commit/6786db99538ef57c872d861ecfb28d99ae857d6d) Thanks [@VaguelySerious](https://github.com/VaguelySerious)! - **Breaking**: SpecVersion 6: Event IDs are now a dense per-run slot number, allocated by the world at publish time so a rejected write leaves no gap in the event log. A replay tells the world how many events it had read and gets back the ones it did not see, so an event that arrives from outside the replay and lands ahead of an event the replay wrote no longer fails the run with `CORRUPTED_EVENT_LOG`: it is held for whichever part of the workflow awaits it. A gap in the numbering fails the run instead of being replayed over.

- [#3205](https://github.com/vercel/workflow/pull/3205) [`22349e9`](https://github.com/vercel/workflow/commit/22349e95fd85a112cbec3f425900b74bf5ccc77f) Thanks [@NathanColosimo](https://github.com/NathanColosimo)! - Load replay-event suffixes through one World request.

- [#3439](https://github.com/vercel/workflow/pull/3439) [`69c30ff`](https://github.com/vercel/workflow/commit/69c30ff49eb89c0c4c4b2642c37985fdf64fa9fd) Thanks [@VaguelySerious](https://github.com/VaguelySerious)! - Stop reporting replay divergence for an event the workflow is still on its way to consuming, by waiting for in-flight step and hook deliveries instead of a fixed delay

- [#3124](https://github.com/vercel/workflow/pull/3124) [`65139ac`](https://github.com/vercel/workflow/commit/65139acfd7118d3b73672435a6e1c47115f6e23f) Thanks [@NathanColosimo](https://github.com/NathanColosimo)! - Infer required run and step entities, including their start times, from
`events.create` request types.
- Updated dependencies [[`74dbf81`](https://github.com/vercel/workflow/commit/74dbf81d327b8574cca429b56757c7322a26b4ef), [`a8db185`](https://github.com/vercel/workflow/commit/a8db185c3b19b3dab971f51aa076aead81ed26ea), [`439a495`](https://github.com/vercel/workflow/commit/439a495a715b9426ef4dbcf8d928a8fc50ffb040), [`bf4dda6`](https://github.com/vercel/workflow/commit/bf4dda64780f5f8e13840871960cf2a647cdd329), [`6786db9`](https://github.com/vercel/workflow/commit/6786db99538ef57c872d861ecfb28d99ae857d6d), [`22349e9`](https://github.com/vercel/workflow/commit/22349e95fd85a112cbec3f425900b74bf5ccc77f), [`665110b`](https://github.com/vercel/workflow/commit/665110b3a255c920a3612dec521234efcf34d4f8), [`65139ac`](https://github.com/vercel/workflow/commit/65139acfd7118d3b73672435a6e1c47115f6e23f), [`4bb86d3`](https://github.com/vercel/workflow/commit/4bb86d305423a2da813cbef8b7d6fe4421288bba), [`264ddff`](https://github.com/vercel/workflow/commit/264ddff67b3cfceea24235ee6d865c48e7982727)]:
- @workflow/world@5.0.0-beta.26
- @workflow/world-vercel@5.0.0-beta.37
- @workflow/world-local@5.0.0-beta.35
- @workflow/errors@5.0.0-beta.16

## 5.0.0-beta.40

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@workflow/core",
"version": "5.0.0-beta.40",
"version": "5.0.0-beta.41",
"description": "Core runtime and engine for Workflow SDK",
"type": "module",
"main": "dist/index.js",
Expand Down
Loading
Loading