Workflow syntax
A workflow has a format version, a process name, optional input typing, at least one decision, and at least one flow entry.
version: 1process: department_routinginput: type: jsondecisions: department: decide: one_of question: Which team should handle this ticket? options: billing: Payments, refunds, invoices support: Product problems and bugs sales: New purchasesflow: - else: do: return value: route: "{{ department.value }}"Top-level fields
Section titled “Top-level fields”| Field | Meaning |
|---|---|
version |
Must be 1. |
process |
Nonempty workflow name. For Cloud, use an identifier beginning with a letter or underscore, followed by letters, digits, or underscores (maximum 120 characters). |
input.type |
Optional: json or text. |
decisions |
Named definitions using one_of, whether, or scale. |
flow |
Ordered conditional returns and an optional final else. |
Decision identifiers start with a letter or underscore and contain only letters, digits, and underscores.
Inputs
Section titled “Inputs”For JSON workflows, --input reads and parses a JSON file. For text workflows, it reads a file verbatim; --text accepts a literal string.
If input.type is omitted, the runtime permits text or JSON-compatible state. The CLI treats --input as JSON in that case. The input declaration does not define a custom JSON schema.
Validation
Section titled “Validation”banh validate workflow.yamlUnknown fields, duplicate YAML keys, non-string mapping keys, YAML aliases, unsupported expressions, and invalid references are rejected. Validation never loads a model.
See decisions and confidence and flow rules and return values for the execution semantics.