{
  "name": "Enriquecimiento de Leads",
  "nodes": [
    {
      "parameters": {
        "content": "## 🎯 Enriquecimiento de Leads\n\n**Qué hace:** Clasifica cada lead por tamaño de empresa (Enterprise > 500 empleados, Medium 50–500, Small < 50) y lo guarda en Google Sheets.\n\n**Cómo usarlo:**\n1. Importa este archivo: Workflows → Import from File.\n2. En *Guardar en Google Sheets*, conecta tu credencial de Google y reemplaza TU_SHEET_ID por el ID de tu hoja (está en la URL del Sheet).\n3. La hoja necesita las columnas: Nombre, Email, Empresa, Categoría, Fecha.\n4. Prueba con el *Manual Trigger*; en producción, reemplázalo por un Webhook o un trigger de formulario.\n\n**Entrada esperada:** items con campos `nombre`, `email`, `empresa`, `empleados`, `fecha`.",
        "height": 400,
        "width": 420
      },
      "name": "Instrucciones",
      "type": "n8n-nodes-base.stickyNote",
      "position": [180, -160]
    },
    {
      "parameters": {},
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [250, 300]
    },
    {
      "parameters": {
        "conditions": {
          "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "strict" },
          "conditions": [
            {
              "id": "e3e3c416-f652-4e93-b5f8-6c184a5b7a3a",
              "leftValue": "={{ $json.empleados }}",
              "rightValue": "500",
              "operator": { "type": "number", "operation": "larger" }
            }
          ]
        }
      },
      "name": "¿Es Enterprise?",
      "type": "n8n-nodes-base.if",
      "position": [450, 300]
    },
    {
      "parameters": {
        "conditions": {
          "options": { "caseSensitive": true, "typeValidation": "strict" },
          "conditions": [
            {
              "id": "b7b7a416-f652-4e93-b5f8-6c184a5b7a3a",
              "leftValue": "={{ $json.empleados }}",
              "rightValue": "50",
              "operator": { "type": "number", "operation": "largerEqual" }
            },
            {
              "id": "c7c7a416-f652-4e93-b5f8-6c184a5b7a3a",
              "leftValue": "={{ $json.empleados }}",
              "rightValue": "500",
              "operator": { "type": "number", "operation": "smallerEqual" }
            }
          ]
        }
      },
      "name": "¿Es Medium?",
      "type": "n8n-nodes-base.if",
      "position": [450, 500]
    },
    {
      "parameters": { "keepOnlySet": true, "values": [{ "name": "categoria", "value": "Enterprise" }] },
      "name": "Categoría: Enterprise",
      "type": "n8n-nodes-base.set",
      "position": [650, 200]
    },
    {
      "parameters": { "keepOnlySet": true, "values": [{ "name": "categoria", "value": "Medium" }] },
      "name": "Categoría: Medium",
      "type": "n8n-nodes-base.set",
      "position": [650, 400]
    },
    {
      "parameters": { "keepOnlySet": true, "values": [{ "name": "categoria", "value": "Small" }] },
      "name": "Categoría: Small",
      "type": "n8n-nodes-base.set",
      "position": [650, 600]
    },
    {
      "parameters": {
        "sheetId": "TU_SHEET_ID",
        "options": {},
        "operation": "append",
        "columns": {
          "mappingMode": "defineBelow",
          "value": [
            { "key": "Nombre", "value": "={{ $json.nombre }}" },
            { "key": "Email", "value": "={{ $json.email }}" },
            { "key": "Empresa", "value": "={{ $json.empresa }}" },
            { "key": "Categoría", "value": "={{ $json.categoria }}" },
            { "key": "Fecha", "value": "={{ $json.fecha }}" }
          ]
        }
      },
      "name": "Guardar en Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [850, 300]
    }
  ],
  "connections": {
    "Manual Trigger": {
      "main": [[{ "node": "¿Es Enterprise?", "type": "main", "index": 0 }]]
    },
    "¿Es Enterprise?": {
      "main": [
        [{ "node": "Categoría: Enterprise", "type": "main", "index": 0 }],
        [{ "node": "¿Es Medium?", "type": "main", "index": 0 }]
      ]
    },
    "¿Es Medium?": {
      "main": [
        [{ "node": "Categoría: Medium", "type": "main", "index": 0 }],
        [{ "node": "Categoría: Small", "type": "main", "index": 0 }]
      ]
    },
    "Categoría: Enterprise": {
      "main": [[{ "node": "Guardar en Google Sheets", "type": "main", "index": 0 }]]
    },
    "Categoría: Medium": {
      "main": [[{ "node": "Guardar en Google Sheets", "type": "main", "index": 0 }]]
    },
    "Categoría: Small": {
      "main": [[{ "node": "Guardar en Google Sheets", "type": "main", "index": 0 }]]
    }
  }
}
