Files
agent-framework/dotnet/samples/GettingStarted/Workflows
T
SergeyMenshykh 9506fb28f6 .NET: [Breaking] Structured Output improvements (#3761)
* .NET: Delete AgentResponse.{Try}Deserialize<T> methods (#3518)

* delete deserialize method of agent response

* order usings

* Update dotnet/samples/GettingStarted/FoundryAgents/FoundryAgents_Step05_StructuredOutput/Program.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update dotnet/samples/GettingStarted/Workflows/_Foundational/08_WriterCriticWorkflow/Program.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update dotnet/samples/GettingStarted/AGUI/Step05_StateManagement/Server/SharedStateAgent.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update dotnet/samples/AGUIClientServer/AGUIDojoServer/SharedState/SharedStateAgent.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update dotnet/samples/M365Agent/Agents/WeatherForecastAgent.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* .NET:[Breaking] Add support for structured output (#3658)

* add support for so

* restore lost xml comment part

* fix using ordering

* Update dotnet/src/Microsoft.Agents.AI.Abstractions/AIAgentStructuredOutput.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update dotnet/src/Microsoft.Agents.AI.Abstractions/AIAgentStructuredOutput.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update dotnet/tests/Microsoft.Agents.AI.UnitTests/ChatClient/ChatClientAgent_SO_WithFormatResponseTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* addressw pr review comments

* address pr review feedback

* address pr review comments

* fix compilation issues after the latest merge with main

* remove unnecessry options

* remove RunAsync<object> methods

* address code review feedback

* address pr review feedback

* make copy constructor protected

* address pr review feedback

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* .NET: Add decorator for structured output support (#3694)

* add decorator that adds structured output support to agents that don't natively support it.

* Update dotnet/src/Microsoft.Agents.AI/StructuredOutput/StructuredOutputAgentResponse.cs

Co-authored-by: westey <164392973+westey-m@users.noreply.github.com>

* Update dotnet/samples/GettingStarted/Agents/Agent_Step05_StructuredOutput/Program.cs

Co-authored-by: westey <164392973+westey-m@users.noreply.github.com>

* address pr review feedback

---------

Co-authored-by: westey <164392973+westey-m@users.noreply.github.com>

* .NET: Support primitives and arrays for SO (#3696)

* wrap primitives and arrays

* fix file encoding

* address review comments

* add adr

* add missed change

* fix compilation issue

* address review comments

* rename adr file name

* reflect decision to have SO decorator as a reference implementation in samples

* .NET: Move SO agent to samples (#3820)

* move SO agent to samples

* change file encoding

* fix files encoding

* .NET: Preserve caller context (#3803)

* fix stuck orchestration

* add previously removed RunAsync<T> method to DurableAIAgent

* suppress IDE0005 warning

* update changelog and remove unused constructor of AgentResponse<T>

* updatge the changelog

* address PR review feedback

* .NET: Disable irrelevant integration test (#3913)

* disable irrelevant integration test

* Update dotnet/tests/AzureAI.IntegrationTests/AIProjectClientAgentStructuredOutputRunTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* forgotten change

* address pr review feedback

* disable intermittently failing integration test.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: westey <164392973+westey-m@users.noreply.github.com>
9506fb28f6 ยท 2026-02-13 17:03:51 +00:00
History
..
2025-11-22 04:14:15 +00:00

Workflow Getting Started Samples

The getting started with workflow samples demonstrate the fundamental concepts and functionalities of workflows in Agent Framework.

Samples Overview

Foundational Concepts - Start Here

Please begin with the Foundational samples in order. These three samples introduce the core concepts of executors, edges, agents in workflows, streaming, and workflow construction.

The folder name starts with an underscore (_Foundational) to ensure it appears first in the explorer view.

Sample Concepts
Executors and Edges Minimal workflow with basic executors and edges
Streaming Extends workflows with event streaming
Agents Use agents in workflows
Agentic Workflow Patterns Demonstrates common agentic workflow patterns
Multi-Service Workflows Shows using multiple AI services in the same workflow
Sub-Workflows Demonstrates composing workflows hierarchically by embedding workflows as executors
Mixed Workflow with Agents and Executors Shows how to mix agents and executors with adapter pattern for type conversion and protocol handling
Writer-Critic Workflow Demonstrates iterative refinement with quality gates, max iteration safety, multiple message handlers, and conditional routing for feedback loops

Once completed, please proceed to other samples listed below.

Note that you don't need to follow a strict order after the foundational samples. However, some samples build upon concepts from previous ones, so it's beneficial to be aware of the dependencies.

Agents

Sample Concepts
Foundry Agents in Workflows Demonstrates using Azure Foundry Agents within a workflow
Custom Agent Executors Shows how to create a custom agent executor for more complex scenarios
Workflow as an Agent Illustrates how to encapsulate a workflow as an agent
Group Chat with Tool Approval Shows multi-agent group chat with tool approval requests and human-in-the-loop interaction

Concurrent Execution

Sample Concepts
Fan-Out and Fan-In Introduces parallel processing with fan-out and fan-in patterns

Loop

Sample Concepts
Looping Shows how to create a loop within a workflow

Workflow Shared States

Sample Concepts
Shared States Demonstrates shared states between executors for data sharing and coordination

Conditional Edges

Sample Concepts
Edge Conditions Introduces conditional edges for dynamic routing based on executor outputs
Switch-Case Routing Extends conditional edges with switch-case routing for multiple paths
Multi-Selection Routing Demonstrates multi-selection routing where one executor can trigger multiple downstream executors

These 3 samples build upon each other. It's recommended to explore them in sequence to fully grasp the concepts.

Declarative Workflows

Sample Concepts
Declarative Demonstrates execution of declartive workflows.

Checkpointing

Sample Concepts
Checkpoint and Resume Introduces checkpoints for saving and restoring workflow state for time travel purposes
Checkpoint and Rehydrate Demonstrates hydrating a new workflow instance from a saved checkpoint
Checkpoint with Human-in-the-Loop Combines checkpointing with human-in-the-loop interactions

Human-in-the-Loop

Sample Concepts
Basic Human-in-the-Loop Introduces human-in-the-loop interaction using input ports and external requests