From 00a78d7bc6c64281b6a1bb73b6b5c3c7c1360bd3 Mon Sep 17 00:00:00 2001 From: Chris <66376200+crickman@users.noreply.github.com> Date: Tue, 28 Oct 2025 16:26:55 -0700 Subject: [PATCH] .NET Workflows - Sample and Package Update (#1759) * Update #1 * Sample comments * Formatting * Whitespace --- dotnet/Directory.Packages.props | 2 +- .../Workflows/Declarative/ExecuteWorkflow/Program.cs | 5 +++-- workflow-samples/DeepResearch.yaml | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dotnet/Directory.Packages.props b/dotnet/Directory.Packages.props index 7a5bd32aab..afa5bc77f0 100644 --- a/dotnet/Directory.Packages.props +++ b/dotnet/Directory.Packages.props @@ -17,7 +17,7 @@ - + diff --git a/dotnet/samples/GettingStarted/Workflows/Declarative/ExecuteWorkflow/Program.cs b/dotnet/samples/GettingStarted/Workflows/Declarative/ExecuteWorkflow/Program.cs index 4b26aa14f1..ce6a19b0d3 100644 --- a/dotnet/samples/GettingStarted/Workflows/Declarative/ExecuteWorkflow/Program.cs +++ b/dotnet/samples/GettingStarted/Workflows/Declarative/ExecuteWorkflow/Program.cs @@ -184,6 +184,7 @@ internal sealed class Program private async Task MonitorAndDisposeWorkflowRunAsync(Checkpointed run, object? response = null) { + // Always dispose the run when done. await using IAsyncDisposable disposeRun = run; bool hasStreamed = false; @@ -231,7 +232,7 @@ internal sealed class Program } else { - await run.Run.DisposeAsync(); + // Yield to handle the external request return requestInfo.Request; } break; @@ -326,7 +327,7 @@ internal sealed class Program } } - return default; + return null; // No request to handle } /// diff --git a/workflow-samples/DeepResearch.yaml b/workflow-samples/DeepResearch.yaml index e1db3cc5c5..be84e92bfb 100644 --- a/workflow-samples/DeepResearch.yaml +++ b/workflow-samples/DeepResearch.yaml @@ -1,5 +1,6 @@ # -# This workflow demonstrates a multi-agent orchestrator that attempts to address complex user requests. +# This workflow coordinates multiple agents in order to address complex user requests +# according to the "Magentic" orchestration pattern introduced by AutoGen. # # For this workflow, several agents used, each with a prompt specific to their role: #