bunqueue v2.7.1
Step retry with exponential backoff, parallel steps, signal timeout, nested workflows (sub-workflows) and more.
To install bunqueue v2.7.1
Section titled “To install bunqueue v2.7.1”bun add bunqueue@2.7.1npm install bunqueue@2.7.1To upgrade bunqueue
Section titled “To upgrade bunqueue”bun add bunqueue@latestStep retry with exponential backoff
Section titled “Step retry with exponential backoff”Steps now retry automatically with configurable retry count. Backoff uses min(500ms × 2^attempt + jitter, 30s). Attempt count tracked in exec.steps['name'].attempts.
Parallel steps
Section titled “Parallel steps”New .parallel() DSL method runs multiple steps concurrently via Promise.allSettled. If any step fails, compensation runs for all completed steps.
Signal timeout
Section titled “Signal timeout”.waitFor('event', { timeout: ms }) fails the execution if the signal doesn’t arrive within the timeout, triggering compensation automatically.
Nested workflows (sub-workflows)
Section titled “Nested workflows (sub-workflows)”New .subWorkflow(name, inputMapper) composes workflows. Parent pauses while child executes; child results available in ctx.steps['sub:<name>'].
Observability (typed events)
Section titled “Observability (typed events)”New WorkflowEmitter with 11 event types: workflow:started/completed/failed/waiting/compensating, step:started/completed/failed/retry, signal:received/timeout. Subscribe via engine.on(), engine.onAny(), or onEvent constructor option.
Cleanup & archival
Section titled “Cleanup & archival”engine.cleanup(maxAgeMs, states?) deletes old executions. engine.archive(maxAgeMs, states?) moves them to workflow_executions_archive table (transactional, up to 1000 per call). engine.getArchivedCount() returns archive size.
Changes
Section titled “Changes”- Refactored
executor.ts(362→273 lines): extractedbuildContext(),findStepDef(),executeStepWithRetry(),executeParallelSteps(),executeSubWorkflow()to newrunner.ts - New
emitter.ts(115 lines) for event system processStep()now allows'waiting'state (for signal timeout re-checks)
Documentation
Section titled “Documentation”- Workflow guide: Added 6 new sections (retry, parallel, signal timeout, nested, observability, cleanup), updated comparison table (+6 rows), API table (+7 methods), architecture diagram
- Blog post: Added sections for retry/parallel/sub-workflows, observability, cleanup
- Examples: Added 3 new workflow examples (parallel enrichment, nested sub-workflow, retry with observability)
- FAQ: Updated feature list, comparison table, JSON-LD schema
- Homepage/Introduction/README: Updated feature descriptions
- 20 new unit tests in
workflow-new-features.test.ts(retry, parallel, signal timeout, cleanup, observability, nested workflows) - 6 new embedded integration tests (tests 8-13 in
scripts/embedded/test-workflow-engine.ts) - 7 new TCP integration tests (tests 7-13 in
scripts/tcp/test-workflow-engine.ts) - All 5,294 existing tests continue to pass
Thanks to 1 contributor!
Section titled “Thanks to 1 contributor!”← bunqueue v2.7.0 · Release on GitHub · Commits since v2.7.0 · Full changelog · All posts