AI / CrewAI Interview Questions
Explain the execution flow of a CrewAI Flow using @start, @listen, and @router together?
- One or more methods decorated with @start fire when the Flow is kicked off, often running in parallel if multiple start methods are defined
- A method decorated with @listen, referencing a start method by name or reference, triggers automatically once that start method completes
- If routing logic is needed, a @router-decorated method evaluates the listener's output and determines which of several possible paths the Flow should follow next
- Downstream @listen methods react to whichever branch the router selected, potentially combining multiple conditions using and_ or or_
- Execution continues until no further listeners are triggered, at which point the output of the last completed method becomes the Flow's final result
This combination is what lets a Flow express genuinely branching, conditional automation, rather than the strictly linear execution a single Crew process provides on its own.
More Related questions...