Skip to content

Python: Include sub-workflow structure in graph signature for checkpoint validation#3783

Merged
TaoChenOSU merged 2 commits intomicrosoft:mainfrom
moonbox3:improve-workflow-validation
Feb 10, 2026
Merged

Python: Include sub-workflow structure in graph signature for checkpoint validation#3783
TaoChenOSU merged 2 commits intomicrosoft:mainfrom
moonbox3:improve-workflow-validation

Conversation

@moonbox3
Copy link
Contributor

Motivation and Context

  • _compute_graph_signature now recursively includes sub-workflow topology when a WorkflowExecutor is present, so checkpoint validation detects structural changes inside sub-workflows
  • Previously, two workflows with identical parent structure but entirely different sub-workflows produced the same signature, making checkpoint resume blind to sub-workflow changes
  • Nested sub-workflows are handled automatically since each recursive call inspects its own WorkflowExecutor children

Description

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

@moonbox3 moonbox3 requested review from TaoChenOSU, Copilot and eavanvalkenburg and removed request for Copilot February 10, 2026 03:47
@moonbox3 moonbox3 self-assigned this Feb 10, 2026
@moonbox3 moonbox3 added the workflows Related to Workflows in agent-framework label Feb 10, 2026
@github-actions github-actions bot changed the title Include sub-workflow structure in graph signature for checkpoint validation Python: Include sub-workflow structure in graph signature for checkpoint validation Feb 10, 2026
@moonbox3 moonbox3 moved this to In Progress in Agent Framework Feb 10, 2026
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Feb 10, 2026

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/core/agent_framework/_workflows
   _workflow.py2682690%87, 265–267, 269–270, 288, 292, 320, 422, 597, 618, 644, 671, 673–674, 679–680, 686, 692, 697, 717–719, 732, 809
TOTAL16607205987% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
3930 225 💤 0 ❌ 0 🔥 1m 9s ⏱️

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates workflow checkpoint validation so that the graph signature reflects nested sub-workflow topology when a WorkflowExecutor is used, preventing silent checkpoint resumes after sub-workflow structural changes.

Changes:

  • Extend _compute_graph_signature() to recursively incorporate sub-workflow signatures for WorkflowExecutor nodes.
  • Add new unit tests to validate checkpoint resume behavior when sub-workflows match vs. change.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
python/packages/core/agent_framework/_workflows/_workflow.py Includes sub-workflow structure in the graph signature for checkpoint validation.
python/packages/core/tests/workflow/test_checkpoint_validation.py Adds tests covering checkpoint validation for nested sub-workflows.

@moonbox3 moonbox3 enabled auto-merge February 10, 2026 04:03
@moonbox3 moonbox3 added this pull request to the merge queue Feb 10, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 10, 2026
@TaoChenOSU TaoChenOSU added this pull request to the merge queue Feb 10, 2026
Merged via the queue into microsoft:main with commit f106a1a Feb 10, 2026
25 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Agent Framework Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python workflows Related to Workflows in agent-framework

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Python: [Bug]: Subworkflow graph structure not included as part of workflow validation

5 participants