# Saga

object type

A Saga — the cross-boundary / multi-step mutation record-of-truth: each step advances status AND commits its effect in ONE transaction; the record IS the durable state machine. Isolation = the semantic lock. SYSTEM-MINTED end to end: the wire is READ-ONLY (no create/edit/transition mutations exist — lifecycle is kit-channel; the first live records mint with the first genuinely multi-step process, checkout). failed is the terminal — compensation itself could not complete; recovery is a NEW linked saga, never a resurrection.

## Fields

| Field | Type | Notes |
| --- | --- | --- |
| `id` | [ID](/types/#scalars) `ID!` | The record’s id — a UUID the platform assigned when the record was created; every reference to this record uses it. |
| `sysId` | [String](/types/#scalars) `String!` | The group-scoped human-facing system id (SG-…). |
| `type` | [String](/types/#scalars) `String!` | The kind of record — always `Saga` here. |
| `caption` | [String](/types/#scalars) `String!` | The record’s display name — what people see it called. |
| `status` | [String](/types/#scalars) `String!` | The FSM state: pending \| running \| compensating \| completed \| compensated \| failed. |
| `parentId` | [ID](/types/#scalars) `ID!` | The parent org group; for a Saga parentId === rootId. |
| `rootId` | [ID](/types/#scalars) `ID!` | The org-group family root. |
| `createdAt` | [String](/types/#scalars) `String!` | When the record was created, as a UTC timestamp. |
| `updatedAt` | [String](/types/#scalars) `String!` | When the record last changed, as a UTC timestamp. |
| `revisionNum` | [Int](/types/#scalars) `Int!` | How many times this record has been edited; the first save is 0. |
| `revision` | [ID](/types/#scalars) `ID!` | The OCC revision token — supply it on every mutation of this record; rotates on every write. |
| `refCaptions` | [RefCaption](/types/RefCaption/) `[RefCaption!]!` | The server-composed captions of this record's declared references (the referenced-caption rule) — one row per referenced id; see RefCaption. |
| `sagaType` | [SagaType](/types/SagaType/) `SagaType!` | The canned process kind. IMMUTABLE at birth. |
| `lockAggregateId` | [ID](/types/#scalars) `ID!` | The aggregate the semantic lock isolates — e.g. the Order under checkout. IMMUTABLE at birth. |
| `participants` | [SagaParticipant](/types/SagaParticipant/) `[SagaParticipant!]!` | The construct refs this saga's steps touch (1..32, distinct). IMMUTABLE at birth. |
| `compensationLog` | [SagaCompensationEntry](/types/SagaCompensationEntry/) `[SagaCompensationEntry!]!` | The compensation audit log (born empty; appends while compensating, ≤ 64 — the failed terminal's last line records why). Server data, never caller-writable. |
| `sfExecutionArn` | [String](/types/#scalars) | Null on SF-less sagas (document-FSM instances) and the degraded lane. The ops/reconcile handle. |
| `taskToken` | [String](/types/#scalars) | The LIVE WaitForTaskToken callback token. Present ⟺ the execution is paused at the external wait; kit-stamped. |

## Used by

- [saga](/reference/saga/saga/)
