diff --git a/dotnet/samples/GettingStarted/Workflows/Agents/WorkflowAsAnAgent/WorkflowFactory.cs b/dotnet/samples/GettingStarted/Workflows/Agents/WorkflowAsAnAgent/WorkflowFactory.cs
index 736c51d555..653ebdf4c2 100644
--- a/dotnet/samples/GettingStarted/Workflows/Agents/WorkflowAsAnAgent/WorkflowFactory.cs
+++ b/dotnet/samples/GettingStarted/Workflows/Agents/WorkflowAsAnAgent/WorkflowFactory.cs
@@ -23,8 +23,8 @@ internal static class WorkflowFactory
// Build the workflow by adding executors and connecting them
return new WorkflowBuilder(startExecutor)
- .AddFanOutEdge(startExecutor, targets: [frenchAgent, englishAgent])
- .AddFanInEdge(aggregationExecutor, sources: [frenchAgent, englishAgent])
+ .AddFanOutEdge(startExecutor, [frenchAgent, englishAgent])
+ .AddFanInEdge([frenchAgent, englishAgent], aggregationExecutor)
.WithOutputFrom(aggregationExecutor)
.Build();
}
diff --git a/dotnet/samples/GettingStarted/Workflows/Concurrent/Concurrent/Program.cs b/dotnet/samples/GettingStarted/Workflows/Concurrent/Concurrent/Program.cs
index e1f71e2311..c839149d6c 100644
--- a/dotnet/samples/GettingStarted/Workflows/Concurrent/Concurrent/Program.cs
+++ b/dotnet/samples/GettingStarted/Workflows/Concurrent/Concurrent/Program.cs
@@ -52,8 +52,8 @@ public static class Program
// Build the workflow by adding executors and connecting them
var workflow = new WorkflowBuilder(startExecutor)
- .AddFanOutEdge(startExecutor, targets: [physicist, chemist])
- .AddFanInEdge(aggregationExecutor, sources: [physicist, chemist])
+ .AddFanOutEdge(startExecutor, [physicist, chemist])
+ .AddFanInEdge([physicist, chemist], aggregationExecutor)
.WithOutputFrom(aggregationExecutor)
.Build();
diff --git a/dotnet/samples/GettingStarted/Workflows/Concurrent/MapReduce/Program.cs b/dotnet/samples/GettingStarted/Workflows/Concurrent/MapReduce/Program.cs
index 9fd4b66e70..1b36b3eeb0 100644
--- a/dotnet/samples/GettingStarted/Workflows/Concurrent/MapReduce/Program.cs
+++ b/dotnet/samples/GettingStarted/Workflows/Concurrent/MapReduce/Program.cs
@@ -62,10 +62,10 @@ public static class Program
// Step 4: Build the concurrent workflow with fan-out/fan-in pattern
return new WorkflowBuilder(splitter)
- .AddFanOutEdge(splitter, targets: [.. mappers]) // Split -> many mappers
- .AddFanInEdge(shuffler, sources: [.. mappers]) // All mappers -> shuffle
- .AddFanOutEdge(shuffler, targets: [.. reducers]) // Shuffle -> many reducers
- .AddFanInEdge(completion, sources: [.. reducers]) // All reducers -> completion
+ .AddFanOutEdge(splitter, [.. mappers]) // Split -> many mappers
+ .AddFanInEdge([.. mappers], shuffler) // All mappers -> shuffle
+ .AddFanOutEdge(shuffler, [.. reducers]) // Shuffle -> many reducers
+ .AddFanInEdge([.. reducers], completion) // All reducers -> completion
.WithOutputFrom(completion)
.Build();
}
diff --git a/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/03_MultiSelection/Program.cs b/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/03_MultiSelection/Program.cs
index 15746f727e..9d340cbae3 100644
--- a/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/03_MultiSelection/Program.cs
+++ b/dotnet/samples/GettingStarted/Workflows/ConditionalEdges/03_MultiSelection/Program.cs
@@ -60,13 +60,13 @@ public static class Program
WorkflowBuilder builder = new(emailAnalysisExecutor);
builder.AddFanOutEdge(
emailAnalysisExecutor,
- targets: [
+ [
handleSpamExecutor,
emailAssistantExecutor,
emailSummaryExecutor,
handleUncertainExecutor,
],
- partitioner: GetPartitioner()
+ GetTargetAssigner()
)
// After the email assistant writes a response, it will be sent to the send email executor
.AddEdge(emailAssistantExecutor, sendEmailExecutor)
@@ -105,7 +105,7 @@ public static class Program
/// Creates a partitioner for routing messages based on the analysis result.
///
/// A function that takes an analysis result and returns the target partitions.
- private static Func> GetPartitioner()
+ private static Func> GetTargetAssigner()
{
return (analysisResult, targetCount) =>
{
diff --git a/dotnet/samples/GettingStarted/Workflows/Observability/WorkflowAsAnAgent/WorkflowHelper.cs b/dotnet/samples/GettingStarted/Workflows/Observability/WorkflowAsAnAgent/WorkflowHelper.cs
index 816dce50d0..8069a3e88e 100644
--- a/dotnet/samples/GettingStarted/Workflows/Observability/WorkflowAsAnAgent/WorkflowHelper.cs
+++ b/dotnet/samples/GettingStarted/Workflows/Observability/WorkflowAsAnAgent/WorkflowHelper.cs
@@ -24,8 +24,8 @@ internal static class WorkflowHelper
// Build the workflow by adding executors and connecting them
return new WorkflowBuilder(startExecutor)
- .AddFanOutEdge(startExecutor, targets: [frenchAgent, englishAgent])
- .AddFanInEdge(aggregationExecutor, sources: [frenchAgent, englishAgent])
+ .AddFanOutEdge(startExecutor, [frenchAgent, englishAgent])
+ .AddFanInEdge([frenchAgent, englishAgent], aggregationExecutor)
.WithOutputFrom(aggregationExecutor)
.Build();
}
diff --git a/dotnet/samples/GettingStarted/Workflows/SharedStates/Program.cs b/dotnet/samples/GettingStarted/Workflows/SharedStates/Program.cs
index 6f4cfdf38b..b7cbc25515 100644
--- a/dotnet/samples/GettingStarted/Workflows/SharedStates/Program.cs
+++ b/dotnet/samples/GettingStarted/Workflows/SharedStates/Program.cs
@@ -26,8 +26,8 @@ public static class Program
// Build the workflow by connecting executors sequentially
var workflow = new WorkflowBuilder(fileRead)
- .AddFanOutEdge(fileRead, targets: [wordCount, paragraphCount])
- .AddFanInEdge(aggregate, sources: [wordCount, paragraphCount])
+ .AddFanOutEdge(fileRead, [wordCount, paragraphCount])
+ .AddFanInEdge([wordCount, paragraphCount], aggregate)
.WithOutputFrom(aggregate)
.Build();
diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows/AgentWorkflowBuilder.cs b/dotnet/src/Microsoft.Agents.AI.Workflows/AgentWorkflowBuilder.cs
index 81d254aa53..41f0d834f0 100644
--- a/dotnet/src/Microsoft.Agents.AI.Workflows/AgentWorkflowBuilder.cs
+++ b/dotnet/src/Microsoft.Agents.AI.Workflows/AgentWorkflowBuilder.cs
@@ -127,7 +127,7 @@ public static partial class AgentWorkflowBuilder
// provenance tracking exposed in the workflow context passed to a handler.
ExecutorBinding[] agentExecutors = (from agent in agents select (ExecutorBinding)new AgentRunStreamingExecutor(agent, includeInputInOutput: false)).ToArray();
ExecutorBinding[] accumulators = [.. from agent in agentExecutors select (ExecutorBinding)new CollectChatMessagesExecutor($"Batcher/{agent.Id}")];
- builder.AddFanOutEdge(start, targets: agentExecutors);
+ builder.AddFanOutEdge(start, agentExecutors);
for (int i = 0; i < agentExecutors.Length; i++)
{
builder.AddEdge(agentExecutors[i], accumulators[i]);
@@ -143,7 +143,7 @@ public static partial class AgentWorkflowBuilder
ExecutorBinding end = endFactory.BindExecutor(ConcurrentEndExecutor.ExecutorId);
- builder.AddFanInEdge(end, sources: accumulators);
+ builder.AddFanInEdge(accumulators, end);
builder = builder.WithOutputFrom(end);
if (workflowName is not null)
diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows/SwitchBuilder.cs b/dotnet/src/Microsoft.Agents.AI.Workflows/SwitchBuilder.cs
index e180650935..b8cd6b6e78 100644
--- a/dotnet/src/Microsoft.Agents.AI.Workflows/SwitchBuilder.cs
+++ b/dotnet/src/Microsoft.Agents.AI.Workflows/SwitchBuilder.cs
@@ -84,7 +84,7 @@ public sealed class SwitchBuilder
List<(Func