/ examples / workflows / complex_branching_workflow.yaml
complex_branching_workflow.yaml
  1  log:
  2    stdout_log_level: INFO
  3    log_file_level: DEBUG
  4    log_file: complex_branching_workflow.log
  5  
  6  !include ../shared_config.yaml
  7  
  8  apps:
  9    # ============================================================================
 10    # SIMPLE TEST AGENTS
 11    # These agents do nothing meaningful - just for testing workflow visualization
 12    # ============================================================================
 13  
 14    - name: agent_alpha_app
 15      app_base_path: .
 16      app_module: solace_agent_mesh.agent.sac.app
 17      broker:
 18        <<: *broker_connection
 19      app_config:
 20        namespace: ${NAMESPACE}
 21        agent_name: "AgentAlpha"
 22        model: *planning_model
 23        model_provider: 
 24          - "planning"
 25        instruction: "Test agent Alpha"
 26        input_schema: {type: object, properties: {data: {type: string}}}
 27        output_schema: {type: object, properties: {result: {type: string}}}
 28        tools:
 29          - tool_type: builtin-group
 30            group_name: "artifact_management"
 31        session_service: {<<: *default_session_service}
 32        artifact_service: {<<: *default_artifact_service}
 33        agent_card:
 34          description: "Test agent Alpha"
 35          skills: [{id: "alpha", name: "Alpha", description: "Alpha", tags: ["test"]}]
 36        agent_card_publishing: { interval_seconds: 10 }
 37        agent_discovery: { enabled: false }
 38  
 39    - name: agent_beta_app
 40      app_base_path: .
 41      app_module: solace_agent_mesh.agent.sac.app
 42      broker:
 43        <<: *broker_connection
 44      app_config:
 45        namespace: ${NAMESPACE}
 46        agent_name: "AgentBeta"
 47        model: *planning_model
 48        model_provider: 
 49          - "planning"
 50        instruction: "Test agent Beta"
 51        input_schema: {type: object, properties: {data: {type: string}}}
 52        output_schema: {type: object, properties: {result: {type: string}}}
 53        tools:
 54          - tool_type: builtin-group
 55            group_name: "artifact_management"
 56        session_service: {<<: *default_session_service}
 57        artifact_service: {<<: *default_artifact_service}
 58        agent_card:
 59          description: "Test agent Beta"
 60          skills: [{id: "beta", name: "Beta", description: "Beta", tags: ["test"]}]
 61        agent_card_publishing: { interval_seconds: 10 }
 62        agent_discovery: { enabled: false }
 63  
 64    - name: agent_gamma_app
 65      app_base_path: .
 66      app_module: solace_agent_mesh.agent.sac.app
 67      broker:
 68        <<: *broker_connection
 69      app_config:
 70        namespace: ${NAMESPACE}
 71        agent_name: "AgentGamma"
 72        model: *planning_model
 73        model_provider: 
 74          - "planning"
 75        instruction: "Test agent Gamma"
 76        input_schema: {type: object, properties: {data: {type: string}}}
 77        output_schema: {type: object, properties: {result: {type: string}}}
 78        tools:
 79          - tool_type: builtin-group
 80            group_name: "artifact_management"
 81        session_service: {<<: *default_session_service}
 82        artifact_service: {<<: *default_artifact_service}
 83        agent_card:
 84          description: "Test agent Gamma"
 85          skills: [{id: "gamma", name: "Gamma", description: "Gamma", tags: ["test"]}]
 86        agent_card_publishing: { interval_seconds: 10 }
 87        agent_discovery: { enabled: false }
 88  
 89    - name: agent_delta_app
 90      app_base_path: .
 91      app_module: solace_agent_mesh.agent.sac.app
 92      broker:
 93        <<: *broker_connection
 94      app_config:
 95        namespace: ${NAMESPACE}
 96        agent_name: "AgentDelta"
 97        model: *planning_model
 98        model_provider: 
 99          - "planning"
