Skip to content

.NET: feat: adds the executorId as an additional property when running the workflow as agent in dotnet - #7934

Open
Vincent Biret (baywet) wants to merge 13 commits into
mainfrom
feat/workflow-as-agent-executor-id-dotnet
Open

Vincent Biret (baywet) wants to merge 13 commits into
mainfrom
feat/workflow-as-agent-executor-id-dotnet

Conversation

@baywet

Copy link
Copy Markdown
Member

fixes #4445

Copilot AI balanced review requested due to automatic review settings August 28, 2026 12:53
@agent-framework-automation agent-framework-automation Bot added .NET Usage: [Issues, PRs], Target: .Net workflows Usage: [Issues, PRs], Target: Workflows labels Aug 28, 2026
@github-actions github-actions Bot changed the title feat: adds the executorId as an additional property when running the workflow as agent in dotnet .NET: feat: adds the executorId as an additional property when running the workflow as agent in dotnet Aug 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds workflow executor attribution to streamed .NET agent response updates.

Changes:

  • Adds a public executorId metadata key.
  • Attaches executor IDs to response updates.
  • Adds multi-executor streaming coverage.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
WorkflowAgentAdditionalProperties.cs Defines the executor ID key.
AgentResponseUpdateEvent.cs Adds attribution metadata to updates.
WorkflowHostSmokeTests.cs Tests attribution and metadata preservation.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread dotnet/src/Microsoft.Agents.AI.Workflows/AgentResponseUpdateEvent.cs Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
github-actions[bot]

This comment was marked as outdated.

This comment was marked as outdated.

…cross execution methods

Signed-off-by: Vincent Biret <vibiret@microsoft.com>
…revious inputs for the executorId

Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Throw.IfNull(message);

return new(message.Role, message.Contents)
return SetExecutorId(new(message.Role, message.Contents)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The behaviour pre-existed this change, Tao Chen (@TaoChenOSU) to confirm whether we should fix that or not

MessageId = Guid.NewGuid().ToString("N"),
Role = ChatRole.Assistant,
ResponseId = this.LastResponseId,
RawRepresentation = evt

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I'm wrong, but I would have thought that the raw representation would typically be some sort of WorkflowEvent, and if so, that users could get the executor id from that.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think I have enough context to reply to this comment. Why should it be a WorkflowEvent as opposed to an Executor Event? What parameters are you taking into consideration for this design suggestion?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really know enough about this area either to know all the different raw representation types that might be represented here, but I think it's a good thing to verify before making the change.
Peter Ibekwe (@peibekwe), might have a better sense.

Comment thread dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowSession.cs
Co-authored-by: SergeyMenshykh <68852919+SergeyMenshykh@users.noreply.github.com>
/// <summary>
/// Defines additional property keys used by workflow-hosted agents.
/// </summary>
public static class WorkflowAgentAdditionalProperties

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: If we are unsure about something new that is public we often mark it as experimental, to make sure we can still make changes to it before graduating the feature. We then remove experimental once we are happy with the overall change.
Not sure if that is applicable here, but just an FYI.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks I think Tao Chen (@TaoChenOSU) and Peter Ibekwe (@peibekwe) will be able to inform the design here and whether or not we need to add those experimental aspects.

@baywet

Copy link
Copy Markdown
Member Author

worth exploring this instead of magic keys in a dictionary

update.RawRepresentation is ExecutorEvent exevt
exevt.ExecutorId

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET Usage: [Issues, PRs], Target: .Net workflows Usage: [Issues, PRs], Target: Workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

4 participants