{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://instruction.md/specification/1/schemas/workflow.schema.json",
  "title": "Instruction Workflow definition",
  "description": "Native instruction/workflow dialect, revision 1. See the normative workflow reference for scheduler, expression and runtime requirements.",
  "type": "object",
  "properties": {
    "act_for": {
      "additionalProperties": false,
      "description": "the person this workflow's schedule, loop and once firings act for with nobody there (RFC 0044 M4): each firing approved by them on their own device (ciba), or with their grant and nobody asked (standing) — as their identity.delegation template allows. Only the operator's own configuration declares it; beside any other start, or a webhook wait, it is refused (act_for_trigger_not_allowed), and a device principal is refused as act_for_device_principal",
      "properties": {
        "principal": {
          "additionalProperties": false,
          "description": "the typed principal, never a display string: an oidc subject (issuer, sub), or a pinned operator or x509 principal by its a2a.principals rule's id",
          "properties": {
            "id": {
              "type": "string"
            },
            "issuer": {
              "type": "string"
            },
            "source": {
              "enum": [
                "oidc",
                "x509",
                "operator"
              ]
            },
            "sub": {
              "type": "string"
            }
          },
          "type": "object"
        },
        "via": {
          "enum": [
            "ciba",
            "standing"
          ]
        }
      },
      "required": [
        "principal",
        "via"
      ],
      "type": "object"
    },
    "armed": {
      "default": true,
      "type": "boolean"
    },
    "concurrency": {
      "properties": {
        "max_runs": {
          "minimum": 1,
          "type": "integer",
          "maximum": 1024
        },
        "on_overflow": {
          "enum": [
            "queue",
            "drop",
            "replace"
          ]
        },
        "scope": {
          "description": "what max_runs counts: every run of this workflow (default), or every run about the same `key` — the difference between a queue and a per-entity lock",
          "enum": [
            "workflow",
            "key"
          ]
        }
      },
      "type": "object"
    },
    "description": {
      "type": "string"
    },
    "durable": {
      "description": "false = runs are memory-only (no checkpoints, gone after a restart) — the fast path for recomputable work; absent = the store.durability.work default (durable)",
      "type": "boolean"
    },
    "inputs": {
      "properties": {
        "schema": {
          "type": "object"
        }
      },
      "type": "object"
    },
    "key": {
      "description": "the logical thing a run is ABOUT, rendered from the trigger payload (e.g. \"{{payload.account_id}}\"); required by concurrency.scope: key",
      "type": "string"
    },
    "limits": {
      "properties": {
        "budget": {
          "type": "object"
        },
        "deadline": {
          "type": "string"
        },
        "steps": {
          "type": "integer"
        },
        "tokens": {
          "type": "integer"
        }
      },
      "type": "object"
    },
    "name": {
      "type": "string",
      "pattern": "^[A-Za-z_][A-Za-z0-9_-]{0,63}$"
    },
    "outputs": {
      "properties": {
        "schema": {
          "type": "object"
        }
      },
      "type": "object"
    },
    "priority": {
      "description": "contention weight: `low` sheds one pressure level earlier and is scheduled last; a tiebreak under scarcity, not a reservation",
      "enum": [
        "low",
        "normal",
        "high"
      ]
    },
    "state": {
      "additionalProperties": {
        "additionalProperties": false,
        "properties": {
          "reducer": {
            "description": "how concurrent writes to this key combine; declaring it makes concurrency a policy rather than a race",
            "enum": [
              "overwrite",
              "append",
              "merge",
              "union"
            ]
          },
          "schema": {
            "description": "a JSON Schema every write to this key must satisfy",
            "type": "object"
          }
        },
        "type": "object"
      },
      "description": "declared run variables — {key: {schema, reducer}}",
      "type": "object"
    },
    "steps": {
      "$ref": "#/$defs/steps"
    },
    "tool": {
      "additionalProperties": false,
      "description": "register this workflow as a first-class tool — a callable procedure with retry, breaker, idempotency and a human gate INSIDE one apparent call. Startup config only; tags are DERIVED from what the steps reach.",
      "properties": {
        "grant": {
          "additionalProperties": false,
          "properties": {
            "agent": {
              "type": "boolean"
            },
            "root": {
              "type": "boolean"
            },
            "subagents": {
              "type": "boolean"
            },
            "user": {
              "type": "boolean"
            },
            "workflows": {
              "type": "boolean"
            }
          },
          "type": "object"
        },
        "mode": {
          "description": "sync parks the caller on the run and returns its output; async returns a handle",
          "enum": [
            "sync",
            "async"
          ]
        },
        "name": {
          "description": "the tool name callers see; may not shadow an internal contract",
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "type": "object"
    },
    "unload": {
      "additionalProperties": false,
      "description": "what happens to LIVE runs when this definition is retired (removed, replaced or deleted)",
      "properties": {
        "policy": {
          "description": "drain (default) lets them finish",
          "enum": [
            "drain",
            "cancel",
            "detach"
          ]
        },
        "timeout": {
          "description": "how long a drain may take",
          "type": "string"
        }
      },
      "type": "object"
    },
    "$schema": {
      "type": "string"
    }
  },
  "required": [
    "name",
    "steps"
  ],
  "additionalProperties": false,
  "patternProperties": {
    "^x-[a-z0-9_.-]+$": {}
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "concurrency": {
            "properties": {
              "scope": {
                "const": "key"
              }
            },
            "required": [
              "scope"
            ]
          }
        },
        "required": [
          "concurrency"
        ]
      },
      "then": {
        "required": [
          "key"
        ]
      }
    }
  ],
  "$defs": {
    "step": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "command": {},
            "roles": {},
            "inputs": {},
            "schema": {},
            "into": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "a2a"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "peer": {},
            "objective": {},
            "command": {},
            "args": {},
            "output_contract": {},
            "timeout": {
              "type": "string"
            },
            "idempotency": {},
            "breaker": {},
            "rate": {},
            "auth_to": {},
            "auth_timeout": {},
            "payment": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "a2a.delegate"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "peer"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "to": {},
            "parts": {},
            "command": {},
            "args": {},
            "context": {},
            "timeout": {
              "type": "string"
            },
            "idempotency": {},
            "breaker": {},
            "rate": {},
            "payment": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "a2a.send"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "to"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "conversation": {},
            "from": {},
            "timeout": {
              "type": "string"
            },
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "a2a.wait"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "from"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "instruction": {},
            "output_contract": {},
            "output_schema": {
              "type": "object"
            },
            "tools": {},
            "servers": {},
            "limits": {},
            "context": {},
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "system": {},
            "model": {},
            "effort": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "agent"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "instruction"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "name": {},
            "mime": {},
            "content": {},
            "from_step": {},
            "sensitive": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "artifact.create"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "name"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "id": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "artifact.delete"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "id"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "id": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "artifact.get"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "id"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "condition": {},
            "message": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "assert"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "condition"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "value": {},
            "writes": {},
            "mode": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "assign"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "over": {},
            "body": {
              "$ref": "#/$defs/body"
            },
            "by": {},
            "size": {},
            "parallel": {},
            "rate": {},
            "collect": {},
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "batch"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "over",
            "body"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "name": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "checkpoint"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "value": {},
            "by": {},
            "size": {},
            "overlap": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "chunk"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "value",
            "size"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "input": {},
            "classes": {},
            "prompt": {},
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "model": {},
            "confidence": {},
            "on_unsure": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "classify"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "input",
            "classes"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "stream": {},
            "on": {},
            "by": {},
            "window": {},
            "on_incomplete": {},
            "filter": {},
            "max_pending": {},
            "inputs": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "correlate"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "stream",
            "on"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "state": {},
            "questions": {},
            "model": {},
            "confidence": {},
            "on_unsure": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "decide"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "state",
            "questions"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "over": {},
            "by": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "dedupe"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "over"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "note": {},
            "audit": {},
            "value": {},
            "stream": {},
            "subject": {},
            "data": {},
            "correlation": {},
            "forward": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "emit"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "on": {},
            "filter": {},
            "inputs": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "event"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "on"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "input": {},
            "output_schema": {
              "type": "object"
            },
            "prompt": {},
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "model": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "extract"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "input",
            "output_schema"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "message": {},
            "code": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "fail"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "over": {},
            "expr": {},
            "as": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "filter"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "over",
            "expr"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "status": {},
            "output": {},
            "reason": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "finish"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "over": {},
            "body": {
              "$ref": "#/$defs/body"
            },
            "batch": {},
            "collect": {},
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "as": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "foreach"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "over",
            "body"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "method": {},
            "url": {},
            "headers": {},
            "query": {},
            "body": {
              "$ref": "#/$defs/body"
            },
            "json": {},
            "timeout": {
              "type": "string"
            },
            "expect": {},
            "allow_private": {},
            "sign": {},
            "idempotency": {},
            "breaker": {},
            "rate": {},
            "auth": {},
            "payment": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "http"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "url"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "question": {},
            "schema": {},
            "to": {},
            "timeout": {
              "type": "string"
            },
            "reply_uri": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "human"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "question"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "body": {
              "$ref": "#/$defs/body"
            },
            "while": {},
            "until": {},
            "max_iterations": {},
            "collect": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "iterate"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "body"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "handles": {},
            "timeout": {
              "type": "string"
            },
            "min": {},
            "partials": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "join"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "handles"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "input": {},
            "rubric": {},
            "levels": {},
            "prompt": {},
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "model": {},
            "confidence": {},
            "on_unsure": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "judge"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "input",
            "rubric"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "id": {},
            "uri": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "knowledge.get"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "query": {},
            "top_k": {},
            "filters": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "knowledge.search"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "query"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "interval": {},
            "delay": {},
            "until": {},
            "max_iterations": {},
            "backoff": {},
            "inputs": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "loop"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "inputs": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "manual"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "over": {},
            "expr": {},
            "as": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "map"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "over",
            "expr"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "server": {},
            "op": {},
            "uri": {},
            "name": {},
            "arguments": {},
            "reference": {},
            "argument": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "mcp.resource"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "server",
            "op"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "server": {},
            "tool": {},
            "args": {},
            "idempotency": {},
            "breaker": {},
            "rate": {},
            "detach": {},
            "input": {},
            "payment": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "mcp.tool"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "server",
            "tool"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "key": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "memory.delete"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "key"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "key": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "memory.get"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "key"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "prefix": {},
            "limit": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "memory.list"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "key": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "memory.pop"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "key"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "key": {},
            "value": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "memory.push"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "key",
            "value"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "key": {},
            "value": {},
            "ttl": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "memory.set"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "key",
            "value"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "key": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "memory.shift"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "key"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "to": {},
            "text": {},
            "parts": {},
            "wait": {},
            "timeout": {
              "type": "string"
            },
            "on_timeout": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "message"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "to"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "noop"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "policy": {},
            "inputs": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "once"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "branches": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": {
                "$ref": "#/$defs/body"
              }
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "min_success": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "parallel"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "branches"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "text": {},
            "format": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "parse"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "text"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "branches": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": {
                "$ref": "#/$defs/body"
              }
            },
            "timeout": {
              "type": "string"
            },
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "race"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "branches"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "over": {},
            "expr": {},
            "initial": {},
            "as": {},
            "acc": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "reduce"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "over",
            "expr"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "input": {},
            "choices": {},
            "prompt": {},
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "model": {},
            "confidence": {},
            "on_unsure": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "route"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "input",
            "choices"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "cron": {},
            "every": {},
            "at": {},
            "inputs": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "schedule"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "url": {},
            "max_bytes": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "search.fetch"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "url"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "query": {},
            "kind": {
              "const": "search.query"
            },
            "limit": {},
            "freshness": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "query"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "name": {},
            "filter": {},
            "inputs": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "signal"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "name"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "duration": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "sleep"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "duration"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "over": {},
            "by": {},
            "order": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "sort"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "over"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "stream": {},
            "subject": {},
            "filter": {},
            "from": {},
            "rate": {},
            "batch": {},
            "inputs": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "stream"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "stream"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "instruction": {},
            "template": {},
            "params": {},
            "mode": {},
            "tools": {},
            "servers": {},
            "limits": {},
            "priority": {},
            "context": {},
            "output_contract": {},
            "output_schema": {
              "type": "object"
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "durable": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "subagent"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "body": {
              "$ref": "#/$defs/body"
            },
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "subgraph"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "body"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "server": {},
            "uri": {},
            "debounce_ms": {},
            "filter": {},
            "window": {},
            "inputs": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "subscribe"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "server",
            "uri"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "input": {},
            "length": {},
            "prompt": {},
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "model": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "summarize"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "input"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "on": {},
            "cases": {
              "type": "object",
              "additionalProperties": {
                "type": "string",
                "pattern": "^[A-Za-z_][A-Za-z0-9_-]{0,63}$"
              }
            },
            "default": {
              "type": "string",
              "pattern": "^[A-Za-z_][A-Za-z0-9_-]{0,63}$"
            },
            "on_no_match": {
              "enum": [
                "fail",
                "skip"
              ]
            },
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "switch"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "on",
            "cases"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "text": {},
            "value": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "template"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "prompt": {},
            "output_schema": {
              "type": "object"
            },
            "reads": {},
            "check": {},
            "retries": {},
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "system": {},
            "model": {},
            "effort": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "think"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "prompt"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "name": {},
            "args": {},
            "detach": {},
            "input": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "tool"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "name"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "value": {},
            "writes": {},
            "mode": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "transform"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "value": {},
            "schema": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "validate"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "value",
            "schema"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "on": {},
            "server": {},
            "uri": {},
            "condition": {},
            "signal": {},
            "run": {},
            "subagent": {},
            "conversation": {},
            "from": {},
            "webhook": {},
            "stream": {},
            "subject": {},
            "subscribe": {},
            "match": {},
            "task": {},
            "timeout": {
              "type": "string"
            },
            "on_timeout": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "wait"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "on"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "path": {},
            "methods": {},
            "auth": {},
            "parallelism": {},
            "on_overflow": {},
            "rate": {},
            "idempotency": {},
            "respond": {},
            "filter": {},
            "inputs": {},
            "signal": {},
            "into": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "webhook"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "path"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "name": {},
            "inputs": {},
            "mode": {},
            "start": {},
            "version": {},
            "cascade": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "workflow"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "name"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "run": {},
            "reason": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "workflow.cancel"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "run"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "name": {},
            "payload": {},
            "run": {},
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "workflow.signal"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "name"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "run": {},
            "timeout": {
              "type": "string"
            },
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "const": "workflow.wait"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind",
            "run"
          ],
          "additionalProperties": false,
          "patternProperties": {
            "^x-[a-z0-9_.-]+$": {}
          }
        },
        {
          "type": "object",
          "properties": {
            "budget": {
              "type": "integer"
            },
            "cache": {
              "type": "object"
            },
            "depends_on": {
              "items": {
                "type": "string"
              },
              "type": "array",
              "uniqueItems": true
            },
            "description": {
              "type": "string"
            },
            "idempotent": {
              "type": "boolean"
            },
            "kind": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9-]*:[a-z][a-z0-9-]*$"
            },
            "on_error": {
              "type": "string",
              "pattern": "^(fail|continue|goto:[A-Za-z_][A-Za-z0-9_-]{0,63})$"
            },
            "on_replay": {
              "enum": [
                "retry",
                "skip",
                "fail"
              ]
            },
            "otel": {
              "type": "object"
            },
            "output_schema": {
              "type": "object"
            },
            "retry": {
              "properties": {
                "backoff": {
                  "type": "string"
                },
                "max": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 20
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "skills": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "timeout": {
              "type": "string"
            },
            "when": {
              "anyOf": [
                {
                  "description": "a CEL guard: the step runs only when it is true",
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "description": "a decision guard (asked as the decide step `<id>.when`): the step runs only when the statement holds, surely; otherwise it is pruned",
                  "properties": {
                    "confidence": {
                      "description": "the least confidence the guard holds at; default roles.decide's",
                      "maximum": 1,
                      "minimum": 0,
                      "type": "number"
                    },
                    "model": {
                      "description": "the model that decides; default roles.decide",
                      "type": "string"
                    },
                    "noul": {
                      "description": "the statement the step runs on when it holds",
                      "minLength": 1,
                      "type": "string"
                    },
                    "state": {
                      "description": "what is decided about (a value or template); default: the outputs of depends_on by step id, or the inputs (a foreach/batch element in its body)"
                    }
                  },
                  "required": [
                    "noul"
                  ],
                  "type": "object"
                }
              ]
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": true,
          "$comment": "An installed extension manifest must validate this node and supply its execution contract before activation."
        }
      ]
    },
    "body": {
      "type": "object",
      "properties": {
        "steps": {
          "$ref": "#/$defs/steps"
        }
      },
      "required": [
        "steps"
      ],
      "additionalProperties": false
    },
    "steps": {
      "type": "object",
      "minProperties": 1,
      "maxProperties": 512,
      "propertyNames": {
        "pattern": "^[A-Za-z_][A-Za-z0-9_-]{0,63}$"
      },
      "additionalProperties": {
        "$ref": "#/$defs/step"
      }
    }
  }
}
