When using the following code
var workflowAsAgent = builder
.AddWorkflow("science-workflow", (sp, key) => { ... })
.AddAsAIAgent(); // Now the workflow can be used as an agent
from https://learn.microsoft.com/en-us/agent-framework/get-started/hosting?pivots=programming-language-csharp#expose-workflow-as-aiagent, then the workflow output is not sent back to the user.
E.g. when using it with app.MapOpenAIResponses(); / app.MapOpenAIConversations(); for DevUI, then the final non-streaming/response.completed JSON still has "output": [] even though the SSE stream carries a WorkflowOutputEvent with the full text. That's because AddAsAIAgent() defaults includeWorkflowOutputsInResponse: false; the WorkflowHostAgent only forwards content (not full chat messages) for terminal outputs in that mode, and the OpenAI-Responses mapping in Microsoft.Agents.AI.Hosting doesn't currently promote that content into response.output.
When using the following code
from https://learn.microsoft.com/en-us/agent-framework/get-started/hosting?pivots=programming-language-csharp#expose-workflow-as-aiagent, then the workflow output is not sent back to the user.
E.g. when using it with app.MapOpenAIResponses(); / app.MapOpenAIConversations(); for DevUI, then the final non-streaming/response.completed JSON still has "output": [] even though the SSE stream carries a WorkflowOutputEvent with the full text. That's because AddAsAIAgent() defaults includeWorkflowOutputsInResponse: false; the WorkflowHostAgent only forwards content (not full chat messages) for terminal outputs in that mode, and the OpenAI-Responses mapping in Microsoft.Agents.AI.Hosting doesn't currently promote that content into response.output.