microsoft / microsoft/agent-framework

.NET: [Feature]: Expose ExecutorId for AgentResponseUpdate when using workflow\.AsAgent().RunStreamingAsync()

Open
#4,445 4 comments 0 reactions 1 assignee View on GitHub

@baywet is already working on this.

Since Aug 28, 2026.

.NET workflows
Dominant language
Python
Stars
13.6k
Forks
2.3k
Avg merge
2d 45m
Merged PRs (30d)
358

Description

Description

Background / Why this matters

At the workflow event layer, the framework already provides executor attribution: AgentResponseUpdateEvent (a workflow output event) exposes the ExecutorId of the executor that produced the update.
However, when consuming streaming output through the agent interface (workflow.AsAgent().RunStreamingAsync()), we receive only AgentResponseUpdate objects, and AgentResponseUpdate does not expose ExecutorId / SourceId.
This prevents common scenarios such as attributing streaming output to the correct workflow node for UI rendering, observability/log correlation, and debugging in multi-executor workflows.


Current behavior (Actual)

  • workflow.AsAgent() returns an AIAgent that supports RunStreamingAsync() and yields IAsyncEnumerable<AgentResponseUpdate>.
  • AgentResponseUpdate includes agent-level metadata (e.g., AgentId) and general fields such as Text, Contents, and RawRepresentation, but it does not include an executor identifier (ExecutorId / SourceId).
  • In the workflow-as-agent conversion path (WorkflowSession.InvokeStageAsync()), when the stream receives an AgentResponseUpdateEvent (which has ExecutorId), the code yields only agentUpdate.Update, dropping the wrapper event that contains the executor id.

Expected behavior

When iterating streaming updates from a workflow wrapped as an agent, each streamed update should provide a way to identify the originating workflow executor (via ExecutorId or equivalent), so consumers can reliably attribute updates to workflow nodes.

Example consumer code (illustrative):

await foreach (var update in workflow.AsAgent().RunStreamingAsync(messages, session))
{
    // Need to know which workflow executor produced this update (ExecutorId)
}

Repro steps

  1. Build a workflow with multiple executors/agents (e.g., sequential pipeline).
  2. Convert it to an agent with workflow.AsAgent().
  3. Call RunStreamingAsync() and enumerate AgentResponseUpdate updates.
  4. Observe that updates cannot be attributed to an executor because ExecutorId is not available on AgentResponseUpdate, and the wrapper event containing ExecutorId is not propagated in this path.

Notes

  • AgentResponseUpdateEvent exposes ExecutorId at the workflow event level.
  • The workflow-as-agent streaming conversion currently returns only AgentResponseUpdate for agent updates, without preserving or surfacing the executor id carried by the event wrapper.

Environment

  • Package: Microsoft.Agents.AI.Workflows (e.g., 1.0.0-rc2)
  • .NET: 8/9/10
  • Usage: workflow.AsAgent() + RunStreamingAsync()
Code Sample

Language/SDK

.NET

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.