{
  "name": "WhatsApp message auto-logger for Vtiger CRM with lead relation",
  "nodes": [
    {
      "id": "a077146b-6cf8-403a-a7a9-660c96c669ca",
      "name": "Search Lead by Phone",
      "type": "n8n-nodes-vtiger-crm.vtigerNode",
      "position": [
        -880,
        16
      ]
    },
    {
      "id": "79d838b4-5684-4b74-bc9d-abc323e93e04",
      "name": "Create Lead",
      "type": "n8n-nodes-vtiger-crm.vtigerNode",
      "position": [
        -496,
        176
      ]
    },
    {
      "id": "56a114e7-0bb4-417e-b49b-58834f4a5d6a",
      "name": "Log to WhatsAppLog (Existing Lead)",
      "type": "n8n-nodes-vtiger-crm.vtigerNode",
      "position": [
        -256,
        0
      ]
    },
    {
      "id": "310ab4fd-bfb7-4e78-aa0a-a12b6aafbdf6",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -656,
        -176
      ]
    },
    {
      "id": "5af4db56-df2f-4a2a-be70-910748ae6181",
      "name": "Webhook: WhatsApp Listen",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1072,
        -192
      ]
    },
    {
      "id": "5f59cb3a-bb09-4335-86d4-3d985729229a",
      "name": "If message not from group and not outbound",
      "type": "n8n-nodes-base.if",
      "position": [
        -864,
        -192
      ]
    },
    {
      "id": "fab20986-8189-4595-8dc6-e143456269ef",
      "name": "Set: Extract Name, Phone & Message",
      "type": "n8n-nodes-base.set",
      "position": [
        -1056,
        16
      ]
    },
    {
      "id": "9eb85375-ae60-4b3f-97ad-708fbadf76c2",
      "name": "If Lead existing",
      "type": "n8n-nodes-base.if",
      "position": [
        -656,
        16
      ]
    },
    {
      "id": "6b49bc90-75ab-44bb-b204-7ec0e4e096ff",
      "name": "Log to WhatsAppLog (New Lead)",
      "type": "n8n-nodes-vtiger-crm.vtigerNode",
      "position": [
        -256,
        176
      ]
    },
    {
      "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"
      }
    }
  ],
  "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
          }
        ]
      ]
    }
  }
}