from agno.workflow import Parallel, Step, StepInput, StepOutput, Workflow
def research_hackernews(step_input: StepInput) -> StepOutput:
return StepOutput(content=f"HackerNews notes for {step_input.input}")
def research_web(step_input: StepInput) -> StepOutput:
return StepOutput(content=f"Web notes for {step_input.input}")
def research_papers(step_input: StepInput) -> StepOutput:
return StepOutput(content=f"Paper notes for {step_input.input}")
def synthesize(step_input: StepInput) -> StepOutput:
combined = step_input.previous_step_content or "No research returned"
return StepOutput(content=f"Synthesis:\n{combined}")
workflow = Workflow(
name="Parallel Research Pipeline",
steps=[
Parallel(
Step(name="HackerNews Research", executor=research_hackernews),
Step(name="Web Research", executor=research_web),
Step(name="Academic Research", executor=research_papers),
name="Research Step",
),
Step(name="Synthesis", executor=synthesize),
],
)
workflow.print_response("Write about the latest AI developments", markdown=True)