API Reference

BullMQ

Redis-backed job queue for Node.js with workers, retries, backoff, concurrency control, delayed jobs, and repeatable schedules.

Official Documentation ↗
CompatibilityThis documentation covers version v6.6.0. Check the official docs for the latest API surface.

Installation

npmnpm install bullmq ioredis
pnpmpnpm add bullmq ioredis
yarnyarn add bullmq ioredis

Methods

BullMQ stores jobs in Redis and delivers them to workers. It supports retries, backoff, delayed jobs, repeatable schedules, and concurrency. The queue is a delivery mechanism, not an exactly-once guarantee; processors must be idempotent.

Producer and worker connections

Use a dedicated Redis connection for workers and set maxRetriesPerRequest: null as required by blocking commands. Close queues and workers during shutdown after in-flight jobs finish. Monitor queue depth, failed jobs, and stalled jobs.

Retries and idempotency

Set bounded attempts and exponential backoff. A stable jobId prevents duplicate enqueue for the same logical task, but a retried job can still run more than once. Record processed job ids with the side effect or make the side effect naturally idempotent.

Failure visibility

Listen for failed and stalled events, alert on a growing failed set, and keep enough failed jobs for diagnosis without unbounded storage. A queue that silently accumulates failures is an outage in progress.

Errors

The following points are quoted verbatim from the official documentation. 来源:https://docs.bullmq.io/ · 取证方式:HTTP GET 官方 README/文档页(HTML 去标签) · 抓取时间:2026-11-07T13:48:36.009Z. Any error type, throw condition or recovery step not stated there is left unspecified; this page does not infer exception classes or return values.

  • The other SDKs implement the core classes ( Queue , Worker , QueueEvents , FlowProducer and job schedulers), with the exception of PHP, which provides a producer-only Queue client. (https://docs.bullmq.io/)

FAQ

Are BullMQ jobs delivered exactly once?
No. A worker can crash after processing but before acknowledging, so jobs may be retried. Make processors idempotent or use the job id and a processed-jobs record.
Why do I need maxRetriesPerRequest: null?
BullMQ workers use blocking Redis commands. The ioredis default retry limit can abort a blocking connection; the BullMQ documentation requires null for worker connections.
How should failed jobs be handled?
Set bounded attempts and backoff, keep failed jobs for inspection, and route permanently failed jobs to a dead-letter queue or an alert. Do not retry forever.