Overview
Jobs are the fundamental units of work in BullMQ. Each job contains data to be processed and metadata about its execution.Job Properties
Core Properties
Job States
A job progresses through various states:Check Job State
Job Lifecycle
Creation
Retrieval
Processing
Job Manipulation
Update Job Data
Update Progress
Change Delay
Reschedule a delayed job:Change Priority
Remove Job
Retry Job
Promote Delayed Job
Move a delayed job to waiting immediately:Job Logging
Add Logs
Retrieve Logs
Clear Logs
Job Dependencies (Flows)
Parent-Child Relationships
Get Child Dependencies
Remove Child Dependency
Advanced Job Options
Backoff Strategies
Auto-Removal
Stack Trace Limit
Control how many stack traces are kept:Job Deduplication
Prevent duplicate jobs from being added:Job Serialization
Export Job as JSON
Create Job from JSON
Waiting for Completion
Wait for a job to complete from outside a worker:Error Handling
Unrecoverable Errors
Mark a job as unrecoverable (won’t retry):TypeScript Support
Fully typed jobs:Best Practices
Set Job IDs
Use custom job IDs for idempotency and easier tracking.
Update Progress
Report progress for long-running jobs to provide visibility.
Use Deduplication
Prevent duplicate jobs with deduplication IDs.
Clean Up Jobs
Use removeOnComplete and removeOnFail to manage memory.
Log Important Events
Add logs at key checkpoints for debugging.
Handle Errors Gracefully
Use UnrecoverableError for jobs that shouldn’t retry.
Next Steps
Workers
Learn how workers process jobs
Events
Monitor job lifecycle with events
Queues
Understand queue operations
