{
  "template_id": "TPL-02",
  "filename": "tpl_02_merchandising_12_steps_with_wia.json",
  "name": "Plantilla 02 — Merchandising: Proceso Comercial Híbrido con Extracción IA, Resumen IA y WIA",
  "category": "Merchandising",
  "tutorial_code": "FA-13",
  "trigger_type": "message_created",
  "description": "Variante híbrida con WIA: utiliza ai_extract para capturar atributos de la conversación, crea oportunidad en Kanban, genera resumen ejecutivo en nota privada (ai_summary) y deriva a ventas o a WIA fuera de horario.",
  "definition": {
    "nodes": [
      {
        "id": "trigger_1",
        "type": "trigger",
        "position": {
          "x": 100,
          "y": 200
        },
        "data": {
          "mode": "event",
          "event": "message_created",
          "once_per_conversation": true,
          "ignore_groups": true
        }
      },
      {
        "id": "msg_bienvenida",
        "type": "message",
        "position": {
          "x": 360,
          "y": 200
        },
        "data": {
          "body": "¡Hola {{ contact.first_name }}! Cuéntanos qué producto corporativo necesitas, qué cantidad aproximada buscas y para qué fecha es tu evento:",
          "buttons": [
            {
              "id": "cotizar_ia",
              "title": "Cotizar proyecto"
            },
            {
              "id": "dudas_ia",
              "title": "Hacer una consulta"
            }
          ]
        }
      },
      {
        "id": "ai_ext_1",
        "type": "ai_extract",
        "position": {
          "x": 640,
          "y": 120
        },
        "data": {
          "mode": "notes",
          "result_name": "notas_extraidas"
        }
      },
      {
        "id": "kanban_1",
        "type": "kanban",
        "position": {
          "x": 920,
          "y": 120
        },
        "data": {
          "mode": "create",
          "funnel_id": 1,
          "funnel_stage": "stage_1",
          "result_name": "card_merch_ia"
        }
      },
      {
        "id": "ai_sum_1",
        "type": "ai_summary",
        "position": {
          "x": 1200,
          "y": 120
        },
        "data": {
          "result_name": "resumen_ejecutivo",
          "private_note": true
        }
      },
      {
        "id": "cond_horario",
        "type": "condition",
        "position": {
          "x": 1480,
          "y": 120
        },
        "data": {
          "combinator": "and",
          "conditions": [
            {
              "left": "{{ inbox.working_now }}",
              "operator": "equals",
              "value": "true"
            }
          ]
        }
      },
      {
        "id": "handoff_1",
        "type": "handoff",
        "position": {
          "x": 1760,
          "y": 60
        },
        "data": {
          "to": "inbox",
          "end_flow": true
        }
      },
      {
        "id": "captain_1",
        "type": "captain",
        "position": {
          "x": 1760,
          "y": 240
        },
        "data": {}
      }
    ],
    "edges": [
      {
        "id": "e1",
        "source": "trigger_1",
        "target": "msg_bienvenida",
        "sourceHandle": "right"
      },
      {
        "id": "e2",
        "source": "msg_bienvenida",
        "target": "ai_ext_1",
        "sourceHandle": "cotizar_ia"
      },
      {
        "id": "e3",
        "source": "msg_bienvenida",
        "target": "captain_1",
        "sourceHandle": "dudas_ia"
      },
      {
        "id": "e4",
        "source": "ai_ext_1",
        "target": "kanban_1",
        "sourceHandle": "right"
      },
      {
        "id": "e4_err",
        "source": "ai_ext_1",
        "target": "kanban_1",
        "sourceHandle": "error"
      },
      {
        "id": "e5",
        "source": "kanban_1",
        "target": "ai_sum_1",
        "sourceHandle": "right"
      },
      {
        "id": "e6",
        "source": "ai_sum_1",
        "target": "cond_horario",
        "sourceHandle": "right"
      },
      {
        "id": "e6_err",
        "source": "ai_sum_1",
        "target": "cond_horario",
        "sourceHandle": "error"
      },
      {
        "id": "e7",
        "source": "cond_horario",
        "target": "handoff_1",
        "sourceHandle": "true"
      },
      {
        "id": "e8",
        "source": "cond_horario",
        "target": "captain_1",
        "sourceHandle": "false"
      }
    ],
    "metadata": {
      "schema_version": 1
    }
  }
}