{
  "name": "Automate medical appointments with ElevenLabs voice agent & Google Calendar",
  "nodes": [
    {
      "id": "3e4fd8c7-20a2-4e12-b628-e320a3d18fd8",
      "name": "Sticky Note - Webhook",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3936,
        -272
      ],
      "parameters": {
        "width": 510,
        "height": 481,
        "content": "## 📥 WEBHOOK ENTRY POINT\n\n**Receives data from ElevenLabs:**\n\n**Body parameters:**\n- `fullName` - Patient name (only for booking)\n- `email` - Contact email (only for booking)\n- `phone` - Phone number "
      }
    },
    {
      "id": "09316f64-01a4-41a6-a5d7-fe188596d08c",
      "name": "Sticky Note - Edit Fields",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3424,
        -272
      ],
      "parameters": {
        "width": 310,
        "height": 481,
        "content": "## ✏️ DATA PREPARATION\n\n**Extracts and formats:**\n- Combines `date` + `time` into single datetime field\n- Prepares all fields for calendar and email nodes\n\n**Output format:**\nYYYY-MM-DD HH:MM\n(e.g., \""
      }
    },
    {
      "id": "e50d4da0-11c4-482b-bf94-3cbde2d83b7e",
      "name": "Sticky Note - Routing",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3120,
        -272
      ],
      "parameters": {
        "width": 406,
        "height": 485,
        "content": "## 🔀 ROUTING LOGIC\n\n**Determines action type:**\n\n**Path 1 (True):** Availability Check\n- Triggered when `fullName` OR `email` is missing\n- Only date/time/type provided\n- Returns available/unavailable "
      }
    },
    {
      "id": "3d3dc615-146c-4602-af78-ed7484856b90",
      "name": "Sticky Note - Booking",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2704,
        304
      ],
      "parameters": {
        "width": 255,
        "height": 274,
        "content": "## ✅ BOOKING PATH\n\n**Creates Google Calendar Event**\n"
      }
    },
    {
      "id": "c16c3b25-795a-4ec0-89f5-b11545ea16b5",
      "name": "Sticky Note - Email",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2448,
        304
      ],
      "parameters": {
        "width": 357,
        "height": 274,
        "content": "## 📧 EMAIL CONFIRMATION\n\n**Sends an ppointment confirmation via Gmail**\n\n\n"
      }
    },
    {
      "id": "06216198-2728-4f2f-bf04-c981c25185a9",
      "name": "Sticky Note - Availability",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2720,
        -272
      ],
      "parameters": {
        "width": 453,
        "height": 482,
        "content": "## 🔍 AVAILABILITY CHECK PATH\n\n**Check if specific time slot is free**\n→ If available: Return success\n→ If unavailable: Find alternative slots\n\n**⚙️ Setup Required:**\nConnect Google Calendar and select"
      }
    },
    {
      "id": "56ffb539-4752-4a58-ac64-245a9ff11138",
      "name": "Sticky Note - Quick Start",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4336,
        -272
      ],
      "parameters": {
        "width": 405,
        "height": 900,
        "content": "## 🚀 QUICK START GUIDE\n\n**1. Configure Credentials:**\n   - [ ] Google Calendar OAuth2\n   - [ ] Gmail OAuth2\n\n**2. Select Calendar:**\n   - Open all Google Calendar nodes\n   - Choose your booking calend"
      }
    },
    {
      "id": "600186bf-6b72-4daf-9e0a-00a8cb247b36",
      "name": "Sticky Note - Troubleshooting",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4336,
        352
      ],
      "parameters": {
        "width": 409,
        "height": 524,
        "content": "## 🐛 TROUBLESHOOTING\n\n**Workflow not triggering:**\n- Check webhook URL is correct\n- Verify workflow is active\n- Check ElevenLabs function configuration\n\n**Calendar not syncing:**\n- Reconnect Google Ca"
      }
    },
    {
      "id": "c5f730f6-8930-4efe-8773-5b93c6fd8e4e",
      "name": "Webhook1",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -3696,
        240
      ]
    },
    {
      "id": "aba4a40b-94f7-4f54-b1e1-87459cf96dca",
      "name": "Available?1",
      "type": "n8n-nodes-base.if",
      "position": [
        -2432,
        48
      ]
    },
    {
      "id": "3cbee3f2-dd7a-4a09-84d7-0957aaac68b7",
      "name": "Check Availability Again",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        -2176,
        128
      ]
    },
    {
      "id": "7cafaa98-68fb-4408-b37b-ba1e7edb436f",
      "name": "Set Up Variables",
      "type": "n8n-nodes-base.set",
      "position": [
        -3328,
        240
      ]
    },
    {
      "id": "7e5cd44f-3b1e-4f6e-ab9f-59d9efd3ce84",
      "name": "Book Appointment",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        -2640,
        416
      ]
    },
    {
      "id": "0bbc9ee0-6813-4688-9638-dc4e79162b1a",
      "name": "Get availability in a calendar",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        -2640,
        48
      ]
    },
    {
      "id": "5c6da70a-f54f-4088-8ed1-4bf32c91cd86",
      "name": "Send a message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -2432,
        416
      ]
    },
    {
      "id": "cda91dc7-8c9a-4ef5-ae69-38e894dd11ad",
      "name": "Confirm Booking ",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -2224,
        416
      ]
    },
    {
      "id": "ce9d6170-3b3f-486b-8667-0f0ec8e879dc",
      "name": "Confirm Available Times",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -2176,
        -32
      ]
    },
    {
      "id": "ade07557-b674-4bb3-9415-cf0c98d6d095",
      "name": "Sort Available Slots",
      "type": "n8n-nodes-base.code",
      "position": [
        -1968,
        128
      ]
    },
    {
      "id": "7527abf9-5e6d-44d2-8250-02db3eee78fa",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -1760,
        128
      ]
    },
    {
      "id": "729f6a0f-ad3e-4f4d-b5f4-d9695ecd1e03",
      "name": "Confirm The Time's Unavailable",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -1552,
        128
      ]
    },
    {
      "id": "990395b5-8563-445a-bf87-9159427498ee",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        -2976,
        240
      ]
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Get availability in a calendar",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Book Appointment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook1": {
      "main": [
        [
          {
            "node": "Set Up Variables",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Confirm The Time's Unavailable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Available?1": {
      "main": [
        [
          {
            "node": "Confirm Available Times",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Check Availability Again",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message": {
      "main": [
        [
          {
            "node": "Confirm Booking ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Book Appointment": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Up Variables": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sort Available Slots": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Availability Again": {
      "main": [
        [
          {
            "node": "Sort Available Slots",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get availability in a calendar": {
      "main": [
        [
          {
            "node": "Available?1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}