Skip to content

Python: Preserve deterministic workflow event order under concurrent executor completion #4653

@davidahmann

Description

@davidahmann

Problem

Equivalent workflow runs can emit executor lifecycle events in different orders when concurrent branches complete in different schedules, which makes traces harder to compare and audit.

Why now

Tracing/debugging is a core framework value. Non-deterministic event ordering increases operator friction and undermines reproducible workflow receipts.

Expected behavior

For equivalent inputs and workflow topology, emitted executor lifecycle ordering should be stable and deterministic in the runtime event stream.

Claim-to-codepath map

  • python/packages/core/agent_framework/_workflows/_runner.py
  • python/packages/core/agent_framework/_workflows/_events.py
  • dotnet/src/Microsoft.Agents.AI.Workflows/ExecutorEvent.cs
  • dotnet/src/Microsoft.Agents.AI.Workflows/SubworkflowErrorEvent.cs

Validation requirements

  • Add regression coverage that exercises concurrent branch completion and asserts stable event-order semantics.
  • Apply minimal runtime ordering fix to deterministic dispatch points.
  • Run targeted workflow tests in Python (and .NET tests if touched).

Evidence packet

  • Commit under test: $(git -C /Users/davidahmann/Projects/agent-ecosystem/agent-framework rev-parse HEAD)
  • Runtime: Python/.NET workflow test harness on macOS
  • Minimal repro concept: concurrent branch workflow run repeated N times yields inconsistent executor event ordering without deterministic dispatch.

Metadata

Metadata

Assignees

Labels

pythonworkflowsRelated to Workflows in agent-framework

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions