Files
Chris 904a5b843e Python / .NET Samples - Restructure and Improve Samples (Feature Branc… (#4092)
* Python: .NET Samples - Restructure and Improve Samples (Feature Branch) (#4091)

* Moved by agent (#4094)

* Fix readme links

* .NET Samples - Create `04-hosting` learning path step (#4098)

* Agent move

* Agent reorderd

* Remove A2A section from README 

Removed A2A section from the Getting Started README.

* Agent fixed links

* Fix broken sample links in durable-agents README (#4101)

* Initial plan

* Fix broken internal links in documentation

Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>

* Revert template link changes; keep only durable-agents README fix

Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>

* .NET Samples - Create `03-workflows` learning path step (#4102)

* Fix solution project path

* Python: Fix broken markdown links to repo resources (outside /docs) (#4105)

* Initial plan

* Fix broken markdown links to repo resources

Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>

* Update README to rename .NET Workflows Samples section

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>

* .NET Samples - Create `02-agents` learning path step (#4107)

* .NET: Fix broken relative link in GroupChatToolApproval README (#4108)

* Initial plan

* Fix broken link in GroupChatToolApproval README

Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>

* Update labeler configuration for workflow samples

* .NET - Reorder Agents samples to start from Step01 instead of Step04 (#4110)

* Fix solution

* Resolve new sample paths

* Move new AgentSkills and AgentWithMemory_Step04 samples

* Fix link

* Fix readme path

* fix: update stale dotnet/samples/Durable path reference in AGENTS.md

Co-authored-by: crickman <66376200+crickman@users.noreply.github.com>

* Moved new sample

* Update solution

* Resolve merge (new sample)

* Sync to new sample - FoundryAgents_Step21_BingCustomSearch

* Updated README

* .NET Samples - Configuration Naming Update (#4149)

* .NET: Restore AzureFunctions index parity with ConsoleApps under DurableAgents samples (#4221)

* Clean-up `05_host_your_agent`

* Config setting consistency

* Refine samples

* AGENTS.md

* Move new samples

* Re-order samples

* Move new project and fixup solution

* Fixup model config

* Fix up new UT project

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
904a5b843e · 2026-02-26 00:56:10 +00:00
History
..

Human-in-the-Loop Orchestration Sample

This sample demonstrates how to use the durable agents extension to create a console app that implements a human-in-the-loop workflow using durable orchestration, including interactive approval prompts.

Key Concepts Demonstrated

  • Human-in-the-loop workflows with durable orchestration
  • External event handling for human approval/rejection
  • Timeout handling for approval requests
  • Iterative content refinement based on human feedback

Environment Setup

See the README.md file in the parent directory for more information on how to configure the environment, including how to install and run common sample dependencies.

Running the Sample

With the environment setup, you can run the sample:

cd dotnet/samples/04-hosting/DurableAgents/ConsoleApps/05_AgentOrchestration_HITL
dotnet run --framework net10.0

The app will prompt you for input:

=== Human-in-the-Loop Orchestration Sample ===
Enter topic for content generation:

The Future of Artificial Intelligence

Max review attempts (default: 3):
3
Approval timeout in hours (default: 72):
72

The orchestration will generate content and prompt you for approval:

Orchestration started with instance ID: 86313f1d45fb42eeb50b1852626bf3ff

=== NOTIFICATION: Content Ready for Review ===
Title: The Future of Artificial Intelligence

Content:
[Generated content appears here]

Please review the content above and provide your approval.

Content is ready for review. Check the logs above for details.
Approve? (y/n): n
Feedback (optional): Please add more details about the ethical implications.

The orchestration will incorporate your feedback and regenerate the content. Once approved, it will publish and complete.

Viewing Orchestration State

You can view the state of the orchestration in the Durable Task Scheduler dashboard:

  1. Open your browser and navigate to http://localhost:8082
  2. In the dashboard, you can see:
    • Orchestrations: View the orchestration instance, including its runtime status, custom status (which shows approval state), input, output, and execution history
    • Agents: View the state of the WriterAgent, including conversation history

The orchestration instance ID is displayed in the console output. You can use this ID to find the specific orchestration in the dashboard and inspect:

  • The custom status field, which shows the current state of the approval workflow
  • When the orchestration is waiting for external events
  • The iteration count and feedback history
  • The final published content