{
  "name": "Wekala — إشعارات الـ Leads",
  "nodes": [
    {
      "parameters": {
        "content": "## 🔔 Wekala — إشعارات الـ Leads\n\nلمّا يجيلك Lead جديد (من فورم Meta أو لاندنج بيدج):\n1) الـ **Webhook** بيستقبله.\n2) **تجهيز البيانات** بيرتّب الاسم/الرقم/المصدر.\n3) بيتسجّل في **Google Sheet** + بيوصلك **إشعار Telegram** فوراً.\n\n⚠️ بعد الاستيراد: اظبط الـ Credentials (Google + Telegram)، وحطّ الـ Sheet ID والـ Chat ID.\n\nربط Meta: في إعدادات Lead Ads اعمل subscribe لرابط الـ Webhook، أو استبدل الـ Webhook بنود «Facebook Lead Ads Trigger».",
        "height": 300,
        "width": 420,
        "color": 4
      },
      "id": "7357d3ad-82ba-4131-a44f-1ee2df409c57",
      "name": "تعليمات",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -40,
        -40
      ]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "wekala-lead",
        "responseMode": "onReceived",
        "options": {}
      },
      "id": "25c4b199-0676-4efe-a358-c798deb57af9",
      "name": "Webhook - استقبال Lead",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        220,
        240
      ],
      "webhookId": "3d254da3-36ac-4c5d-ba60-98b16660a02b"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "a60939fb-0aa8-4f95-a9a5-81c688325e3c",
              "name": "الاسم",
              "type": "string",
              "value": "={{ $json.body.name || $json.body.full_name }}"
            },
            {
              "id": "48f72813-3b5b-4abd-9777-420c6e87a211",
              "name": "الرقم",
              "type": "string",
              "value": "={{ $json.body.phone || $json.body.phone_number }}"
            },
            {
              "id": "80665022-5435-4501-b4f7-b65919e630ad",
              "name": "المصدر",
              "type": "string",
              "value": "={{ $json.body.source || 'Meta Lead Ad' }}"
            },
            {
              "id": "f23d4d57-58b4-4cb5-8f61-9aa9a9cc6add",
              "name": "الوقت",
              "type": "string",
              "value": "={{ $now.format('yyyy-MM-dd HH:mm') }}"
            }
          ]
        },
        "options": {}
      },
      "id": "b8e34bff-9058-47be-bf4a-510929aa6fe0",
      "name": "تجهيز بيانات الـ Lead",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        440,
        240
      ]
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "YOUR_GOOGLE_SHEET_ID",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "Leads",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "autoMapInputData",
          "value": {},
          "matchingColumns": []
        },
        "options": {}
      },
      "id": "a6cbee32-65a6-4887-8529-2072bf05e495",
      "name": "حفظ في Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4,
      "position": [
        680,
        140
      ]
    },
    {
      "parameters": {
        "chatId": "YOUR_TELEGRAM_CHAT_ID",
        "text": "=🔔 Lead جديد!\n\n👤 الاسم: {{ $json['الاسم'] }}\n📞 الرقم: {{ $json['الرقم'] }}\n🔗 المصدر: {{ $json['المصدر'] }}\n🕒 {{ $json['الوقت'] }}",
        "additionalFields": {}
      },
      "id": "0d7ddf2b-986d-4c1a-892e-8654b5a5e0a0",
      "name": "إشعار Telegram",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        680,
        340
      ]
    }
  ],
  "connections": {
    "Webhook - استقبال Lead": {
      "main": [
        [
          {
            "node": "تجهيز بيانات الـ Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "تجهيز بيانات الـ Lead": {
      "main": [
        [
          {
            "node": "حفظ في Google Sheet",
            "type": "main",
            "index": 0
          },
          {
            "node": "إشعار Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {}
}