A flow is a block that owns the steps inside it. The end keyword closes it.
agentflow-beta TB
flow worker["Worker"]
job["Do the job"]@{ shape: task }
endThe word after shape: says what the step is. input, task, tool, decision, action and refdoc are the six.
agentflow-beta LR
brief["Brief"]@{ shape: input }
draft["Draft copy"]@{ shape: task }
check["spell_check"]@{ shape: tool }
guide["Style guide"]@{ shape: refdoc }
ship["Publish"]@{ shape: action }
ok["Ready?"]@{ shape: decision }
brief --> draft --> check --> ship
ok --> shipA labelled arrow says why. A cross is a retry, and a dotted line points at something to read.
agentflow-beta TB
check["Tests pass?"]@{ shape: decision }
ship["Ship it"]@{ shape: action }
fix["Fix the build"]@{ shape: task }
logs["Build logs"]@{ shape: refdoc }
check -- yes --> ship
check -- no --> fix
fix --x check
fix -.- logsA flow can hold other flows. The inner ones are the sub-agents.
agentflow-beta TB
flow team["Content Team"]
flow researcher["Researcher"]
gather["Gather sources"]@{ shape: task }
end
flow writer["Writer"]
compose["Compose draft"]@{ shape: task }
end
researcher --> writer
end