Repository navigation
Conversation
- Implement `Workflow.from_config` to instantiate workflows from configurations. - Resolve nested node and sub-agent `.yaml` file references recursively during configuration loading. - Add parsing support for JoinNode, FunctionNode, and ToolNode types in config utilities.
|
Hi @baptmont , Thank you for your contribution! We appreciate you taking the time to submit this pull request. Your PR has been received by the team and is currently under review. We will provide feedback as soon as we have an update to share. |
|
Hi @DeanChensj , can you please review this. |
|
Hi, I thought loading workflows from YAML is already supported, see this sample: https://github.com/google/adk-python/tree/main/contributing/samples/workflows/loop_config What new features does this PR bring? |
|
Hi @boyangsvl, trying to run the example you linked does not work, at least using Changing the agent_class makes little progress agent_class: Workflow #original
agent_class: google.adk.workflow.Workflow #changeI get Even changing the def _resolve_agent_class(agent_class: str) -> type[BaseAgent]: #original
def _resolve_agent_class(agent_class: str) -> type[BaseNode]: #changePlease let me know if I am missing something, or if the feature is actually missing Also this PR does not use the logic defined in the example README.md, it expects a yaml file for tools, functions and joins. agent_class: ToolNode
or
agent_class: JoinNode
or
agent_class: FunctionNodeIf the feature is missing I can update this PR to follow the README.md logic of |
|
@boyangsvl - can you please take a look? |
|
Thank you @baptmont for testing it! This is a regression. I am working on fixing it. |
|
Update: This was supported but the code was stripped before release due to some issue when we launched 2.0. I am working on brining those back. That's a larger refactoring than just supporting workflow so it may take some time. |
|
Hi @baptmont, This has now landed on main in commit 2a9461b The reflection mapper now supports Workflow, FunctionNode, and graph edge syntax in configuration files (including edge chains, routing maps, fan-out, and node reference caching). As a result, the contributing/samples/workflows/loop_config sample—which was failing with Invalid fully qualified name: google.adk.agents.Workflow—now loads cleanly through AgentLoader. Because our team develops through an internal monorepo pipeline that syncs changes outward rather than merging GitHub branches directly, we are closing this PR in favor of that commit. Please note that this change landed shortly after the v2.8.0 cut, so it is not included in the current release yet. It will be part of the next release; in the meantime, you can test or run directly from main. Thank you again for testing the sample, identifying the regression, and providing the detailed reproduction—that was what prompted the fix to get prioritized and resolved. If you run into any remaining issues loading workflow configs on main, please feel free to comment or reopen! |
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
2. Or, if no issue exists, describe the change:
Problem:
Workflows and workflow-specific node types (
JoinNode,FunctionNode,ToolNode) defined in YAML config files could not be loaded or executed because:Workflowclass and workflow-specific nodes.Solution:
Workflow.from_configmethod to instantiate declarative workflow graphs from configuration inputs.Workflow,JoinNode,FunctionNode, andToolNodein_resolve_node_class..yamlconfigurations during parsing.Testing Plan
Unit Tests:
Summary of configuration-related test execution results:
uv run pytest tests/unittests/agents/test_agent_config.py36 passedManual End-to-End (E2E) Tests:
Verified the correctness of workflow config loading by instantiating complex multi-agent graphs from declarative configurations in
test_agent_config.py.Checklist
Additional context
N/A