Getters
Source URL: https://docs.bullmq.io/guide/jobs/getters
Getters
Section titled “Getters”When jobs are added to a queue, they will be in different statuses during their lifetime. BullMQ provides methods to retrieve information and jobs from the different statuses.

Lifecycle of a job
Job Counts
Section titled “Job Counts”It is often necessary to know how many jobs are in a given status:
{% tabs %} {% tab title=“TypeScript” %}
import { Queue } from 'bullmq';
const myQueue = new Queue('Paint');
const counts = await myQueue.getJobCounts('wait', 'completed', 'failed');
// Returns an object like this { wait: number, completed: number, failed: number }{% endtab %}
{% tab title=“Python” %}
from bullmq import Queue
myQueue = Queue('Paint')
counts = await myQueue.getJobCounts('wait', 'completed', 'failed')
# Returns an object like this { wait: number, completed: number, failed: number }{% endtab %} {% endtabs %}
The available status are:
- completed,
- failed,
- delayed,
- active,
- wait,
- waiting-children,
- prioritized,
- paused, and
- repeat.
Get Jobs
Section titled “Get Jobs”It is also possible to retrieve the jobs with pagination style semantics. For example:
{% tabs %} {% tab title=“TypeScript” %}
const completed = await myQueue.getJobs(['completed'], 0, 100, true);
// returns the oldest 100 jobs{% endtab %}
{% tab title=“Python” %}
completed = await myQueue.getJobs(['completed'], 0, 100, True)
# returns the oldest 100 jobs{% endtab %} {% endtabs %}