Write a workflow
A workflow is a package: a folder with workflow.yaml and the files it references (profiles, schemas,
templates, scripts, knowledge). You can write it by hand, start from a template, or
build it with chat.
-
Start from a template.
Terminal window npx azhi init my-report # the weekly quality report (default)npx azhi init my-digest -t ci-digestnpx azhi init my-delivery -t sdlc # feature delivery with design and release gates -
Validate locally. Compiles the package and prints diagnostics: graph, ref types against output schemas, tool arguments and projections, CEL, taint.
Terminal window npx azhi validate my-reportnpx azhi validate my-report -c azhi.config.yaml # also checks the toolsnpx azhi schema # print the workflow JSON Schema (2.x) -
Register tools and read the plan.
Terminal window npx azhi apply my-report/azhi.config.yamlnpx azhi plan my-report -
Test one node on a fixture, with writes mocked.
Terminal window npx azhi test-node metrics my-report -f fixtures/metrics.json -
Run it.
Terminal window npx azhi run my-report -i team=payments --waitnpx azhi inspect <run-id> -
Publish and schedule. A published version’s
trigger.schedulebecomes the workflow’s schedule, in an IANA timezone.Terminal window npx azhi publish my-reportnpx azhi schedule my-report --cron "0 8 * * 1" --timezone Asia/Kolkata
Anatomy
Section titled “Anatomy”schema_version: "2.0"id: quality-reportname: Weekly quality reporttrigger: schedule: {cron: "0 8 * * 1", timezone: "Asia/Kolkata"} manual: trueinputs: type: object properties: {team: {type: string}} required: [team]config: channel: C-QUALITYnodes: # ... tool → script → agent → report → notify - id: post type: notify channel: slack destination: {ref: config.channel} message: {ref: nodes.report.output.markdown} guard: "args.channel == config.channel" # taint gate: analyse read untrusted dataHabits that pay off
Section titled “Habits that pay off”| Habit | Why |
|---|---|
Put numbers in a script and let the agent explain them | Authoritative figures, fewer tokens |
Use project: on tool nodes | The agent sees the fields it needs, not the whole payload |
Give every agent an output_schema and a budget | Validated output (with two repairs) and a spend cap |
| Gate every write after an agent with a guard or an approval | Otherwise it will not compile |
Run azhi plan in CI | Catches an unsatisfiable workflow before a scheduled run does |
Pin datasets by tag (name@approved) | Reproducible knowledge |