/ examples / consolidated_params / basic_workflow.py
basic_workflow.py
 1  """Basic workflow example with consolidated params."""
 2  from praisonaiagents import Agent
 3  from praisonaiagents import AgentFlow, Task
 4  
 5  # Create agents
 6  writer = Agent(instructions="You are a content writer.")
 7  editor = Agent(instructions="You are an editor.")
 8  
 9  # Create workflow with consolidated params
10  workflow = AgentFlow(
11      name="Content Pipeline",
12      steps=[
13          Task(name="write", agent=writer, action="Write about {{topic}}"),
14          Task(name="edit", agent=editor, action="Edit the content", context=["write"]),
15      ],
16      output="verbose",
17      planning=True,
18  )
19  
20  if __name__ == "__main__":
21      result = workflow.run(variables={"topic": "AI agents"})
22      print(result)