<!-- source: https://secondlayer.tools/docs/api-reference#subgraph-operation-object -->

## The Subgraph operation object

A reindex or backfill. One per subgraph can be queued or running at a time.

| Field | Type | Description |
| --- | --- | --- |
| `id` | string · uuid | Operation id. |
| `subgraphName` | string | Subgraph it runs on. |
| `kind` | enum | `reindex` drops and rebuilds; `backfill` re-runs a range in place. Values: `reindex`, `backfill`. |
| `status` | enum | `queued` until a processor claims it. `completed`, `failed` and `cancelled` are final. Values: `queued`, `running`, `completed`, `failed`, `cancelled`. |
| `weight` | enum | `light` for contract-scoped sources, `heavy` for broad ones. The processor limits how many heavy operations run at once. Values: `light`, `heavy`. |
| `fromBlock` | integer · nullable | First block. `null` on a reindex queued from `/reindex`, which starts at the subgraph's start block. |
| `toBlock` | integer · nullable | Last block. `null` means the chain tip. |
| `processedBlocks` | integer · nullable | Blocks covered. Set when the operation finishes. |
| `cursorBlock` | integer · nullable | Backfills only: last committed block. A requeued backfill resumes after it. |
| `estimatedEvents` | integer · nullable | Events expected, computed at enqueue for contract-scoped sources. |
| `processedEvents` | integer · nullable | Events processed so far. |
| `progress` | number · 0 to 1 · nullable | Fraction done, 0 to 1, from events when estimated, else blocks. `null` before any progress is reported. |
| `queuePosition` | integer | Queued only: approximate 1-based position. Show it as `~N`. |
| `error` | string · nullable | Why it failed. |
| `startedAt` | string · date-time · nullable | When a processor claimed it. |
| `finishedAt` | string · date-time · nullable | When it reached a final status. |
| `createdAt` | string · date-time | When it was queued. |
| `updatedAt` | string · date-time | Last change. |

```json
{
  "id": "3f1c9a52-7d4e-4b8a-9e21-5c0d8f6a2b17",
  "subgraphName": "sbtc-flows",
  "kind": "reindex",
  "status": "running",
  "weight": "light",
  "fromBlock": 8000000,
  "toBlock": 9048712,
  "processedBlocks": null,
  "cursorBlock": null,
  "estimatedEvents": 48210,
  "processedEvents": 24105,
  "progress": 0.5,
  "error": null,
  "startedAt": "2026-09-21T09:15:04.000Z",
  "finishedAt": null,
  "createdAt": "2026-09-21T09:14:53.000Z",
  "updatedAt": "2026-09-21T09:18:37.000Z"
}
```
