{
 "name": "Mendera · 005 · Felicitar cumpleaños de clientes",
 "nodes": [
  {
   "id": "a0050000-0000-4000-8000-000000000001",
   "name": "Mendera Systems",
   "parameters": {
    "content": "## Creado con Mendera Systems\nmenderasystems.com — Sistema 005 de la biblioteca.\nSi te lo han pasado, es gratis: el resto de la biblioteca está en menderasystems.com/biblioteca-de-sistemas.",
    "height": 160,
    "width": 420
   },
   "position": [
    0,
    -160
   ],
   "type": "n8n-nodes-base.stickyNote",
   "typeVersion": 1
  },
  {
   "id": "a0050000-0000-4000-8000-000000000002",
   "name": "Cómo se monta",
   "parameters": {
    "content": "## Cómo se monta\n1. Importa este archivo en n8n (Workflows → Import from File).\n2. Crea una hoja de cálculo con las columnas nombre | telefono | cumpleanos y pon su ID en TU_ID_DE_HOJA.\n3. Escribe las fechas como AAAA-MM-DD (por ejemplo, 1990-05-10).\n4. Conecta tu credencial de Google Sheets en «Leer clientes».\n5. Conecta tu credencial de WhatsApp Business en «Felicitar al cliente».\n6. En «Felicitar al cliente», pon tu Phone Number ID en TU_PHONE_NUMBER_ID.\n7. Activa el flujo: cada día a las 9:00 felicita a quien cumpla años ese día. Solo funciona si el cliente te escribió en las últimas 24 horas o tienes una plantilla aprobada.",
    "height": 360,
    "width": 420
   },
   "position": [
    0,
    40
   ],
   "type": "n8n-nodes-base.stickyNote",
   "typeVersion": 1
  },
  {
   "id": "a0050000-0000-4000-8000-000000000003",
   "name": "Cada día 09:00",
   "parameters": {
    "rule": {
     "interval": [
      {
       "field": "cronExpression",
       "expression": "0 9 * * *"
      }
     ]
    }
   },
   "position": [
    480,
    300
   ],
   "type": "n8n-nodes-base.scheduleTrigger",
   "typeVersion": 1
  },
  {
   "id": "a0050000-0000-4000-8000-000000000004",
   "name": "Leer clientes",
   "parameters": {
    "documentId": {
     "__rl": true,
     "mode": "id",
     "value": "TU_ID_DE_HOJA"
    },
    "operation": "read",
    "sheetName": {
     "__rl": true,
     "mode": "name",
     "value": "Clientes"
    }
   },
   "position": [
    720,
    300
   ],
   "type": "n8n-nodes-base.googleSheets",
   "typeVersion": 4,
   "credentials": {
    "googleSheetsOAuth2Api": {
     "id": "",
     "name": "TU_CREDENCIAL_GOOGLE_SHEETS"
    }
   }
  },
  {
   "id": "a0050000-0000-4000-8000-000000000006",
   "name": "¿Cumple hoy?",
   "parameters": {
    "conditions": {
     "combinator": "and",
     "conditions": [
      {
       "id": "a0050000-0000-4000-8000-000000000005",
       "leftValue": "={{ DateTime.fromISO($json.cumpleanos).month }}",
       "operator": {
        "operation": "equals",
        "type": "number"
       },
       "rightValue": "={{ $now.month }}"
      },
      {
       "id": "a0050000-0000-4000-8000-000000000007",
       "leftValue": "={{ DateTime.fromISO($json.cumpleanos).day }}",
       "operator": {
        "operation": "equals",
        "type": "number"
       },
       "rightValue": "={{ $now.day }}"
      }
     ],
     "options": {
      "caseSensitive": true,
      "leftValue": "",
      "typeValidation": "loose"
     }
    },
    "options": {}
   },
   "position": [
    960,
    300
   ],
   "type": "n8n-nodes-base.if",
   "typeVersion": 2
  },
  {
   "id": "a0050000-0000-4000-8000-000000000008",
   "name": "Felicitar al cliente",
   "parameters": {
    "additionalFields": {},
    "operation": "send",
    "phoneNumberId": "TU_PHONE_NUMBER_ID",
    "recipientPhoneNumber": "={{ $json.telefono }}",
    "textBody": "=¡Feliz cumpleaños, {{ $json.nombre }}! Que tengas un día estupendo. — Mendera Systems"
   },
   "position": [
    1200,
    300
   ],
   "type": "n8n-nodes-base.whatsApp",
   "typeVersion": 1,
   "credentials": {
    "whatsAppApi": {
     "id": "",
     "name": "TU_CREDENCIAL_WHATSAPP"
    }
   }
  }
 ],
 "connections": {
  "Cada día 09:00": {
   "main": [
    [
     {
      "node": "Leer clientes",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Leer clientes": {
   "main": [
    [
     {
      "node": "¿Cumple hoy?",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "¿Cumple hoy?": {
   "main": [
    [
     {
      "node": "Felicitar al cliente",
      "type": "main",
      "index": 0
     }
    ],
    []
   ]
  }
 },
 "active": false,
 "settings": {
  "executionOrder": "v1"
 },
 "pinData": {}
}
