Bull

Redis-backed job queue for Node.js with retries, rate limiting, and scheduling

Library
npm
v4.16.5
16,257 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
65 /100 Good
Development Activity 48
Maintenance 44
Community 68
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
68 /100 Good
Architecture 75
Code Quality 68
Innovation 60
Learning Curve 70

Bull is a fast, robust Redis-based queue library for Node.js used to distribute jobs and messages across workers. It provides delayed jobs, priorities, rate limiting, retries with backoff, repeatable cron-style jobs, and atomic Redis-script-driven state transitions, making it a long-standing choice for background job processing in Node applications.

The project is now in maintenance mode (bug fixes only), with its author steering new feature development toward BullMQ, a TypeScript rewrite. Bull nonetheless remains widely deployed in production systems such as Atlassian’s GitHub-for-Jira integration and NestJS’s @nestjs/bull module, and continues to receive stability and security fixes.

What You Get

  • A Queue class for creating named job queues backed by Redis
  • Delayed, repeatable (cron-based), and prioritized job scheduling
  • Configurable retries with backoff strategies and rate limiting per queue
  • Sandboxed (child-process) job processors for CPU-heavy or crash-isolated work
  • Global and local events for job lifecycle (active, completed, failed, stalled)
  • Pause/resume support at the queue or worker level

Common Use Cases

  • Offloading video/audio/image transcoding to background workers
  • Sending transactional emails or notifications asynchronously
  • Running scheduled/cron-style maintenance tasks across a cluster
  • Rate-limiting calls to third-party APIs from a worker pool
  • Building multi-step pipelines where jobs report progress to a UI

Under The Hood

Architecture - Bull represents each queue as a set of Redis keys (lists, sorted sets, and hashes) manipulated through Lua scripts (in lib/commands) to guarantee atomic state transitions between waiting, active, completed, failed, and delayed states; lib/queue.js orchestrates job creation and dispatch, while lib/job.js and lib/worker.js handle per-job execution, locking (via a renewable Redis lock), and progress/event reporting through Redis pub/sub.

Tech Stack - The library is plain JavaScript (no TypeScript source, though .d.ts typings are maintained externally in DefinitelyTyped) targeting Node.js 12+, built on ioredis for the Redis client, msgpackr for efficient job-data serialization, cron-parser for repeatable-job schedules, and lodash/semver/uuid as small utility dependencies; the Lua scripts are compiled at runtime via generateRawScripts.js.

Code Quality - The test/ directory contains an extensive Mocha-based suite (test_queue.js, test_job.js, test_pause.js, test_metrics.js, and more) covering job lifecycle, pausing, obliteration, and connection handling, with fixtures for sandboxed processors; the codebase favors callback/promise-based APIs consistent with its 2013-era origins rather than modern async/await idioms throughout, and commit history shows the project is now accepting only targeted bug fixes rather than new feature work.

API Design - The public API centers on a small number of well-documented methods (queue.add(), queue.process(), job.progress(), job.moveToCompleted()) with a low-friction quick-start (new Queue('name') plus a .process() callback is enough to get going), though some ergonomics (callback-style done() completion, separate TypeScript definitions package) reflect its age relative to newer alternatives like BullMQ.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers