{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/indices-io/json-schema/indices-io-run-schema.json",
  "title": "Run",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/indices-io-openapi.json#/components/schemas/Run",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the object."
    },
    "connector_id": {
      "type": "string",
      "description": "ID of the connector executed in this run."
    },
    "connector_version": {
      "type": "integer",
      "description": "Version of the connector executed in this run. Runs pin the version that was newest when they were created."
    },
    "arguments": {
      "additionalProperties": true,
      "type": "object",
      "description": "Arguments in this run for the connector's input parameters."
    },
    "secret_bindings": {
      "additionalProperties": {
        "type": "string"
      },
      "type": "object",
      "description": "Secrets to use for this run. This dict must be a mapping of secret slot names to secret IDs."
    },
    "status": {
      "$ref": "#/$defs/RunStatus",
      "description": "Lifecycle status of the run: `pending`, `running`, `success`, `connector_error`, `timed_out`, `result_too_large`, or `internal_error`. `connector_error` means the connector's code failed (see `error`); `timed_out` and `internal_error` are platform outcomes worth retrying; `result_too_large` means the result exceeded the execution limit or could not be retained for an async caller. Async results above 1 MB require a new synchronous request."
    },
    "result": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "description": "Execution result of the run, matching the connector's output schema. Synchronous requests return successful results up to the 100 MB execution limit. Only results of at most 1,000,000 UTF-8 JSON bytes are stored. Larger results are returned once to the synchronous caller and are null on later retrieval. If delivery fails, the result cannot be retrieved later."
    },
    "result_stored": {
      "type": "boolean",
      "description": "Whether the result is retained for later retrieval."
    },
    "result_size_bytes": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "description": "Size of the executor's serialized result in UTF-8 bytes, when known."
    },
    "error": {
      "anyOf": [
        {
          "$ref": "#/$defs/RunError"
        },
        {
          "type": "null"
        }
      ],
      "description": "Why the run failed. Present iff `status` is `connector_error`; for platform failures the status itself is the reason."
    },
    "has_logs": {
      "type": "boolean",
      "description": "Whether the run has associated logs"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp when the object was created."
    },
    "finished_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "description": "Timestamp when the object was last updated."
    }
  },
  "type": "object",
  "required": [
    "id",
    "connector_id",
    "connector_version",
    "arguments",
    "status",
    "result",
    "result_stored",
    "result_size_bytes",
    "error",
    "has_logs",
    "created_at",
    "finished_at"
  ],
  "$defs": {
    "RunError": {
      "properties": {
        "type": {
          "type": "string",
          "description": "Machine-readable failure type: `auth_required`, `invalid_input`, `site_unavailable`, `anti_bot`, `site_changed`, `internal_error`, `crash`, or `unhandled`."
        },
        "message": {
          "type": "string",
          "description": "Human-readable description of the failure."
        },
        "retryable": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "description": "Whether retrying the run with the same arguments is expected to succeed. Null when unknown."
        },
        "exception": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Exception class name, when the failure came from a raised exception."
        },
        "details": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "description": "Structured context reported by the connector."
        }
      },
      "type": "object",
      "required": [
        "type",
        "message",
        "retryable",
        "exception",
        "details"
      ],
      "title": "RunError"
    },
    "RunStatus": {
      "type": "string",
      "enum": [
        "pending",
        "running",
        "success",
        "connector_error",
        "timed_out",
        "result_too_large",
        "internal_error"
      ],
      "title": "RunStatus"
    }
  }
}