Upload Lead Qualification + WhatsApp.json
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478{ "name": "Lead Qualification + WhatsApp", "nodes": [ { "parameters": { "events": [ "BOOKING_CREATED" ], "options": {} }, "type": "n8n-nodes-base.calTrigger", "typeVersion": 2, "position": [ -880, 16 ], "id": "f35b112f-dee9-49e2-8f29-2a8a65094208", "name": "📅 Cal.com Trigger", "webhookId": "6fa888f6-7b42-495b-8a74-dd13ea19e3c7", "credentials": { "calApi": { "id": "QAp2NYBKhGw6J0xM", "name": "Cal account" } } }, { "parameters": { "operation": "send", "phoneNumberId": "896248000230657", "recipientPhoneNumber": "={{ $('Extract Data').item.json.whatsapp }}", "textBody": "={{ $json.output.message }}", "additionalFields": {} }, "type": "n8n-nodes-base.whatsApp", "typeVersion": 1.1, "position": [ 320, -96 ], "id": "d6d82038-1ce6-4df4-95e0-e8192310626e", "name": "4️⃣ Send WhatsApp", "webhookId": "6fa7838e-17e2-4d21-8ef9-9adc88fc30c1", "credentials": { "whatsAppApi": { "id": "Y9M96ixI4NlpizmQ", "name": "WhatsApp account" } } }, { "parameters": { "operation": "append", "documentId": { "__rl": true, "value": "1UGWpraMjN4hmIh16ueUgaOIAENOfjmkUK_44phq8ASE", "mode": "list", "cachedResultName": "Agentrix212_Leads_Template", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1UGWpraMjN4hmIh16ueUgaOIAENOfjmkUK_44phq8ASE/edit?usp=drivesdk" }, "sheetName": { "__rl": true, "value": 1720662659, "mode": "list", "cachedResultName": "Agentrix212_Leads_Template.csv", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1UGWpraMjN4hmIh16ueUgaOIAENOfjmkUK_44phq8ASE/edit#gid=1720662659" }, "columns": { "mappingMode": "defineBelow", "value": { "Timestamp": "={{ $now.format('yyyy-MM-dd HH:mm') }}", "Full name": "={{ $('Extract Data').item.json.name }}", "Email": "={{ $('Extract Data').item.json.email }}", "Event": "={{ $('📅 Cal.com Trigger').item.json.title }}", "Event Time": "={{ $('Extract Data').item.json.eventTime }}", "Status": "QUALIFIED", "Response Status": "MESSAGE_SENT", "Budget": "={{ $('Extract Data').item.json.budget }}", "Pain Points": "={{ $('Extract Data').item.json.painPoints }}", "Source": "ca.com" }, "matchingColumns": [], "schema": [ { "id": "Timestamp", "displayName": "Timestamp", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "Full name", "displayName": "Full name", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "Email", "displayName": "Email", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "WhatsApp", "displayName": "WhatsApp", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": true }, { "id": "Budget", "displayName": "Budget", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "Event", "displayName": "Event", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "Event Time", "displayName": "Event Time", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "Pain Points", "displayName": "Pain Points", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "Status", "displayName": "Status", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "Response Status", "displayName": "Response Status", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "Source", "displayName": "Source", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false } ], "attemptToConvertTypes": false, "convertFieldsToString": false }, "options": {} }, "type": "n8n-nodes-base.googleSheets", "typeVersion": 4.4, "position": [ 528, -96 ], "id": "8113c0f1-765b-4eb5-a510-14cb2e42cff3", "name": "5️⃣ Save Qualified", "credentials": { "googleSheetsOAuth2Api": { "id": "cqc0aG1cc1RyiagA", "name": "Google Sheets account" } } }, { "parameters": { "operation": "append", "documentId": { "__rl": true, "value": "1rMgNKIf5Pq32jzdyfLSgHYVBfjlRuE8d-CrfaxLYTqs" }, "sheetName": { "__rl": true, "value": 885562620 }, "columns": { "mappingMode": "defineBelow", "value": { "Timestamp": "={{ $now.format('yyyy-MM-dd HH:mm') }}", "Full name": "={{ $json.name }}", "Email": "={{ $json.email }}", "WhatsApp": "={{ $json.whatsapp }}", "Event": "={{ $json.eventName }}", "Event Time": "={{ $json.eventTime }}", "Status": "NOT_QUALIFIED", "Response Status": "={{ $json.reason }}" } }, "options": {} }, "type": "n8n-nodes-base.googleSheets", "typeVersion": 4.4, "position": [ 96, 176 ], "id": "62bc0426-fc17-469e-a167-d62ad25c1b0c", "name": "5️⃣ Save Unqualified", "credentials": { "googleSheetsOAuth2Api": { "id": "cqc0aG1cc1RyiagA", "name": "Google Sheets account" } } }, { "parameters": { "amount": 1 }, "type": "n8n-nodes-base.wait", "typeVersion": 1.1, "position": [ 80, -96 ], "id": "960a97d0-5636-437a-b3d3-fe89062dc357", "name": "Wait", "webhookId": "b1a38a55-23aa-465c-a3ee-a9a93f3018b2" }, { "parameters": { "model": "deepseek/deepseek-chat-v3.1", "options": {} }, "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter", "typeVersion": 1, "position": [ -592, 224 ], "id": "3dc2a8a2-03b9-4ec6-913c-2da225259313", "name": "OpenRouter Chat Model", "credentials": { "openRouterApi": { "id": "Uh6EhUnlPGQ0AEYw", "name": "OpenRouter account" } } }, { "parameters": { "jsonSchemaExample": "{\n \"isQualified\": true,\n \"qualificationScore\": 8,\n \"reason\": \"Budget 3000, clear automation pain points\",\n \"message\": \"Hi Mouad! Thanks for booking. We'll discuss RAG on Nov 27 at 7:00 PM. Please confirm? 🚀\"\n}" }, "type": "@n8n/n8n-nodes-langchain.outputParserStructured", "typeVersion": 1.3, "position": [ -336, 224 ], "id": "a99e5ae8-2648-4182-8e47-fcb87495bc34", "name": "Structured Output Parser" }, { "parameters": { "promptType": "define", "text": "=You are a lead qualifier and WhatsApp message writer for Agentrix212.\n\nLEAD DATA:\nName: {{ $json.name }}\nBudget: {{ $json.budget }}\nPain Points: {{ $json.painPoints }}\nEvent: {{ $json.eventName }}\nTime: {{ $json.eventTime }}\n", "hasOutputParser": true, "messages": { "messageValues": [ { "message": "You are a strict lead qualifier. Only qualify serious leads with sufficient budget. \n\nQUALIFY: 1. Budget must be >= $1000 2. Pain points must mention: automation, workflow, efficiency, RAG, implementation 3. Serious response (2+ sentences) IF QUALIFIED: Generate WhatsApp message (max 50 words): - Thank them - Mention their event - tell me tham that we can help them with their pain point - Confirm time - Ask to confirm and you might also ask any clarification questions to keep the lead hot and interested or one - Be friendly RESPOND ONLY: { \"isQualified\": true/false, \"qualificationScore\": 1-10, \"reason\": \"brief reason\", \"message\": \"your message or empty string\" }" } ] }, "batching": {} }, "type": "@n8n/n8n-nodes-langchain.chainLlm", "typeVersion": 1.7, "position": [ -480, 16 ], "id": "5be12cb2-24f0-4330-81cf-0bb01c6bfe45", "name": " AI: Qualify + Message" }, { "parameters": { "mode": "raw", "jsonOutput": "={\n \"name\": \"{{ $json.attendees[0].name }}\",\n \"email\": \"{{ $json.responses.email.value }}\",\n \"whatsapp\": \"{{ $json.responses.attendeePhoneNumber.value }}\",\n \"budget\": \"{{ $json.responses.Budget.value }}\",\n \"painPoints\": \"{{ $json.responses.notes.value }}\",\n \"eventName\": \"{{ $json.eventTitle }}\",\n \"eventTime\": \"{{ $json.startTime }}\"\n}", "options": {} }, "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ -656, 16 ], "id": "05a5b04b-5cd3-4096-81bc-a7a95ba7041c", "name": "Extract Data" }, { "parameters": { "conditions": { "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "strict", "version": 1 }, "conditions": [ { "id": "40f41e3c-8a5f-4e4c-b3e2-0c79814a3f7c", "leftValue": "={{ $json.output.isQualified }}", "rightValue": "", "operator": { "type": "boolean", "operation": "true", "singleValue": true } } ], "combinator": "and" }, "options": {} }, "type": "n8n-nodes-base.if", "typeVersion": 2, "position": [ -144, 32 ], "id": "a217f6c9-64fa-46cf-af67-aad5047ddd9b", "name": "Is Qualified?" } ], "pinData": {}, "connections": { "📅 Cal.com Trigger": { "main": [ [ { "node": "Extract Data", "type": "main", "index": 0 } ] ] }, "4️⃣ Send WhatsApp": { "main": [ [ { "node": "5️⃣ Save Qualified", "type": "main", "index": 0 } ] ] }, "Wait": { "main": [ [ { "node": "4️⃣ Send WhatsApp", "type": "main", "index": 0 } ] ] }, "OpenRouter Chat Model": { "ai_languageModel": [ [ { "node": " AI: Qualify + Message", "type": "ai_languageModel", "index": 0 } ] ] }, "Structured Output Parser": { "ai_outputParser": [ [ { "node": " AI: Qualify + Message", "type": "ai_outputParser", "index": 0 } ] ] }, " AI: Qualify + Message": { "main": [ [ { "node": "Is Qualified?", "type": "main", "index": 0 } ] ] }, "Extract Data": { "main": [ [ { "node": " AI: Qualify + Message", "type": "main", "index": 0 } ] ] }, "Is Qualified?": { "main": [ [ { "node": "Wait", "type": "main", "index": 0 } ], [ { "node": "5️⃣ Save Unqualified", "type": "main", "index": 0 } ] ] } }, "active": true, "settings": { "executionOrder": "v1" }, "versionId": "abc217e5-6429-4610-92ce-7dd144f714d6", "meta": { "templateCredsSetupCompleted": true, "instanceId": "66c58b798d3adbdaf64a47b3041d335e10015ca13cec5104fbf9f568a82eba73" }, "id": "gnEE9aSXeQozXNRS", "tags": []}Workflows/N8N_Workflows/Lead Qualification + WhatsApp/Lead Qualification + WhatsApp.jsonAdded+478