{
  "name": "KyndredAI · Lead → Google Sheets + email de bienvenida",
  "nodes": [
    {
      "parameters": {
        "content": "# 🔷 KyndredAI · Lead → Google Sheets + email de bienvenida\n\nRecibe un lead de tu formulario, lo **guarda en Google Sheets** y le manda un **email de bienvenida automático** por Gmail. Captura + nurture en un solo flujo.\n\n**Cómo funciona:** Webhook recibe el lead → valida email → normaliza → guarda en la planilla → envía el email de bienvenida.\n\n**Necesitás:** una credencial de **Google Sheets** + una de **Gmail** (la misma cuenta de Google sirve para las dos).\n\n**Setup:** seguí los pasos ① ② ③ de abajo.\n\nProbado en n8n ~v2.26 (2026) · self-hosted o cloud · kyndredai.com",
        "height": 352,
        "width": 820,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        272,
        48
      ],
      "id": "e4e84725-a687-4160-8e0c-64ecb8870913",
      "name": "README"
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "kyndredai-lead",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        48,
        448
      ],
      "id": "db04da0e-3967-46ed-a336-befebda8f4ec",
      "name": "Recibir lead (Webhook)",
      "webhookId": "10000000-0000-4000-8000-000000000012"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose",
            "version": 2
          },
          "conditions": [
            {
              "id": "20000001-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": "ad5a0c2d-0b91-4db6-b145-cd9263939fa5",
      "name": "Validar: ¿tiene email?"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "30000001-0000-4000-8000-000000000001",
              "name": "nombre",
              "value": "={{ $json.body.nombre }}",
              "type": "string"
            },
            {
              "id": "30000002-0000-4000-8000-000000000002",
              "name": "email",
              "value": "={{ $json.body.email }}",
              "type": "string"
            },
            {
              "id": "30000003-0000-4000-8000-000000000003",
              "name": "mensaje",
              "value": "={{ $json.body.mensaje }}",
              "type": "string"
            },
            {
              "id": "30000004-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": "6e81cbdc-eeb7-4b9e-acb8-eb00bb6eaccd",
      "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": "27fcd9d3-e817-4cea-a498-98629d1b1bc8",
      "name": "Guardar en Google Sheets",
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 2000
    },
    {
      "parameters": {
        "sendTo": "={{ $('Normalizar campos').item.json.email }}",
        "subject": "=¡Gracias por tu mensaje, {{ $('Normalizar campos').item.json.nombre }}!",
        "emailType": "text",
        "message": "=Hola {{ $('Normalizar campos').item.json.nombre }},\n\n¡Gracias por escribirnos! Recibimos tu mensaje y te vamos a responder a la brevedad.\n\nEsto es lo que nos dejaste:\n\"{{ $('Normalizar campos').item.json.mensaje }}\"\n\n¡Saludos!",
        "options": {}
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        1184,
        448
      ],
      "id": "62dfe17b-c808-42fd-9558-166d82705068",
      "name": "Enviar email de bienvenida",
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 2000,
      "webhookId": "ad6b6f3e-429f-43f8-84a1-ae156fbcebe2"
    },
    {
      "parameters": {
        "content": "## ① Conectá tu formulario\n\nApuntá tu formulario / landing a la URL de este Webhook (**POST**).\n\nCampos esperados en el body:\n• nombre\n• email\n• mensaje\n\n*Tip:* **Listen for test event** + un POST de prueba.",
        "height": 332,
        "width": 324,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        624
      ],
      "id": "3f1554d1-65a6-4f9f-b375-06be30e6729d",
      "name": "Setup 1"
    },
    {
      "parameters": {
        "content": "### Validación\n\nDescarta los envíos **sin email** (evita filas basura y mails fallidos).",
        "height": 168,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        352,
        624
      ],
      "id": "a51b4d81-e9ca-44b7-af9a-09be18a471a6",
      "name": "Nota validación"
    },
    {
      "parameters": {
        "content": "## ② Conectá Google Sheets\n\n1. **Guardar en Google Sheets** → Credential → conectá tu Google.\n2. Elegí planilla + pestaña, mapeo **Map Automatically**.\n\nEncabezados: **nombre · email · mensaje · fecha**",
        "height": 280,
        "width": 324,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        752,
        624
      ],
      "id": "580b7dcc-8e29-44b2-97b3-fb001fbab544",
      "name": "Setup 2"
    },
    {
      "parameters": {
        "content": "## ③ Conectá Gmail\n\n1. **Enviar email de bienvenida** → Credential → conectá tu Gmail.\n2. Personalizá **asunto** y **cuerpo** a gusto (usan `nombre` y `mensaje`).\n\n💡 Podés cambiar `emailType` a **html** para un mail con diseño.",
        "height": 284,
        "width": 332,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1104,
        624
      ],
      "id": "9797a15f-bbc7-4e01-aa37-3e4b47e8d826",
      "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": "Enviar email de bienvenida",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": { "executionOrder": "v1" },
  "tags": []
}