bull-mq

Acting as a BullMQ expert, help developers build Redis-based high-performance Node.js job queues and reliable background processing systems. Supports delayed jobs, rate limiting, priority settings, repeatable cron jobs, job dependencies, concurrency control, and dead-letter handling, suitable for email sending, image processing, webhook delivery, report generation, and other asynchronous workloads.

Last repository push
GitHub Stars
219
Forks
38
Issues / PRs
7

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "bull-mq" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-66d02861e714d436a8b23f600f96b8bf29bace3a79f74c8bd4ecb16697b18219. Verify the upstream source and version against https://github.com/TerminalSkills/skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Acting as a BullMQ expert, help developers build Redis-based high-performance Node.js job queues and reliable background processing systems. Supports delayed jobs, rate limiting, priority settings, repeatable cron jobs, job dependencies, concurrency control, and dead-letter handling, suitable for email sending, image processing, webhook delivery, report generation, and other asynchronous workloads.

0 Downloads

Introduction source: third_party · TerminalSkills · 1.0.0 Reference

SkillPi interpretation

Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: bull-mq
description: >-
  You are an expert in BullMQ, the high-performance job queue for Node.js
  built on Redis. You help developers build reliable background processing
  systems with delayed jobs, rate limiting, prioritization, repeatable cron
  jobs, job dependencies, concurrency control, and dead-letter handling —
  powering email sending, image processing, webhook delivery, report
  generation, and any async workload.
license: Apache-2.0
compatibility: ''
metadata:
  author: terminal-skills
  version: 1.0.0
  category: Backend Development
  tags:
    - queue
    - redis
    - jobs
    - background
    - worker
    - cron
    - node

BullMQ — Redis-Based Job Queue for Node.js

You are an expert in BullMQ, the high-performance job queue for Node.js built on Redis. You help developers build reliable background processing systems with delayed jobs, rate limiting, prioritization, repeatable cron jobs, job dependencies, concurrency control, and dead-letter handling — powering email sending, image processing, webhook delivery, report generation, and any async workload.

Core Capabilities

Queue and Worker

import { Queue, Worker, QueueScheduler, FlowProducer } from "bullmq";
import IORedis from "ioredis";

const connection = new IORedis({ host: "localhost", port: 6379, maxRetriesPerRequest: null });

// Define queue
const emailQueue = new Queue("email", { connection });

// Add jobs
await emailQueue.add("welcome", {
  to: "user@example.com",
  template: "welcome",
  data: { name: "Alice" },
}, {
  priority: 1,                            // Lower = higher priority
  attempts: 3,                            // Retry up to 3 times
  backoff: { type: "exponential", delay: 2000 },
  removeOnComplete: { count: 1000 },      // Keep last 1000 completed
  removeOnFail: { age: 7 * 24 * 3600 },   // Keep failed for 7 days
});

// Delayed job
await emailQueue.add("reminder", { userId: 42 }, {
  delay: 24 * 60 * 60 * 1000,            // 24 hours from now
});

// Repeatable (cron)
await emailQueue.add("digest", {}, {
  repeat: { pattern: "0 9 * * 1" },       // Every Monday at 9 AM
});

// Worker
const worker = new Worker("email", async (job) => {
  switch (job.name) {
    case "welcome":
      await sendEmail(job.data.to, job.data.template, job.data.data);
      break;
    case "reminder":
      await sendReminderEmail(job.data.userId);
      break;
    case "digest":
      await sendWeeklyDigest();
      break;
  }

  // Progress reporting
  await job.updateProgress(100);
  return { sent: true, timestamp: Date.now() };
}, {
  connection,
  concurrency: 5,                         // Process 5 jobs simultaneously
  limiter: { max: 100, duration: 60000 }, // Rate limit: 100 jobs/min
});

worker.on("completed", (job, result) => console.log(`Job ${job.id} completed`));
worker.on("failed", (job, err) => console.error(`Job ${job?.id} failed: ${err.message}`));

Job Flows (Parent-Child Dependencies)

const flow = new FlowProducer({ connection });

await flow.add({
  name: "generate-report",
  queueName: "reports",
  data: { reportId: "monthly-2026-03" },
  children: [
    { name: "fetch-sales", queueName: "data", data: { source: "sales" } },
    { name: "fetch-users", queueName: "data", data: { source: "users" } },
    { name: "fetch-metrics", queueName: "data", data: { source: "metrics" } },
  ],
  // Parent job runs only after ALL children complete
});

Installation

npm install bullmq ioredis

Best Practices

  1. Separate workers — Run workers in separate processes/containers from your API; scale independently
  2. Idempotent jobs — Design jobs to be safely retried; use unique job IDs to prevent duplicates
  3. Backoff strategy — Use exponential backoff for retries; prevents thundering herd on downstream failures
  4. Rate limiting — Use limiter to respect API rate limits (email providers, webhooks, external APIs)
  5. Progress tracking — Use job.updateProgress() for long-running jobs; clients can poll progress
  6. Graceful shutdown — Call worker.close() on SIGTERM; finishes current jobs before exiting
  7. Flows for pipelines — Use FlowProducer for job dependencies; parent waits for all children to complete
  8. Monitor with Bull Board — Use @bull-board/express for a web UI showing queue status, job data, and failures

Current listing version

1.0.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value88/100

Highlights

  • 提供 BullMQ 完整技术栈支持,解决 Node.js 后台任务队列核心痛点
  • 覆盖延迟任务、速率限制、优先级、cron、依赖、并发、死信等关键能力
  • 有明确应用场景(邮件、图像处理、Webhook、报告生成)
Trigger Precision92/100

Highlights

  • description 完整描述 Skill 能力边界
  • 覆盖 BullMQ 核心概念(queue, worker, redis, jobs, cron 等)
  • 触发词精准,无明显歧义或重叠
Structure and Standards95/100

Highlights

  • 有清晰 Phase 划分(Core Capabilities, Installation, Best Practices)
  • 包含端到端代码示例
  • frontmatter 完整(name, description, license, metadata)
  • 单文件约 400 行,符合规范
Execution Reliability90/100

Highlights

  • 工具来源明确(bullmq, ioredis)
  • 参数使用正确(priority, attempts, backoff, limiter 等)
  • 覆盖主要异常处理(retry, backoff, graceful shutdown)
  • 不可逆操作有确认机制(removeOnComplete/removeOnFail)
Evidence Verifiability (mean of the first four)91/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

  • Install or fetch external dependencies

    Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.

    Mentioned in main document · lines 114

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.