{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "fbaac3f3-2306-46cc-b1a9-000cfd6f2a90",
      "name": "Workflow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2336,
        -1680
      ],
      "parameters": {
        "color": 3,
        "width": 460,
        "height": 428,
        "content": "## Property Inquiry \u2192 Personalized SMS + AI Buyer Qualification\n\n**How it works:**\n1. Receives property inquiry from Zillow, Realtor.com, IDX site, or Facebook Lead Ads\n2. Normalizes buyer data + property address, price, and MLS#\n3. Creates contact in Aloware with full property details in custom fields\n4. Sends hyper-personalized SMS referencing the exact property\n5. Enrolls in AI Buyer Qualification Sequence\n\n**Setup:**\n- Set n8n Variables: `ALOWARE_API_TOKEN`, `ALOWARE_LINE_PHONE`, `ALOWARE_SEQUENCE_ID`, `AGENT_NAME`, `BROKERAGE_NAME`\n- Connect your lead source to POST to this webhook URL\n- Create an AI Buyer Qualification Sequence in Aloware"
      },
      "typeVersion": 1
    },
    {
      "id": "0578b203-5591-415a-8a67-860bb41e915c",
      "name": "Receive & Create Contact",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2816,
        -1552
      ],
      "parameters": {
        "color": 4,
        "width": 720,
        "height": 308,
        "content": "### \ud83d\udce5 Receive Inquiry & Create Contact"
      },
      "typeVersion": 1
    },
    {
      "id": "6116a0df-22eb-4c9a-9b84-f4ed481fc456",
      "name": "SMS + AI Sequence",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3536,
        -1552
      ],
      "parameters": {
        "color": 6,
        "width": 788,
        "height": 308,
        "content": "### \ud83d\udce4 Property SMS + AI Qualification"
      },
      "typeVersion": 1
    },
    {
      "id": "309d82bd-3e97-40b4-8074-bbdc26c8ad98",
      "name": "Qualification Tip",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3728,
        -1680
      ],
      "parameters": {
        "width": 380,
        "height": 80,
        "content": "AI Sequence should qualify: timeline, pre-approval status, budget, preferred showing times"
      },
      "typeVersion": 1
    },
    {
      "id": "63868fca-aa86-4250-917e-e4060be49e6e",
      "name": "Property Inquiry Received",
      "type": "n8n-nodes-base.webhook",
      "position": [
        2848,
        -1440
      ],
      "parameters": {
        "path": "property-inquiry",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2
    },
    {
      "id": "5c9b51d5-48d0-4663-85af-cfc97d737146",
      "name": "Normalize Inquiry Data",
      "type": "n8n-nodes-base.set",
      "position": [
        3072,
        -1440
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "a001",
              "name": "buyerPhone",
              "type": "string",
              "value": "={{ $json.body?.phone || $json.phone || $json.contact?.phone || $json.lead?.phone || '' }}"
            },
            {
              "id": "a002",
              "name": "buyerFirstName",
              "type": "string",
              "value": "={{ $json.body?.first_name || $json.first_name || $json.contact?.first_name || $json.name?.split(' ')[0] || 'there' }}"
            },
            {
              "id": "a003",
              "name": "buyerLastName",
              "type": "string",
              "value": "={{ $json.body?.last_name || $json.last_name || $json.contact?.last_name || '' }}"
            },
            {
              "id": "a004",
              "name": "buyerEmail",
              "type": "string",
              "value": "={{ $json.body?.email || $json.email || $json.contact?.email || '' }}"
            },
            {
              "id": "a005",
              "name": "propertyAddress",
              "type": "string",
              "value": "={{ $json.body?.property_address || $json.property?.address || $json.listing?.address || $json.address || 'the property' }}"
            },
            {
              "id": "a006",
              "name": "propertyPrice",
              "type": "string",
              "value": "={{ $json.body?.property_price || $json.property?.price || $json.listing?.price || '' }}"
            },
            {
              "id": "a007",
              "name": "propertyMlsId",
              "type": "string",
              "value": "={{ $json.body?.mls_id || $json.property?.mls_id || $json.listing?.mls_id || '' }}"
            },
            {
              "id": "a008",
              "name": "inquirySource",
              "type": "string",
              "value": "={{ $json.body?.source || $json.source || $json.platform || 'Website' }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "d19b05e7-26a0-4810-a89f-4d7f7c04ebaa",
      "name": "Aloware: Create Contact with Property Details",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3312,
        -1440
      ],
      "parameters": {
        "url": "https://app.aloware.com/api/v1/webhook/forms",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "api_token",
              "value": "={{ $vars.ALOWARE_API_TOKEN }}"
            },
            {
              "name": "phone_number",
              "value": "={{ $json.buyerPhone }}"
            },
            {
              "name": "first_name",
              "value": "={{ $json.buyerFirstName }}"
            },
            {
              "name": "last_name",
              "value": "={{ $json.buyerLastName }}"
            },
            {
              "name": "email",
              "value": "={{ $json.buyerEmail }}"
            },
            {
              "name": "lead_source",
              "value": "={{ $json.inquirySource }}"
            },
            {
              "name": "csf1",
              "value": "={{ 'Interested in: ' + $json.propertyAddress }}"
            },
            {
              "name": "csf2",
              "value": "={{ $json.propertyPrice ? 'List Price: $' + $json.propertyPrice : '' }}"
            },
            {
              "name": "csf3",
              "value": "={{ $json.propertyMlsId ? 'MLS#: ' + $json.propertyMlsId : '' }}"
            },
            {
              "name": "notes",
              "value": "={{ 'Property inquiry from ' + $json.inquirySource + '. Address: ' + $json.propertyAddress }}"
            },
            {
              "name": "force_update",
              "value": "=true"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "530d1c93-a259-4074-affe-456fdb87f665",
      "name": "Aloware: Send Property Inquiry SMS",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3712,
        -1440
      ],
      "parameters": {
        "url": "https://app.aloware.com/api/v1/webhook/sms-gateway/send",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "api_token",
              "value": "={{ $vars.ALOWARE_API_TOKEN }}"
            },
            {
              "name": "from",
              "value": "={{ $vars.ALOWARE_LINE_PHONE }}"
            },
            {
              "name": "to",
              "value": "={{ $('Normalize Inquiry Data').item.json.buyerPhone }}"
            },
            {
              "name": "message",
              "value": "=Hi {{ $('Normalize Inquiry Data').item.json.buyerFirstName }}! This is {{ $vars.AGENT_NAME }} from {{ $vars.BROKERAGE_NAME }}. I saw your interest in {{ $('Normalize Inquiry Data').item.json.propertyAddress }} \u2014 great choice! I'd love to tell you more and arrange a showing. Reply YES or call me at {{ $vars.ALOWARE_LINE_PHONE }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "f93a2abf-3192-4ff2-83b8-36a65512fa8c",
      "name": "Aloware: Enroll in AI Buyer Qualification Sequence",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4016,
        -1440
      ],
      "parameters": {
        "url": "https://app.aloware.com/api/v1/webhook/sequence-enroll",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "api_token",
              "value": "={{ $vars.ALOWARE_API_TOKEN }}"
            },
            {
              "name": "sequence_id",
              "value": "={{ $vars.ALOWARE_SEQUENCE_ID }}"
            },
            {
              "name": "phone_number",
              "value": "={{ $('Normalize Inquiry Data').item.json.buyerPhone }}"
            },
            {
              "name": "source",
              "value": "n8n-property-inquiry"
            },
            {
              "name": "force_enroll",
              "value": "=false"
            }
          ]
        }
      },
      "typeVersion": 4.2
    }
  ],
  "connections": {
    "Normalize Inquiry Data": {
      "main": [
        [
          {
            "node": "Aloware: Create Contact with Property Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Property Inquiry Received": {
      "main": [
        [
          {
            "node": "Normalize Inquiry Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aloware: Send Property Inquiry SMS": {
      "main": [
        [
          {
            "node": "Aloware: Enroll in AI Buyer Qualification Sequence",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aloware: Create Contact with Property Details": {
      "main": [
        [
          {
            "node": "Aloware: Send Property Inquiry SMS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}