Files
vercel__workflow/packages/errors/CHANGELOG.md
2026-09-09 12:12:11 -07:00

21 KiB

@workflow/errors

5.0.0-beta.21

Minor Changes

  • #3787 61fb1f9 Thanks @VaguelySerious! - Add an experimental_retention option to start(): experimental_retention: 0 asks the World to delete the run's user data as soon as the run completes or fails, while keeping the run itself listable. Implemented on the Vercel, Postgres and Local Worlds. Reading a run whose data has expired now throws RunExpiredError instead of resolving to a placeholder.

5.0.0-beta.20

Minor Changes

  • #3943 fbfb9fe Thanks @karthikscale3! - Validate world.analytics arguments up front: an invalid id, an out-of-range page limit, an oversized attribute filter, or a half-open startTime/endTime window now throws a WorkflowWorldError with code: 'INVALID_ARGUMENT' and field set to the offending parameter, instead of failing the request. The message names the method, the parameter, and what it received. Adds ANALYTICS_RUN_SCOPED_PAGE_LIMIT, ANALYTICS_PAGE_LIMIT and ANALYTICS_MAX_ATTRIBUTE_FILTERS.

    Deprecate analytics.events.listByCorrelationId() in favour of analytics.events.list({ runId, correlationId }).

    Fix analytics.attributes.list() timestamps being shifted by the local UTC offset.

  • #3850 fe2fd8c Thanks @alangenfeld! - Add a catchable StreamError and classify Workflow stream infrastructure failures as STREAM_ERROR instead of USER_ERROR.

5.0.0-beta.19

Patch Changes

  • Updated dependencies [ffc5807]:
    • @workflow/utils@5.0.0-beta.10

5.0.0-beta.18

Patch Changes

  • Updated dependencies [f771585, f771585]:
    • @workflow/utils@5.0.0-beta.9

5.0.0-beta.17

Patch Changes

  • #3479 b589460 Thanks @VaguelySerious! - Replay-context event writes now always report the log position they replayed from, and the WORKFLOW_PRECONDITION_GUARD flag is removed.

  • #3410 c1a5c74 Thanks @alangenfeld! - Surface typed terminal errors when stream retention expires.

5.0.0-beta.16

Minor Changes

  • #2960 79e4c04 Thanks @alangenfeld! - Re-route a queue delivery that reaches a deployment other than the one its run is pinned to, retry transient publishing failures through normal queue redelivery, and fail the run with the new DEPLOYMENT_MISMATCH error code once the recovery budget is spent.

5.0.0-beta.15

Minor Changes

  • #3145 1471f25 Thanks @VaguelySerious! - Strengthen the event-creation precondition guard: replay-context writes now also send the number of loaded events, so a snapshot that is missing an event is rejected instead of committing a divergent event log, and a rejection restarts the replay in-process (consuming the events a world may attach to the rejection) rather than re-committing the rejected payload or re-invoking over the queue. @workflow/world-local and @workflow/world-postgres do not implement the check.

5.0.0-beta.14

Patch Changes

  • Updated dependencies [a09d001]:
    • @workflow/utils@5.0.0-beta.8

5.0.0-beta.13

Patch Changes

  • #3061 62d570e Thanks @NathanColosimo! - Remove the retired step route runtime and make queue health checks target the combined flow handler.

  • Updated dependencies [49276f2, 62d570e]:

    • @workflow/utils@5.0.0-beta.7

5.0.0-beta.12

Patch Changes

  • #2986 fe12b84 Thanks @shalabhc! - Enforce a server-supplied per-run event limit (default 25K)

  • #2946 eb8fdb9 Thanks @VaguelySerious! - The WORKFLOW_PRECONDITION_GUARD event-creation guard is now on by default; opt out with WORKFLOW_PRECONDITION_GUARD=0.

5.0.0-beta.11

Minor Changes

  • #2266 a00d169 Thanks @VaguelySerious! - Add an opt-in optimistic-concurrency guard for event creation (WORKFLOW_PRECONDITION_GUARD=1): replay-context event creations send a stateUpdatedAt snapshot timestamp, and the runtime reloads the event log and retries (then falls back to a queue re-invocation) when the backend reports a newer out-of-band event with a 412 PreconditionFailedError.

5.0.0-beta.10

Patch Changes

  • Updated dependencies [239031a, 0f557d5]:
    • @workflow/utils@5.0.0-beta.6

5.0.0-beta.9

