name: parallel_fanout
description: 一份輸入分發多個子 workflow 並行處理（trigger_workflow 模式）

flow:
  - "input >> ON_SUCCESS >> dispatch_to_summary"
  - "input >> ON_SUCCESS >> dispatch_to_translate"
  - "input >> ON_SUCCESS >> dispatch_to_classify"

config:
  # 三個並行子 workflow 觸發。各自獨立執行、互不影響、不等彼此
  # cypher-executor 處理 fan-out：三條邊同源 (input) → 三個目標各自跑
  dispatch_to_summary:
    component: trigger_workflow
    workflow_name: "llm_classify_example"   # 改成你的 summary workflow
    api_key: "{{api_key}}"
    input:
      api_key: "{{api_key}}"
      text: "{{input.text}}"

  dispatch_to_translate:
    component: trigger_workflow
    workflow_name: "your_translate_workflow"
    api_key: "{{api_key}}"
    input:
      api_key: "{{api_key}}"
      text: "{{input.text}}"
      target_lang: "{{input.target_lang}}"

  dispatch_to_classify:
    component: trigger_workflow
    workflow_name: "llm_classify_example"
    api_key: "{{api_key}}"
    input:
      api_key: "{{api_key}}"
      text: "{{input.text}}"
