[BREAKING] Python: Remove workflow register factory methods. Update tests and samples#3781
Merged
moonbox3 merged 2 commits intomicrosoft:mainfrom Feb 10, 2026
Merged
Conversation
Member
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the Python workflow “factory registration” APIs (and related participant factory patterns in orchestrations) in favor of building workflows directly from executor/agent instances, and updates tests/samples to match.
Changes:
- Removed
WorkflowBuilder.register_executor/register_agentand string-based node wiring; workflows are now wired with executor/agent instances. - Removed
participant_factoriessupport from orchestration builders (Sequential/Concurrent/GroupChat/Magentic/Handoff) and updated tests accordingly. - Updated (and in a few cases removed) getting-started samples that previously demonstrated factory-based patterns.
Reviewed changes
Copilot reviewed 46 out of 46 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| python/samples/getting_started/workflows/visualization/concurrent_with_visualization.py | Updates sample to build workflow from executor/AgentExecutor instances. |
| python/samples/getting_started/workflows/state-management/state_with_agents.py | Updates sample to use direct agent instances and direct edge wiring. |
| python/samples/getting_started/workflows/parallelism/map_reduce_and_visualization.py | Updates map/reduce sample to instantiate executors directly and wire by instance. |
| python/samples/getting_started/workflows/parallelism/fan_out_fan_in_edges.py | Updates fan-out/fan-in sample to use AgentExecutor instances and instance wiring. |
| python/samples/getting_started/workflows/parallelism/aggregate_results_of_different_types.py | Updates sample to instantiate executors directly and wire by instance. |
| python/samples/getting_started/workflows/control-flow/workflow_cancellation.py | Updates sample to wire @executor instances directly (no registration). |
| python/samples/getting_started/workflows/control-flow/switch_case_edge_group.py | Updates switch/case sample to use AgentExecutor instances and instance wiring. |
| python/samples/getting_started/workflows/control-flow/simple_loop.py | Updates loop sample to use AgentExecutor instance and instance wiring. |
| python/samples/getting_started/workflows/control-flow/sequential_streaming.py | Updates sequential streaming sample to wire executors by instance. |
| python/samples/getting_started/workflows/control-flow/sequential_executors.py | Updates sample to instantiate executors and wire by instance. |
| python/samples/getting_started/workflows/control-flow/multi_selection_edge_group.py | Updates multi-selection sample to use AgentExecutor instances and instance wiring. |
| python/samples/getting_started/workflows/control-flow/edge_condition.py | Updates conditional routing sample to use AgentExecutor instances and instance wiring. |
| python/samples/getting_started/workflows/composition/sub_workflow_request_interception.py | Updates sub-workflow composition sample to instantiate executors directly. |
| python/samples/getting_started/workflows/composition/sub_workflow_parallel_requests.py | Updates sub-workflow parallel request sample to instantiate executors directly. |
| python/samples/getting_started/workflows/composition/sub_workflow_basics.py | Updates basic sub-workflow composition sample to use direct instances. |
| python/samples/getting_started/workflows/checkpoint/workflow_as_agent_checkpoint.py | Updates SequentialBuilder usage to pass participant instances (no factories). |
| python/samples/getting_started/workflows/checkpoint/sub_workflow_checkpoint.py | Updates checkpointing sample to instantiate executors directly and wire by instance. |
| python/samples/getting_started/workflows/checkpoint/checkpoint_with_resume.py | Updates checkpoint resume sample to instantiate executors directly and wire by instance. |
| python/samples/getting_started/workflows/checkpoint/checkpoint_with_human_in_the_loop.py | Updates HITL checkpoint sample to use AgentExecutor instance and instance wiring. |
| python/samples/getting_started/workflows/agents/workflow_as_agent_with_thread.py | Updates SequentialBuilder usage to pass agent instances (no factories). |
| python/samples/getting_started/workflows/agents/workflow_as_agent_reflection_pattern.py | Updates workflow-as-agent sample to instantiate executors directly. |
| python/samples/getting_started/workflows/agents/workflow_as_agent_human_in_the_loop.py | Updates workflow-as-agent HITL sample to instantiate executors directly. |
| python/samples/getting_started/workflows/agents/azure_chat_agents_tool_calls_with_feedback.py | Updates agent-to-agent workflow sample to use AgentExecutor instances and instance wiring. |
| python/samples/getting_started/workflows/agents/azure_ai_agents_with_shared_thread.py | Updates shared-thread sample to use AgentExecutor instances and instance wiring. |
| python/samples/getting_started/workflows/_start-here/step4_using_factories.py | Removes factory-focused “start here” step sample. |
| python/samples/getting_started/workflows/_start-here/step1_executors_and_edges.py | Adds helper-function guidance for state isolation now that factories are removed. |
| python/samples/getting_started/orchestrations/sequential_participant_factory.py | Removes orchestration sample demonstrating participant factories. |
| python/samples/getting_started/orchestrations/handoff_participant_factory.py | Removes orchestration sample demonstrating participant factories. |
| python/samples/getting_started/orchestrations/concurrent_participant_factory.py | Removes orchestration sample demonstrating participant factories. |
| python/packages/orchestrations/tests/test_sequential.py | Removes participant factory tests and updates assertions for participants-only behavior. |
| python/packages/orchestrations/tests/test_magentic.py | Removes participant factory tests and updates builder validation expectations. |
| python/packages/orchestrations/tests/test_handoff.py | Removes participant factory tests and updates validation expectations. |
| python/packages/orchestrations/tests/test_group_chat.py | Removes participant factory tests and updates validation expectations. |
| python/packages/orchestrations/tests/test_concurrent.py | Removes participant factory and aggregator-factory tests; updates for participants-only behavior. |
| python/packages/orchestrations/agent_framework_orchestrations/_sequential.py | Removes participant_factories support; requires participants. |
| python/packages/orchestrations/agent_framework_orchestrations/_magentic.py | Removes participant_factories support; requires participants. |
| python/packages/orchestrations/agent_framework_orchestrations/_handoff.py | Removes factory-based participant APIs; updates handoff wiring to instance-only. |
| python/packages/orchestrations/agent_framework_orchestrations/_group_chat.py | Removes participant_factories support; requires participants. |
| python/packages/orchestrations/agent_framework_orchestrations/_concurrent.py | Removes participant_factories and custom aggregator factory registration; requires participants. |
| python/packages/declarative/tests/test_graph_workflow_integration.py | Updates executor count expectations due to declarative entry node. |
| python/packages/declarative/tests/test_graph_coverage.py | Updates tests to construct WorkflowBuilder with a real executor instance. |
| python/packages/declarative/agent_framework_declarative/_workflows/_declarative_builder.py | Introduces a stable _workflow_entry node and wires it to the first action. |
| python/packages/core/tests/workflow/test_workflow_observability.py | Updates tracing test to reflect start executor is now an instance, not a string. |
| python/packages/core/tests/workflow/test_workflow_builder.py | Rewrites tests to use direct executor/agent instances (no registration APIs). |
| python/packages/core/tests/workflow/test_workflow_agent.py | Updates tests to build workflows directly from executor/agent instances. |
| python/packages/core/agent_framework/_workflows/_workflow_builder.py | Removes factory registration APIs and string-based wiring; requires instance-based wiring. |
python/packages/orchestrations/agent_framework_orchestrations/_handoff.py
Outdated
Show resolved
Hide resolved
python/packages/declarative/agent_framework_declarative/_workflows/_declarative_builder.py
Show resolved
Hide resolved
dmytrostruk
approved these changes
Feb 10, 2026
eavanvalkenburg
approved these changes
Feb 10, 2026
TaoChenOSU
reviewed
Feb 10, 2026
python/samples/getting_started/workflows/_start-here/step4_using_factories.py
Show resolved
Hide resolved
TaoChenOSU
approved these changes
Feb 10, 2026
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 and Context
Remove workflow register factory methods in favor of creating a helper method with executor/agent instances + workflow builder.
Description
Contribution Checklist