db620d33df
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
dotnet-build-and-test / dotnet-test-functions (push) Has been cancelled
dotnet-build-and-test / paths-filter (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Debug, windows-latest, net9.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net10.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net8.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, windows-latest, net472) (push) Has been cancelled
dotnet-build-and-test / dotnet-test (Release, integration, true, ubuntu-latest, net10.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-test (Release, integration, true, windows-latest, net472) (push) Has been cancelled
dotnet-build-and-test / dotnet-foundry-hosted-it (push) Has been cancelled
dotnet-build-and-test / dotnet-build-and-test-check (push) Has been cancelled
dotnet-build-and-test / Integration Test Report (push) Has been cancelled
Workflow on a Standalone Durable Task Worker
This sample demonstrates running an agent-framework Workflow as a durable
orchestration on a standalone Durable Task worker — no Azure Functions
required. It is the durabletask counterpart to the Azure Functions workflow
samples (samples/04-hosting/azure_functions/10_workflow_no_shared_state).
Key Concepts Demonstrated
- Hosting a MAF
Workflowoutside Azure Functions viaDurableAIAgentWorker.configure_workflow(workflow), which auto-registers:- a durable entity for each agent executor,
- a durable activity for each non-agent executor, and
- the workflow orchestrator (registered as
WORKFLOW_ORCHESTRATOR_NAME).
- Conditional routing with
add_switch_case_edge_group(spam vs. legitimate email). - Mixing AI agents with non-agent executors in one workflow graph.
- Starting the workflow from a client with
DurableWorkflowClient.start_workflow(input=...)and reading its result withawait_workflow_output(instance_id).
Environment Setup
See the README.md in the parent directory for environment setup.
This sample uses Azure AI Foundry credentials:
FOUNDRY_PROJECT_ENDPOINTFOUNDRY_MODEL
It also needs a Durable Task Scheduler. For local development, start the
emulator (defaults to http://localhost:8080):
docker run -d -p 8080:8080 -p 8082:8082 mcr.microsoft.com/dts/dts-emulator:latest
Running the Sample
Start the worker in one terminal:
cd samples/04-hosting/durabletask/08_workflow
python worker.py
In a second terminal, run the client:
python client.py
The client runs two cases:
- Legitimate email →
SpamDetectionAgent→EmailAssistantAgent→email_sender→"Email sent: ...". - Spam email →
SpamDetectionAgent→spam_handler→"Email marked as spam: ...".