This workflow corresponds to n8n.io template #6595 β we link there as the canonical source.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide β
{
"id": "o9Vh63HwDIEzugjl",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "Auto-Log WhatsApp Inbound Messages to Vtiger CRM WALog and relate with Leads",
"tags": [],
"nodes": [
{
"id": "a077146b-6cf8-403a-a7a9-660c96c669ca",
"name": "Search Lead by Phone",
"type": "n8n-nodes-vtiger-crm.vtigerNode",
"position": [
-880,
16
],
"parameters": {
"query_field": "={{ `SELECT id FROM Leads WHERE phone='${$json.phone}' OR mobile='${$json.phone}' LIMIT 1;` }}"
},
"credentials": {
"vtigerApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "79d838b4-5684-4b74-bc9d-abc323e93e04",
"name": "Create Lead",
"type": "n8n-nodes-vtiger-crm.vtigerNode",
"position": [
-496,
176
],
"parameters": {
"operation": "create",
"element_field": "={ \n\"firstname\": \"-\",\n\"lastname\": \"{{ $('Set: Extract Name, Phone & Message').item.json.custName }}\", \n\"phone\": \"{{ $('Set: Extract Name, Phone & Message').item.json.phone }}\", \n\"assigned_user_id\": \"19x1\"\n}",
"elementType_field": "Leads"
},
"credentials": {
"vtigerApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "56a114e7-0bb4-417e-b49b-58834f4a5d6a",
"name": "Log to WhatsAppLog (Existing Lead)",
"type": "n8n-nodes-vtiger-crm.vtigerNode",
"position": [
-256,
0
],
"parameters": {
"operation": "create",
"element_field": "={ \"cf_1100\": \"{{ $('Set: Extract Name, Phone & Message').item.json.message }}\",\n\"name\": \"{{ $('Set: Extract Name, Phone & Message').item.json.custName }}\",\n\"cf_1098\": \"Inbound\",\n\"cf_1102\": \"{{ $('Set: Extract Name, Phone & Message').item.json.phone }}\",\n\"leadid\": \"{{$json.result[0].id}}\",\n\"assigned_user_id\" : \"19x1\"\n}",
"elementType_field": "WhatsaAppLog"
},
"credentials": {
"vtigerApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "310ab4fd-bfb7-4e78-aa0a-a12b6aafbdf6",
"name": "No Operation, do nothing",
"type": "n8n-nodes-base.noOp",
"position": [
-656,
-176
],
"parameters": {},
"typeVersion": 1
},
{
"id": "5af4db56-df2f-4a2a-be70-910748ae6181",
"name": "Webhook: WhatsApp Listen",
"type": "n8n-nodes-base.webhook",
"position": [
-1072,
-192
],
"parameters": {
"path": "whatsAppListen",
"options": {},
"httpMethod": "POST"
},
"typeVersion": 1
},
{
"id": "5f59cb3a-bb09-4335-86d4-3d985729229a",
"name": "If message not from group and not outbound",
"type": "n8n-nodes-base.if",
"position": [
-864,
-192
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "419382f9-3a23-40ba-afa1-33d71252d2e7",
"operator": {
"type": "boolean",
"operation": "equals"
},
"leftValue": "={{ $json.body.data.key.fromMe }}",
"rightValue": "={{false}}"
},
{
"id": "df484897-bdd3-490f-9902-0b2b51906bd1",
"operator": {
"type": "boolean",
"operation": "equals"
},
"leftValue": "={{ $json.body.data.key.remoteJid.includes('@g.us') }}",
"rightValue": "={{false}}"
},
{
"id": "6d2be59c-30bd-4de3-a36b-720adaa5cbcf",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "fab20986-8189-4595-8dc6-e143456269ef",
"name": "Set: Extract Name, Phone & Message",
"type": "n8n-nodes-base.set",
"position": [
-1056,
16
],
"parameters": {
"values": {
"string": [
{
"name": "custName",
"value": "={{ $json.body.data.pushName }}"
},
{
"name": "phone",
"value": "={{ $json.body.data.key.remoteJid.replace('@s.whatsapp.net', '') }}"
},
{
"name": "message",
"value": "={{ $json.body.data.message.conversation }}"
}
]
},
"options": {},
"keepOnlySet": true
},
"typeVersion": 2
},
{
"id": "9eb85375-ae60-4b3f-97ad-708fbadf76c2",
"name": "If Lead existing",
"type": "n8n-nodes-base.if",
"position": [
-656,
16
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "ee868d62-2dcd-4628-8cae-6ee6f673c5b3",
"operator": {
"type": "string",
"operation": "notEmpty",
"singleValue": true
},
"leftValue": "={{ $json.result[0].id || '' }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "6b49bc90-75ab-44bb-b204-7ec0e4e096ff",
"name": "Log to WhatsAppLog (New Lead)",
"type": "n8n-nodes-vtiger-crm.vtigerNode",
"position": [
-256,
176
],
"parameters": {
"operation": "create",
"element_field": "={ \"cf_1100\": \"{{ $('Set: Extract Name, Phone & Message').item.json.message }}\",\n\"name\": \"{{ $('Set: Extract Name, Phone & Message').item.json.custName }}\",\n\"cf_1098\": \"Inbound\",\n\"cf_1102\": \"{{ $('Set: Extract Name, Phone & Message').item.json.phone }}\",\n\"leadid\": \"{{ $json.result.id }}\",\n\"assigned_user_id\" : \"19x1\"\n}",
"elementType_field": "WhatsaAppLog"
},
"credentials": {
"vtigerApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "77633b01-34f1-4abd-9183-f9d9a20c0eb5",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1456,
-160
],
"parameters": {
"width": 336,
"height": 448,
"content": "## Summary\nThis workflow:\n- **Listens** for inbound WhatsApp messages.\n- **Ignores** group messages and those sent by yourself (Outbound).\n- **Searches** Vtiger CRM for an existing lead by phone.\n- If found, **logs** the message in the `WhatsAppLog` module and relate with Lead.\n- If not found, **creates a new lead** and logs the message.\n\n### Use case:\n- Ideal for businesses using WhatsApp for customer communication who want to automate CRM lead management and ensure no conversation is missed."
},
"typeVersion": 1
}
],
"active": true,
"settings": {
"executionOrder": "v1"
},
"versionId": "5d737057-8452-4fca-97bc-7685a15b14c7",
"connections": {
"Create Lead": {
"main": [
[
{
"node": "Log to WhatsAppLog (New Lead)",
"type": "main",
"index": 0
}
]
]
},
"If Lead existing": {
"main": [
[
{
"node": "Log to WhatsAppLog (Existing Lead)",
"type": "main",
"index": 0
}
],
[
{
"node": "Create Lead",
"type": "main",
"index": 0
}
]
]
},
"Search Lead by Phone": {
"main": [
[
{
"node": "If Lead existing",
"type": "main",
"index": 0
}
]
]
},
"Webhook: WhatsApp Listen": {
"main": [
[
{
"node": "If message not from group and not outbound",
"type": "main",
"index": 0
}
]
]
},
"Log to WhatsAppLog (Existing Lead)": {
"main": [
[]
]
},
"Set: Extract Name, Phone & Message": {
"main": [
[
{
"node": "Search Lead by Phone",
"type": "main",
"index": 0
}
]
]
},
"If message not from group and not outbound": {
"main": [
[
{
"node": "Set: Extract Name, Phone & Message",
"type": "main",
"index": 0
}
],
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing β you'll add your own.
vtigerApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
π₯ A Game-Changer for CRM Logging! Automatically Log WhatsApp Inbound Messages to Vtiger and Link to Leads π¬β‘ β οΈ This Workflow Requires Community Nodes & a Self-Hosted n8n Instance
Source: https://n8n.io/workflows/6595/ β original creator credit. Request a take-down β
More Marketing & Ads workflows β Β· Browse all categories β
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This workflow is designed to manage the assignment and validation of unique QR code coupons within a lead generation system with SuiteCRM.
This workflow acts as an instant SDR that replies to new inbound leads across multiple channels in real time. It first captures and normalizes all incoming lead data into a unified structure. The work
AI Lead Qualification & Roting System. Uses httpRequest, twilio, airtable. Webhook trigger; 26 nodes.
Turn a simple Google Sheet into a lightweight CRM powered by n8n.
A comprehensive n8n workflow template for streamlining influencer application processing with real-time social media data validation, intelligent scoring algorithms, and automated onboarding workflows