Skip to content

.Net: WIP: feat: Define Workflow and Executor APIs - #261

Merged
Jacob Alber (lokitoth) merged 48 commits into
mainfrom
dev/dotnet_workflow
Aug 13, 2025
Merged

.Net: WIP: feat: Define Workflow and Executor APIs#261
Jacob Alber (lokitoth) merged 48 commits into
mainfrom
dev/dotnet_workflow

Conversation

@lokitoth

@lokitothJacob Alber (lokitoth) commented Jul 28, 2025

Copy link
Copy Markdown
Contributor

Implements the Workflow APIs for .NET

TODOs:

  • Executor and Message Handling
  • Workflow Builder
  • Higher Order Edges
    • Loop
    • Chain
    • Fan In/Out
  • Execution on Runtime
  • State/Checkpointing (will be in folloup PR)
  • AoT Support
    • Factor out explicit handler registration
    • Fix ILTrim issues
    • Fix DynamicCodeExecution issues
    • Source Generator for ConfigureRoutes() (will be in folloup PR, if needed)
  • Source Documentation XML Comments
  • Address Remaining feedback

CopilotAI review requested due to automatic review settings July 28, 2025 20:12
@eavanvalkenburgEduard van Valkenburg (eavanvalkenburg) added the .NET Usage: [Issues, PRs], Target: .Net label Jul 28, 2025
@github-actionsgithub-actionsBot changed the title WIP: feat: Define Workflow and Executor APIs.Net: WIP: feat: Define Workflow and Executor APIsJul 28, 2025

CopilotAI 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 implements the foundational Workflow APIs for .NET, establishing the core architecture for orchestrating message-based executors within workflows. It introduces the executor pattern for handling typed messages, workflow builders for defining execution flow, and higher-order operations like loops, chains, and fan-in/fan-out patterns.

Key changes:

  • Core executor and message handling infrastructure with type-safe message routing
  • Workflow builder pattern for constructing execution graphs with conditional edges
  • Higher-order workflow operations (loops, chains, fan-in/out) for complex orchestration patterns

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
FileDescription
WorkflowBuilderExtensions.csImplements higher-order workflow operations and fan-in/out patterns
WorkflowBuilder.csCore workflow construction logic with executor tracking and edge management
TypeErasure.csUtility for handling generic ValueTask types in reflection scenarios
MessageRouting.csMessage dispatch system with reflection-based handler binding
MessageHandler.csCore interfaces for typed message handling
Message.csMessage wrapper types with metadata and retry functionality
Executor.csAbstract base class for workflow execution units
ExecutionContext.csInterface for execution services
DisposableObject.csBase class for async disposal pattern
CompletedValueTaskSource.csCompatibility utilities for ValueTask across framework versions
Comments suppressed due to low confidence (1)

dotnet/src/Microsoft.Agents.Orchestration/Workflows/WorkflowBuilderExtensions.cs:17

  • Missing closing parenthesis for the string interpolation expression. The line should end with ); instead of ";.
 throw new ArgumentNullException(nameof(value), $"Value cannot be null: {paramExpr}";

Comment threaddotnet/src/Microsoft.Agents.Orchestration/Workflows/WorkflowBuilder.cs Outdated
Comment threaddotnet/src/Microsoft.Agents.Orchestration/Workflows/Core/MessageRouting.cs Outdated

@crickmanChris (crickman) 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.

Are unit-tests and samples intended to be included in this change?

Comment threaddotnet/src/Microsoft.Agents.Orchestration/Workflows/Core/MessageRouting.cs Outdated
Comment threaddotnet/src/Microsoft.Agents.Orchestration/Workflows/WorkflowBuilder.cs Outdated
Comment threaddotnet/src/Microsoft.Agents.Orchestration/Workflows/WorkflowBuilder.cs Outdated
Comment threaddotnet/src/Microsoft.Agents.Orchestration/Workflows/Core/Message.cs Outdated
Comment threaddotnet/src/Microsoft.Agents.Orchestration/Workflows/Core/Executor.cs Outdated
@crickman

Copy link
Copy Markdown
Contributor

Should this be its own project independent from the specific orchestrations?

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

Labels

.NETUsage: [Issues, PRs], Target: .Net

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

8 participants

@lokitoth@crickman@stephentoub@ekzhu@TaoChenOSU@v1212@eavanvalkenburg