{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/Execution",
  "title": "Execution",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "workflowId": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "completed",
        "failed",
        "cancelled"
      ]
    },
    "input": {
      "type": "object",
      "additionalProperties": true
    },
    "output": {
      "type": "object",
      "additionalProperties": true
    },
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "nodeId": {
          "type": "string"
        },
        "code": {
          "type": "string"
        }
      }
    },
    "startedAt": {
      "type": "string",
      "format": "date-time"
    },
    "completedAt": {
      "type": "string",
      "format": "date-time"
    },
    "duration": {
      "type": "integer",
      "description": "Execution duration in milliseconds"
    },
    "nodeResults": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "nodeId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "output": {
            "type": "object",
            "additionalProperties": true
          },
          "duration": {
            "type": "integer"
          }
        }
      }
    }
  }
}