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

bunqueue v2.7.0

Workflow Engine.

bun add bunqueue@2.7.0
npm install bunqueue@2.7.0
bun add bunqueue@latest

A new orchestration layer for multi-step business processes, built entirely on top of bunqueue’s existing Queue and Worker. Zero core engine modifications, zero new infrastructure.

  • Fluent DSL: Chain .step(), .branch(), .path(), and .waitFor() to define workflows in pure TypeScript
  • Saga compensation: Attach compensate handlers to steps; on failure, they run automatically in reverse order, rolling back side effects (payments, reservations, database writes)
  • Conditional branching: Route execution to different paths at runtime based on step results (e.g., VIP vs standard, risk-level tiers)
  • Human-in-the-loop: .waitFor('event') pauses execution (persisted to SQLite); engine.signal(id, event, payload) resumes it, minutes, hours, or days later
  • Step timeouts: Prevent steps from running indefinitely with per-step timeout configuration
  • Context passing: Each step accesses the original input and all previous step results via ctx.steps['step-name']
  • SQLite persistence: Execution state is stored in a dedicated workflow_executions table; survives process restarts
  • Embedded & TCP: Works in both modes, just like Queue and Worker
  • Import: import { Workflow, Engine } from 'bunqueue/workflow'
  • Export mapping: added "./workflow" to package.json exports
const flow = new Workflow('order')
.step('validate', async (ctx) => { ... })
.step('charge', async (ctx) => { ... }, {
compensate: async () => { /* auto-rollback */ },
})
.waitFor('manager-approval')
.step('ship', async (ctx) => { ... });
const engine = new Engine({ embedded: true });
engine.register(flow);
const run = await engine.start('order', { orderId: 'ORD-1' });
await engine.signal(run.id, 'manager-approval', { approved: true });
  • New page: Workflow Engine guide with competitor comparison (vs Temporal, Inngest, Trigger.dev), full API reference, and 4 production examples (e-commerce, CI/CD pipeline, KYC onboarding, ETL data pipeline)
  • Quickstart: Added Workflow Engine section with example
  • README: Added Workflow Engine section with code examples and competitor comparison table
  • Sidebar: Added Workflow Engine entry under Client SDK
  • SEO: Updated global keywords, JSON-LD structured data, and sitemap priority for workflow page
  • 27 new unit tests across 3 test files (workflow-engine, workflow-realistic, workflow-e2e-production)
  • 7 new embedded integration tests (scripts/embedded/test-workflow-engine.ts)
  • 6 new TCP integration tests (scripts/tcp/test-workflow-engine.ts)
  • All 5274 existing tests continue to pass

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