تقييم العملاء المحتملين بالذكاء الاصطناعي
الذكاء الاصطناعي يقيّم كل عميل جديد ويرسل العملاء المهمين فورًا لفريق المبيعات.
كيف تعمل
المشغّل: Webhook — النموذج يرسل بيانات العميل
- استقبل الاسم والشركة والميزانية والرسالة من نموذجك.
- اطلب من نموذج ذكاء اصطناعي تقييم العميل من 1 إلى 10 حسب وصف عميلك المثالي.
- إذا كان التقييم 7 أو أكثر، نبّه #sales في Slack مع السبب.
- وإلا، أرسل ردًا آليًا لطيفًا مع مصادر مفيدة.
المخطط
مشغّل تطبيق منطق كود ذكاء اصطناعي
الكود
كود JavaScript المستخدم في خطوات Code، وهو مضمَّن بالفعل في القالب بالأسفل.
// Mode: Run Once for Each Item
// The AI was asked to answer with JSON like {"score": 8, "reason": "..."}.
const match = $json.text.match(/\{[\s\S]*\}/);
const result = match ? JSON.parse(match[0]) : { score: 0, reason: "Could not read AI answer" };
const lead = $("New lead").item.json.body;
return {
json: {
...lead,
score: Number(result.score),
reason: result.reason,
},
};ابنِها بأداتك
اختر أداتك — نفس الأتمتة، خطوة بخطوة.
انسخه والصقه مباشرة في مساحة عمل n8n (Ctrl+V)، أو حمّله واستخدم Import from File. بعد ذلك اربط حساباتك واستبدل كل قيمة تبدأ بـ YOUR_. خطوات الذكاء الاصطناعي تستخدم نموذج Claude، ويمكنك استبداله بـ OpenAI أو Gemini أو Ollama.
عرض الكود (225 سطر)
{
"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": "292cf932-28a7-42d8-aca3-5a1f662fbc81",
"name": "Setup notes",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
-420,
-60
]
},
{
"parameters": {
"httpMethod": "POST",
"path": "new-lead",
"options": {}
},
"id": "292cf932-28a7-42d8-aca3-5a1f662fbc81",
"name": "New lead",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [
0,
0
],
"webhookId": "292cf932-28a7-42d8-aca3-5a1f662fbc81"
},
{
"parameters": {
"promptType": "define",
"text": "=You qualify B2B leads for our company. Our ideal customer: YOUR_IDEAL_CUSTOMER_DESCRIPTION.\n\nLead:\n{{ JSON.stringify($json.body, null, 2) }}\n\nReply ONLY with JSON: {\"score\": <1-10>, \"reason\": \"<one sentence>\"}"
},
"id": "292cf932-28a7-42d8-aca3-5a1f662fbc81",
"name": "Score lead",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"typeVersion": 1.5,
"position": [
300,
0
]
},
{
"parameters": {
"model": {
"__rl": true,
"value": "claude-sonnet-5",
"mode": "list"
},
"options": {}
},
"id": "292cf932-28a7-42d8-aca3-5a1f662fbc81",
"name": "Claude model",
"type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
"typeVersion": 1.3,
"position": [
300,
220
]
},
{
"parameters": {
"jsCode": "// Mode: Run Once for Each Item\n// The AI was asked to answer with JSON like {\"score\": 8, \"reason\": \"...\"}.\nconst match = $json.text.match(/\\{[\\s\\S]*\\}/);\nconst result = match ? JSON.parse(match[0]) : { score: 0, reason: \"Could not read AI answer\" };\nconst lead = $(\"New lead\").item.json.body;\n\nreturn {\n json: {\n ...lead,\n score: Number(result.score),\n reason: result.reason,\n },\n};",
"mode": "runOnceForEachItem"
},
"id": "292cf932-28a7-42d8-aca3-5a1f662fbc81",
"name": "Read score",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
600,
0
]
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "loose"
},
"conditions": [
{
"id": "c1",
"leftValue": "={{ $json.score }}",
"rightValue": 7,
"operator": {
"type": "number",
"operation": "gte"
}
}
],
"combinator": "and"
},
"options": {}
},
"id": "292cf932-28a7-42d8-aca3-5a1f662fbc81",
"name": "Score 7 or more?",
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
900,
0
]
},
{
"parameters": {
"select": "channel",
"channelId": {
"__rl": true,
"value": "#sales",
"mode": "name"
},
"text": "=🔥 Hot lead ({{ $json.score }}/10): {{ $json.name }} — {{ $json.company }}\n{{ $json.reason }}\n{{ $json.email }}",
"otherOptions": {}
},
"id": "292cf932-28a7-42d8-aca3-5a1f662fbc81",
"name": "Alert #sales",
"type": "n8n-nodes-base.slack",
"typeVersion": 2.2,
"position": [
1200,
0
]
},
{
"parameters": {
"sendTo": "={{ $json.email }}",
"subject": "Thanks for reaching out!",
"emailType": "text",
"message": "=Hi {{ $json.name }},\n\nThanks for your message! Here are some resources that might help while we get back to you: YOUR_RESOURCES_LINK\n\nBest,\nYOUR_NAME",
"options": {
"appendAttribution": false
}
},
"id": "292cf932-28a7-42d8-aca3-5a1f662fbc81",
"name": "Send friendly reply",
"type": "n8n-nodes-base.gmail",
"typeVersion": 2.1,
"position": [
1200,
220
]
}
],
"connections": {
"New lead": {
"main": [
[
{
"node": "Score lead",
"type": "main",
"index": 0
}
]
]
},
"Score lead": {
"main": [
[
{
"node": "Read score",
"type": "main",
"index": 0
}
]
]
},
"Read score": {
"main": [
[
{
"node": "Score 7 or more?",
"type": "main",
"index": 0
}
]
]
},
"Score 7 or more?": {
"main": [
[
{
"node": "Alert #sales",
"type": "main",
"index": 0
}
],
[
{
"node": "Send friendly reply",
"type": "main",
"index": 0
}
]
]
},
"Claude model": {
"ai_languageModel": [
[
{
"node": "Score lead",
"type": "ai_languageModel",
"index": 0
}
]
]
}
},
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"meta": {
"templateCredsSetupCompleted": false
},
"tags": []
}في Make، أنشئ سيناريو جديدًا وأضف هذه الوحدات بالترتيب:
- Webhooks › Custom webhook
- Anthropic Claude › Create a Prompt (or OpenAI › Create a Completion)
- Tools › Set variable / Iterator + Array aggregator (same logic as the Code step)
- Router with two routes: “Score 7 or more?” (yes / no filters)
- إذا نعمSlack › Create a Message
- إذا لاGmail › Send an Email
- كل تشغيل لوحدة يستهلك عمليات (operations) في Make — والباقة المجانية تتضمن حصة شهرية.
- دوال Make المدمجة (map و sum و formatDate…) تغني عن معظم خطوات Code؛ وللمنطق المعقد استخدم وحدة كود.
- قد تختلف أسماء الوحدات والخطوات قليلًا مع تحديث Make و Zapier لتطبيقاتهما.
في Zapier، أنشئ Zap جديدًا وأضف هذه الخطوات بالترتيب:
- Webhooks by Zapier — Catch Hook
- Anthropic (Claude) — Send Message (or ChatGPT — Conversation)
- Code by Zapier — Run JavaScript (paste the code from the Code section)
- Paths by Zapier: “Score 7 or more?” (yes / no)
- إذا نعمSlack — Send Channel Message
- إذا لاGmail — Send Email
- الـ Zaps التي فيها أكثر من خطوتين تحتاج باقة Zapier مدفوعة.
- الـ Webhooks والفلاتر/المسارات و Code by Zapier ميزات مدفوعة في بعض باقات Zapier.
- Code by Zapier يشغّل JavaScript: أعد استخدام الكود بالأعلى، مع قراءة المدخلات من inputData بدلًا من $json.
- قد تختلف أسماء الوحدات والخطوات قليلًا مع تحديث Make و Zapier لتطبيقاتهما.
نصائح
- اطلب من الذكاء الاصطناعي الرد بصيغة JSON مثل {"score": 8, "reason": "..."} ليسهل استخدامها.
أتمتات مشابهة
المبيعات وإدارة العملاءمتوسط
فلتر رسائل مزعجة بالذكاء الاصطناعي لنماذج التواصل
الذكاء الاصطناعي يفحص كل رسالة، ولا يصل لفريقك إلا الاستفسارات الحقيقية.
Webhook → AI model → Slack3 س/شهر
المبيعات وإدارة العملاءمتقدم
ملخص تحضير تلقائي قبل الاجتماعات
عند حجز اجتماع، يصلك ملخص قصير بالذكاء الاصطناعي عن الشركة التي ستقابلها.
Google Calendar → HTTP Request → AI model → Gmail4 س/شهر
المبيعات وإدارة العملاءسهل
نموذج التواصل ← Airtable + رد تلقائي فوري
رسائل موقعك تُحفظ في Airtable ويصل المرسل تأكيد فوري.
Webhook → Airtable → Gmail3 س/شهر