{
  "name": "HubSpot new contact or deal stage → WhatsApp (WbizTool)",
  "nodes": [
    {
      "parameters": {
        "eventsUi": {
          "eventValues": [
            {
              "name": "contact.creation"
            },
            {
              "name": "deal.propertyChange",
              "property": "dealstage"
            }
          ]
        },
        "additionalFields": {}
      },
      "id": "d6d30496-ce2a-51e1-abaf-55452517059b",
      "name": "HubSpot Trigger",
      "type": "n8n-nodes-base.hubspotTrigger",
      "typeVersion": 1,
      "position": [
        0,
        300
      ],
      "webhookId": "d3fde590-1c64-5492-a2d9-53f5380f607b"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose"
          },
          "conditions": [
            {
              "id": "b7a69d2a-2823-5586-a019-6b6eb3dbee4f",
              "leftValue": "={{ $json.subscriptionType }}",
              "rightValue": "contact.creation",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "e7856f0f-7523-5517-9b63-46b82db3415a",
      "name": "New contact?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        220,
        300
      ]
    },
    {
      "parameters": {
        "authentication": "appToken",
        "resource": "contact",
        "operation": "search",
        "returnAll": false,
        "limit": 1,
        "filterGroupsUi": {
          "filterGroupsValues": [
            {
              "filtersUi": {
                "filterValues": [
                  {
                    "propertyName": "hs_object_id|number",
                    "operator": "EQ",
                    "value": "={{ $json.contactId }}"
                  }
                ]
              }
            }
          ]
        },
        "additionalFields": {
          "properties": [
            "firstname",
            "phone",
            "mobilephone"
          ]
        }
      },
      "id": "06c63a7d-a07d-5d1d-a34c-5c0fb1b63076",
      "name": "Read new contact",
      "type": "n8n-nodes-base.hubspot",
      "typeVersion": 2.2,
      "position": [
        460,
        160
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose"
          },
          "conditions": [
            {
              "id": "73a35330-f07e-570b-9f48-1cdbe2104f9a",
              "leftValue": "={{ $json.properties.phone || $json.properties.mobilephone }}",
              "rightValue": "",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "fe9a12b2-78e6-5d9d-8a8f-30f7c8c720c4",
      "name": "Contact has a number?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        680,
        160
      ]
    },
    {
      "parameters": {
        "targetType": "phone",
        "phone": "={{ $json.properties.phone || $json.properties.mobilephone }}",
        "countryCode": "",
        "messageType": "0",
        "message": "=Hi {{ $json.properties.firstname }}, thanks for getting in touch. You can reach us here on WhatsApp.",
        "whatsappClientId": 0,
        "additionalOptions": {}
      },
      "id": "749e9a91-a0c2-526c-9cf4-7d3933d47bbb",
      "name": "WbizTool Send Message (new contact)",
      "type": "n8n-nodes-wbiztool.wbizToolSendMessage",
      "typeVersion": 1.1,
      "position": [
        900,
        140
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose"
          },
          "conditions": [
            {
              "id": "15a11095-bd5e-5e92-8b3a-dab6ee0c6087",
              "leftValue": "={{ $json.propertyValue }}",
              "rightValue": "closedwon",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "1b039001-f9dd-5ad8-8122-d38d2088da3a",
      "name": "Deal stage is",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        460,
        440
      ]
    },
    {
      "parameters": {
        "method": "GET",
        "url": "=https://api.hubapi.com/crm/objects/2026-09/deals/{{ $json.dealId }}?properties=dealname&associations=contacts",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "hubspotAppToken",
        "options": {}
      },
      "id": "df95a559-0af6-5b15-a7ad-994661e9efbb",
      "name": "Get deal and contacts",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        680,
        440
      ]
    },
    {
      "parameters": {
        "authentication": "appToken",
        "resource": "contact",
        "operation": "search",
        "returnAll": false,
        "limit": 1,
        "filterGroupsUi": {
          "filterGroupsValues": [
            {
              "filtersUi": {
                "filterValues": [
                  {
                    "propertyName": "hs_object_id|number",
                    "operator": "EQ",
                    "value": "={{ $json.associations.contacts.results[0].id }}"
                  }
                ]
              }
            }
          ]
        },
        "additionalFields": {
          "properties": [
            "firstname",
            "phone",
            "mobilephone"
          ]
        }
      },
      "id": "b786af7e-1c64-5e9a-bc1a-a8d449f0e17d",
      "name": "Read deal contact",
      "type": "n8n-nodes-base.hubspot",
      "typeVersion": 2.2,
      "position": [
        900,
        440
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose"
          },
          "conditions": [
            {
              "id": "19db8399-46cf-5a1e-8ec6-12e992ab1138",
              "leftValue": "={{ $json.properties.phone || $json.properties.mobilephone }}",
              "rightValue": "",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "f98bf56e-074b-5aed-8f24-ab3410d3f26a",
      "name": "Deal contact has a number?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        1120,
        440
      ]
    },
    {
      "parameters": {
        "targetType": "phone",
        "phone": "={{ $json.properties.phone || $json.properties.mobilephone }}",
        "countryCode": "",
        "messageType": "0",
        "message": "=Hi {{ $json.properties.firstname }}, good news: {{ $('Get deal and contacts').first().json.properties.dealname }} is confirmed. Reply here on WhatsApp if you have any questions.",
        "whatsappClientId": 0,
        "additionalOptions": {}
      },
      "id": "ab0bf5ec-19e7-5e19-b547-587c07ffeb57",
      "name": "WbizTool Send Message (deal stage)",
      "type": "n8n-nodes-wbiztool.wbizToolSendMessage",
      "typeVersion": 1.1,
      "position": [
        1340,
        420
      ]
    }
  ],
  "connections": {
    "HubSpot Trigger": {
      "main": [
        [
          {
            "node": "New contact?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New contact?": {
      "main": [
        [
          {
            "node": "Read new contact",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Deal stage is",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read new contact": {
      "main": [
        [
          {
            "node": "Contact has a number?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Contact has a number?": {
      "main": [
        [
          {
            "node": "WbizTool Send Message (new contact)",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "Deal stage is": {
      "main": [
        [
          {
            "node": "Get deal and contacts",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "Get deal and contacts": {
      "main": [
        [
          {
            "node": "Read deal contact",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read deal contact": {
      "main": [
        [
          {
            "node": "Deal contact has a number?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Deal contact has a number?": {
      "main": [
        [
          {
            "node": "WbizTool Send Message (deal stage)",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    }
  },
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}
