Overview
pg-boss is a job queue for Node.js built on PostgreSQL, first published in 2016 and maintained by a single developer (GitHub user timgit). It relies on Postgres's SKIP LOCKED to hand each job to exactly one worker, and jobs can be created inside an existing database transaction, with adapters for Drizzle, Knex, Kysely and Prisma.
Features include cron scheduling, deferred jobs, priority queues, dead-letter queues with redrive, automatic retries with exponential backoff, job dependency workflows and a pub/sub API for fanning one event out to several queues. Queue storage policies cover rate limiting, debouncing and concurrency patterns. Workers poll with backpressure and can use LISTEN/NOTIFY for lower latency.
Separate packages add a web dashboard, an HTTP proxy for platforms that cannot hold database connections, and a CLI for migrations. It works with Postgres-compatible databases such as CockroachDB, YugabyteDB and Citus, or embedded PGlite. It requires Node 22.12+ and PostgreSQL 13+.
Pricing and plans
| Plan | Price | What you get |
|---|---|---|
| pg-boss | Free | MIT licence, maintained by one person with sponsorship |
What it does
- Exactly-once delivery
- SKIP LOCKED ensures each job is fetched by only one worker.
- Transactional enqueue
- Create jobs in an existing transaction, with adapters for Drizzle, Knex, Kysely and Prisma.
- Cron and deferral
- Cron schedules and jobs deferred to a later time.
- Retries and dead letters
- Exponential backoff retries, priority queues and dead-letter queues with redrive.
- Queue policies
- Storage policies for rate limiting, debouncing and concurrency control.
- Dashboard and proxy
- Optional @pg-boss/dashboard web UI and @pg-boss/proxy HTTP proxy packages.
Strengths and limitations
Strengths
- No Redis or broker; uses the Postgres you already run
- MIT licence with a commitment to stay MIT
- Rich feature set including cron, DLQ and pub/sub
- Works with serverless functions and Postgres-compatible databases
Limitations
- Requires Node 22.12 or higher and PostgreSQL 13 or higher
- Maintained by a single person
- Job traffic adds load to your database
- Worker API is Node.js only; other runtimes use SQL directly
Who it suits
Good for
- Node.js apps on Postgres wanting fewer moving parts
- Jobs that must be created atomically with data changes
- Small teams that do not want to operate Redis
Look elsewhere if
- Extremely high job volumes better served by a dedicated broker
- Projects stuck on older Node.js versions
Alternatives to pg-boss
| Tool | From | Free option | Stages |
|---|---|---|---|
| Celery Distributed task queue for Python | — | ||
| Hatchet Postgres-backed task queue and durable workflow engine | Usage-based | Free tier | |
| Sidekiq Redis-based background job library for Ruby | $99/mo | ||
| Cloudflare Workflows Durable workflow engine on Cloudflare Workers | Usage-based | Free tier | |
| Solid Queue Database-backed Active Job backend for Rails | — | ||
| Graphile Worker PostgreSQL job queue for Node.js | — |
Questions
Is pg-boss free?
Yes. pg-boss is MIT-licensed and free; it is funded by sponsorship.
Does pg-boss support cron jobs?
Yes. It includes cron scheduling as well as deferred jobs.
What does pg-boss require?
Node.js 22.12 or higher and PostgreSQL 13 or higher.
Does pg-boss have a dashboard?
Yes, as the separate @pg-boss/dashboard package.
Sources read for this page