Skip to content

.NET: [BREAKING] Unify ExecutorIsh and ExecutorRegistration, unify/simplify APIs#1637

Merged
lokitoth merged 3 commits into
mainfrom
dev/dotnet_workflow/executor_registration_api
Nov 3, 2025
Merged

.NET: [BREAKING] Unify ExecutorIsh and ExecutorRegistration, unify/simplify APIs#1637
lokitoth merged 3 commits into
mainfrom
dev/dotnet_workflow/executor_registration_api

Conversation

@lokitoth

@lokitoth lokitoth commented Oct 22, 2025

Copy link
Copy Markdown
Contributor

Motivation and Context

ExecutorIsh, a type built to work around the lack of full support for anonymous discriminated unions in .NET, leads to confusion, and makes it difficult to find how to integrate Executor-like types into a workflow. It also duplicates some functionality with ExecutorRegistration, and now that something broke in F#'s ability to feed the auto-cast types to WorkflowBuilder the value of the split between the two is lowered.

Description

Breaking:

  • Removes ExecutorIsh type, in favour of ExecutorRegistration
  • Obsoletes .ConfigureFactory() and .ConfigureSubworkflow() extension methods in favour of .RegisterExecutor() and .AsExecutor(), respectively

Relevant Issues:

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

Copilot AI review requested due to automatic review settings October 22, 2025 19:18
@markwallace-microsoft markwallace-microsoft added .NET Usage: [Issues, PRs], Target: .Net workflows Usage: [Issues, PRs], Target: Workflows labels Oct 22, 2025
@lokitoth lokitoth changed the title .NET: [BREAKING] .NET: [BREAKING] Unify ExecutorIsh and ExecutorRegistration, unify/simplify APIs Oct 22, 2025
@lokitoth lokitoth force-pushed the dev/dotnet_workflow/executor_registration_api branch from 8d015db to b2978c4 Compare October 22, 2025 19:20
@lokitoth lokitoth added the breaking change Usage: [PRs], Target: all PRs that introduce changes that are not backward compatible label Oct 22, 2025

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

This PR removes the ExecutorIsh type and unifies its functionality with ExecutorRegistration, now implemented as a record-based type hierarchy. The change simplifies the API by normalizing extension methods to .AsExecutor() and .RegisterExecutor(), while obsoleting older methods like .ConfigureFactory() and .ConfigureSubworkflow().

Key Changes:

  • Replaced ExecutorIsh with an abstract ExecutorRegistration record class hierarchy
  • Added concrete registration types: ExecutorInstanceRegistration, SubworkflowRegistration, RequestPortRegistration, AIAgentRegistration, PlaceholderRegistration, and ConfiguredExecutorRegistration
  • Updated all extension methods to use .AsExecutor() and .RegisterExecutor() naming conventions

Reviewed Changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
ExecutorIsh.cs Deleted file - entire ExecutorIsh type removed
ExecutorRegistration.cs Converted from internal sealed class to public abstract record class with type hierarchy
ExecutorRegistrationExtensions.cs New file containing unified extension methods for creating registrations
ExecutorInstanceRegistration.cs New registration type for executor instances
SubworkflowRegistration.cs New registration type for workflows used as executors
RequestPortRegistration.cs New registration type for request ports
AIAgentRegistration.cs New registration type for AI agents
PlaceholderRegistration.cs New registration type for unbound executor references
ConfiguredExecutorRegistration.cs New registration type for configured executors
WorkflowBuilder.cs Updated to use ExecutorRegistration instead of ExecutorIsh
Workflow.cs Updated property names and reset logic for new registration model
Sample files Updated to use new .AsExecutor() and .RegisterExecutor() methods

Comment thread dotnet/src/Microsoft.Agents.AI.Workflows/ExecutorRegistrationExtensions.cs Outdated
Comment thread dotnet/src/Microsoft.Agents.AI.Workflows/ExecutorRegistrationExtensions.cs Outdated
Comment thread dotnet/src/Microsoft.Agents.AI.Workflows/ExecutorRegistrationExtensions.cs Outdated
Comment thread dotnet/src/Microsoft.Agents.AI.Workflows/ExecutorRegistrationExtensions.cs Outdated
Comment thread dotnet/src/Microsoft.Agents.AI.Workflows/ExecutorRegistrationExtensions.cs Outdated
Comment thread dotnet/src/Microsoft.Agents.AI.Workflows/ExecutorRegistrationExtensions.cs Outdated
Comment thread dotnet/src/Microsoft.Agents.AI.Workflows/ExecutorRegistrationExtensions.cs Outdated
Comment thread dotnet/src/Microsoft.Agents.AI.Workflows/ExecutorRegistrationExtensions.cs Outdated
Comment thread dotnet/src/Microsoft.Agents.AI.Workflows/ExecutorRegistrationExtensions.cs Outdated
Comment thread dotnet/src/Microsoft.Agents.AI.Workflows/ExecutorRegistration.cs Outdated
@lokitoth lokitoth force-pushed the dev/dotnet_workflow/executor_registration_api branch from b2978c4 to 8549eae Compare October 22, 2025 19:24
@lokitoth lokitoth force-pushed the dev/dotnet_workflow/executor_registration_api branch from 8549eae to 240deb3 Compare October 22, 2025 19:27
@crickman crickman assigned crickman and lokitoth and unassigned crickman Oct 22, 2025
@crickman crickman moved this to In Review in Agent Framework Oct 22, 2025
@crickman