Patch Changes

  • Updated dependencies [f6772d9]:
    • @workflow/utils@5.0.0-beta.5

5.0.0-beta.8

Patch Changes

  • Updated dependencies [926a5e7]:
    • @workflow/utils@5.0.0-beta.4

5.0.0-beta.7

Patch Changes

  • #2212 2a3b11b Thanks @pranaygp! - Retry transient workflow replay divergence before classifying repeated divergence as a corrupted event log.

5.0.0-beta.6

Patch Changes

  • #2145 8d0928b Thanks @TooTallNate! - Classify SDK-level AES-GCM encryption failures as RUNTIME_ERROR instead of USER_ERROR via a new RuntimeDecryptionError.

5.0.0-beta.5

Patch Changes

  • #1799 503a929 Thanks @TooTallNate! - Use inline sourcemaps for all workspace packages; published packages no longer ship external .js.map files.

  • Updated dependencies [503a929]:

    • @workflow/utils@5.0.0-beta.3

5.0.0-beta.4

Patch Changes

  • #2046 ad71b58 Thanks @pranaygp! - Report corrupted event logs with a distinct CorruptedEventLogError type and CORRUPTED_EVENT_LOG run error code.

  • #2060 1d3959e Thanks @pranaygp! - Record fatal world response contract failures as non-retryable workflow errors.

5.0.0-beta.3

Patch Changes

5.0.0-beta.2

Major Changes

  • #1851 5f22832 Thanks @TooTallNate! - BREAKING CHANGE: Run and step errors are now serialized through the workflow serialization pipeline, preserving original class identity and cause chains on WorkflowRunFailedError.cause. Pre-upgrade failed runs in the world-postgres legacy error text column surface as error: undefined on read; the original payload is still readable directly from the errorJson column for manual inspection.

Patch Changes

  • #1915 540a2ef Thanks @VaguelySerious! - Replace the chalk import in @workflow/errors/ansi with a tiny inline ANSI shim. @workflow/errors/ansi is reachable from the workflow-VM bundle (via @workflow/core/workflow → context-errors → context-violation-error → here), and chalk pulls in supports-color, which calls require('os') at module load — crashing every workflow with ReferenceError: require is not defined in the sandboxed VM.

  • #1849 1203dae Thanks @pranaygp! - Friendlier workflow error messages. New SerializationError, WorkflowBuildError, and structured context-violation classes (e.g. NotInWorkflowContextError) with actionable hints and docs links applied to user-facing throw sites; FatalError.is() recognizes any error with fatal: true so context violations and serialization failures now fail fast instead of burning retry attempts. Runtime logs are namespaced under [workflow-sdk] and gain errorAttribution (user vs sdk) plus class-aware hints

  • #1849 1203dae Thanks @pranaygp! - Replace util.inspect's default object dump for runtime structured-log metadata with an opinionated, workflow-aware formatter. The runtime logger uses color-coded metadata blocks.

  • Updated dependencies [1203dae]:

    • @workflow/utils@5.0.0-beta.2

5.0.0-beta.1

Patch Changes

5.0.0-beta.0

Major Changes

Patch Changes

  • Updated dependencies [c5cdfc0]:
    • @workflow/utils@5.0.0-beta.0

4.1.0-beta.20

Patch Changes

  • #1567 6dc1b78 Thanks @VaguelySerious! - Increase flow route limit to max fluid duration and fail run if a single replay takes too long

4.1.0-beta.19

Patch Changes

  • #1448 73a851a Thanks @pranaygp! - Add HookConflictError to @workflow/errors and use it for hook token conflicts instead of WorkflowRuntimeError

  • #1340 84599b7 Thanks @pranaygp! - Add error code classification (USER_ERROR, RUNTIME_ERROR) to run_failed events, improve queue and schema validation error logging

  • #1447 2ef33d2 Thanks @pranaygp! - Export semantic error types from workflow/internal/errors and add API reference documentation

  • #1452 672d919 Thanks @pranaygp! - Fix workflow/step not found errors to fail gracefully instead of causing infinite queue retries

  • #1344 beccbc4 Thanks @pranaygp! - Remove VQS maxDeliveries cap and enforce max delivery limit in workflow/step handlers with graceful failure

  • #1342 aee035f Thanks @pranaygp! - Replace HTTP status code checks with semantic error types (EntityConflictError, RunExpiredError, ThrottleError, TooEarlyError). BREAKING CHANGE: WorkflowAPIError renamed to WorkflowWorldError.

