from agno.workflow import RemoteWorkflow
workflow = RemoteWorkflow(
base_url="http://localhost:7778", # Running on localhost for this example
workflow_id="story-workflow",
)
print("Workflow Response: ", end="", flush=True)
async for event in workflow.arun(
"Write a story about space exploration",
stream=True,
):
# Handle content from agent steps or workflow completion
if event.event == "RunContent" and hasattr(event, "content"):
print(event.content, end="", flush=True)
elif event.event == "WorkflowAgentCompleted" and hasattr(event, "content"):
if event.content:
print(event.content, end="", flush=True)