{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://weverlabs.com/schemas/energyops-reference-workflow.schema.json",
  "title": "EnergyOps Reference Workflow",
  "type": "object",
  "required": [
    "workflow_id",
    "tool",
    "workflow_type",
    "route",
    "inputs",
    "checks",
    "outputs"
  ],
  "properties": {
    "workflow_id": {
      "type": "string"
    },
    "tool": {
      "const": "energyops"
    },
    "workflow_type": {
      "const": "interconnection_packet_readiness"
    },
    "route": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "inputs": {
      "type": "object",
      "properties": {
        "project_context": {
          "type": "object"
        },
        "evidence_references": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "callback_destination": {
          "type": "string"
        }
      }
    },
    "checks": {
      "type": "array",
      "items": {
        "$ref": "https://weverlabs.com/schemas/energyops-interconnection-readiness-check.schema.json"
      }
    },
    "outputs": {
      "type": "object",
      "properties": {
        "readiness_status": {
          "type": "string"
        },
        "readiness_score": {
          "type": "number"
        },
        "missing_items": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "exception_records": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "result_package_url": {
          "type": "string"
        },
        "callback_state": {
          "type": "string"
        },
        "task_ledger_url": {
          "type": "string"
        },
        "attestation_url": {
          "type": "string"
        }
      }
    }
  }
}
