Flows: @start and @listen
A Flow is a Python class whose methods run when something happens, not when you call them. Send two refund requests through one Flow and watch @start, @router and @listen choose the route while state keeps the facts.
10 minPro
Checking your access…
Inside this lesson
- An animation you play, pause and step through, with each part saying what it is doing.
- The real code beside it, with the lines for each step lit up.
- Practice mode, where you route each message yourself, and a short quiz.
- About 10 minutes.
Written from the official documentation
In this module: Flows
- Flows: @start and @listenSteps that fire on events, with shared state.Pro
- Flow state and persistenceUnstructured or Pydantic state, and @persist to save it.Pro
- Flow control: or_, and_ and @routerJoining branches and routing on a result.Pro
- Agents and crews inside flowsA flow project that calls crews, plus plots and kickoff.Pro
- Human input and feedbackPutting a person in the loop.Pro
- The @human_feedback decoratorApprove, reject or revise inside a flow, sync or async.Pro
- Conversational flowsMulti turn chat with handle_turn, history and intent routing.Pro