Repository navigation
Replies: 3 comments
|
Thanks for raising this! The good news is that AG-UI now natively supports MAF workflows, so you no longer need to wrap your workflow with Use from agent_framework.ag_ui import AgentFrameworkWorkflow, add_agent_framework_fastapi_endpoint
from fastapi import FastAPI
app = FastAPI()
demo_workflow = AgentFrameworkWorkflow(
workflow_factory=lambda _thread_id: workflow, # your built workflow
name="my_workflow",
description="Streaming workflow demo",
)
add_agent_framework_fastapi_endpoint(
app=app,
agent=demo_workflow,
path="/my-endpoint",
)The For a full working example, check out the AG-UI Workflow Handoff demo. |
|
One thing I’ve found useful with multi-agent workflows is keeping the UI protocol separate from the orchestration model. The workflow should own coordination and participant transitions, while AG-UI should ideally just expose the resulting events consistently to the client. This becomes especially noticeable once you introduce dynamic orchestration or remote agents, because you don’t want UI concerns influencing how the agents themselves coordinate. I’ve been experimenting with multi-agent orchestration and A2A patterns in .NET here: I’m also interested in how others are handling event correlation when multiple agents are producing streamed output in the same workflow. |
|
I’ve run into a similar architectural question around WorkflowAgent streaming. From an application perspective, I’d ideally want the workflow boundary to preserve incremental updates rather than effectively turning a multi-step execution into a small number of large aggregated chunks. That becomes particularly important for UI responsiveness, observability and long-running multi-agent workflows. I’ve been working on workflow, OpenTelemetry and multi-agent patterns in .NET here: I’d be interested in whether the intended model is for WorkflowAgent to expose fine-grained underlying workflow events, or whether consumers are expected to observe those through the workflow execution layer separately. |
Uh oh!
There was an error while loading. Please reload this page.
Issue
When using
workflow.as_agent().run(stream=True), workflow agents buffer responses into large text chunks instead of streaming individual tokens like single agents.Code Comparison
Single Agent (✅ Token-level streaming works)
Workflow Agent (❌ Buffering issue)
Comparison
Single Agent :
Workflow Agent (Current Issue):
Question
The workflow loses token-level granularity essential for real time streaming UIs (For AGUI)
How can we preserve token-by-token streaming when using workflow.as_agent().run(stream=True)? 🙏
All reactions