Skip to content

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: 1
process: department_routing
input:
type: json
decisions:
department:
decide: one_of
question: Which team should handle this ticket?
options:
billing: Payments, refunds, invoices
support: Product problems and bugs
sales: New purchases
flow:
- else:
do: return
value:
route: "{{ department.value }}"
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.

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.

Terminal window
banh validate workflow.yaml

Unknown 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.