> ## Documentation Index
> Fetch the complete documentation index at: https://docs.transluce.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Ingestion Job Management

> Track the status of background processing jobs

Agent run ingestion can run as background jobs.
Use these methods to track their progress.

## Get Job Status

```python theme={null}
from docent import Docent

client = Docent()

status = client.get_agent_run_job_status("my-collection-id", "job-123")
print(f"Status: {status['status']}")
print(f"Type: {status['type']}")
```

### Parameters

<ParamField body="collection_id" type="str" required>
  ID of the collection.
</ParamField>

<ParamField body="job_id" type="str" required>
  ID of the job to check.
</ParamField>

### Returns

<ResponseField name="status" type="dict">
  Job status information.

  <Expandable title="Fields">
    <ResponseField name="job_id" type="str">The job ID.</ResponseField>
    <ResponseField name="status" type="str">One of `"pending"`, `"running"`, `"cancelling"`, `"completed"`, `"canceled"`.</ResponseField>
    <ResponseField name="type" type="str">The job type.</ResponseField>
    <ResponseField name="created_at" type="str">ISO timestamp of job creation.</ResponseField>
  </Expandable>
</ResponseField>

***

## Batch Status Check

Check multiple jobs at once (up to 100).

```python theme={null}
statuses = client.get_agent_run_job_statuses(
    "my-collection-id",
    ["job-1", "job-2", "job-3"],
)
for s in statuses:
    print(f"{s['job_id']}: {s['status']}")
```

### Parameters

<ParamField body="collection_id" type="str" required>
  ID of the collection.
</ParamField>

<ParamField body="job_ids" type="list[str]" required>
  List of job IDs to check. Maximum 100.
</ParamField>

### Returns

<ResponseField name="statuses" type="list[dict]">
  List of job status dictionaries (same shape as single status above).
</ResponseField>

### Errors

* **`ValueError`** — More than 100 job IDs provided

***

## Example: Poll Until Complete

```python theme={null}
import time

def wait_for_jobs(client, collection_id, job_ids, poll_interval=2.0):
    pending = set(job_ids)
    while pending:
        statuses = client.get_agent_run_job_statuses(collection_id, list(pending))
        for s in statuses:
            if s["status"] in ("completed", "canceled", "cancelling"):
                pending.discard(s["job_id"])
                print(f"Job {s['job_id']}: {s['status']}")
        if pending:
            time.sleep(poll_interval)
    print("All jobs finished")
```

<Note>
  When using `add_agent_runs` with `wait=True` (the default), job polling is handled
  automatically. You only need manual polling when `wait=False`.
</Note>
