سجّل كل عميل جديد على واتساب كعميل محتمل

أول ما يراسلك شخص جديد على واتساب، يُحفظ في جدول العملاء المحتملين ويصل تنبيه لفريق المبيعات.

متوسط توفّر ~5 ساعة شهريًا المبيعات وإدارة العملاءبواسطة فريق Flowngn

تعمل مع n8n · Make · Zapier

كيف تعمل

المشغّل: واتساب — وصول رسالة
  1. استقبل رسالة واتساب الواردة.
  2. ابحث عن رقم المرسل في جدول العملاء المحتملين.
  3. إذا كان جديدًا، أضفه باسمه وأول رسالة والتاريخ.
  4. نبّه فريق المبيعات على تيليجرام ليرد أحدهم بسرعة.

المخطط

trueWIncoming messageWhatsApp Trigger{ }Get senderCodeGFind in LeadsGoogle Sheets⑂New contact?IfGAdd leadGoogle SheetsTAlert sales teamTelegram
مشغّل تطبيق منطق كود

الكود

كود JavaScript المستخدم في خطوات Code، وهو مضمَّن بالفعل في القالب بالأسفل.

Get sender · عقدة Code
// Pulls the sender's phone, profile name and first message out of the WhatsApp event.
const data = $input.first().json;
const msg = data.messages?.[0];
if (!msg) return [];

return [{
  json: {
    phone: msg.from,
    name: data.contacts?.[0]?.profile?.name || "",
    message: msg.type === "text" ? msg.text.body : `(${msg.type})`,
    date: new Date(Number(msg.timestamp) * 1000).toISOString(),
  },
}];

ابنِها بأداتك

اختر أداتك — نفس الأتمتة، خطوة بخطوة.

انسخه والصقه مباشرة في مساحة عمل n8n (Ctrl+V)، أو حمّله واستخدم Import from File. بعد ذلك اربط حساباتك واستبدل كل قيمة تبدأ بـ YOUR_.

ملف Workflow JSON
عرض الكود (231 سطر)
{
  "name": "سجّل كل عميل جديد على واتساب كعميل محتمل (Flowngn)",
  "nodes": [
    {
      "parameters": {
        "content": "## سجّل كل عميل جديد على واتساب كعميل محتمل\nأول ما يراسلك شخص جديد على واتساب، يُحفظ في جدول العملاء المحتملين ويصل تنبيه لفريق المبيعات.\n\n**Setup**\n1. Open each node and connect your own credentials.\n2. Replace every YOUR_… placeholder.\n3. Test once, then activate.\n\nFree template from Flowngn",
        "height": 260,
        "width": 340
      },
      "id": "3f36c28d-dcaa-4fe7-afb0-dde2cffcb7d1",
      "name": "Setup notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -420,
        -60
      ]
    },
    {
      "parameters": {
        "updates": [
          "messages"
        ]
      },
      "id": "3f36c28d-dcaa-4fe7-afb0-dde2cffcb7d1",
      "name": "Incoming message",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "webhookId": "3f36c28d-dcaa-4fe7-afb0-dde2cffcb7d1"
    },
    {
      "parameters": {
        "jsCode": "// Pulls the sender's phone, profile name and first message out of the WhatsApp event.\nconst data = $input.first().json;\nconst msg = data.messages?.[0];\nif (!msg) return [];\n\nreturn [{\n  json: {\n    phone: msg.from,\n    name: data.contacts?.[0]?.profile?.name || \"\",\n    message: msg.type === \"text\" ? msg.text.body : `(${msg.type})`,\n    date: new Date(Number(msg.timestamp) * 1000).toISOString(),\n  },\n}];"
      },
      "id": "3f36c28d-dcaa-4fe7-afb0-dde2cffcb7d1",
      "name": "Get sender",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        300,
        0
      ]
    },
    {
      "parameters": {
        "operation": "read",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SPREADSHEET_ID",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "Leads",
          "mode": "name"
        },
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "phone",
              "lookupValue": "={{ $json.phone }}"
            }
          ]
        }
      },
      "id": "3f36c28d-dcaa-4fe7-afb0-dde2cffcb7d1",
      "name": "Find in Leads",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        600,
        0
      ],
      "alwaysOutputData": true
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose"
          },
          "conditions": [
            {
              "id": "c1",
              "leftValue": "={{ $json.phone }}",
              "rightValue": "",
              "operator": {
                "type": "string",
                "operation": "notExists",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "3f36c28d-dcaa-4fe7-afb0-dde2cffcb7d1",
      "name": "New contact?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        900,
        0
      ]
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SPREADSHEET_ID",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "Leads",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "date": "={{ $('Get sender').item.json.date }}",
            "phone": "={{ $('Get sender').item.json.phone }}",
            "name": "={{ $('Get sender').item.json.name }}",
            "first_message": "={{ $('Get sender').item.json.message }}",
            "status": "new"
          }
        },
        "options": {}
      },
      "id": "3f36c28d-dcaa-4fe7-afb0-dde2cffcb7d1",
      "name": "Add lead",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1200,
        0
      ]
    },
    {
      "parameters": {
        "chatId": "YOUR_CHAT_ID",
        "text": "=New WhatsApp lead: {{ $('Get sender').item.json.name || 'no name' }} (+{{ $('Get sender').item.json.phone }})\n\"{{ $('Get sender').item.json.message }}\"",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "id": "3f36c28d-dcaa-4fe7-afb0-dde2cffcb7d1",
      "name": "Alert sales team",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        1500,
        0
      ]
    }
  ],
  "connections": {
    "Incoming message": {
      "main": [
        [
          {
            "node": "Get sender",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get sender": {
      "main": [
        [
          {
            "node": "Find in Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find in Leads": {
      "main": [
        [
          {
            "node": "New contact?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New contact?": {
      "main": [
        [
          {
            "node": "Add lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add lead": {
      "main": [
        [
          {
            "node": "Alert sales team",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}

← افتحها في ساحة التجربة لتعديلها

نصائح

  • أضف عمودًا لمصدر العميل، واستخدم رسالة جاهزة مختلفة في كل إعلان لتعرف من أي حملة جاء.

أتمتات مشابهة