A parallel flow runs independent agents concurrently on the same input, then combines their analyses. It suits tasks that benefit from multiple viewpoints, such as business evaluation, code review, or research across subtopics. section 9.3 section 9.3.3
Implement the flow as an Agent with an asynchronous run() method. Capture the existing context length, invoke every agent with asyncio.gather(), and merge the returned events. Copy earlier context first, append only events generated after the captured boundary, remove duplicate user events, and use event.author to preserve each agent’s identity. Combine final outputs with an agent-name header. section 9.3.1 section 9.3.3
Three-perspective startup analysis
Create optimist, pessimist, and realist agents with focused instructions, place them in ParallelWorkflow, and run them on an AI education-platform startup idea. The resulting output preserves each perspective while presenting a single merged result. section 9.3.3
Listing 9.4 Workflow design: Agent inheritance
class SequentialWorkflow(Agent):
async def run(self, user_input=None, context=None, verbose=False) -> AgentResult:
...
class ParallelWorkflow(Agent):
async def run(self, user_input=None, context=None, verbose=False) -> AgentResult:
...
class LoopWorkflow(Agent):
async def run(self, user_input=None, context=None, verbose=False) -> AgentResult:
...
Use the workflow inheritance listing to inspect the shared Agent interface and compose parallel flows inside larger workflows. section 9.3.1 section 9.3.5

