feat(DATAGO-114389): PR 5c: Workflow Runtime - Advanced Node Types #712
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.
PR 5c: Workflow Runtime - Advanced Node Types
Overview
This PR completes the DAG executor with advanced node types: switch (multi-way branching), loop (while iteration), and map (parallel for-each). It also includes the AgentCaller for A2A communication with agents.
Branch Information
pr/workflows-5c-advanced-nodespr/workflows-5b-dag-coreFiles Changed
src/solace_agent_mesh/workflow/dag_executor.py(lines ~700-1382)Advanced node execution methods:
_execute_switch_node()_execute_loop_node()_execute_map_node()_launch_map_iterations()_skip_branch()resolve_value()handle_node_completion()_finalize_map_node()src/solace_agent_mesh/workflow/agent_caller.pyAgent invocation via A2A (~350 lines):
call_agent()_resolve_node_input()_construct_agent_message()_create_input_artifact()_publish_agent_request()Key Concepts
Switch Node Execution
Multi-way branching evaluates cases in order:
Loop Node Execution
While-loop with "do-while" semantics:
Iteration tracking:
_loop_iteration: Current iteration indexMap Node Execution
Parallel for-each with concurrency control:
Iteration context:
_map_item: Current item being processed_map_index: Index of current itemprocess_items_0,process_items_1, etc.Value Resolution
The
resolve_value()method handles:"{{step1.output.field}}""{{step1.output.data.items[0].name}}"workflow.input.*: Workflow input data_map_item: Current map iteration item_map_index: Current map iteration index_loop_iteration: Current loop iterationNode Completion Handling
handle_node_completion()processes agent responses:StructuredInvocationResultnode_outputsexecute_workflow()to process next nodesAgent Caller Flow