queue-scheduler

Register recurring BullMQ jobs from NestJS modules with cron or interval schedules.

Updated Mar 1, 2026
One-click install
npx skills add https://github.com/Zoppy-crm/.github --skill queue-scheduler-zoppy-crm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: queue-scheduler
Source: https://github.com/Zoppy-crm/.github/tree/main/skills/backend/queue-scheduler
Command: npx skills add https://github.com/Zoppy-crm/.github --skill queue-scheduler-zoppy-crm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enables reliable scheduling of recurring background work by registering repeatable BullMQ jobs from NestJS modules so tasks run automatically on a cron or interval schedule without manual triggers.

Core Features & Use Cases

  • BaseCommand integration: Commands extend BaseCommand to upsert repeatable jobs on module init.
  • Flexible scheduling: Support for interval-based runs (every N ms) or cron patterns via RepeatOptions.
  • Safe local development: Schedulers are skipped when IS_LOCAL=1 to avoid running background jobs in dev environments.
  • Processor guidance: Scheduled jobs carry null sessions and processors must call loginMaster instead of setSession.
  • Use case: Run hourly metrics aggregation, nightly order syncs, or weekday reports automatically via a repeatable BullMQ job.

Quick Start

Create a BaseCommand subclass with a unique CommandKeyEnum, set repeatOptions and templateOptions, register the command in CommandModule, and ensure the processor uses loginMaster to handle scheduled (null-session) jobs.

Frequently Asked Questions about queue-scheduler

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I schedule recurring background jobs in NestJS with BullMQ?

To schedule recurring background jobs in NestJS, you create a BaseCommand subclass with a unique CommandKeyEnum and configure RepeatOptions. This registers repeatable BullMQ jobs automatically on module initialization, enabling hourly, daily, or cron-based tasks without manual triggers.

Why do my scheduled BullMQ jobs fail when running without a user session?

Scheduled BullMQ jobs fail without a user session because they carry null sessions and cannot use setSession. Processors must call loginMaster instead of setSession to properly authenticate and handle scheduled background jobs that run independently of user activity.

How do I stop background jobs from running automatically during local development?

To stop background jobs from running during local development, set the IS_LOCAL environment variable to 1. This automatically skips scheduler registration and prevents repeatable BullMQ jobs from executing in your local dev environment.

Can I use cron expressions to configure BullMQ repeatable jobs in a NestJS backend?

Yes, you can use cron expressions to configure BullMQ repeatable jobs in a NestJS backend by setting them in the RepeatOptions of your BaseCommand subclass. This allows flexible scheduling for nightly order syncs or weekday reports alongside interval-based runs.

What is the best way to automate hourly metrics aggregation without manual triggers?

The best way to automate hourly metrics aggregation is registering a repeatable BullMQ job from a NestJS module using a BaseCommand subclass. Configure the RepeatOptions with your desired interval or cron pattern to ensure the task runs automatically without user sessions.