Workflows

Workflow examples

Start with a complete workflow, run it as-is, then replace the agent and tool names with ones from your AXL deployment. Every example is compiled as part of AXL's test suite.

If you want to…Example sourceGuided walkthrough
Build the smallest model workflowhello.axgHello, workflow
Call a tool and return its resulttool_call.axgCall a tool
Keep going after a step failserror_route.axgKeep going after a step fails
Route work with conditional branchestriage_branch.axgBranching
Run independent steps concurrentlyparallel_join.axgRun in parallel
Process every item in a collectionmap_node.axgFan out over a collection
Improve a result until it passes a conditionrefine_loop.axgDraft and refine
Pause a run for a person's decisionhuman_approval.axgPause for approval
Coordinate durable runs with eventsevent_driven.axgCoordinate with events
Invoke a registered child workflowsub_workflow.axgCompose a sub-workflow
Research, branch on findings, and notifyresearch_and_notify.axgCombine the patterns

Run an example

Download a source file or use it directly from a clone of the repository:

curl -sX POST "$AXL_HOST/api/v1/workflow/flow/source?name=hello" \
  -H "Authorization: Bearer $TOKEN" \
  --data-binary @docs/workflows/examples/hello.axg

Then submit a run using the returned workflow hash. See Quickstart for the complete compile, submit, and observe loop.

Read the Language Guide when you need the syntax behind a pattern.

Next

On this page