Skip to content

Commit 839a4d1

Browse files
crickmanJacob Alberekzhu
authored
.NET: Add Declarative Workflow Interpreter (microsoft#401)
* test: Add Reflection/Invocation tests * fix: Terminate on Completion event * refactor: Update public API surface * feat: Add support for external requests * feat: Support hosting AIAgent instances in Workflows * fix: Fix routing to go through Executor.ExecuteAsync * test: Update samples for "must SendMessage" semantics * Add invoking samples to unit tests to avoid future breaks * fix: ExternalRequest should block Workflow completion * feat: Normalize API surface against Python * Also adds xmldoc to all public APIs * refactor: Normalize UnitTest and Sample namespaces * fix: Formatting * refactor: Normalize project/folder names * feat: Remove DynamicCodeExecution from ValueTaskTypeErasure * fix: Fix ILTrim warnings * docs: Add missing docs and fix typos * feat: Hosted Agents should report Run events * fix: Fix type propagation for ILTrim changes * refactor: Simplify DynamicallyAccessedMembers annotations * sample: Use static-Type construction of InputPort * feat: Support non-Streaming Run Mode * test: Add test for non-streaming execution * Conversion checkpoint * Fix namespace error * Restructure * Completion * Executor checkpoint * Conditional checkpoint * Cleanup * Exception cleanup * Sample cleanup * Updates * feat: Define Workflow and Executor APIs * feat: Define IExecutionContext and Events * feat: Simple Workflow Demos * refactor: Move Workflows classes to separate assembly * feat: Move FanOut/In to LowLevel API with new semantics * feat: Implement Local Execution * refactor: Assembly name .Workflow => .Workflows * feat: Enable Default Message Handling * also lifts Bind in MessageHandlerInfo to better be able to direclty invoke handlers (for AOT, later) * feat: Implement StreamingHandle APIs This allows the user to respond to WorkflowEvents with external messages, enabling HIL. * feat: Add checks for duplicate edges and chain cycles * feat: Add built-in WorkflowEvents * refactor: Pull classes into own files * refactor: Simplify Disposal pattern in Executor * refactor: Break EdgeRunner file into per-type files * refactor: Use Throw.IfNull() * refactor: Remove AddLoop() Per microsoft#272 (comment) we decided this was not very useful. * refactor: Normalize use of ValueTask * fix: Build Break from removing .AddLoop * refactor: Explicit routing and RouteBuilder Split out reflection from MessageRouter implemention into build phase, enabling AOT compilation to drive RouteBuilding without reflection. * test: Add Reflection/Invocation tests * fix: Terminate on Completion event * refactor: Update public API surface * feat: Add support for external requests * feat: Support hosting AIAgent instances in Workflows * fix: Fix routing to go through Executor.ExecuteAsync * test: Update samples for "must SendMessage" semantics * Add invoking samples to unit tests to avoid future breaks * fix: ExternalRequest should block Workflow completion * feat: Normalize API surface against Python * Also adds xmldoc to all public APIs * refactor: Normalize UnitTest and Sample namespaces * fix: Formatting * refactor: Normalize project/folder names * feat: Remove DynamicCodeExecution from ValueTaskTypeErasure * fix: Fix ILTrim warnings * docs: Add missing docs and fix typos * feat: Hosted Agents should report Run events * fix: Fix type propagation for ILTrim changes * refactor: Simplify DynamicallyAccessedMembers annotations * sample: Use static-Type construction of InputPort * feat: Support non-Streaming Run Mode * test: Add test for non-streaming execution * refactor: Remove unused types * refactor: Simplify Event and EdgeData type hierarchies * feat: Add Switch (=Conditional Edge Group) control flow * Fix unit-tests * Add sample * Comment cleanup * Fix debug output * Formating helpers * feat: Define Workflow and Executor APIs * feat: Define IExecutionContext and Events * feat: Simple Workflow Demos * refactor: Move Workflows classes to separate assembly * feat: Move FanOut/In to LowLevel API with new semantics * feat: Implement Local Execution * refactor: Assembly name .Workflow => .Workflows * feat: Enable Default Message Handling * also lifts Bind in MessageHandlerInfo to better be able to direclty invoke handlers (for AOT, later) * feat: Implement StreamingHandle APIs This allows the user to respond to WorkflowEvents with external messages, enabling HIL. * feat: Add checks for duplicate edges and chain cycles * feat: Add built-in WorkflowEvents * refactor: Pull classes into own files * refactor: Simplify Disposal pattern in Executor * refactor: Break EdgeRunner file into per-type files * refactor: Use Throw.IfNull() * refactor: Remove AddLoop() Per microsoft#272 (comment) we decided this was not very useful. * refactor: Normalize use of ValueTask * fix: Build Break from removing .AddLoop * refactor: Explicit routing and RouteBuilder Split out reflection from MessageRouter implemention into build phase, enabling AOT compilation to drive RouteBuilding without reflection. * test: Add Reflection/Invocation tests * fix: Terminate on Completion event * refactor: Update public API surface * feat: Add support for external requests * feat: Support hosting AIAgent instances in Workflows * fix: Fix routing to go through Executor.ExecuteAsync * test: Update samples for "must SendMessage" semantics * Add invoking samples to unit tests to avoid future breaks * fix: ExternalRequest should block Workflow completion * feat: Normalize API surface against Python * Also adds xmldoc to all public APIs * refactor: Normalize UnitTest and Sample namespaces * fix: Formatting * refactor: Normalize project/folder names * feat: Remove DynamicCodeExecution from ValueTaskTypeErasure * fix: Fix ILTrim warnings * docs: Add missing docs and fix typos * feat: Hosted Agents should report Run events * fix: Fix type propagation for ILTrim changes * refactor: Simplify DynamicallyAccessedMembers annotations * sample: Use static-Type construction of InputPort * feat: Support non-Streaming Run Mode * test: Add test for non-streaming execution * refactor: Remove unused types * refactor: Simplify Event and EdgeData type hierarchies * feat: Add Switch (=Conditional Edge Group) control flow * feat: Make .NET AutoSend the MessageHandler result * feat: Implement State APIs * Add tests * Fix merge from main * Test coverage * Message event * Comments and clean-up * Format * Cleanup * Test checkpoint * Clean-up - comments / test * Test baseline - 100% * More clean-up * Comments * Streaming...sort've... * Fix build / test * Stable * Checkpoint * Checkpoint * Stable * Update sample after merge * Add "Question" workflow * State clean-up checkpoint * State clean-up * Sample updated * Expression bug fix * Sample formatting * Add unit test * Comments * Scope cleanup * Refine cleanup * Fill gaps * fcs * Finalize data-types * Add unit-test * Debug cleanup * Bug fixes * Demo progress * Sample clean-up * Update samples * Sample updates * Sync demo workflows * Sample formatting * Sample formatting * Demo complete * Workflow formatting * Demo formatting microsoft#2 * Readme + Sample clean-up * Scope update * Update diagnostics * Variable initiaization * Rollback * Tune research summary * State management * Fix merge * Fix merge - demo * Add readme * Overload for workflow builder * Fault tolerance - scope equivalency * Fix feed * Update sample * Add default for "Bot" * Nuget.config patchwork * Scope assignment check * Rollback nuget.config haxx * Sample format * Namespace * Namespace * Agent-Provider * Clean-up extra files * Renaming * Update sample * Prune junk files * Clean-up * Use transform * agent provider fix * Typo * Null check fix * Fix merge * Checkpoint * Cleanup * Exception cleanup * Exception message * Clean-up * Sample config update * Update handling of "Env" scope * Sample agent templates * Add readme * Event cleanup * Rename event * Update workflows/README.md Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com> --------- Co-authored-by: Jacob Alber <jaalber@microsoft.com> Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
1 parent 2e042d6 commit 839a4d1

113 files changed

Lines changed: 8278 additions & 38 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dotnet/Directory.Packages.props

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@
8080
<PackageVersion Include="Microsoft.ML.OnnxRuntimeGenAI" Version="0.9.0" />
8181
<!-- Identity -->
8282
<PackageVersion Include="Microsoft.Identity.Client.Extensions.Msal" Version="4.74.1" />
83+
<!-- Workflows -->
84+
<PackageVersion Include="Microsoft.Bot.ObjectModel" Version="2025.8.2-1" />
85+
<PackageVersion Include="Microsoft.Bot.ObjectModel.Json" Version="2025.8.2-1" />
86+
<PackageVersion Include="Microsoft.Bot.ObjectModel.PowerFx" Version="2025.8.2-1" />
87+
<PackageVersion Include="Microsoft.PowerFx.Interpreter" Version="1.4.0-build.20250625-1002" />
8388
<!-- Test -->
8489
<PackageVersion Include="FluentAssertions" Version="8.5.0" />
8590
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />

dotnet/agent-framework-dotnet.slnx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@
4444
<Folder Name="/Samples/GettingStarted/Telemetry/">
4545
<Project Path="samples/GettingStarted/AgentOpenTelemetry/AgentOpenTelemetry.csproj" />
4646
</Folder>
47+
<Folder Name="/Samples/GettingStarted/Workflows/">
48+
<Project Path="samples/DeclarativeWorkflow/DeclarativeWorkflow.csproj" />
49+
</Folder>
50+
<Folder Name="/Samples/GettingStarted/Workflows/Example/">
51+
<File Path="../workflows/DeepResearch.yaml" />
52+
<File Path="../workflows/HelloWorld.yaml" />
53+
<File Path="../workflows/MathChat.yaml" />
54+
<File Path="../workflows/Question.yaml" />
55+
<File Path="../workflows/README.md" />
56+
<File Path="../workflows/wttr.json" />
57+
</Folder>
4758
<Folder Name="/Samples/SemanticKernelMigration/" />
4859
<Folder Name="/Samples/SemanticKernelMigration/AzureAIFoundry/">
4960
<Project Path="samples/SemanticKernelMigration/AzureAIFoundry/Step01_Basics/AzureAIFoundry_Step01_Basics.csproj" />
@@ -80,6 +91,8 @@
8091
<File Path="Directory.Build.props" />
8192
<File Path="Directory.Build.targets" />
8293
<File Path="Directory.Packages.props" />
94+
<File Path="global.json" />
95+
<File Path="nuget.config" />
8396
</Folder>
8497
<Folder Name="/Solution Items/.github/" />
8598
<Folder Name="/Solution Items/.github/workflows/">
@@ -175,6 +188,7 @@
175188
</Folder>
176189
<Folder Name="/src/">
177190
<Project Path="src/Microsoft.Agents.Orchestration/Microsoft.Agents.Orchestration.csproj" />
191+
<Project Path="src/Microsoft.Agents.Workflows.Declarative/Microsoft.Agents.Workflows.Declarative.csproj" />
178192
<Project Path="src/Microsoft.Agents.Workflows/Microsoft.Agents.Workflows.csproj" />
179193
<Project Path="src/Microsoft.Extensions.AI.Agents.A2A/Microsoft.Extensions.AI.Agents.A2A.csproj" />
180194
<Project Path="src/Microsoft.Extensions.AI.Agents.Abstractions/Microsoft.Extensions.AI.Agents.Abstractions.csproj" />
@@ -204,6 +218,7 @@
204218
</Folder>
205219
<Folder Name="/Tests/UnitTests/">
206220
<Project Path="tests/Microsoft.Agents.Orchestration.UnitTests/Microsoft.Agents.Orchestration.UnitTests.csproj" />
221+
<Project Path="tests/Microsoft.Agents.Workflows.Declarative.UnitTests/Microsoft.Agents.Workflows.Declarative.UnitTests.csproj" />
207222
<Project Path="tests/Microsoft.Agents.Workflows.UnitTests/Microsoft.Agents.Workflows.UnitTests.csproj" />
208223
<Project Path="tests/Microsoft.Extensions.AI.Agents.A2A.UnitTests/Microsoft.Extensions.AI.Agents.A2A.UnitTests.csproj" />
209224
<Project Path="tests/Microsoft.Extensions.AI.Agents.Abstractions.UnitTests/Microsoft.Extensions.AI.Agents.Abstractions.UnitTests.csproj" />

dotnet/nuget.config

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
<configuration>
33
<packageSources>
44
<clear />
5-
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
5+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
6+
<add key="CopilotStudio" value="https://pkgs.dev.azure.com/Power-Fx/7dd30b4a-31be-4ac9-a649-e6addd4d5b0a/_packaging/CopilotStudio/nuget/v3/index.json" />
67
</packageSources>
8+
<packageSourceMapping>
9+
<packageSource key="nuget.org">
10+
<package pattern="*" />
11+
</packageSource>
12+
<packageSource key="CopilotStudio">
13+
<package pattern="Microsoft.Bot.*" />
14+
<package pattern="Microsoft.PowerFx.*" />
15+
</packageSource>
16+
</packageSourceMapping>
717
</configuration>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFrameworks>net9.0</TargetFrameworks>
6+
<ProjectsDebugTargetFrameworks>net9.0</ProjectsDebugTargetFrameworks>
7+
<TargetFrameworks Condition="'$(Configuration)' == 'Debug'">$(ProjectsDebugTargetFrameworks)</TargetFrameworks>
8+
<Nullable>enable</Nullable>
9+
<ImplicitUsings>disable</ImplicitUsings>
10+
<UserSecretsId>5ee045b0-aea3-4f08-8d31-32d1a6f8fed0</UserSecretsId>
11+
<NoWarn>$(NoWarn);CA1812</NoWarn>
12+
</PropertyGroup>
13+
14+
<PropertyGroup>
15+
<InjectSharedThrow>true</InjectSharedThrow>
16+
</PropertyGroup>
17+
18+
<ItemGroup>
19+
<PackageReference Include="Microsoft.Extensions.Configuration" />
20+
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" />
21+
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" />
22+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" />
23+
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" />
24+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
25+
<PackageReference Include="Microsoft.Extensions.Logging" />
26+
</ItemGroup>
27+
28+
<ItemGroup>
29+
<ProjectReference Include="..\..\src\Microsoft.Agents.Workflows\Microsoft.Agents.Workflows.csproj" />
30+
<ProjectReference Include="..\..\src\Microsoft.Agents.Workflows.Declarative\Microsoft.Agents.Workflows.Declarative.csproj" />
31+
</ItemGroup>
32+
33+
</Project>

0 commit comments

Comments
 (0)