{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://open-coder-ai.github.io/chock/schemas/v0/manifest.workflow.json",
  "title": "ChockWorkflowPayload",
  "description": "V3 workflow payload under 'workflow:'.",
  "type": "object",
  "additionalProperties": false,
  "required": ["effects", "approval", "steps"],
  "properties": {
    "effects": {"$ref": "https://open-coder-ai.github.io/chock/schemas/v0/manifest.common.json#/definitions/effects"},
    "approval": {"$ref": "https://open-coder-ai.github.io/chock/schemas/v0/manifest.common.json#/definitions/approval"},
    "control": {"type": "string", "enum": ["deterministic", "llm_driven"]},
    "steps": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["id", "uses"],
        "properties": {
          "id": {"type": "string"},
          "uses": {"type": "string"},
          "mode": {"type": "string", "enum": ["inline", "delegated"]},
          "input": {"type": "object", "additionalProperties": true},
          "output": {"type": "object", "additionalProperties": true},
          "on_error": {"type": "string", "enum": ["abort", "continue"]}
        }
      }
    },
    "outputs": {"type": "object", "additionalProperties": true},
    "max_delegation_depth": {"type": "integer", "minimum": 1},
    "aggregate_check": {"type": "boolean"}
  }
}