← Open Source

⚡ High-performance job queue for Bun. SQLite by default, PostgreSQL multi-broker when you scale. DLQ, cron, SQLite S3 backups, and native MCP. No Redis.

AI EngineeringGive agent toolsTypeScript
Momentum
+0stars in 24 hours0.0%
602
Stars
19
Forks
+1
This week
4
Contributors
Created 2026-01-28 · Updated 2026-12-04 · #20849 today
Top developers
README

High-performance job queue, scheduler, and workflow engine. No Redis.
Runs in-process on Bun (memory or one-file SQLite), as a standalone server, or multi-broker on PostgreSQL 17–19.

Docs · Quick Start · SDKs · Video Course · Benchmarks · npm


Pick your setup

Use case How to run Storage
Bun app (fastest start) bun add bunqueue (embedded: true) In-memory or 1 SQLite file (dataPath)
Node / Deno / Python / Go / Rust Docker, single binary, or bunx bunqueue start SQLite (single broker)
Multi-broker HA docker compose -f docker-compose.postgres.yml up -d (from a repo clone) PostgreSQL 17–19 (19.0 recommended)

Only the server and embedded runtime require Bun (>= 1.4.0). Producers and workers run from Node.js, Deno, Bun, Cloudflare Workers, Python, Go, and Rust.


1. Quickstart on Bun (in-process, zero setup)

bun add bunqueue
// jobs.ts
import { Queue, Worker } from 'bunqueue/client';

const queue = new Queue<{ to: string }>('emails', { embedded: true });

const worker = new Worker<{ to: string }>(
  'emails',
  async (job) => {
    console.log('Processing:', job.data.to);
    return { sent: true };
  },
  { embedded: true }
);

worker.on('error', (error) => console.error(error));
await queue.add('welcome', { to: 'hello@example.com' });
bun jobs.ts
# Processing: hello@example.com

Add dataPath: './jobs.db' to Queue and Worker to persist jobs to a single SQLite file across restarts.


2. Server Mode (any language)

Start the server

# Docker (amd64 & arm64 — variants: alpine, debian, slim, distroless)
docker run -d --name bunqueue \
  --restart unless-stopped \
  -p 127.0.0.1:6789:6789 \
  -p 127.0.0.1:6790:6790 \
  -v bunqueue-data:/app/data \
  egeominotti/bunqueue:2.9.26-alpine

curl --fail http://127.0.0.1:6790/health

Prefer no Docker? Install the verified single binary or run via Bun:

curl -fsSL https://bunqueue.dev/install.sh | sh                              # macOS / Linux binary
curl -fsSL https://bunqueue.dev/install.sh | sudo sh -s -- --systemd         # Linux hardened systemd service
# irm https://bunqueue.dev/install.ps1 | iex                                 # Windows (x64 & arm64)
bunx bunqueue start --host 127.0.0.1 --data-path ./bunqueue.db               # Bun CLI

Connect from Node.js (or any SDK)

npm install bunqueue-client
// jobs.mjs
import { Queue, Worker } from 'bunqueue-client';

const options = {
  embedded: false,
  connection: { host: '127.0.0.1', port: 6789 },
};
const queue = new Queue('emails', options);

const worker = new Worker(
  'emails',
  async (job) => {
    console.log('Processing:', job.data.to);
    return { sent: true };
  },
  options
);

worker.on('error', (error) => console.error(error));
await queue.add('welcome', { to: 'hello@example.com' });
node jobs.mjs
# Processing: hello@example.com

Official SDKs

Runtime Install
Node.js ≥ 20, Deno ≥ 2, Bun, Cloudflare Workers npm install bunqueue-client
Python ≥ 3.10 pip install bunqueue-client
Go ≥ 1.26.5 go get github.com/egeominotti/bunqueue/sdk/go
Rust ≥ 1.85 cargo add bunqueue-client

All four SDKs share the same wire protocol, Queue / Worker / atomic FlowProducer APIs, and conformance suite (SDK guide →).

Scale out with PostgreSQL 17–19

From a clone of this repository:

POSTGRES_PASSWORD='replace-me' \
  BUNQUEUE_POSTGRES_URL='postgres://bunqueue:replace-me@postgres:5432/bunqueue' \
  docker compose -f docker-compose.postgres.yml up --build -d

Starts active-active brokers against one PostgreSQL database with database-authoritative claims, fenced leases, and failover (storage guide → · Docker & deployment →).


Core features

Built-in server-side: retries with backoff, priorities, cron, rate limits, fair FIFO groups & native batches (QueuePro/WorkerPro), atomic parent/child flows, DLQ, SQLite S3 backups, and BullMQ-compatible APIs (migrate in minutes →).

Simple Mode (Bunqueue — Queue + Worker + routes + cron in one object)

import { Bunqueue } from 'bunqueue/client';