100        instruction: "Test agent Delta"
101        input_schema: {type: object, properties: {data: {type: string}}}
102        output_schema: {type: object, properties: {result: {type: string}}}
103        tools:
104          - tool_type: builtin-group
105            group_name: "artifact_management"
106        session_service: {<<: *default_session_service}
107        artifact_service: {<<: *default_artifact_service}
108        agent_card:
109          description: "Test agent Delta"
110          skills: [{id: "delta", name: "Delta", description: "Delta", tags: ["test"]}]
111        agent_card_publishing: { interval_seconds: 10 }
112        agent_discovery: { enabled: false }
113  
114    - name: agent_epsilon_app
115      app_base_path: .
116      app_module: solace_agent_mesh.agent.sac.app
117      broker:
118        <<: *broker_connection
119      app_config:
120        namespace: ${NAMESPACE}
121        agent_name: "AgentEpsilon"
122        model: *planning_model
123        model_provider: 
124          - "planning"
125        instruction: "Test agent Epsilon"
126        input_schema: {type: object, properties: {data: {type: string}}}
127        output_schema: {type: object, properties: {result: {type: string}}}
128        tools:
129          - tool_type: builtin-group
130            group_name: "artifact_management"
131        session_service: {<<: *default_session_service}
132        artifact_service: {<<: *default_artifact_service}
133        agent_card:
134          description: "Test agent Epsilon"
135          skills: [{id: "epsilon", name: "Epsilon", description: "Epsilon", tags: ["test"]}]
136        agent_card_publishing: { interval_seconds: 10 }
137        agent_discovery: { enabled: false }
138  
139    - name: agent_zeta_app
140      app_base_path: .
141      app_module: solace_agent_mesh.agent.sac.app
142      broker:
143        <<: *broker_connection
144      app_config:
145        namespace: ${NAMESPACE}
146        agent_name: "AgentZeta"
147        model: *planning_model
148        model_provider: 
149          - "planning"
150        instruction: "Test agent Zeta"
151        input_schema: {type: object, properties: {data: {type: string}}}
152        output_schema: {type: object, properties: {result: {type: string}}}
153        tools:
154          - tool_type: builtin-group
155            group_name: "artifact_management"
156        session_service: {<<: *default_session_service}
157        artifact_service: {<<: *default_artifact_service}
158        agent_card:
159          description: "Test agent Zeta"
160          skills: [{id: "zeta", name: "Zeta", description: "Zeta", tags: ["test"]}]
161        agent_card_publishing: { interval_seconds: 10 }
162        agent_discovery: { enabled: false }
163  
164    - name: agent_eta_app
165      app_base_path: .
166      app_module: solace_agent_mesh.agent.sac.app
167      broker:
168        <<: *broker_connection
169      app_config:
170        namespace: ${NAMESPACE}
171        agent_name: "AgentEta"
172        model: *planning_model
173        model_provider: 
174          - "planning"
175        instruction: "Test agent Eta"
176        input_schema: {type: object, properties: {data: {type: string}}}
177        output_schema: {type: object, properties: {result: {type: string}}}
178        tools:
179          - tool_type: builtin-group
180            group_name: "artifact_management"
181        session_service: {<<: *default_session_service}
182        artifact_service: {<<: *default_artifact_service}
183        agent_card:
184          description: "Test agent Eta"
185          skills: [{id: "eta", name: "Eta", description: "Eta", tags: ["test"]}]
186        agent_card_publishing: { interval_seconds: 10 }
187        agent_discovery: { enabled: false }
188  
189    - name: agent_theta_app
190      app_base_path: .
191      app_module: solace_agent_mesh.agent.sac.app
192      broker:
193        <<: *broker_connection
194      app_config:
195        namespace: ${NAMESPACE}
196        agent_name: "AgentTheta"
197        model: *planning_model
198        model_provider: 
199          - "planning"
200        instruction: "Test agent Theta"
201        input_schema: {type: object, properties: {data: {type: string}}}
202        output_schema: {type: object, properties: {result: {type: string}}}
203        tools:
204          - tool_type: builtin-group
205            group_name: "artifact_management"
206        session_service: {<<: *default_session_service}
207        artifact_service: {<<: *default_artifact_service}
208        agent_card:
209          description: "Test agent Theta"
210          skills: [{id: "theta", name: "Theta", description: "Theta", tags: ["test"]}]
211        agent_card_publishing: { interval_seconds: 10 }
212        agent_discovery: { enabled: false }
213  
214    - name: agent_iota_app
215      app_base_path: .
216      app_module: solace_agent_mesh.agent.sac.app
217      broker:
218        <<: *broker_connection
219      app_config:
220        namespace: ${NAMESPACE}
221        agent_name: "AgentIota"
222        model: *planning_model
223        model_provider: 
224          - "planning"
225        instruction: "Test agent Iota"
226        input_schema: {type: object, properties: {data: {type: string}}}
227        output_schema: {type: object, properties: {result: {type: string}}}
228        tools:
229          - tool_type: builtin-group
230            group_name: "artifact_management"
231        session_service: {<<: *default_session_service}
232        artifact_service: {<<: *default_artifact_service}
233        agent_card:
234          description: "Test agent Iota"
235          skills: [{id: "iota", name: "Iota", description: "Iota", tags: ["test"]}]
236        agent_card_publishing: { interval_seconds: 10 }
237        agent_discovery: { enabled: false }
238  
239    - name: agent_kappa_app
240      app_base_path: .
241      app_module: solace_agent_mesh.agent.sac.app
242      broker:
243        <<: *broker_connection
244      app_config:
245        namespace: ${NAMESPACE}
246        agent_name: "AgentKappa"
247        model: *planning_model
248        model_provider: 
249          - "planning"
250        instruction: "Test agent Kappa"
251        input_schema: {type: object, properties: {data: {type: string}}}
252        output_schema: {type: object, properties: {result: {type: string}}}
253        tools:
254          - tool_type: builtin-group
255            group_name: "artifact_management"
256        session_service: {<<: *default_session_service}
257        artifact_service: {<<: *default_artifact_service}
258        agent_card:
259          description: "Test agent Kappa"
260          skills: [{id: "kappa", name: "Kappa", description: "Kappa", tags: ["test"]}]
261        agent_card_publishing: { interval_seconds: 10 }
262        agent_discovery: { enabled: false }
263  
264    - name: agent_lambda_app
265      app_base_path: .
266      app_module: solace_agent_mesh.agent.sac.app
267      broker:
268        <<: *broker_connection
269      app_config:
270        namespace: ${NAMESPACE}
271        agent_name: "AgentLambda"
272        model: *planning_model
273        model_provider: 
274          - "planning"
275        instruction: "Test agent Lambda"
276        input_schema: {type: object, properties: {data: {type: string}}}
277        output_schema: {type: object, properties: {result: {type: string}}}
278        tools:
279          - tool_type: builtin-group
280            group_name: "artifact_management"
281        session_service: {<<: *default_session_service}
282        artifact_service: {<<: *default_artifact_service}
283        agent_card:
284          description: "Test agent Lambda"
285          skills: [{id: "lambda", name: "Lambda", description: "Lambda", tags: ["test"]}]
286        agent_card_publishing: { interval_seconds: 10 }
287        agent_discovery: { enabled: false }
288  
289    - name: agent_mu_app
290      app_base_path: .
291      app_module: solace_agent_mesh.agent.sac.app
292      broker:
293        <<: *broker_connection
294      app_config:
295        namespace: ${NAMESPACE}
296        agent_name: "AgentMu"
297        model: *planning_model
298        model_provider: 
299          - "planning"
300        instruction: "Test agent Mu"
301        input_schema: {type: object, properties: {data: {type: string}}}
302        output_schema: {type: object, properties: {result: {type: string}}}
303        tools:
304          - tool_type: builtin-group
305            group_name: "artifact_management"
306        session_service: {<<: *default_session_service}
307        artifact_service: {<<: *default_artifact_service}
308        agent_card:
309          description: "Test agent Mu"
310          skills: [{id: "mu", name: "Mu", description: "Mu", tags: ["test"]}]
311        agent_card_publishing: { interval_seconds: 10 }
312        agent_discovery: { enabled: false }
313  
314    # ============================================================================
315    # WORKFLOW: Complex Branching Test
316    # Lots of branches, switches, maps, loops for testing visualization
317    # ============================================================================
318    - name: complex_branching_workflow
319      app_base_path: .
320      app_module: solace_agent_mesh.workflow.app
321      broker:
322        <<: *broker_connection
323  
324      app_config:
325        namespace: ${NAMESPACE}
326        name: "ComplexBranchingWorkflow"
327        display_name: "Complex Branching Test Workflow"
328  
329        workflow:
330          version: "1.0.0"
331          description: |
332            A complex workflow for testing the visualization with many branches,
333            parallel paths, nested containers, and multiple switch nodes.
334  
335          input_schema:
336            type: object
337            properties:
338              mode:
339                type: string
340                enum: ["fast", "normal", "slow", "ultra"]
341              items:
342                type: array
343                items: {type: object}
344              enable_loop:
345                type: boolean
346            required: [mode, items]
347  
348          output_schema:
349            type: object
350            properties:
351              status: {type: string}
352  
353          nodes:
354            # ====================================================================
355            # ENTRY: Initial processing
356            # ====================================================================
357            - id: entry_processor
358              type: agent
359              agent_name: "AgentAlpha"
360              input:
361                data: "{{workflow.input.mode}}"
362  
363            # ====================================================================
364            # FIRST BRANCH: Three parallel paths from entry
365            # ====================================================================
366            - id: path_a_start
367              type: agent
368              agent_name: "AgentBeta"
369              depends_on: [entry_processor]
370              input:
371                data: "path_a"
372  
373            - id: path_b_start
374              type: agent
375              agent_name: "AgentGamma"
376              depends_on: [entry_processor]
377              input:
378                data: "path_b"
379  
380            - id: path_c_start
381              type: agent
382              agent_name: "AgentDelta"
383              depends_on: [entry_processor]
384              input:
385                data: "path_c"
386  
387            # ====================================================================
388            # PATH A: Contains a switch with 4 branches
389            # ====================================================================
390            - id: path_a_switch
391              type: switch
392              depends_on: [path_a_start]
393              cases:
394                - condition: "'{{workflow.input.mode}}' == 'fast'"
395                  node: fast_handler
396                - condition: "'{{workflow.input.mode}}' == 'normal'"
397                  node: normal_handler
398                - condition: "'{{workflow.input.mode}}' == 'slow'"
399                  node: slow_handler
400              default: ultra_handler
401  
402            - id: fast_handler
403              type: agent
404              agent_name: "AgentEpsilon"
405              depends_on: [path_a_switch]
406              input:
407                data: "fast"
408  
409            - id: normal_handler
410              type: agent
411              agent_name: "AgentZeta"
412              depends_on: [path_a_switch]
413              input:
414                data: "normal"
415  
416            - id: slow_handler
417              type: agent
418              agent_name: "AgentEta"
419              depends_on: [path_a_switch]
420              input:
421                data: "slow"
422  
423            - id: ultra_handler
424              type: agent
425              agent_name: "AgentTheta"
426              depends_on: [path_a_switch]
427              input:
428                data: "ultra"
429  
430            # Path A continuation after switch
431            - id: path_a_merge
432              type: agent
433              agent_name: "AgentIota"
434              depends_on: [fast_handler, normal_handler, slow_handler, ultra_handler]
435              input:
436                data: "merged"
437  
438            # ====================================================================
439            # PATH B: Contains a map node
440            # ====================================================================
441            - id: path_b_map
442              type: map
443              depends_on: [path_b_start]
444              items: "{{workflow.input.items}}"
445              node: item_processor
446  
447            - id: item_processor
448              type: agent
449              agent_name: "AgentKappa"
450              input:
451                data: "{{_map_item}}"
452  
453            # Path B continuation after map
454            - id: path_b_post_map
455              type: agent
456              agent_name: "AgentLambda"
457              depends_on: [path_b_map]
458              input:
459                data: "post_map"
460  
461            # ====================================================================
462            # PATH C: Contains a loop node
463            # ====================================================================
464            - id: path_c_loop
465              type: loop
466              depends_on: [path_c_start]
467              node: loop_body
468              condition: "{{loop_body.output.continue}} == true"
469              max_iterations: 3
470  
471            - id: loop_body
472              type: agent
473              agent_name: "AgentMu"
474              input:
475                data: "iteration_{{_loop_iteration}}"
476  
477            # Path C continuation after loop
478            - id: path_c_post_loop
479              type: agent
480              agent_name: "AgentAlpha"
481              depends_on: [path_c_loop]
482              input:
483                data: "post_loop"
484  
485            # ====================================================================
486            # SECOND MERGE: All three paths come together
487            # ====================================================================
488            - id: merge_all_paths
489              type: agent
490              agent_name: "AgentBeta"
491              depends_on: [path_a_merge, path_b_post_map, path_c_post_loop]
492              input:
493                data: "all_merged"
494  
495            # ====================================================================
496            # FINAL SWITCH: Two more branches before exit
497            # ====================================================================
498            - id: final_switch
499              type: switch
500              depends_on: [merge_all_paths]
501              cases:
502                - condition: "{{workflow.input.enable_loop}} == true"
503                  node: enabled_path
504              default: disabled_path
505  
506            - id: enabled_path
507              type: agent
508              agent_name: "AgentGamma"
509              depends_on: [final_switch]
510              input:
511                data: "enabled"
512  
513            - id: disabled_path
514              type: agent
515              agent_name: "AgentDelta"
516              depends_on: [final_switch]
517              input:
518                data: "disabled"
519  
520            # ====================================================================
521            # EXIT: Final processing
522            # ====================================================================
523            - id: exit_processor
524              type: agent
525              agent_name: "AgentEpsilon"
526              depends_on: [enabled_path, disabled_path]
527              input:
528                data: "exit"
529  
530          output_mapping:
531            status: "{{exit_processor.output.result}}"
532  
533          skills:
534            - id: "complex_test"
535              name: "Complex Test"
536              description: "Tests complex branching visualization"
537              tags: ["test", "visualization"]
538  
539        session_service:
540          <<: *default_session_service
541        artifact_service:
542          <<: *default_artifact_service
543  
544        agent_card_publishing: { interval_seconds: 10 }
545        agent_discovery: { enabled: false }