@workflow/errors
5.0.5 · 20 Oct 2026Apache-2.01.2M / weekRepositorynpmAtom feed
15 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 5.x · latest line
5.0.5
20 Oct 2026@TooTallNate - Add a QuickJS snapshotting hint and docs link to
MaxEventsExceededError
5.0.4
12 Oct 2026@VaguelySerious - Add
InBandSupersededErrorand optionalinBand/expectedSeqInBandevent-create params for the in-band writer fence.@workflow/world-vercelforwards them, does not retry a fenced write in-process, and records the fence on its event spans. The runtime does not use them yet.
5.0.1 – 5.0.33 releases that only update dependencies@workflow/world 5.0.3@workflow/utils 5.0.1Show each
- 5.0.38 Oct 2026@workflow/world 5.0.3
- 5.0.26 Oct 2026@workflow/utils 5.0.1@workflow/world 5.0.2
- 5.0.11 Oct 2026@workflow/world 5.0.1
5.0.0
30 Sep 2026- breaking
Initial v5 beta release
- breaking
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 theworld-postgreslegacyerrortext column surface aserror: undefinedon read; the original payload is still readable directly from theerrorJsoncolumn for manual inspection. Validate
world.analyticsarguments up front: an invalid id, an out-of-range page limit, an oversized attribute filter, or a half-openstartTime/endTimewindow now throws aWorkflowWorldErrorwithcode: 'INVALID_ARGUMENT'andfieldset to the offending parameter, instead of failing the request. The message names the method, the parameter, and what it received. AddsANALYTICS_RUN_SCOPED_PAGE_LIMIT,ANALYTICS_PAGE_LIMITandANALYTICS_MAX_ATTRIBUTE_FILTERS.Deprecate
analytics.events.listByCorrelationId()in favour ofanalytics.events.list({ runId, correlationId }).Fix
analytics.attributes.list()timestamps being shifted by the local UTC offset.
Major Changes
- breaking
Initial v5 beta release
- breaking
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 theworld-postgreslegacyerrortext column surface aserror: undefinedon read; the original payload is still readable directly from theerrorJsoncolumn for manual inspection.
Minor Changes
Validate
world.analyticsarguments up front: an invalid id, an out-of-range page limit, an oversized attribute filter, or a half-openstartTime/endTimewindow now throws aWorkflowWorldErrorwithcode: 'INVALID_ARGUMENT'andfieldset to the offending parameter, instead of failing the request. The message names the method, the parameter, and what it received. AddsANALYTICS_RUN_SCOPED_PAGE_LIMIT,ANALYTICS_PAGE_LIMITandANALYTICS_MAX_ATTRIBUTE_FILTERS.Deprecate
analytics.events.listByCorrelationId()in favour ofanalytics.events.list({ runId, correlationId }).Fix
analytics.attributes.list()timestamps being shifted by the local UTC offset.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-localand@workflow/world-postgresdo not implement the check.Add an opt-in optimistic-concurrency guard for event creation (
WORKFLOW_PRECONDITION_GUARD=1): replay-context event creations send astateUpdatedAtsnapshot 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 412PreconditionFailedError.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_MISMATCHerror code once the recovery budget is spent.Add
createHook({ experimental_force: true })option, which takes a hook token over from the run that currently holds it instead of rejecting withHookConflictError. Previous runs awaiting the hook are rejected withHookForceClaimedErrornaming the run that took the token. Seeexperimental_forcedocs for details.Add an
experimental_retentionoption tostart():experimental_retention: 0asks 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 throwsRunExpiredErrorinstead of resolving to a placeholder.Add an optional
invokemethod and capability to the World interface. It routes a payload to the runner handling the specifiedrunIdand returns a promise for its response. In world-postgres, this uses a regular queue roundtrip with a run-scoped queue. The runtime usesinvokewhen available, initially to resume hooks.Add a catchable
StreamErrorand classify Workflow stream infrastructure failures asSTREAM_ERRORinstead ofUSER_ERROR.
Patch Changes
Expose the active run ID on hook token conflict errors.
Report corrupted event logs with a distinct
CorruptedEventLogErrortype andCORRUPTED_EVENT_LOGrun error code.Replace the
chalkimport in@workflow/errors/ansiwith a tiny inline ANSI shim.@workflow/errors/ansiis reachable from the workflow-VM bundle (via@workflow/core/workflow→context-errors→context-violation-error→ here), andchalkpulls insupports-color, which callsrequire('os')at module load — crashing every workflow withReferenceError: require is not definedin the sandboxed VM.Enforce a server-supplied per-run event limit (default 25K)
Embed source content in published sourcemaps.
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 withfatal: trueso context violations and serialization failures now fail fast instead of burning retry attempts. Runtime logs are namespaced under[workflow-sdk]and gainerrorAttribution(uservssdk) plus class-aware hintsThe
WORKFLOW_PRECONDITION_GUARDevent-creation guard is now on by default; opt out withWORKFLOW_PRECONDITION_GUARD=0.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.Rename
useworkflow.devURLs toworkflow-sdk.devRetry transient workflow replay divergence before classifying repeated divergence as a corrupted event log.
Remove the retired step route runtime and make queue health checks target the combined flow handler.
Classify SDK-level AES-GCM encryption failures as
RUNTIME_ERRORinstead ofUSER_ERRORvia a newRuntimeDecryptionError.Record fatal world response contract failures as non-retryable workflow errors.
Replay-context event writes now always report the log position they replayed from, and the
WORKFLOW_PRECONDITION_GUARDflag is removed.Surface typed terminal errors when stream retention expires.
Mark
WorkflowRunFailedErrorandWorkflowRunCancelledErroras non-retryable, so a step that reads a terminal run'sreturnValuefails on its first attempt with the error intact instead of exhausting its retry budget first.Use inline sourcemaps for all workspace packages; published packages no longer ship external
.js.mapfiles.
- 4.x
4.2.0
29 Jul 2026@VaguelySerious - Add an optimistic-concurrency guard for event creation (on by default; opt out with
WORKFLOW_PRECONDITION_GUARD=0): replay-context event creations send astateUpdatedAtsnapshot timestamp, and the runtime reloads the event log and retries (then falls back to a fresh re-invocation) when the backend reports a newer out-of-band event with a 412PreconditionFailedError. Backends without guard support ignore the snapshot, so this is backward-compatible and fails open.
4.1.5
22 Jul 2026Reading the note…
4.1.4
11 Jun 2026Reading the note…
4.1.3
2 Jun 2026Reading the note…
4.1.2
22 May 2026Reading the note…
4.1.1
16 Apr 2026Reading the note…
4.1.0
7 Apr 2026Reading the note…