Overview
Solace Agent Mesh executes workflows using a DAG (Directed Acyclic Graph) executor that coordinates agent invocations based on node dependencies. This page explains the execution model.Execution Lifecycle
1. Workflow Invocation
Workflows are invoked like agents via the A2A protocol:2. State Initialization
The workflow executor creates an execution context:3. DAG Validation
Before execution, the DAG is validated for:- Cycle detection: No circular dependencies
- Reference validation: All
depends_onreferences exist - Reachability: All nodes are reachable from entry points
- Control flow consistency: Switch/map/loop targets have proper dependencies
4. Node Scheduling
The DAG executor uses topological scheduling:5. Node Execution
Each node type has specific execution logic:Agent/Workflow Nodes
- Generate unique
sub_task_id - Resolve input templates
- Publish
WorkflowNodeExecutionStartDataevent - Invoke agent via A2A (see Task Invocation)
- Register timeout handler
- Wait for response asynchronously
Switch Nodes
- Evaluate cases in order
- Select first matching branch
- Skip all non-selected branches
- Mark switch node complete
- Continue execution
Map Nodes
- Resolve
itemsarray - Create iteration state for each item
- Launch iterations up to
concurrency_limit - Execute inner node for each item with
_map_itemand_map_index - Track completion and launch remaining iterations
- Mark map complete when all items finish
Loop Nodes
- Check iteration count against
max_iterations - Evaluate condition (skip on first iteration)
- If continue, execute inner node with
_loop_iteration - Wait for completion
- Re-execute loop node to check condition again
- Mark loop complete when condition false or max iterations reached
6. Node Completion Handling
When a node completes:7. Exit Handlers
Before finalization, exit handlers execute based on outcome:8. Workflow Finalization
Success Finalization
Failure Finalization
Similar to success, but with error artifact andTaskState.failed.
Template Resolution
Template expressions are resolved dynamically during execution:Template Path Resolution
State Persistence
Workflow state is persisted to the session service:- Resumption after component restart
- Debugging via state inspection
- Audit trail of execution history
Cancellation
Workflows support graceful cancellation:Events and Observability
Workflows publish structured events for observability:Workflow Events
WorkflowExecutionStartDataEvent Streaming
Events are published via A2A status updates:Error Handling
Node Failure
When a node fails:Timeout Handling
Nodes have configurable timeouts:Performance Considerations
Artifact Caching
Node outputs are cached in workflow state to avoid repeated loading:Concurrency Control
Map nodes support concurrency limits:State Persistence
State is persisted after each node completion to enable resumption.Next Steps
A2A Task Invocation
Learn how workflows are invoked via A2A protocol
A2A Streaming
Understand workflow event streaming