{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sap-btp/json-schema/sap-btp-ai-execution-response-with-details-schema.json",
  "title": "AiExecutionResponseWithDetails",
  "description": "Execution that may generate artifacts",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sap-btp-ai-core-openapi.yml#/components/schemas/AiExecutionResponseWithDetails",
  "type": "object",
  "properties": {
    "id": {
      "$ref": "#/$defs/AiExecutionId"
    },
    "configurationId": {
      "$ref": "#/$defs/AiConfigurationId"
    },
    "configurationName": {
      "$ref": "#/$defs/AiConfigurationName"
    },
    "executableId": {
      "$ref": "#/$defs/AiExecutableId"
    },
    "scenarioId": {
      "$ref": "#/$defs/AiScenarioId"
    },
    "targetStatus": {
      "type": "string",
      "description": "Target status of the execution",
      "enum": [
        "COMPLETED",
        "RUNNING",
        "STOPPED",
        "DELETED"
      ]
    },
    "status": {
      "$ref": "#/$defs/AiExecutionStatus"
    },
    "statusMessage": {
      "$ref": "#/$defs/AiExecutionStatusMessage"
    },
    "outputArtifacts": {
      "$ref": "#/$defs/AiArtifactArray"
    },
    "executionScheduleId": {
      "$ref": "#/$defs/AiExecutionScheduleId"
    },
    "createdAt": {
      "type": "string",
      "description": "Timestamp of resource creation",
      "format": "date-time"
    },
    "modifiedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp of latest resource modification"
    },
    "submissionTime": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp of job submitted"
    },
    "startTime": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp of job status changed to RUNNING"
    },
    "completionTime": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp of job status changed to COMPLETED/DEAD/STOPPED"
    },
    "statusDetails": {
      "$ref": "#/$defs/AiExecutionStatusDetails"
    }
  },
  "required": [
    "id",
    "configurationId",
    "status",
    "createdAt",
    "modifiedAt"
  ],
  "$defs": {
    "AiArtifact": {
      "description": "Base data of the artifact; this is the data that can be provided when the artifact is created; `name` and `kind` are required because they constitute important semantic filtering criteria for use in training / inference executables (`name` is a semantic handle of the artifact within a scenario and `kind` specifies the type of usage, e.g. you would only want to allow models in the model operator).\n",
      "type": "object",
      "properties": {
        "labels": {
          "$ref": "#/$defs/AiLabelList"
        },
        "name": {
          "$ref": "#/$defs/AiArtifactName"
        },
        "kind": {
          "type": "string",
          "enum": [
            "model",
            "dataset",
            "resultset",
            "other"
          ],
          "description": "Kind of the artifact, i.e. model or dataset"
        },
        "url": {
          "$ref": "#/$defs/AiArtifactUrl"
        },
        "description": {
          "$ref": "#/$defs/AiArtifactDescription"
        },
        "id": {
          "$ref": "#/$defs/AiArtifactId"
        },
        "scenarioId": {
          "$ref": "#/$defs/AiScenarioId"
        },
        "configurationId": {
          "$ref": "#/$defs/AiConfigurationId"
        },
        "executionId": {
          "$ref": "#/$defs/AiExecutionId"
        },
        "createdAt": {
          "type": "string",
          "description": "Timestamp of resource creation",
          "format": "date-time"
        },
        "modifiedAt": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp of latest resource modification"
        },
        "scenario": {
          "type": [
            "object",
            "null"
          ],
          "anyOf": [
            {
              "$ref": "#/$defs/AiScenario"
            },
            {}
          ]
        }
      },
      "required": [
        "name",
        "kind",
        "url",
        "id",
        "scenarioId",
        "createdAt",
        "modifiedAt"
      ]
    },
    "AiArtifactArray": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AiArtifact"
      }
    },
    "AiArtifactDescription": {
      "type": "string",
      "maxLength": 5000,
      "description": "Description of the artifact"
    },
    "AiArtifactId": {
      "type": "string",
      "pattern": "^[\\w.-]{4,64}$",
      "description": "ID of the artifact"
    },
    "AiArtifactName": {
      "type": "string",
      "pattern": "^[\\w\\s.!?,;:\\[\\](){}<>\"'=+*/\\\\^&%@~$#|-]*$",
      "maxLength": 256,
      "description": "Name of the artifact"
    },
    "AiArtifactUrl": {
      "type": "string",
      "pattern": "([a-z0-9-]+):\\/\\/.+",
      "maxLength": 1024,
      "description": "Reference to the location of the artifact.\n"
    },
    "AiConfigurationId": {
      "type": "string",
      "pattern": "^[\\w.-]{4,64}$",
      "description": "ID of the configuration"
    },
    "AiConfigurationName": {
      "type": "string",
      "pattern": "^[\\w\\s.!?,;:\\[\\](){}<>\"'=+*/\\\\^&%@~$#|-]*$",
      "maxLength": 256,
      "description": "Name of the configuration"
    },
    "AiExecutableId": {
      "type": "string",
      "pattern": "^[\\w.-]{4,64}$",
      "description": "ID of the executable"
    },
    "AiExecutionId": {
      "type": "string",
      "pattern": "^[\\w.-]{4,64}$",
      "description": "ID of the execution"
    },
    "AiExecutionScheduleId": {
      "type": "string",
      "pattern": "^[\\w.-]{4,64}$",
      "description": "ID of the execution schedule"
    },
    "AiExecutionStatus": {
      "type": "string",
      "description": "Execution status",
      "enum": [
        "PENDING",
        "RUNNING",
        "COMPLETED",
        "DEAD",
        "STOPPING",
        "STOPPED",
        "UNKNOWN"
      ]
    },
    "AiExecutionStatusDetails": {
      "type": "object",
      "description": "Current status details of the execution"
    },
    "AiExecutionStatusMessage": {
      "type": "string",
      "description": "Execution status message",
      "maxLength": 256
    },
    "AiLabel": {
      "type": "object",
      "required": [
        "key",
        "value"
      ],
      "properties": {
        "key": {
          "$ref": "#/$defs/AiLabelKey"
        },
        "value": {
          "$ref": "#/$defs/AiLabelValue"
        }
      }
    },
    "AiLabelKey": {
      "type": "string",
      "maxLength": 256,
      "pattern": "^ext\\.ai\\.sap\\.com\\/[\\w\\.-]+$"
    },
    "AiLabelList": {
      "type": "array",
      "description": "Arbitrary labels as meta information",
      "items": {
        "$ref": "#/$defs/AiLabel"
      }
    },
    "AiLabelValue": {
      "type": "string",
      "maxLength": 5000
    },
    "AiScenario": {
      "type": "object",
      "description": "An ML Scenario consists of a number of executables. E.g., there can be one or several training executables, an inference (deployment) executable. An ML Scenario is versioned.\n",
      "required": [
        "name",
        "id",
        "createdAt",
        "modifiedAt"
      ],
      "properties": {
        "name": {
          "type": "string",
          "maxLength": 256,
          "description": "Name of the scenario"
        },
        "description": {
          "type": "string",
          "maxLength": 5000,
          "description": "Description of the scenario"
        },
        "labels": {
          "$ref": "#/$defs/AiScenarioLabelList"
        },
        "id": {
          "$ref": "#/$defs/AiScenarioId"
        },
        "createdAt": {
          "type": "string",
          "description": "Timestamp of resource creation",
          "format": "date-time"
        },
        "modifiedAt": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp of latest resource modification"
        }
      }
    },
    "AiScenarioId": {
      "type": "string",
      "pattern": "^[\\w.-]{4,64}$",
      "description": "ID of the scenario"
    },
    "AiScenarioLabel": {
      "type": "object",
      "required": [
        "key",
        "value"
      ],
      "properties": {
        "key": {
          "$ref": "#/$defs/AiScenarioLabelKey"
        },
        "value": {
          "$ref": "#/$defs/AiLabelValue"
        }
      }
    },
    "AiScenarioLabelKey": {
      "type": "string",
      "maxLength": 256,
      "pattern": "^(scenarios|ext)\\.ai\\.sap\\.com\\/[\\w\\.-]+$"
    },
    "AiScenarioLabelList": {
      "type": "array",
      "description": "Arbitrary labels as meta information",
      "items": {
        "$ref": "#/$defs/AiScenarioLabel"
      }
    }
  }
}