{
  "template_id": "TPL-09",
  "filename": "tpl_09_hybrid_flow_builder_plus_wia.json",
  "name": "Plantilla 09 — Flow Builder + WIA: Triaje Determinístico Inicial y Continuidad con WIA",
  "category": "Flow Builder + WIA",
  "tutorial_code": "FA-26",
  "trigger_type": "message_created",
  "description": "Combina bienvenida con botones (0 consumo IA), extracción de datos y transferencia controlada a WIA o a agentes humanos según disponibilidad en línea.",
  "definition": {
    "nodes": [
      {
        "id": "trig_hyb",
        "type": "trigger",
        "position": {
          "x": 100,
          "y": 200
        },
        "data": {
          "mode": "event",
          "event": "message_created",
          "once_per_conversation": true,
          "ignore_groups": true
        }
      },
      {
        "id": "cond_agents",
        "type": "condition",
        "position": {
          "x": 380,
          "y": 200
        },
        "data": {
          "combinator": "and",
          "conditions": [
            {
              "left": "{{ inbox.online_agents }}",
              "operator": "greater_than",
              "value": "0"
            }
          ]
        }
      },
      {
        "id": "msg_menu_hyb",
        "type": "message",
        "position": {
          "x": 660,
          "y": 100
        },
        "data": {
          "body": "¡Hola {{ contact.first_name }}! Elige cómo prefieres continuar:",
          "buttons": [
            {
              "id": "ia_rapida",
              "title": "Asistencia con IA"
            },
            {
              "id": "humano",
              "title": "Esperar a un asesor"
            }
          ]
        }
      },
      {
        "id": "captain_hyb",
        "type": "captain",
        "position": {
          "x": 960,
          "y": 240
        },
        "data": {}
      },
      {
        "id": "handoff_hyb",
        "type": "handoff",
        "position": {
          "x": 960,
          "y": 80
        },
        "data": {
          "to": "inbox",
          "end_flow": true
        }
      }
    ],
    "edges": [
      {
        "id": "e1",
        "source": "trig_hyb",
        "target": "cond_agents",
        "sourceHandle": "right"
      },
      {
        "id": "e2",
        "source": "cond_agents",
        "target": "msg_menu_hyb",
        "sourceHandle": "true"
      },
      {
        "id": "e3",
        "source": "cond_agents",
        "target": "captain_hyb",
        "sourceHandle": "false"
      },
      {
        "id": "e4",
        "source": "msg_menu_hyb",
        "target": "captain_hyb",
        "sourceHandle": "ia_rapida"
      },
      {
        "id": "e5",
        "source": "msg_menu_hyb",
        "target": "handoff_hyb",
        "sourceHandle": "humano"
      }
    ],
    "metadata": {
      "schema_version": 1
    }
  }
}