microsoft / microsoft/agent-framework

.NET: [Bug]: Workflow switches and conditions does not work as expected when used as Durable workflows

Open
#6,722 2 comments 0 reactions 2 assignees View on GitHub

@cgillum is already working on this.

Since Jun 25, 2026.

.NET reproduced
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.