microsoft / microsoft/agent-framework
.NET: [Bug]: Workflow switches and conditions does not work as expected when used as Durable workflows
@cgillum is already working on this.
Since Jun 25, 2026.
- Dominant language
- Python
- Stars
- 13.6k
- Forks
- 2.3k
- Avg merge
- 2d 45m
- Merged PRs (30d)
- 358
Description
### Description
**Description**
The switches used in Durable Workflows are routing execution to all the underlying executors disregarding the configured case conditions.
**Example **
A use case that detects if a given number is a prime or a non prime number. The ChatClientAgent correctly determines the number type and the agent response acts as the input to two separate executors **sendPrimeNumberNotification** , **sendNonPrimeNumberNotification** .
By default it first executes the true condition and then continues on to execute the false condition as well. This leads to workflow failure. The execution should correctly execute based on the given number being identified a prime number or non prime number.
This use case works perfectly well when not used as a Durable workflow.
**Expected Behavior**
The workflow execution should correctly route and execute the appropriate executor based on whether the input number is identified as a prime number or a non-prime number. The execution should then terminate once the correct executor has been executed.
### Error Messages / Stack Traces
```markdown
```
### Package Versions
Microsoft.Agents.AI.Hosting.AzureFunctions : 1.8.0-preview.260528.1 , Microsoft.Agents.AI.Workflows : 1.8.0 , Microsoft.Azure.Functions.Worker.Extensions.DurableTask.AzureManaged : 1.8.1 , Microsoft.Azure.Functions.Worker.Extensions.DurableTask : 1.16.5
### .NET Version
.NET 10.0
### Additional Context
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.