const app = new Bunqueue<{ to?: string }, { ok: boolean }>('notifications', {
  embedded: true,
  routes: {
    'send-email': async (job) => {
      console.log('Sending to:', job.data.to);
      return { ok: true };
    },
    'daily-report': async () => ({ ok: true }),
  },
  concurrency: 10,
  retry: { maxAttempts: 5, strategy: 'jitter' },
});

await app.cron('daily-report', '0 9 * * *', {});
await app.add('send-email', { to: 'alice@example.com' });

Workflow Engine (sagas, branching, human-in-the-loop)

import { Workflow, Engine } from 'bunqueue/workflow';

const orderFlow = new Workflow('order-pipeline')
  .step('reserve', async () => inventory.reserve(), {
    compensate: async () => inventory.release(), // auto-rollback on downstream failure
  })
  .step('charge', async () => ({ txId: await payments.charge() }), {
    compensate: async () => payments.refund(),
  })
  .waitFor('manager-approval', { timeout: 86_400_000 })
  .step('confirm', async (ctx) => ({ txId: (ctx.steps['charge'] as { txId: string }).txId }));

const engine = new Engine({ embedded: true });
engine.register(orderFlow);
const run = await engine.start('order-pipeline', { orderId: 'ORD-1' });
await engine.signal(run.id, 'manager-approval', { approved: true });

Built-in MCP Server (AI agents)

Ships with 79 primary tools (+ 3 optional workflow tools, 5 resources, 3 prompts) over stdio or Streamable HTTP:

bun add bunqueue @modelcontextprotocol/sdk
claude mcp add bunqueue -e BUNQUEUE_MCP_PROFILE=agent -- bunx --package=bunqueue bunqueue-mcp

Live Monitoring & Diagnostics

bunqueue top                     # live terminal TUI (queues, jobs, DLQ, workers, workflows)
bunqueue doctor --deep           # check config, TCP, host limits, SQLite, PostgreSQL >=17, systemd
bunx bunqueue-dashboard          # web UI (beta) — live demo: https://egeominotti.github.io/bunqueue-dashboard/

Performance

Medians on native Ryzen 9 9950X3D (Bun 1.3.14, repeated fresh processes — methodology & full report →):

Workload Mode Median Persistence
Internal batched push (1M jobs) Embedded 729,395 jobs/sec In-memory
Public addBulk (50K cell) Embedded 186,384 jobs/sec On-disk SQLite
TCP PUSHB (50K sample) Server 158,779 jobs/sec On-disk SQLite
No-work worker drain (concurrency 50) Server 17,256 jobs/sec Full pull/process/ACK
Linear Workflow Engine (3 nodes) Embedded / TCP 2,700 / 3,187 wf/sec SQLite

These operations do different work; the internal in-memory push result is not an SQLite or public-API claim.

Head-to-Head vs BullMQ 6.7.12 + Redis 8.10.2

Dedicated AMD Ryzen 9 9950X (1:1 pinned Zen 5 CCDs, 5 measured runs + 1 warm-up, exact-once delivery verified; interactive isometric report & raw data →):

Scenario (In-Memory, 5 reps) bunqueue 2.9.26 BullMQ 6.7.12 (best Node/Bun) Advantage
Bulk add (100/call) 250,857 jobs/s 64,887 jobs/s (Bun) 3.87x faster
Concurrent add (64 in flight) 265,062 jobs/s 92,213 jobs/s (Bun) 2.87x faster
Backlog drain (4 / 8 workers) 82,910 / 82,906 jobs/s 48,585 / 46,356 jobs/s 1.71x–1.79x faster
Pickup latency p50 (1K / 10K jobs/s) 0.66 / 0.87 ms 0.73 / 1.07 ms (Bun) 1.11x–1.24x lower
Delayed job lateness (p50 / p99) 3.56 / 13.1 ms 42.5 / 85.8 ms 11.95x / 6.53x tighter
Retries (fail 2x -> pass) 13,279 jobs/s 7,115 jobs/s (Bun) 1.87x faster

Honest trade-offs: in durable disk mode (SQLite WAL vs Redis AOF appendfsync everysec), Redis AOF drains backlogs 11.5x–13.1x faster (37.0K–38.4K vs 2.9K–3.3K jobs/s) because it syncs sequentially once per second rather than committing SQLite rows; BullMQ leads p99 pickup tails at 5K–10K/s; and Redis uses less RAM at 1M queued jobs (578–586 MiB vs 2,392–2,473 MiB). Scale bunqueue horizontally on PostgreSQL 17–19 when you outgrow single-file SQLite.


Documentation & Links

License

MIT — provided as is, without warranty of any kind. See DISCLAIMER.md.

Nearby in the ranking
Similar items

AI Rank for iPhone

Follow AI model rankings

Download on the App Store