AlmondTill/G3N API

On this page

cancelExportJob

mutation · in the family Reading your records

What it does

Stop one of your own background exports — it ends as cancelled and no file is produced.

Cancel YOUR queued or running background export: the record flips to cancelled and the session's export slot frees at once; NO file is composed and no notice is sent — the parts already written age out on their own; the machine notices at its next step boundary and stops. Only the job's OWNER (the same user AND the same session) may cancel — anyone else refuses AUTHZ/FORBIDDEN; a job outside your tenant, or none at all, is NOT_FOUND; a finished job refuses (terminal records are immutable). Requires the unrestricted capability on a USER session.

What happens

Only the person who started the export can cancel it; a finished export cannot be cancelled. Signing out cancels your running export for you.

Who may call it

Capability area: Reading your records — Looking up and listing the records of your organization.

Arguments

NameTypeRequiredNotes
idID ID!yesThe id of the record.

Returns

ExportJob ExportJob! — 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.

Example request

mutation ExampleCancelExportJob($id: ID!) {
  cancelExportJob(id: $id) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    userId
    sessionId
    planJson
    words
    format
    reportJson
    stepsDone
    examined
    partCount
    rowCount
    bytes
    partial
    fileKey
    fileName
    fileTtl
    startedAt
    finishedAt
    problem
    sfExecutionArn
  }
}

Variables:

{
  "id": "01900000-0000-7000-8000-37386ae00000"
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

{
  "data": {
    "cancelExportJob": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "EX-EXMP-0000-000F",
      "type": "ExportJob",
      "caption": "Blue jeans",
      "status": "queued",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "userId": "01900000-0000-7000-8000-11f967df0000",
      "sessionId": "01900000-0000-7000-8000-be25a35a0000",
      "planJson": "<plan json>",
      "words": "<words>",
      "format": "<format>",
      "reportJson": "<report json>",
      "stepsDone": 1,
      "examined": 1,
      "partCount": 1,
      "rowCount": 1,
      "bytes": 1,
      "partial": true,
      "fileKey": "<file key>",
      "fileName": "Blue jeans",
      "fileTtl": 1,
      "startedAt": "2027-01-31T00:00:00.000Z",
      "finishedAt": "2027-01-31T00:00:00.000Z",
      "problem": "<problem>",
      "sfExecutionArn": "<sf execution arn>"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer