> For the complete documentation index, see [llms.txt](https://docs.bullmq.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bullmq.io/guide/jobs/getters.md).

# 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.

<figure><img src="/files/CyyFWVB2KZyK2D6G6D18" alt="Diagram of the lifecycle of a BullMQ job in the queue"><figcaption><p>Lifecycle of a job</p></figcaption></figure>

#### Job Counts

It is often necessary to know how many jobs are in a given status:

{% tabs %}
{% tab title="TypeScript" %}

```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" %}

```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 %}

{% tab title="Rust" %}

```rust
use bullmq::{Queue, QueueOptions};

let queue = Queue::new("Paint", QueueOptions::default()).await?;

let counts = queue.get_job_counts().await?;
// counts.waiting, counts.completed, counts.failed, counts.active, etc.
println!("waiting: {}, completed: {}, failed: {}", counts.waiting, counts.completed, counts.failed);
```

{% endtab %}
{% endtabs %}

The available status are:

* *completed*,
* *failed*,
* *delayed*,
* *active*,
* *wait*,
* *waiting-children*,
* *prioritized*,
* *paused*, and
* *repeat*.

#### Get Jobs

It is also possible to retrieve the jobs with pagination style semantics. For example:

{% tabs %}
{% tab title="TypeScript" %}

```typescript
const completed = await myQueue.getJobs(['completed'], 0, 99, true);

// returns jobs at indices 0-99 inclusive (100 jobs total)
```

{% endtab %}

{% tab title="Python" %}

```python
completed = await myQueue.getJobs(['completed'], 0, 99, True)

# returns jobs at indices 0-99 inclusive (100 jobs total)
```

{% endtab %}

{% tab title="Rust" %}

```rust
let completed = queue.get_jobs(&["completed"], 0, 99, true).await?;

// returns jobs at indices 0-99 inclusive (100 jobs total)
```

{% endtab %}
{% endtabs %}

## Read more:

* 💡 [Get Job Counts API Reference](https://api.docs.bullmq.io/classes/v5.Queue.html#getjobcounts)
* 💡 [Get Jobs API Reference](https://api.docs.bullmq.io/classes/v5.Queue.html#getjobs)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.bullmq.io/guide/jobs/getters.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
