{
  "name": "Real Estate Property Viewing Scheduler",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "real-estate-viewing-request",
        "responseMode": "onReceived",
        "options": {}
      },
      "id": "70077cfd-205b-4264-9b8c-7f7204cee3eb",
      "name": "Qualified Lead",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "method": "GET",
        "url": "={{ $env.CALENDAR_AVAILABILITY_ENDPOINT }}",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "agent_id",
              "value": "={{ $json.body.agent_id }}"
            },
            {
              "name": "date",
              "value": "={{ $json.body.preferred_date }}"
            }
          ]
        },
        "options": {}
      },
      "id": "52d62a8f-e425-40f8-be84-281da3fd2c1b",
      "name": "Check Calendar",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        260,
        0
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $env.WHATSAPP_SEND_ENDPOINT }}",
        "sendBody": true,
        "contentType": "raw",
        "rawContentType": "application/json",
        "body": "={{ JSON.stringify({to:$json.phone,available_slots:$json.slots}) }}",
        "options": {}
      },
      "id": "b3dfd827-8664-45a2-938c-3a2499935f66",
      "name": "Offer Slots",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        520,
        0
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $env.CRM_ACTIVITY_ENDPOINT }}",
        "sendBody": true,
        "contentType": "raw",
        "rawContentType": "application/json",
        "body": "={{ JSON.stringify($json) }}",
        "options": {}
      },
      "id": "7f6e2aa0-700d-46c0-b49a-3ff5c870c917",
      "name": "Log Offer",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        780,
        0
      ]
    }
  ],
  "pinData": {},
  "connections": {
    "Qualified Lead": {
      "main": [
        [
          {
            "node": "Check Calendar",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Calendar": {
      "main": [
        [
          {
            "node": "Offer Slots",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Offer Slots": {
      "main": [
        [
          {
            "node": "Log Offer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "7822fb87-030a-43af-803c-58ed0c51f0ba",
  "meta": {
    "templateCredsSetupCompleted": false,
    "kumoDraftAsset": true,
    "credentialPlaceholdersRequired": true
  },
  "tags": []
}