4.1.0-beta.18

Patch Changes

  • #1270 adfe8b6 Thanks @pranaygp! - Add HookNotFoundError to @workflow/errors and adopt it across all world backends

4.1.0-beta.17

Patch Changes

  • Updated dependencies [e55c636]:
    • @workflow/utils@4.1.0-beta.13

4.1.0-beta.16

Patch Changes

  • #1055 c2b4fe9 Thanks @pranaygp! - Detect and fatal error on orphaned/invalid events in the event log instead of silently hanging

4.1.0-beta.15

Patch Changes

  • #966 56f2221 Thanks @VaguelySerious! - Add 429 throttle retry handling and 500 server error retry with exponential backoff to the workflow and step runtimes

  • Updated dependencies [3d770d5]:

    • @workflow/utils@4.1.0-beta.12

4.1.0-beta.14

Minor Changes

  • #621 4966b72 Thanks @pranaygp! - BREAKING: Storage interface is now read-only; all mutations go through events.create()
    • Remove cancel, pause, resume from runs
    • Remove create, update from runs, steps, hooks
    • Add run lifecycle events: run_created, run_started, run_completed, run_failed, run_cancelled
    • Add step_created event type
    • Remove fatal field from step_failed (terminal failure is now implicit)
    • Add step_retrying event with error info for retriable failures

Patch Changes

  • #621 4966b72 Thanks @pranaygp! - Add backwards compatibility for runs created with different spec versions

    • Add RunNotSupportedError for runs requiring newer world versions
    • Add semver-based version comparison utilities
    • Legacy runs (< 4.1): route to legacy handlers
    • run_cancelled: skip event storage, directly update run
    • wait_completed: store event only (no entity mutation)
    • Unknown legacy events: throw error
  • #621 4966b72 Thanks @pranaygp! - Add hook_conflict event type for duplicate token detection

    • World returns hook_conflict event when hook_created uses an existing token
    • Add HOOK_CONFLICT error slug
  • Updated dependencies [4966b72, b16a682]:

    • @workflow/utils@4.1.0-beta.11

4.0.1-beta.13

Patch Changes

  • Updated dependencies [9b1640d]:
    • @workflow/utils@4.0.1-beta.10

4.0.1-beta.12

Patch Changes

  • Updated dependencies [e3f0390]:
    • @workflow/utils@4.0.1-beta.9

4.0.1-beta.11

Patch Changes

  • Updated dependencies [0cf0ac3]:
    • @workflow/utils@4.0.1-beta.8

4.0.1-beta.10

Patch Changes

4.0.1-beta.9

Patch Changes

  • #505 b56aae3 Thanks @copilot-swe-agent! - Override setTimeout, setInterval, and related functions in workflow VM context to throw helpful errors suggesting to use sleep instead

  • Updated dependencies [1ef6b2f]:

    • @workflow/utils@4.0.1-beta.7

4.0.1-beta.8

Patch Changes

  • Updated dependencies [c9b8d84]:
    • @workflow/utils@4.0.1-beta.6

4.0.1-beta.7

Patch Changes

  • Updated dependencies [bc9b628]
  • Updated dependencies [34f3f86]
  • Updated dependencies [cd451e0]
    • @workflow/utils@4.0.1-beta.5

4.0.1-beta.6

Patch Changes

  • Updated dependencies [edb69c3]
    • @workflow/utils@4.0.1-beta.4

4.0.1-beta.5

Patch Changes

  • b97b6bf: Lock all dependencies in our packages
  • 00b0bb9: Wire through world's structured errors in WorkflowRunFailedError
  • Updated dependencies [b97b6bf]
    • @workflow/utils@4.0.1-beta.3

4.0.1-beta.4

Patch Changes

  • Updated dependencies [bf170ad]
  • Updated dependencies [adf0cfe]
    • @workflow/utils@4.0.1-beta.2

4.0.1-beta.3

Patch Changes

  • f973954: Update license to Apache 2.0

4.0.1-beta.2

Patch Changes

  • 796fafd: Add static is() methods to all Error subclasses

4.0.1-beta.1

Patch Changes

  • 1408293: Add "description" field to package.json file
  • 8422a32: Update Workflow naming convention
  • e46294f: Add "license" and "repository" fields to package.json file

4.0.1-beta.0

Patch Changes

  • fcf63d0: Initial publish