Python: Support checkpoint hydration and new input in a single workflow run (#7863) - #7910
Draft
Shivani . (Shivani767) wants to merge 1 commit into
Draft
Conversation
Restore and validate the checkpoint before seeding start-executor input so hosts can resume multi-turn workflows without a separate hydrate round trip (microsoft#7863). Keep the prior two-step path working.
Shivani . (Shivani767)
deployed
to
github-app-auth
August 27, 2026 11:13 — with
GitHub Actions
Active
Shivani . (Shivani767)
deployed
to
github-app-auth
August 27, 2026 11:13 — with
GitHub Actions
Active
Shivani . (Shivani767)
deployed
to
github-app-auth
August 27, 2026 11:13 — with
GitHub Actions
Active
Shivani . (Shivani767)
deployed
to
github-app-auth
August 27, 2026 11:13 — with
GitHub Actions
Active
Shivani . (Shivani767)
deployed
to
github-app-auth
August 27, 2026 11:14 — with
GitHub Actions
Active
Contributor
There was a problem hiding this comment.
Pull request overview
Adds single-call checkpoint hydration plus new input for Python workflows.
Changes:
- Supports
messagewithcheckpoint_idin graph and functional workflows. - Updates workflow adapters and adds checkpoint-resume coverage.
- Adds a runnable hydration sample.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
python/samples/03-workflows/checkpoint/checkpoint_hydrate_with_input.py |
Demonstrates combined hydration and input. |
python/packages/core/tests/workflow/test_workflow.py |
Updates parameter validation tests. |
python/packages/core/tests/workflow/test_functional_workflow.py |
Tests functional combined runs. |
python/packages/core/tests/workflow/test_checkpoint.py |
Tests graph hydration, streaming, and validation failure. |
python/packages/core/agent_framework/_workflows/_workflow.py |
Implements graph restore-then-seed behavior. |
python/packages/core/agent_framework/_workflows/_functional.py |
Enables the functional API combination. |
python/packages/core/agent_framework/_workflows/_agent.py |
Consolidates agent checkpoint continuation. |
python/packages/ag-ui/agent_framework_ag_ui/_workflow_run.py |
Clarifies AG-UI checkpoint routing. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+827
to
+829
| *message* may be combined with *checkpoint_id* to restore a checkpoint | ||
| and apply new start input in a single call (#7863). *message* remains | ||
| mutually exclusive with *responses*. |
Comment on lines
661
to
+664
| await self._runner.restore_from_checkpoint(checkpoint_id, checkpoint_storage) | ||
|
|
||
| # Handle initial message | ||
| elif message is not None: | ||
| # Seed start-executor input for a new turn (alone or after restore). | ||
| if message is not None: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation & Context
Resuming a multi-turn workflow from a persisted checkpoint previously required two
workflow.runcalls: hydrate from the checkpoint, then submit the new user input. That adds an unnecessary round trip, can surface intermediate hydrate events to adapters, and complicates HTTP/hosted request handlers that receive one logical request (#7863).Description & Review Guide
What are the major changes?
Workflow.run(message=..., checkpoint_id=...)(and the functional-workflow mirror): restore/validate first, then seed start-executor input in the same run.checkpoint_idis present, because restore replaces the runner context before the new message is applied.WorkflowAgent’s restore-then-run path into oneworkflow.runwhen both checkpoint and input are provided (HITL usesresponses+checkpoint_id; idle turns usemessage+checkpoint_id).responses); clarify the branch comments.python/samples/03-workflows/checkpoint/checkpoint_hydrate_with_input.py.What is the impact of these changes?
checkpoint_id+responsesremain supported.What do you want reviewers to focus on?
WorkflowAgentpeekingcheckpoint.pending_request_info_eventsis the right HITL vs idle discriminator.Related Issue
Fixes #7863
Related: #7809
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.