{
  "name": "Automate WhatsApp booking system with GPT-4 Assistant, Cal.com and SMS reminders",
  "nodes": [
    {
      "id": "1d45c88a-5c71-42bb-9207-a7060a64030b",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -500,
        480
      ],
      "parameters": {
        "width": 1620,
        "height": 280,
        "content": "# 🟩 STEP 3 — Send SMS Reminder Before Appointment\n\n"
      }
    },
    {
      "id": "1274c8bb-78fd-445f-b3bb-c1adedba3acc",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -500,
        -540
      ],
      "parameters": {
        "width": 1620,
        "height": 460,
        "content": "# 🟫 STEP 1 — Qualify User and Suggest Appointment"
      }
    },
    {
      "id": "bb147090-c21c-4b75-bfd7-92b1b61646f5",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -500,
        -60
      ],
      "parameters": {
        "width": 1620,
        "height": 520,
        "content": "# 🟥 STEP 2 — Book Appointment Automatically\n\n"
      }
    },
    {
      "id": "3b2b3031-55a6-4c98-a6a5-75eb746b2c99",
      "name": "Webhook Trigger (WhatsApp Input)",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -960,
        -80
      ]
    },
    {
      "id": "6c7ffde6-b3bc-4162-b45d-8e483e347d49",
      "name": "Switch: Confirm vs Chat Flow",
      "type": "n8n-nodes-base.switch",
      "position": [
        -740,
        -80
      ]
    },
    {
      "id": "f7f43574-cfed-4448-983f-dc53343ec4ab",
      "name": "AI Booking Assistant (Dr Firas)",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        40,
        -460
      ]
    },
    {
      "id": "03d391f5-43b5-462e-8c56-cdce426f9751",
      "name": "LLM: GPT-4o Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -200,
        -260
      ]
    },
    {
      "id": "365fc08f-6514-4182-b77f-86a13ef55576",
      "name": "AI Conversation Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -40,
        -260
      ]
    },
    {
      "id": "96eeb9b5-aea9-46cc-893f-4ea3697a3fb5",
      "name": "Create New Prospect in Google Sheet",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        140,
        -260
      ]
    },
    {
      "id": "9fcb6a32-34e7-4c5a-997a-cd0fe58f62cd",
      "name": "Update Prospect with Booking Details",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        320,
        -260
      ]
    },
    {
      "id": "9e1a6470-0937-4190-9d24-259ea2749190",
      "name": "Fetch Available Time Slots",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "position": [
        520,
        -260
      ]
    },
    {
      "id": "5d8dc1ce-020f-4df3-88cc-7f61594a3347",
      "name": "Send Response to WhatsApp",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        700,
        -460
      ]
    },
    {
      "id": "5cd00123-c0ea-48f9-85e6-e496a0bd6620",
      "name": "Retrieve Prospect Details",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -420,
        140
      ]
    },
    {
      "id": "9696140f-857f-42b6-9bb9-3d25f5d893d4",
      "name": "Normalize Booking Time (UTC Format)",
      "type": "n8n-nodes-base.code",
      "position": [
        -200,
        140
      ]
    },
    {
      "id": "6d2ef19a-93d1-46f1-bc31-ad1010d3bb4a",
      "name": "Send Booking",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        20,
        140
      ]
    },
    {
      "id": "472dc55f-b42f-483f-b6cc-1f8c25f0158e",
      "name": "Format Date for Readability (Display)",
      "type": "n8n-nodes-base.code",
      "position": [
        240,
        140
      ]
    },
    {
      "id": "7f0f86bc-8199-4d81-8bce-e96ced534f6e",
      "name": "Check Booking Status (Success or Error)",
      "type": "n8n-nodes-base.switch",
      "position": [
        460,
        140
      ]
    },
    {
      "id": "108c9a6b-a345-4f33-ab22-113b6e63914b",
      "name": "Webhook Response: Booking Confirmed",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        700,
        -20
      ]
    },
    {
      "id": "8c3d9734-7aad-4445-9810-29d7045fbc78",
      "name": "Webhook Response: Booking Failed",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        700,
        280
      ]
    },
    {
      "id": "2a3ed659-5cec-497b-bde8-f6a15585cc41",
      "name": "Mark Booking as Confirmed in Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        920,
        140
      ]
    },
    {
      "id": "5bfa51a3-e939-41e8-a1df-b4e59c4feef1",
      "name": "Trigger: Check Appointments Every Hour",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -420,
        580
      ]
    },
    {
      "id": "0413b7b7-b523-4e22-ad4a-40d7342abed9",
      "name": "Read Upcoming Appointments from Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -200,
        580
      ]
    },
    {
      "id": "408e1330-29e4-4de7-b681-1bb372b5f841",
      "name": "Filter Appointments Within Next 2 Hours",
      "type": "n8n-nodes-base.code",
      "position": [
        20,
        580
      ]
    },
    {
      "id": "0a9d6747-85d2-400e-a9fd-b5768ae4605c",
      "name": "Send SMS Reminder",
      "type": "n8n-nodes-base.sms77",
      "position": [
        240,
        580
      ]
    },
    {
      "id": "3a01ec5e-57ea-43ac-8e59-97d66e85454f",
      "name": "Mark SMS as Sent in Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        460,
        580
      ]
    }
  ],
  "connections": {
    "Send Booking": {
      "main": [
        [
          {
            "node": "Format Date for Readability (Display)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send SMS Reminder": {
      "main": [
        [
          {
            "node": "Mark SMS as Sent in Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Conversation Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Booking Assistant (Dr Firas)",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "LLM: GPT-4o Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Booking Assistant (Dr Firas)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve Prospect Details": {
      "main": [
        [
          {
            "node": "Normalize Booking Time (UTC Format)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Available Time Slots": {
      "ai_tool": [
        [
          {
            "node": "AI Booking Assistant (Dr Firas)",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Switch: Confirm vs Chat Flow": {
      "main": [
        [
          {
            "node": "AI Booking Assistant (Dr Firas)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Retrieve Prospect Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Booking Assistant (Dr Firas)": {
      "main": [
        [
          {
            "node": "Send Response to WhatsApp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook Trigger (WhatsApp Input)": {
      "main": [
        [
          {
            "node": "Switch: Confirm vs Chat Flow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create New Prospect in Google Sheet": {
      "ai_tool": [
        [
          {
            "node": "AI Booking Assistant (Dr Firas)",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Booking Time (UTC Format)": {
      "main": [
        [
          {
            "node": "Send Booking",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook Response: Booking Confirmed": {
      "main": [
        [
          {
            "node": "Mark Booking as Confirmed in Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Prospect with Booking Details": {
      "ai_tool": [
        [
          {
            "node": "AI Booking Assistant (Dr Firas)",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Format Date for Readability (Display)": {
      "main": [
        [
          {
            "node": "Check Booking Status (Success or Error)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Upcoming Appointments from Sheet": {
      "main": [
        [
          {
            "node": "Filter Appointments Within Next 2 Hours",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger: Check Appointments Every Hour": {
      "main": [
        [
          {
            "node": "Read Upcoming Appointments from Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Booking Status (Success or Error)": {
      "main": [
        [
          {
            "node": "Webhook Response: Booking Confirmed",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Webhook Response: Booking Failed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Appointments Within Next 2 Hours": {
      "main": [
        [
          {
            "node": "Send SMS Reminder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}