Remove Individual Job
Remove a specific job by its ID, along with all its dependencies:Method Signature
string
required
The ID of the job to remove
boolean
default:"true"
If true, also removes child jobs in flows. Set to false to keep child jobs.
1 if the job was removed successfully, 0 if the job or any of its dependencies were locked.
Example
When a job is removed, a
removed event is emitted by the queue.Drain
Removes all jobs that are waiting or delayed, but not active, waiting-children, completed, or failed jobs.Method Signature
boolean
default:"false"
If true, also removes delayed jobs
Examples
Parent Job Behavior
Clean
Removes jobs in a specific state, keeping only jobs within a grace period. Similar to drain but more targeted.Method Signature
number
required
Grace period in milliseconds. Jobs older than this will be removed.
number
required
Maximum number of jobs to clean
string
default:"completed"
The type of jobs to clean. Can be:
completed, wait, waiting, active, paused, prioritized, delayed, or failed.Examples
The
clean method triggers a cleaned event with the deleted job IDs and the job type.Obliterate
Completely destroys a queue and all of its contents irreversibly. Use with extreme caution.Method Signature
boolean
default:"false"
Use
force: true to obliterate even with active jobs in the queuenumber
default:"1000"
Maximum number of keys to delete per iteration
Examples
This operation may be slow for very large queues as it must iterate over all jobs.
