bunqueue v2.7.4
blog · release
bunqueue v2.7.4
Crash recovery, type-safe workflow steps.
To install bunqueue v2.7.4
Section titled “To install bunqueue v2.7.4”bun add bunqueue@2.7.4npm install bunqueue@2.7.4To upgrade bunqueue
Section titled “To upgrade bunqueue”bun add bunqueue@latestCrash recovery
Section titled “Crash recovery”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.
Type-safe workflow steps
Section titled “Type-safe workflow steps”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.
More additions
Section titled “More additions”- New
src/client/workflow/compensator.ts, ExtractedWaitForSignalErrorandrunCompensation()from executor. - New
src/client/workflow/recovery.ts, Recovery logic withRecoverDepsinterface andrecoverExecutions(). - New
WorkflowStore.listRecoverable()method, Queries SQLite for executions in recoverable states. - Exported
RecoverResult,TypedStepHandler,TypedCompensateHandlerfrombunqueue/workflow.
Documentation
Section titled “Documentation”- 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)
Thanks to 1 contributor!
Section titled “Thanks to 1 contributor!”← bunqueue v2.7.3 · Release on GitHub · Commits since v2.7.3 · Full changelog · All posts