Copy link
Copy Markdown
Contributor

Good riddance Executorish (imho).

@crickman

Copy link
Copy Markdown
Contributor

For thew new public registration types, is there sample debt being incurred here? If so, can some issues be created to track new samples that might be desired?

@crickman

Copy link
Copy Markdown
Contributor

Are there any patterns here that should be channeled back into the python platform? @ekzhu?

@crickman crickman requested a review from ekzhu October 22, 2025 21:30
@crickman

Copy link
Copy Markdown
Contributor

Do we have tests that cover the issues being closed?

@lokitoth lokitoth force-pushed the dev/dotnet_workflow/executor_registration_api branch from 240deb3 to 7cab9ad Compare October 22, 2025 21:43
@markwallace-microsoft markwallace-microsoft added the documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs label Oct 30, 2025
@lokitoth lokitoth force-pushed the dev/dotnet_workflow/executor_registration_api branch from 83af7d5 to c45bb5c Compare November 3, 2025 14:24
@lokitoth lokitoth force-pushed the dev/dotnet_workflow/executor_registration_api branch from c45bb5c to 6bcac73 Compare November 3, 2025 15:53
Comment thread dotnet/src/Microsoft.Agents.AI.Workflows/Checkpointing/WorkflowInfo.cs Outdated
Comment thread dotnet/src/Microsoft.Agents.AI.Workflows/Visualization/WorkflowVisualizer.cs Outdated
Comment thread dotnet/src/Microsoft.Agents.AI.Workflows/ExecutorBindingExtensions.cs Outdated
@lokitoth lokitoth force-pushed the dev/dotnet_workflow/executor_registration_api branch from 6bcac73 to 42cde51 Compare November 3, 2025 17:24
* Switch to more modern Record type-tree for Sum Types
* Unify APIs for getting ExecutorBinding
* Fix an issue where workflows consisting entirely of cross-run shareable executors which are not instance-resettable do not properly clear state when running non-concurrently.
@lokitoth lokitoth force-pushed the dev/dotnet_workflow/executor_registration_api branch from 42cde51 to a333131 Compare November 3, 2025 18:13
@lokitoth lokitoth added this pull request to the merge queue Nov 3, 2025
Merged via the queue into main with commit b25b0af Nov 3, 2025
15 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in Agent Framework Nov 3, 2025
@mikeholczer

mikeholczer commented Nov 5, 2025

Copy link
Copy Markdown

I hope this is an OK place to ask this, but I'm seeing that in these changes in AIAgentBinding that the ExecutorBinding constructor is passed the AIAgent's Name if it;'s not null and otherwise the AIAgent's Id and in ExecutorBinding.CheckId there is a check that the Executor's Id matches the ExecutorBinding's Id. On the otherhand the AIAgentHostExecutor's constructor always passes the AIAgent's Id to it's base classes constructor. That creates a mismatch if an AIAgent has it's Name and Id set to different values.

I don't know if that's a bug, or if it's not intended that one would set both the Name and Id of a AIAgent.

@mikeholczer

Copy link
Copy Markdown

Looks like #1840 addressed the issue I was having.

@crickman crickman deleted the dev/dotnet_workflow/executor_registration_api branch November 11, 2025 16:22
arisng pushed a commit to arisng/agent-framework that referenced this pull request Feb 2, 2026
Concurrent run support was recently added to workflows, but Orchestrations did not fully update to support it. A few executors were missing Cross-Run Shareable annotations, and the ConcurrentEnd executor needed to be factory-instantiated.

This also ports the fix for microsoft#1613 from microsoft#1637, to avoid waiting on that PR.
arisng pushed a commit to arisng/agent-framework that referenced this pull request Feb 2, 2026
…mplify APIs (microsoft#1637)

* refactor: Unify ExecutorIsh and ExecutorRegistration => ExecutorBinding

* Switch to more modern Record type-tree for Sum Types
* Unify APIs for getting ExecutorBinding
* Fix an issue where workflows consisting entirely of cross-run shareable executors which are not instance-resettable do not properly clear state when running non-concurrently.

* feat: Simplify function-to-executor pattern

* refactor: Normalize API naming
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Usage: [PRs], Target: all PRs that introduce changes that are not backward compatible documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs .NET Usage: [Issues, PRs], Target: .Net workflows Usage: [Issues, PRs], Target: Workflows

Projects

Status: Done

10 participants