{
  "name": "KyndredAI · Lead → Google Sheets + aviso por Telegram",
  "nodes": [
    {
      "parameters": {
        "content": "# 🔷 KyndredAI · Lead → Google Sheets + aviso por Telegram\n\nRecibe un lead, lo **guarda en Google Sheets** y te **avisa al instante por Telegram**. Ideal para no perder ningún contacto.\n\n**Cómo funciona:** Webhook recibe el lead → valida email → normaliza → guarda en la planilla → te manda un Telegram.\n\n**Necesitás:** una credencial de **Google Sheets** + un **bot de Telegram** (gratis, vía @BotFather).\n\n**Setup:** seguí los pasos ① ② ③ de abajo.\n\nProbado en n8n ~v2.26 (2026) · self-hosted o cloud · kyndredai.com",
        "height": 332,
        "width": 820,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        272,
        64
      ],
      "id": "8a482feb-a726-47a5-84cb-a446dc7e7138",
      "name": "README"
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "kyndredai-lead",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        48,
        448
      ],
      "id": "b127362b-3c87-4bf3-8709-44c912c029df",
      "name": "Recibir lead (Webhook)",
      "webhookId": "30000000-0000-4000-8000-000000000022"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose",
            "version": 2
          },
          "conditions": [
            {
              "id": "31000001-0000-4000-8000-000000000001",
              "leftValue": "={{ $json.body.email }}",
              "rightValue": "",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        352,
        448
      ],
      "id": "c7feef80-f841-42d8-a6b8-b82c85c88c33",
      "name": "Validar: ¿tiene email?"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "32000001-0000-4000-8000-000000000001",
              "name": "nombre",
              "value": "={{ $json.body.nombre }}",
              "type": "string"
            },
            {
              "id": "32000002-0000-4000-8000-000000000002",
              "name": "email",
              "value": "={{ $json.body.email }}",
              "type": "string"
            },
            {
              "id": "32000003-0000-4000-8000-000000000003",
              "name": "mensaje",
              "value": "={{ $json.body.mensaje }}",
              "type": "string"
            },
            {
              "id": "32000004-0000-4000-8000-000000000004",
              "name": "fecha",
              "value": "={{ $now.toFormat('yyyy-LL-dd HH:mm') }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        624,
        448
      ],
      "id": "51c77fcf-6ede-4704-bda2-da88422fdd0f",
      "name": "Normalizar campos"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "",
          "mode": "list",
          "cachedResultName": ""
        },
        "sheetName": {
          "__rl": true,
          "value": "",
          "mode": "list",
          "cachedResultName": ""
        }
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        912,
        448
      ],
      "id": "ad346c6e-1198-4037-a296-ab81ba0f8330",
      "name": "Guardar en Google Sheets",
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 2000
    },
    {
      "parameters": {
        "chatId": "TU_CHAT_ID",
        "text": "=🔔 Nuevo lead\n\n👤 {{ $('Normalizar campos').item.json.nombre }}\n✉️ {{ $('Normalizar campos').item.json.email }}\n💬 {{ $('Normalizar campos').item.json.mensaje }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        1184,
        448
      ],
      "id": "63e238f7-1bf4-4e81-8044-41b374de15a2",
      "name": "Avisar por Telegram",
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 2000,
      "webhookId": "4f2a5819-423e-45fd-a175-0f0fdf8017db"
    },
    {
      "parameters": {
        "content": "## ① Conectá tu formulario\n\nApuntá tu formulario / landing a la URL de este Webhook (**POST**).\n\nCampos esperados:\n• nombre\n• email\n• mensaje",
        "height": 280,
        "width": 260,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        624
      ],
      "id": "40b387de-7935-470e-9810-f61bbe065965",
      "name": "Setup 1"
    },
    {
      "parameters": {
        "content": "### Validación\n\nDescarta envíos **sin email** (evita filas basura).",
        "height": 148,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        304,
        624
      ],
      "id": "1fd26fe4-4493-4ddb-a39c-675e2d87ab4a",
      "name": "Nota validación"
    },
    {
      "parameters": {
        "content": "## ② Conectá Google Sheets\n\n**Guardar en Google Sheets** → Credential → tu Google → planilla + pestaña, mapeo **Map Automatically**.\n\nEncabezados: **nombre · email · mensaje · fecha**",
        "height": 232,
        "width": 324,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        768,
        624
      ],
      "id": "45abb18b-6470-4d76-973c-6fa398e04130",
      "name": "Setup 2"
    },
    {
      "parameters": {
        "content": "## ③ Conectá Telegram\n\n1. Creá un bot con **@BotFather** → te da un *token* → ponelo en la credencial de Telegram.\n2. Tu **Chat ID:** escribile a **@get_id_bot** → pegá el número en el campo `chatId` (reemplazá `TU_CHAT_ID`).",
        "height": 236,
        "width": 300,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1120,
        624
      ],
      "id": "21d42f68-4e4c-43b1-b261-cc02934c5a8b",
      "name": "Setup 3"
    }
  ],
  "pinData": {},
  "connections": {
    "Recibir lead (Webhook)": {
      "main": [
        [
          {
            "node": "Validar: ¿tiene email?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validar: ¿tiene email?": {
      "main": [
        [
          {
            "node": "Normalizar campos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalizar campos": {
      "main": [
        [
          {
            "node": "Guardar en Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Guardar en Google Sheets": {
      "main": [
        [
          {
            "node": "Avisar por Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": { "executionOrder": "v1" },
  "tags": []
}