{
  "name": "Dental Chatbot Lead Capture",
  "nodes": [
    {
      "parameters": {
        "rule": "incomingWebhook"
      },
      "id": "webhook-trigger",
      "name": "Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "position": [250, 300]
    },
    {
      "parameters": {
        "url": "https://autostack-17.polsia.app/api/dental/leads",
        "method": "POST",
        "bodyParameters": {
          "parameters": [
            { "name": "name", "value": "={{ $json.name }}" },
            { "name": "email", "value": "={{ $json.email }}" },
            { "name": "phone", "value": "={{ $json.phone }}" },
            { "name": "intent", "value": "={{ $json.intent }}" },
            { "name": "notes", "value": "={{ $json.notes }}" },
            { "name": "source", "value": "chatbot" }
          ]
        }
      },
      "id": "create-lead",
      "name": "Create Lead in DB",
      "type": "n8n-nodes-base.httpRequest",
      "position": [500, 300]
    },
    {
      "parameters": {
        "conditions": {
          "options": {},
          "conditions": [
            {
              "id": "intent-condition",
              "leftValue": "={{ $json.intent }}",
              "rightValue": "booking_cleaning",
              "operator": { "type": "string", "operation": "equals" }
            }
          ]
        }
      },
      "id": "qualify-lead",
      "name": "Qualify Lead Intent",
      "type": "n8n-nodes-base.if",
      "position": [750, 300]
    },
    {
      "parameters": {
        "functionCode": "return [{ json: { message: 'Hi {{ $json.name }}! I see you want to book a cleaning. Our next available slot is Thursday at 10am. Would you like to book that time?' } }];"
      },
      "id": "booking-response",
      "name": "Send Booking Prompt",
      "type": "n8n-nodes-base.function",
      "position": [1000, 200]
    },
    {
      "parameters": {
        "functionCode": "return [{ json: { message: 'Thanks {{ $json.name }}! Our team will follow up within 2 hours to answer your questions.' } }];"
      },
      "id": "general-response",
      "name": "Send General Inquiry Response",
      "type": "n8n-nodes-base.function",
      "position": [1000, 400]
    }
  ],
  "connections": {
    "Webhook Trigger": { "main": [[{ "node": "Create Lead in DB", "type": "main" }]] },
    "Create Lead in DB": { "main": [[{ "node": "Qualify Lead Intent", "type": "main" }]] },
    "Qualify Lead Intent": {
      "main": [
        [{ "node": "Send Booking Prompt", "type": "main" }],
        [{ "node": "Send General Inquiry Response", "type": "main" }]
      ]
    }
  },
  "settings": {},
  "description": "Imports into n8n: captures chatbot leads from website, saves to AutoStack DB, qualifies intent (booking vs inquiry)"
}