Skip to content
Get started
Get started
Introduction: A Free Job Queue for Your Language
View Markdown
guide · introduction

A job queue for your language.

bunqueue is a free, MIT-licensed job queue for Node.js, Deno, Python, PHP, Go, Rust, Elixir and Bun. The name comes from the core engine, which runs on Bun. Your application and workers use their own runtime through an official client.

A job queue lets your app hand off slow work (sending emails, processing images, calling APIs) to run in the background instead of blocking a request.

Choose the setup that matches your application:

  • Node.js, Deno, Python, PHP, Go, Rust or Elixir: run the included bunqueue server, install your language’s client, then connect it to the server. Bun is required on the server, not in your application. Follow the server and client setup.
  • Bun: use the server in the same way, or run the queue and worker together with embedded: true. Follow the embedded quickstart.

Both options are free and include the queue features. No account, paid plan or Redis service is required. Use memory for ephemeral jobs, SQLite for one-process persistence, or PostgreSQL for several active brokers.

import { Queue, Worker } from 'bunqueue/client';
const storage = { embedded: true, dataPath: './data/bunq.db' } as const;
const queue = new Queue('emails', storage);
const worker = new Worker(
'emails',
async (job) => {
console.log('Sending to', job.data.to);
return { sent: true };
},
storage
);
await queue.add('welcome', { to: 'user@example.com' });

Run it with bun run app.ts. No server: the queue runs embedded in your process.

That is a complete, working queue. The Quick Start walks through it step by step.

  • Zero external infrastructure. Add dataPath for one-file SQLite persistence, or omit it for memory-only queues. No Redis, no separate broker, and only one runtime dependency.
  • Multi-broker when needed. PostgreSQL 15–18 coordinates independent standalone servers with transactional claims and fenced leases; 18.6 is recommended.
  • Native Bun. Local persistence uses bun:sqlite; PostgreSQL uses Bun’s built-in SQL client directly, with no ORM or third-party database driver.
  • Familiar API. If you know BullMQ, you already know most of bunqueue.
  • Production features. Retries with backoff (automatic waiting between retry attempts), a dead letter queue (a holding area for jobs that keep failing), cron scheduling, rate limiting, stall detection, and S3 backups.
  • AI-agent ready. A built-in MCP server with 73 tools lets agents like Claude add jobs, manage crons, and monitor queues via natural language.
ComparisonEmbeddedServer
What it isA library inside your processA standalone bunqueue process
Best forSingle-process apps, scripts, serverlessMultiple services sharing one queue
SetupPass embedded: trueRun bunqueue start, then connect
PersistenceMemory or SQLite via dataPathMemory/SQLite, or PostgreSQL via URL
Broker scalingOne processOne SQLite broker or several PostgreSQL brokers

Embedded mode means the queue lives inside your app, like using SQLite instead of Postgres:

import { Queue, Worker } from 'bunqueue/client';
// Queue and Worker must use the same embedded storage configuration.
const storage = { embedded: true, dataPath: './data/bunq.db' } as const;
const queue = new Queue('tasks', storage);
const worker = new Worker(
'tasks',
async (job) => {
/* ... */
},
storage
);

Server mode runs bunqueue as a standalone service, and any number of apps connect to it over TCP. Use SQLite for one broker:

Terminal window
bunqueue start --data-path ./data/queue.db

Or point independent servers at the same PostgreSQL namespace, with a unique broker ID for each process:

Terminal window
BUNQUEUE_POSTGRES_URL='postgres://bunqueue:secret@postgres:5432/bunqueue' \
BUNQUEUE_POSTGRES_NAMESPACE=production \
BUNQUEUE_BROKER_ID=broker-a \
bunqueue start

See Storage backends before choosing a production topology.

// No embedded option = connects to localhost:6789
const queue = new Queue('tasks');
const worker = new Worker('tasks', async (job) => {
/* ... */
});

Server mode also unlocks clients in other runtimes: Node.js, Deno, Python, PHP, Go, Rust, Elixir, and Cloudflare Workers via the client SDKs.

FeaturebunqueueBullMQ
RuntimeBunNode.js
StorageMemory/SQLite; optional PostgreSQLRedis
External depsNone by default; PostgreSQL when selectedRedis server
Priorities, delays, retries, cronYesYes
Rate limiting, stall detection, flowsYesYes
Pro-style groups and processor batchesYesPro package
Pro telemetry / NestJS integrationNoPro package
Advanced DLQ (auto-retry, filters)YesBasic
S3 backupsSQLite modeNo
MCP server for AI agentsYes (73 tools)No
Built-in workflow engineYesNo

Migrating? The API is intentionally close to BullMQ, see the migration guide.

For multi-step processes (validate an order, charge, notify, ship) bunqueue ships a workflow engine with retries, parallel steps, branching, rollback on failure, and human-in-the-loop signals:

import { Workflow, Engine } from 'bunqueue/workflow';
const flow = new Workflow('order')
.step('validate', async (ctx) => ({ ok: true }))
.step('charge', async (ctx) => ({ txId: 'tx_123' }), { retry: 3 })
.waitFor('approval')
.step('ship', async (ctx) => ({ shipped: true }));

No Temporal, no extra service. See the Workflow Engine guide.