{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/wordis-bond-com/json-schema/wordis-bond-com-flow-ir-schema.json",
  "title": "FlowIR",
  "description": "The canonical, git-serializable representation of a phone-system flow. A discriminated node graph (prompt / menu / condition / agent / transfer / tool / hangup) plus flow metadata. Deterministic serialization → a stable content hash and a clean diff, so a flow can be version-controlled and regression-tested like source code. Extensible toward the migration surface — the same envelope hosts an imported vendor config and a hand-authored flow.",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/wordis-bond-com-openapi.json#/components/schemas/FlowIR",
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "integer",
      "const": 1
    },
    "kind": {
      "type": "string",
      "const": "voice_flow"
    },
    "name": {
      "type": "string"
    },
    "language": {
      "type": "string"
    },
    "entry": {
      "type": "string",
      "description": "Id of the node the call enters at."
    },
    "nodes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "prompt",
              "menu",
              "condition",
              "agent",
              "transfer",
              "tool",
              "hangup"
            ]
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "type"
        ]
      }
    },
    "metadata": {
      "type": "object",
      "description": "Free-form; reserved keys `goal` and `persona` drive the regression scenario."
    }
  },
  "required": [
    "schemaVersion",
    "kind",
    "name",
    "language",
    "entry",
    "nodes"
  ]
}