{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/runonflux-com/json-schema/runonflux-com-operation-schema.json",
  "title": "operation",
  "description": "The state of a long-running operation, as served by GET /apps/operations/{jobId}.",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/runonflux-com-openapi.yaml#/components/schemas/operation",
  "type": "object",
  "properties": {
    "jobId": {
      "type": "string",
      "description": "Operation id, of the form `op_<uuid>`"
    },
    "kind": {
      "type": "string",
      "description": "What the operation is doing, e.g. `fileoperation.copy`"
    },
    "status": {
      "type": "string",
      "description": "`Running`, or one of the terminal states. `Evicted` means the node took the work away — distinct from `Canceled`, which the caller asked for, and from `Failed`, where the caller's input was at fault.",
      "enum": [
        "Running",
        "Succeeded",
        "Failed",
        "Canceled",
        "Evicted"
      ]
    },
    "createdAt": {
      "type": "integer",
      "description": "Unix milliseconds"
    },
    "lastUpdatedAt": {
      "type": "integer",
      "description": "Unix milliseconds"
    },
    "progress": {
      "type": "array",
      "description": "Line-numbered progress output; use `sinceSeq` to read only what is new",
      "items": {
        "type": "string"
      }
    },
    "error": {
      "type": [
        "object",
        "null"
      ],
      "description": "An RFC 9457 problem object when the operation failed, otherwise null. Registry credentials are scrubbed from `detail`.",
      "properties": {
        "type": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "status": {
          "type": "integer"
        },
        "detail": {
          "type": "string"
        },
        "instance": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "retryAfterMs": {
          "type": "integer"
        }
      }
    },
    "detail": {
      "type": [
        "object",
        "null"
      ],
      "description": "Operation-specific detail, built at read time"
    }
  }
}