bunqueue v2.9.24
A zero-dependency live terminal dashboard (bunqueue top), PostgreSQL 16-19 multi-pod storage and production hardening for the Workflow Engine, PostgreSQL 19 support, fast cursor-bounded journal replay (6-86 shared blocks in 0.01-0.05 ms), deeper lease and flow hardening, and Bun 1.4.5.
bunqueue v2.9.24 brings two headline capabilities for production operators alongside deep engine hardening across SQLite and PostgreSQL. First, bunqueue top puts a k9s/btop-inspired terminal dashboard directly in the CLI with zero new runtime dependencies and no wire-protocol changes. Second, bunqueue/workflow gains native PostgreSQL 16-19 multi-pod storage (EngineOptions.postgres), Schema v2 with O(active) partial indexes, idempotent starts, durable timers, cooperative AbortSignal cancellation, lease-loss watchdogs, rolling-deploy support, and MCP PostgreSQL integration.
This release also adds PostgreSQL 19 (19.0) across CI, Docker Compose examples, and SDK conformance, upgrades the runtime pin from Bun 1.4.4 to 1.4.5, drops PostgreSQL event journal replay scans from 449 shared blocks down to 6-86 shared blocks in 0.01-0.05 ms (#199), and closes lease-fencing, SQLite durability, flow-dependency, multi-broker PostgreSQL, and saga-recovery edge cases. Every observable change and migration note is listed in Before you upgrade.
To install bunqueue v2.9.24
Section titled “To install bunqueue v2.9.24”curl -fsSL https://bunqueue.dev/install.sh | sh -s -- --version 2.9.24& ([scriptblock]::Create((irm https://bunqueue.dev/install.ps1))) -Version 2.9.24bun add bunqueue@2.9.24npm install bunqueue@2.9.24TAG=2.9.24docker run -p 6789:6789 -p 6790:6790 ghcr.io/egeominotti/bunqueue:$TAGTo upgrade bunqueue
Section titled “To upgrade bunqueue”bun add bunqueue@latestMonitor and triage queues from your shell with bunqueue top
Section titled “Monitor and triage queues from your shell with bunqueue top”bunqueue top is a zero-dependency live terminal UI (src/cli/top/) that attaches to any bunqueue broker over a single persistent TCP+TLS+Auth connection using existing wire commands (Auth, Hello, DashboardOverview, DashboardQueues, DashboardQueue, GetQueueLimits, GetJob, GetLogs, GetDlqStats, Dlq, ListWebhooks, Pause, Resume, RateLimit, RateLimitClear, SetConcurrency, ClearConcurrency, PUSH, Drain, Cancel, Promote, Discard, RetryDlq, PurgeDlq, SetWebhookEnabled, RemoveWebhook, CronDelete, and CompactMemory). No broker hot paths or protocol frames were changed.
# Try the built-in interactive simulator with no running serverbunx bunqueue top --demo
# Attach to a live brokerbunx bunqueue top --host 127.0.0.1 --port 6789 --theme cyber
# Scriptable single-frame and JSON snapshotsbunx bunqueue top --once --view dlq -q billingbunx bunqueue top --once --jsonWhat ships inside bunqueue top:
- Live telemetry and 4 themes: A 4-row truecolor Braille throughput area chart,
p50/p95/p99latency percentiles, a heap/RSS gauge, and 4 live color themes (cyber,tokyo,amber,mono). - 7 interactive views and drill-down: Switch across Queues (with live deltas and heat load bars), Workers, Crons, DLQ Triage (deterministic root-cause clustering with inline secret and ANSI scrubbing), Webhooks, a live Activity feed derived from snapshot diffs, and
[7] Workflows(zero-DDL SQLite--workflow-dbor PostgreSQL 16-19--workflow-pginspection, step-by-step timeline drill-down, and live transactionalwaitForsignal delivery viasand:wf), plus a toggleable bottom split preview (v) and Queue -> Job + Logs inspection. - Live operator controls and command palette: Pause or resume queues, tune rate limits and concurrency, quick-push jobs, promote/discard/cancel jobs, run canary or full DLQ retries, purge DLQs, manage webhooks and crons, wake parked workflows, and compact broker memory with
y/Nconfirmation on destructive actions and ak9s-style:command palette. - Interactive browser simulator: The same
--demoengine runs live on the documentation homepage with six guided scenario presets (including[7] Workflows & Signals), in the Terminal UI guide, and in the dedicatedbunqueue toplaunch post.
Verified installers, package manifests, and bunqueue doctor --deep
Section titled “Verified installers, package manifests, and bunqueue doctor --deep”Release v2.9.24 ships production-grade single-binary installers at https://bunqueue.dev/install.sh (strictly POSIX sh) and https://bunqueue.dev/install.ps1 (PowerShell 5.1+ and 7+) alongside deterministic package manager manifests and deep host diagnostics:
# macOS (arm64/x64 + Rosetta 2 detection) and Linux (glibc or musl/Alpine)curl -fsSL https://bunqueue.dev/install.sh | sh
# Hardened Linux systemd server with generated AUTH_TOKENS and live healthcheckcurl -fsSL https://bunqueue.dev/install.sh | sudo sh -s -- --systemd
# Deep production audit: TCP/TLS+Auth+Ping, SQLite WAL & integrity, PostgreSQL 16+, systemdbunqueue doctor --deep --host 127.0.0.1 --port 6789 --token "$BQ_TOKEN"- Fail-closed installers: Both
install.shandinstall.ps1enforce HTTPS with TLS 1.2, mandatorySHA256SUMSverification, tar-slip and zip-slip path guards, a pre-swap--versionsmoke check with automatic rollback, optional GitHub Sigstore provenance verification (--verify-attestation),--dry-run, and--uninstall. On Linux,--systemdprovisions a dedicatedbunqueueuser,/var/lib/bunqueue(0750),/etc/bunqueue/bunqueue.env(0640, preserving existingAUTH_TOKENSon upgrades), and a hardenedbunqueue.serviceunit (ProtectSystem=strict,NoNewPrivileges=true). - Homebrew, Scoop, and Winget manifests:
scripts/generate-package-manifests.tsbuilds checksum-verifiedhomebrew/bunqueue.rb(macOS and Linux with aserviceblock),scoop/bunqueue.json(Windows64bitandarm64), and Winget v1.9.0 manifests fromSHA256SUMS. Every GitHub Release attachesbunqueue.rbandbunqueue.json, and CI includes a non-blockingpublish-homebrew-tapjob foregeominotti/homebrew-tapwhenHOMEBREW_TAP_TOKENis set. - Deep production diagnostics (
bunqueue doctor): Keeps defaultbunqueue doctorHTTP/healthbehavior intact while adding opt-in--deep,--tcp,--sqlite <path>(read-only WAL,quick_check, and disk headroom),--pg <url>(bounded PostgreSQL 16+ and schema/index probe with credentials stripped),--systemd(service state,bunqueue.envpermission audit,/var/lib/bunqueuewritability),--http-port <port>, dedicatedbunqueue doctor --help, and structured--jsonoutput.
Run bunqueue/workflow across multiple pods on PostgreSQL 16-19
Section titled “Run bunqueue/workflow across multiple pods on PostgreSQL 16-19”Previously, bunqueue/workflow stored execution state in local SQLite (dataPath). In v2.9.24 (#196), EngineOptions.postgres adds native Bun.SQL persistence for PostgreSQL 16-19 so multiple Kubernetes pods can share one PostgreSQL workflow namespace (bunqueue_workflow_executions, bunqueue_workflow_executions_archive, bunqueue_workflow_schema_migrations) and a remote TCP bunqueue step queue with zero local SQLite files.
import { Engine } from 'bunqueue/workflow';
const engine = new Engine({ postgres: { url: process.env.DATABASE_URL!, namespace: 'orders', }, connection: { host: 'bunqueue.internal', port: 6789 }, autoStart: false,});
engine.register(orderWorkflow);await engine.ready();Alongside PostgreSQL storage, v2.9.24 hardens the Workflow Engine across both SQLite and PostgreSQL:
- Schema v2 and O(active) partial indexes: Automatic startup migration (advisory-locked with transactional backfill on PostgreSQL) adds
needs_rollback,idempotency_key, anddefinition_hashplus O(active) partial indexes (idx_wf_recoverable/idx_wf_pg_recoverable,idx_wf_active_by_name/idx_wf_pg_active_by_name, and uniqueidx_wf_idempotency_key/idx_wf_pg_idempotency_key) so recovery and registration checks scan only live or rollback-owed runs instead of settled history. - Idempotency, deadlines, and completion waiting:
engine.start(name, input?, { idempotencyKey?, executionId?, timeoutMs? })provides atomic deduplication (RunHandle.deduplicated) and durable execution deadlines (deadlineAt), paired withengine.waitForCompletion(id, { timeoutMs?, pollIntervalMs? })across forward runs and saga compensations. - Cancellation, lease-loss watchdogs, and retry controls:
engine.cancel(id, { reason?, compensate? })transitions runs to'cancelled'and emits'workflow:cancelled'(16 workflow events total), propagatingAbortSignal(ctx.signal) through steps, parallel blocks, branches, loops,forEach,map, sub-workflows, and compensations. An independent local deadline watchdog (startLeaseRenewalWithWatchdoginsrc/client/workflow/postgresLeaseWait.ts) self-fences a partitioned pod under silent TCP blackholes (iptables -j DROP) before a surviving replica can take over. Also addsNonRetryableError,StepOptions.backoff,StepOptions.retryIf,WorkflowLeaseLostError, andWorkflowDefinitionMismatchError. - Durable timers:
Workflow.sleep(name, durationMs)andWorkflow.sleepUntil(name, target)park executions instate='waiting'with an indexedwait_deadline_at, freeing Worker concurrency slots and PostgreSQL leases and resuming after restarts or pod evictions. - Rolling deploys, sweepers, health, and MCP PostgreSQL: Adds
EngineOptions.autoStart,engine.register(wf, { legacy: true })for zero-downtime multi-version rollouts,PostgresRecoverySweeper(recoverySweepIntervalMs,orphanGraceMs),EngineOptions.retention,engine.getHealth(),engine.getStats()/engine.getStatsAsync(), and fail-closed zero-DDL PostgreSQL support for opt-in MCP workflow tools viaBUNQUEUE_MCP_WORKFLOW_POSTGRES_URLandBUNQUEUE_MCP_WORKFLOW_POSTGRES_NAMESPACE. - Rewritten Workflow documentation: All 7 Workflow Engine guides (
Overview,Quick Start,Steps & Control Flow,Rollback (Saga),Durability & Idempotency,Human Approval, andAPI Reference) were rewritten with interactive 3D isometric diagrams and a homepage showcase.
PostgreSQL 19 (19.0), Bun 1.4.5, and cursor-bounded journal replay
Section titled “PostgreSQL 19 (19.0), Bun 1.4.5, and cursor-bounded journal replay”- PostgreSQL 19 (
19.0) matrix: Addedpostgres:19.0-alpineand native Debian 13postgresql-19across the CI PostgreSQL matrix (19.0,18.6,17.x,16.x), SDK conformance sandbox, Docker Compose examples, test harness defaults, and docs. - Event journal replay seeks directly into the index (#199): Adding
AND journal.commit_seq >= ${cursor.commitSeq}alongside the tuple predicate inloadPostgresJournalEventsAfterlets PostgreSQL 16-19 seek directly intobunqueue_event_commits_replay_idx. Measured on PostgreSQL 18.7 over 3,000 commits, idle and tail polls dropped fromSeq Scan+Hash Joinreading 449 shared blocks toIndex Only Scanreading 6-86 shared blocks in 0.01-0.05 ms. - Bun
1.4.5runtime pin: Updated active CI workflows, Dockerfiles, compose examples, release-gate tests, and contributor/deployment guides from Bun1.4.4to1.4.5.
Core lease fencing, SQLite durability, flows, and multi-broker hardening
Section titled “Core lease fencing, SQLite durability, flows, and multi-broker hardening”- Atomic lease fencing inside
processingLocks:ack,fail,ackBatch,moveJobToDelayed,moveActiveToWait,moveToWaitingChildren,discardJob, andupdateJobProgressnow re-validate active status and lease tokens insideprocessingLocks, preventing a paused stale worker from interfering with a successor’s active delivery. Expired active locks are tracked in a WeakMap sogetLockInforeturnsnullwhilecheckExpiredLocksreclaims the job and stale workers remain fenced, and unexpired stall-retry guard locks survivecleanOrphanedJobLocks. - SQLite durability and live custom-ID ownership past 50,000 entries:
discardJobcommits DLQ insertion andjobsdeletion in onecommitFailedJobtransaction andrecoverPendingJobsskipsdlqJobIdsso crash-split databases never resurrect DLQ jobs.promoteJob/promoteJobspersist insideshardLocks,WriteBufferclears stale pending entries after durable writes and keeps_diskFullset untilonFlushSuccess, andhandleCustomId/getJobByCustomIdfall back fromcustomIdMapLRU eviction to authoritativejobIndexlookup past the 50,000-entry default cap. - Parent-child flows and dependency promotion: Re-pins
completionPinswhen returning a promoted parent towaiting-children, clears staleflow_failuresatomically on admission, terminal transitions, and recovery, reconciles forward dependencies on reused custom IDs withinpushBatch, and makes SQLite/memoryremoveUnprocessedChildrenatomic across shards. - PostgreSQL multi-broker coordination: Persists
manuallyParkedonmovePostgresJobToWaitingChildren, adds monotonicsupersedeSeqtoPostgresProjectionRefreshesand prunes deadactiveTokens, honorsAbortSignaland generation guards in PostgreSQLWaitJob, enforces monotoniclast_seenupdates insavePostgresWorker, and takesFOR UPDATEonbunqueue_queue_statefor grouped claims (includeGroups). - Workflow and saga recovery: Resumes
runningchild executions when their parent is parked incompensation-stuck, awaits active child compensation claims (LostCompensationClaim.settled) and reloads the child row, persists loop records andloopItem/loopIndexmetadata atomically acrossdoUntil/doWhile/forEach, matches parkedwaitForevent names inrecordSignal, clears wait timers only after durable resume enqueue, and enforces atomic state andcurrent_node_indexchecks inparkForSignal.
Before you upgrade
Section titled “Before you upgrade”- Remote
ExtendLock,ExtendLocks, and duration-bearingJobHeartbeatrequire a non-empty locktoken: Missing or empty tokens now fail onExtendLockand duration-bearingJobHeartbeat(Lock token required for job <id>) and are skipped inExtendLocks. TokenlessJobHeartbeatwithout adurationstays accepted. On PostgreSQL,JobHeartbeatwithduration: 0preservesleaseDurationMsinstead of shrinking the lease to1 ms. - Active lease fencing and stall-retry tokens:
ack,fail,ackBatch,moveJobToDelayed,moveActiveToWait,moveToWaitingChildren,discardJob, andupdateJobProgressthrowLock token required for job <id>orInvalid or expired lock token for job <id>on missing or stale tokens. Bogus non-empty tokens on unlocked stall-retried jobs are rejected while tokenless late-ACK compatibility on unlocked stall-retried jobs is preserved. - Automatic Workflow Engine Schema v2 migration:
workflow_executions(SQLite) andbunqueue_workflow_executions(PostgreSQL, advisory-locked with transactional backfill) migrate automatically on startup to addneeds_rollback,idempotency_key,definition_hash, and O(active) partial indexes. No manual DDL is needed. StepOptions.inputSchemafail-fast and interrupted-step retry errors: FailedinputSchemavalidation terminates on attempt 1 instead of consuming retries on immutable input. Interrupted steps that exhaust their cumulativeretrybudget now report an explicit attempt diagnostic instead of'Step failed'.- Workflow Engine PostgreSQL exclusivity and async methods: Passing both
EngineOptions.postgresanddataPaththrowsCannot configure both "postgres" and "dataPath" on Engine. On PostgreSQL, synchronous inspection/maintenance methods (getExecution(),listExecutions(),cleanup(),archive(),getArchivedCount()) throw and require their*Async()counterparts; synchronous SQLite callers are unchanged. - MCP workflow PostgreSQL fail-closed zero-DDL: Setting both
BUNQUEUE_MCP_WORKFLOW_DBandBUNQUEUE_MCP_WORKFLOW_POSTGRES_URLthrows at startup. WithBUNQUEUE_MCP_WORKFLOW_POSTGRES_URL(and optionalBUNQUEUE_MCP_WORKFLOW_POSTGRES_NAMESPACE, default'default'), the MCP server never executes DDL and fails closed ifbunqueue_workflow_executionsdoes not exist; initialize the schema with the applicationEnginefirst. - Runtime and CLI notes: Official Docker images and CI run Bun
1.4.5(up from1.4.4) with PostgreSQL16through19(19.0).bunqueue top(--workflow-dband--workflow-pgmutually exclusive, zero-DDL fail-closed) exits0on clean quit or snapshot,1on connection/auth/runtime error, and2on invalid flags.bunqueue doctorpreserves default HTTP/healthbehavior and adds opt-in deep probes (--deep,--tcp,--sqlite,--pg,--systemd,--http-port,doctor --help), exiting2on invalid flags.
Other improvements and documentation
Section titled “Other improvements and documentation”- Redesigned full-width documentation homepage and full audit: Shipped a full-width, dual-theme “Live Mission Control” homepage featuring a multi-mode install deck, interactive code trace stage, live
bunqueue topbrowser simulator with 6 guided presets (including[7] Workflows & Signals), 4-tile architecture Bento grid (deployment spectrum, interactive Saga rollback diagram, 8 runtimes + 79 MCP tools, and measured BullMQ bars), production installer deck, and 3-step quickstart; also resolved over 440 accuracy and coverage gaps across 177 files (including Go, PHP, and Python SDK READMEs). - SEO and responsive layout hardening: Expanded
BreadcrumbListJSON-LD across all 11 indexable section hubs, ordered all 115 non-blog pages in/llms-full.txt, aligned mobile/tablet layouts across320pxto1440px(40pxmenu button hidden above50rem, header navigation restored at64rem/1024px), refreshedreleaseMeta.json(260 versions, 191 tagged), and added inline SVG diagrams to the v2.9.23 release post. - CI cleanup: Removed the automatic PR
.github/workflows/claude-code-review.ymlworkflow (claude.ymlremains available for explicit@claudementions).