{
  "name": "Real Estate WhatsApp Qualification Sequence",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "real-estate-whatsapp-qualification",
        "responseMode": "onReceived",
        "options": {}
      },
      "id": "46f9f061-844f-4bac-96e3-2a21651b00e8",
      "name": "Inbound WhatsApp Event",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "e1ae1770-8b45-4185-a66d-58e4314a4003",
              "name": "phone",
              "value": "={{ $json.body.from }}",
              "type": "string"
            },
            {
              "id": "9940a349-5976-4203-ad84-ceb90c7ddd48",
              "name": "answer",
              "value": "={{ $json.body.text }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "a3136986-9640-4488-915d-b4d5bcfce32d",
      "name": "Extract Answer",
      "type": "n8n-nodes-base.set",
      "typeVersion": 2,
      "position": [
        260,
        0
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $env.QUALIFICATION_STATE_ENDPOINT }}",
        "sendBody": true,
        "contentType": "raw",
        "rawContentType": "application/json",
        "body": "={{ JSON.stringify($json) }}",
        "options": {}
      },
      "id": "54434488-6e4b-4dfb-bf6a-c9bf9668254f",
      "name": "Update Qualification State",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        520,
        0
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $env.WHATSAPP_SEND_ENDPOINT }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer {{$env.WHATSAPP_TOKEN}}"
            }
          ]
        },
        "sendBody": true,
        "contentType": "raw",
        "rawContentType": "application/json",
        "body": "={{ JSON.stringify({to:$json.phone,state:$json}) }}",
        "options": {}
      },
      "id": "5aed0ffc-1b7c-48fd-860b-9f13f6cef3af",
      "name": "Send Next Question",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        780,
        0
      ]
    }
  ],
  "pinData": {},
  "connections": {
    "Inbound WhatsApp Event": {
      "main": [
        [
          {
            "node": "Extract Answer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Answer": {
      "main": [
        [
          {
            "node": "Update Qualification State",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Qualification State": {
      "main": [
        [
          {
            "node": "Send Next Question",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "5c7a1721-7e6a-46f1-8c1f-25ad498f78c0",
  "meta": {
    "templateCredsSetupCompleted": false,
    "kumoDraftAsset": true,
    "credentialPlaceholdersRequired": true
  },
  "tags": []
}