{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/usewrit-app/json-schema/usewrit-app-automation-run-result-schema.json",
  "title": "AutomationRunResult",
  "description": "Manual-run outcome — either an execution record or a skip notice (a status-gated event with no triggering context).",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/usewrit-app-automations-api-openapi.yml#/components/schemas/AutomationRunResult",
  "oneOf": [
    {
      "type": "object",
      "title": "Executed",
      "required": [
        "execution_id",
        "status",
        "results",
        "error"
      ],
      "properties": {
        "execution_id": {
          "type": "integer",
          "format": "int64"
        },
        "status": {
          "type": "string"
        },
        "results": {
          "description": "Parsed action results (any JSON value; null on parse failure)."
        },
        "error": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    {
      "type": "object",
      "title": "Skipped",
      "required": [
        "status",
        "reason"
      ],
      "properties": {
        "status": {
          "type": "string",
          "const": "skipped"
        },
        "reason": {
          "type": "string"
        }
      }
    }
  ]
}