{
  "name": "LiveConnect 02 \u2014 Env\u00edo masivo de plantillas WABA",
  "nodes": [
    {
      "parameters": {
        "content": "## Env\u00edo masivo de plantillas (WhatsApp Business API)\n\n1. Reemplaza el nodo **Destinatarios (demo)** por tu fuente real: Google Sheets, base de datos, o `Contacto \u00b7 Obtener Varios` del propio nodo LiveConnect.\n2. En **Enviar plantilla** elige el **Canal** y la **Plantilla** en los desplegables: la etiqueta de la plantilla dice cu\u00e1ntas variables pide y si lleva imagen o video.\n3. Para los valores que cambian en cada fila tienes dos caminos:\n   - Llenar los campos **Variable {{1}}, {{2}}\u2026** con expresiones (`{{ $json.nombre }}`).\n   - O mandarlos todos juntos por **Campos Adicionales \u2192 Variables del Cuerpo Separadas por Comas**, que es lo que hace este ejemplo y tambi\u00e9n sirve cuando la plantilla se elige con una expresi\u00f3n.\n4. El **Wait** de 2 s regula el ritmo de env\u00edo (aj\u00fastalo seg\u00fan tu l\u00edmite de WABA).\n\nCada item debe traer `numero` (celular destino) y `variables` (CSV en el orden de la plantilla).",
        "height": 320,
        "width": 440
      },
      "id": "b2000000-0000-4000-8000-000000000001",
      "name": "Instrucciones",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        -140
      ]
    },
    {
      "parameters": {},
      "id": "b2000000-0000-4000-8000-000000000002",
      "name": "Ejecutar manualmente",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        480,
        40
      ]
    },
    {
      "parameters": {
        "jsCode": "// DEMO: reemplaza por Google Sheets, MySQL, o LiveConnect Contact \u00b7 Get Many\nreturn [\n\t{ json: { numero: '573001112233', variables: 'Ana,Plan Pro' } },\n\t{ json: { numero: '573004445566', variables: 'Luis,Plan B\u00e1sico' } },\n];"
      },
      "id": "b2000000-0000-4000-8000-000000000003",
      "name": "Destinatarios (demo)",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        700,
        40
      ]
    },
    {
      "parameters": {
        "batchSize": 10,
        "options": {}
      },
      "id": "b2000000-0000-4000-8000-000000000004",
      "name": "Por lotes",
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        920,
        40
      ]
    },
    {
      "parameters": {
        "resource": "waba",
        "operation": "sendTemplate",
        "id_canal": "",
        "numero": "={{ $json.numero }}",
        "id_plantilla": "",
        "additionalFields": {
          "variables_csv": "={{ $json.variables }}"
        }
      },
      "id": "b2000000-0000-4000-8000-000000000005",
      "name": "Enviar plantilla",
      "type": "n8n-nodes-liveconnect.liveConnect",
      "typeVersion": 1,
      "position": [
        1140,
        60
      ]
    },
    {
      "parameters": {
        "amount": 2
      },
      "id": "b2000000-0000-4000-8000-000000000006",
      "name": "Pausa anti-l\u00edmite",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        1360,
        60
      ]
    },
    {
      "parameters": {},
      "id": "b2000000-0000-4000-8000-000000000007",
      "name": "Fin",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        1140,
        -120
      ]
    }
  ],
  "connections": {
    "Ejecutar manualmente": {
      "main": [
        [
          {
            "node": "Destinatarios (demo)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Destinatarios (demo)": {
      "main": [
        [
          {
            "node": "Por lotes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Por lotes": {
      "main": [
        [
          {
            "node": "Fin",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Enviar plantilla",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enviar plantilla": {
      "main": [
        [
          {
            "node": "Pausa anti-l\u00edmite",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pausa anti-l\u00edmite": {
      "main": [
        [
          {
            "node": "Por lotes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  }
}