AlmondTill/G3N API

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

FieldTypeNotes
idID ID!The record’s id — a UUID the platform assigned when the record was created; every reference to this record uses it.
sysIdString String!The group-scoped human-facing system id (EX-…).
typeString String!The kind of record — always ExportJob here.
captionString String!The record’s display name — what people see it called.
statusString String!The FSM state: queued | running | done | cancelled | expired | failed.
parentIdID ID!The parent org group (the Saga shape); for an ExportJob parentId === rootId.
rootIdID ID!The org-group family root.
createdAtString String!When the record was created, as a UTC timestamp.
updatedAtString String!When the record last changed, as a UTC timestamp.
revisionNumInt Int!How many times this record has been edited; the first save is 0.
revisionID ID!The OCC revision token — supply it on every mutation of this record; rotates on every write.
refCaptionsRefCaption [RefCaption!]!The server-composed captions of this record's declared references (the referenced-caption rule) — one row per referenced id; see RefCaption.
userIdID 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.
sessionIdID 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.
planJsonString 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.
wordsString String!IMMUTABLE at birth.
formatString 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.
reportJsonStringThe 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.
stepsDoneInt Int!Machine steps taken so far (0 at birth; stamped by the step lane).
examinedInt Int!Records examined so far across every walk and hydrate (0 at birth) — the budget law’s counter.
partCountInt Int!Parts written so far (0 at birth; +1 per terminal page that kept at least one record).
rowCountInt Int!Rows written so far across every part (0 at birth) — the file’s row count at the finish.
bytesInt 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.
partialBoolean Boolean!True when the run halted before the end — cancelled · expired · refused · the byte ceiling; the file holds what was written.
fileKeyStringThe file’s object key under exports/<rootId>/<jobId>/ — stamped at the finish. Null while live and on a cancel.
fileNameStringThe 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.
fileTtlIntThe file’s expiry (epoch SECONDS = finishedAt + 7 days) — the download’s lazy-TTL gate. Null until the finish.
startedAtStringThe running instant (UTC ISO-8601 — the clock’s zero). Null while queued.
finishedAtStringThe terminal instant (UTC ISO-8601). Null while live.
problemStringWhy 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.
sfExecutionArnStringThe ops/reconcile handle.

Used by