{
  "name": "KyndredAI · Captura de leads → Google Sheets",
  "nodes": [
    {
      "parameters": {
        "content": "# 🔷 KyndredAI · Captura de leads → Google Sheets\n\nRecibe los envíos de tu formulario o landing y los guarda como filas en una planilla de Google Sheets. Sin código.\n\n**Cómo funciona:** el Webhook recibe el lead → valida que tenga email → normaliza los campos → agrega la fila en tu planilla.\n\n**Necesitás:** una credencial de Google Sheets (OAuth) + una planilla con encabezados: nombre · email · mensaje · fecha\n\n**Setup:** seguí los pasos ① ② ③ de abajo.\n\nProbado en n8n ~v2.26 (2026) · self-hosted o cloud · kyndredai.com",
        "height": 376,
        "width": 760,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [0, 0],
      "id": "11111111-1111-4111-8111-111111111111",
      "name": "README"
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "kyndredai-lead",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [60, 456],
      "id": "22222222-2222-4222-8222-222222222222",
      "name": "Recibir lead (Webhook)",
      "webhookId": "2a2a2a2a-2222-4222-8222-222222222222"
    },
    {
      "parameters": {
        "conditions": {
          "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "loose", "version": 2 },
          "conditions": [
            {
              "id": "3c3c3c3c-3333-4333-8333-333333333333",
              "leftValue": "={{ $json.body.email }}",
              "rightValue": "",
              "operator": { "type": "string", "operation": "exists", "singleValue": true }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [340, 456],
      "id": "33333333-3333-4333-8333-333333333333",
      "name": "Validar: ¿tiene email?"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            { "id": "4a000001-4444-4444-8444-444444444401", "name": "nombre", "value": "={{ $json.body.nombre }}", "type": "string" },
            { "id": "4a000002-4444-4444-8444-444444444402", "name": "email", "value": "={{ $json.body.email }}", "type": "string" },
            { "id": "4a000003-4444-4444-8444-444444444403", "name": "mensaje", "value": "={{ $json.body.mensaje }}", "type": "string" },
            { "id": "4a000004-4444-4444-8444-444444444404", "name": "fecha", "value": "={{ $now.toFormat('yyyy-LL-dd HH:mm') }}", "type": "string" }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [620, 456],
      "id": "44444444-4444-4444-8444-444444444444",
      "name": "Normalizar campos"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": { "__rl": true, "value": "", "mode": "list", "cachedResultName": "" },
        "sheetName": { "__rl": true, "value": "", "mode": "list", "cachedResultName": "" },
        "columns": {
          "mappingMode": "autoMapInputData",
          "value": {},
          "matchingColumns": [],
          "schema": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [900, 456],
      "id": "55555555-5555-4555-8555-555555555555",
      "name": "Guardar en Google Sheets",
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 2000
    },
    {
      "parameters": {
        "content": "## ① Conectá tu formulario\n\nApuntá tu formulario / landing a la URL de este Webhook (método **POST**).\n\nCampos esperados en el body:\n• nombre\n• email\n• mensaje\n\n*Tip:* tocá **Listen for test event** y mandá un POST de prueba.",
        "height": 364,
        "width": 260,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [0, 616],
      "id": "66666666-6666-4666-8666-666666666666",
      "name": "Setup 1"
    },
    {
      "parameters": {
        "content": "### Validación\n\nDescarta los envíos **sin email** (evita filas basura). Solo pasan los que tienen email; el resto se ignora.",
        "height": 368,
        "width": 240,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [300, 616],
      "id": "77777777-7777-4777-8777-777777777777",
      "name": "Nota validación"
    },
    {
      "parameters": {
        "content": "## ② Ajustá los campos\n\nAcá definís qué dato va a cada columna. Cambiá o agregá campos según tu formulario.\n\nPor defecto: **nombre, email, mensaje, fecha** (la fecha se completa sola).",
        "height": 372,
        "width": 260,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [580, 616],
      "id": "88888888-8888-4888-8888-888888888888",
      "name": "Setup 2"
    },
    {
      "parameters": {
        "content": "## ③ Conectá Google Sheets\n\n1. Abrí este nodo → **Credential** → *Create new* → conectá tu cuenta de Google.\n2. Elegí tu **planilla** (Document) y la **pestaña** (Sheet).\n3. En **Mapping**, dejá *Map Automatically* (mapea por nombre de columna).\n\n⚠️ Los encabezados de tu planilla deben coincidir con:\n**nombre · email · mensaje · fecha**",
        "height": 368,
        "width": 300,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [880, 616],
      "id": "99999999-9999-4999-8999-999999999999",
      "name": "Setup 3"
    }
  ],
  "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 }]]
    }
  },
  "active": false,
  "settings": { "executionOrder": "v1" },
  "pinData": {},
  "tags": []
}
