How It Works
- All three analysts receive the same input.
- They execute concurrently (asyncio tasks).
- Results are combined as
[step_name]: contentin the output.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Execute multiple steps concurrently and combine results.
from definable.agent import Agent
from definable.agent.workflow import Workflow, Parallel, Step
tech_analyst = Agent(model="gpt-4o", instructions="Analyze technical feasibility.")
biz_analyst = Agent(model="gpt-4o", instructions="Analyze business viability.")
legal_analyst = Agent(model="gpt-4o", instructions="Analyze legal and compliance risks.")
workflow = Workflow(
name="multi-analysis",
steps=[
Parallel(name="analysis", steps=[
Step(name="technical", agent=tech_analyst),
Step(name="business", agent=biz_analyst),
Step(name="legal", agent=legal_analyst),
]),
],
)
result = await workflow.arun("Evaluate launching an AI-powered hiring tool")
[step_name]: content in the output.Parallel(
name="analysis",
steps=[...],
max_concurrency=2, # Only 2 steps run at a time
)
workflow = Workflow(
name="pipeline",
steps=[
# Step 1: Research in parallel
Parallel(name="research", steps=[
Step(name="web", agent=web_researcher),
Step(name="papers", agent=paper_reader),
]),
# Step 2: Synthesize (receives both parallel outputs)
Step(name="synthesizer", agent=synthesizer),
],
)