# ExportJob

object type

The record is the durable truth (stepsDone · examined · partCount · rowCount · bytes grow; partial says the run stopped short; problem says why). the budget rule is the SearchJob's VERBATIM — at most 50000 records examined · 300 s from the start (past it the job is expired WITH the parts written) · 400 machine steps — plus ONE bound of its own: 256 MiB on the composed file (the walk halts partial the step before it would cross). The plan's limit does NOT bound the export — every terminal record is written. ONE running export per signed-in session (the EXPORTLOCK marker — a second start refuses CONFLICT/EXPORT_JOB_ACTIVE naming the holder; a running search does not block it). Lifecycle queued → running → done | cancelled | expired | failed: cancel is the owner's (cancelExportJob) or the session's end — NO file is composed on cancel; done stays listed, the other terminals are doomed-class. The generic wire is READ-ONLY (the two reads) — the bespokes own the writes: startExportJob (THE PLAN GATE, then the per-family list-op offer AS THE CALLER — a family you may not list stops the plan before any read; the format csv | jsonl) · cancelExportJob · exportJobDownload (a query — the owner alone AND the reader's own list right over the plan's terminal family). The finish mints an in-app notice (export_finished · export_expired · export_failed), never on cancel.

## 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 (EX-…). |
| `type` | [String](/types/#scalars) `String!` | The kind of record — always `ExportJob` here. |
| `caption` | [String](/types/#scalars) `String!` | The record’s display name — what people see it called. |
| `status` | [String](/types/#scalars) `String!` | The FSM state: queued \| running \| done \| cancelled \| expired \| failed. |
| `parentId` | [ID](/types/#scalars) `ID!` | The parent org group (the Saga shape); for an ExportJob 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. |
| `userId` | [ID](/types/#scalars) `ID!` | The owner — the User who started the job; cancel and the download are theirs alone (the system hook cancels on their session’s end). IMMUTABLE at birth. |
| `sessionId` | [ID](/types/#scalars) `ID!` | The signed-in session the job runs under — the EXPORTLOCK aggregate (ONE running export per session); a Session is not a catalog construct, so the id is opaque on the wire. IMMUTABLE at birth. |
| `planJson` | [String](/types/#scalars) `String!` | The NORMALIZED plan as JSON text (the validated SearchPlan with its defaults applied; at most 8192 characters) — re-parsed and re-validated at every read. IMMUTABLE at birth. |
| `words` | [String](/types/#scalars) `String!` | IMMUTABLE at birth. |
| `format` | [String](/types/#scalars) `String!` | The file format the finish composes — csv (RFC 4180 through the one cell rule: the header = the column union over the whole set, nested leaves as dotted paths, arrays as JSON in the cell) or jsonl (one record per line — the parts’ bytes concatenated). The parts are JSON Lines either way. IMMUTABLE at birth. |
| `reportJson` | [String](/types/#scalars) | The report arm (📊 THE REPORT ENGINE): the validated ReportSpec as JSON text (at most 12288 characters — the reportRun grammar VERBATIM; its plan equals planJson's), re-parsed at the finish to compose the file (a projection's columns or an aggregate's groups); the job's words are then the report's. IMMUTABLE at birth; null on a plain export. |
| `stepsDone` | [Int](/types/#scalars) `Int!` | Machine steps taken so far (0 at birth; stamped by the step lane). |
| `examined` | [Int](/types/#scalars) `Int!` | Records examined so far across every walk and hydrate (0 at birth) — the budget law’s counter. |
| `partCount` | [Int](/types/#scalars) `Int!` | Parts written so far (0 at birth; +1 per terminal page that kept at least one record). |
| `rowCount` | [Int](/types/#scalars) `Int!` | Rows written so far across every part (0 at birth) — the file’s row count at the finish. |
| `bytes` | [Int](/types/#scalars) `Int!` | Bytes written so far across every part (0 at birth) — tracked against the 256 MiB file ceiling; the composed file’s size at the finish. |
| `partial` | [Boolean](/types/#scalars) `Boolean!` | True when the run halted before the end — cancelled · expired · refused · the byte ceiling; the file holds what was written. |
| `fileKey` | [String](/types/#scalars) | The file’s object key under exports/<rootId>/<jobId>/ — stamped at the finish. Null while live and on a cancel. |
| `fileName` | [String](/types/#scalars) | The file’s name — <family>-<YYYYMMDD-HHMMSS>-<sysId>.<csv\|jsonl> at the finish instant (ASCII); what exportJobDownload is saved as. Null while live and on a cancel. |
| `fileTtl` | [Int](/types/#scalars) | The file’s expiry (epoch SECONDS = finishedAt + 7 days) — the download’s lazy-TTL gate. Null until the finish. |
| `startedAt` | [String](/types/#scalars) | The running instant (UTC ISO-8601 — the clock’s zero). Null while queued. |
| `finishedAt` | [String](/types/#scalars) | The terminal instant (UTC ISO-8601). Null while live. |
| `problem` | [String](/types/#scalars) | Why the run stopped short — the executor’s refusal in its teaching voice (the budget, the frontier, the step cap), the byte ceiling, the expiry, the start refusal, or a machine fault’s cause. Null on done. |
| `sfExecutionArn` | [String](/types/#scalars) | The ops/reconcile handle. |

## Used by

- [cancelExportJob](/reference/reading-your-records/cancelExportJob/)
- [exportJob](/reference/export-job/exportJob/)
- [startExportJob](/reference/reading-your-records/startExportJob/)
