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

# Processing Jobs

> MCP tools for monitoring data uploads, calculations, and report generation status

# Processing Jobs

Monitor data processing activity — file uploads, emission calculations, report generation, and bulk operations. Each job tracks progress with item counts and timing, making it easy to spot failures or pending work.

## `list_processing_jobs`

List data processing jobs with their status, progress, and timing.

**Parameters:**

| Parameter         | Type    | Required | Default     | Description       |
| ----------------- | ------- | -------- | ----------- | ----------------- |
| `organization_id` | string  | No       | default org | Organization UUID |
| `page`            | integer | No       | 1           | Page number       |
| `size`            | integer | No       | 20          | Results per page  |

**Example response:**

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "items": [
    {
      "id": "6028bb7e-...",
      "entity_name": "BUSINESS_TRAVELS",
      "action": "CREATE",
      "trigger_type": "FILE_UPLOAD",
      "items_total": 250,
      "items_success": 250,
      "items_failed": 0,
      "status": "COMPLETED",
      "started_at": "2025-02-25T11:33:15",
      "completed_at": "2025-02-25T11:33:50"
    },
    {
      "id": "a19cf3b2-...",
      "entity_name": "PURCHASES",
      "action": "CREATE",
      "trigger_type": "FILE_UPLOAD",
      "items_total": 1200,
      "items_success": 1195,
      "items_failed": 5,
      "status": "COMPLETED",
      "started_at": "2025-02-25T10:15:00",
      "completed_at": "2025-02-25T10:18:30"
    }
  ],
  "total": 45,
  "page": 1,
  "size": 20,
  "pages": 3
}
```

**Key response fields:**

| Field                            | Description                                        |
| -------------------------------- | -------------------------------------------------- |
| `entity_name`                    | Data type being processed (see entity types below) |
| `action`                         | `CREATE`, `UPDATE`, `DELETE`, or `EXPORT`          |
| `trigger_type`                   | What started the job (see trigger types below)     |
| `status`                         | `PENDING`, `RUNNING`, `COMPLETED`, or `FAILED`     |
| `items_total`                    | Total items in the job                             |
| `items_success` / `items_failed` | Success and failure counts                         |
| `started_at` / `completed_at`    | Job timing (completed\_at is null while running)   |

### Job Statuses

| Status      | Description                                               |
| ----------- | --------------------------------------------------------- |
| `PENDING`   | Queued, waiting to start                                  |
| `RUNNING`   | Currently being processed                                 |
| `COMPLETED` | Successfully finished (check `items_failed` — can be > 0) |
| `FAILED`    | Processing failed entirely                                |

<Note>
  A `COMPLETED` job can still have `items_failed > 0` — this means most items succeeded but some had errors. Check the ratio of `items_failed` to `items_total` for data quality assessment.
</Note>

### Trigger Types

| Value               | Description                            |
| ------------------- | -------------------------------------- |
| `FILE_UPLOAD`       | Data imported from a file (Excel, CSV) |
| `CALCULATION`       | Emission calculation run               |
| `RECALCULATION`     | Re-run of a previous calculation       |
| `BULK_DELETE`       | Mass deletion operation                |
| `REPORT_GENERATION` | PDF/Excel report being generated       |

<Accordion title="Entity types">
  | Value                          | Category                       |
  | ------------------------------ | ------------------------------ |
  | `BUSINESS_TRAVELS`             | Scope 3 — business travel      |
  | `EMPLOYEE_COMMUTING`           | Scope 3 — employee commuting   |
  | `HOTEL_STAYS`                  | Scope 3 — hotel stays          |
  | `PURCHASES`                    | Scope 3 — purchased goods      |
  | `LOGISTICS_REQUESTS`           | Scope 3 — transport logistics  |
  | `VEHICLES`                     | Scope 1 — fleet vehicles       |
  | `VEHICLE_CONSUMPTIONS`         | Scope 1 — vehicle fuel data    |
  | `INVOICES`                     | Scope 1 & 2 — energy invoices  |
  | `INVOICES_ELECTRICITY`         | Scope 2 — electricity invoices |
  | `INVOICES_HEAT`                | Scope 2 — heat invoices        |
  | `INVOICES_WATER`               | Water invoices                 |
  | `WASTES`                       | Scope 3 — waste records        |
  | `FACILITY_CONSUMPTION`         | Scope 1 & 2 — facility energy  |
  | `SOLD_PRODUCTS`                | Scope 3 — sold products        |
  | `LCA_PIECES`                   | LCA — product components       |
  | `LCA_MATERIALS`                | LCA — materials                |
  | `GENERATED_REPORT`             | Report generation              |
  | `PIVOT_TABLE_CARBON_FOOTPRINT` | Carbon footprint pivot table   |
</Accordion>

**Example prompts:**

```
"Are there any failed processing jobs?"
"Show me recent file uploads and their status"
"Is any data still being processed?"
"How many items failed in the last upload?"
"Show processing jobs for purchases"
```

## Workflow

1. **Check processing status** — `list_processing_jobs` to see recent activity and find failures
2. **Investigate failures** — Filter by the `entity_name` of failed jobs, then use the corresponding list tool (e.g. `list_purchases`) to check the data
3. **View overall health** — `get_organization_metrics` for a high-level overview of data completeness

## Related

<CardGroup cols={2}>
  <Card title="Files" icon="file" href="/mcp/files">
    Uploaded files that trigger processing jobs
  </Card>

  <Card title="Organizations" icon="building" href="/mcp/organizations">
    Organization metrics and data overview
  </Card>
</CardGroup>
