Skip to content
Get started
Get started
bunqueue v2.7.4
View Markdown
blog · release

bunqueue v2.7.4

Crash recovery, type-safe workflow steps.

bun add bunqueue@2.7.4
npm install bunqueue@2.7.4
bun add bunqueue@latest

New engine.recover() re-enqueues orphaned executions after crash/restart. Handles three states: running (re-enqueue at current step), waiting (re-arm signal timeout or resume if signal arrived), compensating (re-run compensation). Returns RecoverResult with counts.

Workflow<TInput> now uses a generic accumulator pattern to track step return types at compile time. Each .step() narrows the return type so subsequent steps see previous results without as casts. Works with .parallel(), .map(), .forEach(), .subWorkflow(). Fully backward compatible.

  • New src/client/workflow/compensator.ts, Extracted WaitForSignalError and runCompensation() from executor.
  • New src/client/workflow/recovery.ts, Recovery logic with RecoverDeps interface and recoverExecutions().
  • New WorkflowStore.listRecoverable() method, Queries SQLite for executions in recoverable states.
  • Exported RecoverResult, TypedStepHandler, TypedCompensateHandler from bunqueue/workflow.
  • Workflow guide: Added “Type-Safe Steps” and “Crash Recovery” sections, updated comparison table (+2 rows), updated Quick Start with type-safe examples, updated StepContext table, updated Limitations & Caveats, added engine.recover() to API table.
  • 7 new crash recovery tests (test/workflow-recovery.test.ts)
  • 8 new type-safe step tests (test/workflow-typesafe.test.ts)

← bunqueue v2.7.3 · Release on GitHub · Commits since v2.7.3 · Full changelog · All posts