Complete Booking System with Google Calendar, Business Hours & REST API

GCalendar Smart Booking System

Demo

github code Try yourself

šŸ“‹ Description

Transform your booking chaos into streamlined automation with this production-ready GCalendar Smart Booking System. This comprehensive n8n workflow eliminates weeks of custom development by providing two powerful REST APIs that handle everything from input validation to calendar integration.

What makes this special? Unlike basic booking forms, this system includes enterprise-grade features like intelligent conflict detection, public holiday awareness, business hours enforcement, and automatic Google Calendar integration with Meet links. It's battle-tested with real-world business logic including lunch breaks, timezone handling, and comprehensive error responses.

Privacy & Cost Benefits: šŸ” Privately yours & free** - No need to purchase expensive booking software or worry about data breaches. Your booking data stays secure in your own Google Calendar, completely under your control. šŸŽÆ All-in-One solution** - No manual invitation sending required. Google Calendar automatically handles attendee notifications and generates real Google Meet links for every booking, creating a seamless experience for both you and your clients. No need pay for API to get public holiday, use the google calendar free default .

Perfect for rapid deployment: Whether you're building for clients, launching an MVP, or replacing expensive booking software, this template gets you from zero to production in under 15 minutes. The clean API design makes frontend integration effortless, while the robust validation ensures reliable operation at scale.

Two endpoints, endless possibilities: /make-booking - Complete booking creation with multi-layer validation /check-booking-date - Real-time slot availability listing (comes with conflict detection, business hour checks)

Built by developers, for developers - with comprehensive documentation, testing examples, and customization guides included.

Purpose This workflow provides a webhook API endpoint that your frontend can easily integrate typically triggered by a submit button on a booking form. When the frontend calls this REST API, the workflow handles the booking logic by performing several key checks: Valid Input — Ensures all required fields are present and correctly formatted. Date & Time Validation — Confirms the requested slot falls within business hours, excludes lunch/dinner breaks, and respects public holidays. Conflict Detection — Checks for any existing bookings at the requested time to prevent overlaps. Calendar Integration — Once all checks pass, the workflow automatically creates a booking entry in your Google Calendar, keeping everything synced and visible.

šŸŽÆ Target Audience

This template is perfect for:

šŸ„ Healthcare & Medical Professionals: Clinics, dental offices, physiotherapy centers, and medical practices needing automated appointment scheduling with proper business hours validation and no-show reduction.

šŸ’¼ Professional Service Providers: Consultants, lawyers, accountants, financial advisors, and coaches who require sophisticated booking systems with calendar integration and conflict prevention.

šŸŽ“ Educational Institutions: Universities, tutoring centers, training academies, and educational consultants needing student appointment scheduling with academic calendar integration.

šŸ¢ Small to Medium Businesses: Service-based businesses like salons, spas, repair services, and consulting firms looking to automate their booking process without expensive software subscriptions.

šŸ‘Øā€šŸ’» Software Development Teams: Developers and engineering teams who need to rapidly deploy booking functionality for client projects without building from scratch.

🌐 Digital Agencies: Web development agencies, marketing firms, and digital consultancies building booking solutions for multiple clients across different industries.

šŸØ Hospitality & Events: Meeting room booking, event venue scheduling, equipment rental companies, and co-working spaces requiring intelligent availability management.

šŸ”§ Freelancers & Solo Entrepreneurs: Independent professionals like designers, photographers, personal trainers, and contractors who need professional booking systems on a budget.

šŸ“Š Product Managers: Teams building SaaS products that require booking/scheduling features as part of their core functionality or user experience.

šŸš€ Startup Founders: Early-stage companies needing to validate booking-related business models quickly without significant development investment.

šŸŽØ Creative Professionals: Photographers, videographers, music instructors, and artists who need client appointment scheduling with portfolio integration possibilities.

āš™ļø Technical Operations Teams: DevOps engineers and system administrators who need to implement booking systems for internal resource allocation (servers, equipment, meeting rooms).

This template eliminates weeks of development time while providing enterprise-grade validation, making it ideal for anyone who values rapid deployment, reliability, and professional functionality in their booking systems.

āš™ļø How It Works

šŸ”„ Booking Flow (Step-by-Step)

Phase 1: Input Validation // Real validation logic from the workflow āœ… Name, email, phone, date, time validation āœ… Email format verification (RFC compliant) āœ… Phone number format checking āœ… Date/time format standardization (YYYY-MM-DD, HH:MM)

Phase 2: Business Logic Validation // Business hours: Monday-Friday, 9AM-9PM (customizable) āœ… Weekend blocking āœ… Business hours enforcement
āœ… Lunch break exclusion (12PM-2PM) āœ… Dinner break exclusion (6PM-8PM) āœ… Timezone handling (Malaysia/UTC+8 default)

Phase 3: Intelligent Conflict Detection // Multi-calendar checking āœ… Public holiday calendar integration āœ… Main booking calendar conflict detection āœ… Real-time availability verification āœ… Overlap prevention algorithms

Phase 4: Calendar Integration // Google Calendar automation āœ… Event creation with attendee invitation āœ… Google Meet link generation āœ… Custom event descriptions and summaries āœ… Calendar color coding

šŸ•’ Availability API Flow

Date Input → Validates YYYY-MM-DD format Weekend/Holiday Check → Blocks non-working days Slot Generation → Creates available time slots Conflict Mapping → Marks booked vs available slots Response Formatting → Returns structured availability data

šŸ› ļø Quick Start Guide

Prerequisites n8n instance (cloud or self-hosted) Google Cloud Project with Calendar API enabled Google Calendar credentials

Simple Setup Guide

Step 1: Import the Workflow ā¬‡ļø Download the smart-booking-system.json file In your n8n instance: Workflows → Import from File Select the downloaded JSON file Click Import

Step 2: Set Up Google Calendar Credentials šŸ”‘ Create Google Cloud Project: Go to Google Cloud Console Create new project or select existing one Enable Google Calendar API

Configure n8n Credentials: In n8n: Credentials → Add Credential → Google Calendar OAuth2 API Enter your Google Cloud Client ID and Client Secret Save as "Google Calendar account"

Update Workflow Nodes: Find nodes: Create Calendar Event, Check Calendar Availability, etc. Select your Google Calendar credential in each node

Step 3: Configure Your Calendars šŸ“… Main Booking Calendar: Create a dedicated Google Calendar for bookings Copy the Calendar ID (found in Calendar Settings) Replace YOUR_BOOKING_CALENDAR_ID@group.calendar.google.com in these nodes: Create Calendar Event Check Calendar Availability - Main Check Calendar Availability

Holiday Calendar (Optional): Add your country's holiday calendar to Google Calendar Find the calendar ID (e.g., en.usa#holiday@group.v.calendar.google.com) Update Check Calendar Availability - public holiday and Check Public Holiday Calendar nodes

Step 4: Customize Business Hours ā° Find the ConfigTimeSlots node Edit the time slots array: [ { "time": "09:30", "display": "9:30 AM - 10:30 AM", "available": true }, { "time": "10:30", "display": "10:30 AM - 11:30 AM", "available": true }, { "time": "11:30", "display": "11:30 AM - 12:30 PM", "available": true }, { "time": "14:30", "display": "2:30 PM - 3:30 PM", "available": true }, { "time": "15:30", "display": "3:30 PM - 4:30 PM", "available": true }, { "time": "16:30", "display": "4:30 PM - 5:30 PM", "available": true }, { "time": "17:30", "display": "5:30 PM - 6:30 PM", "available": true }, { "time": "20:30", "display": "8:30 PM - 9:30 PM", "available": true } ]

Step 5: Activate & Test šŸš€ Activate the workflow: Toggle the workflow Active switch Get your webhook URLs: Booking: https://your-n8n-domain/webhook/suarify-make-booking Availability: https://your-n8n-domain/webhook/suarify-check-booking-date

Test with sample requests: Test booking creation curl -X POST 'https://your-n8n-domain/webhook/suarify-make-booking'
-H 'Content-Type: application/json'
-d '{ "name": "John Doe", "email": "john@example.com", "phone": "+1234567890", "date": "2024-03-15", "time": "14:30" }'

Test availability checking
curl -X POST 'https://your-n8n-domain/webhook/suarify-check-booking-date'
-H 'Content-Type: application/json'
-d '{"date": "2024-03-15"}'

Step 6: Integrate with Your Frontend šŸ’» Use the webhook URLs in your booking form Handle the JSON responses for success/error states Display available time slots from the availability API

šŸŽ‰ You're ready to start taking bookings!

šŸ“‹ API Documentation

šŸ“¤ Booking Creation API

Endpoint: POST /webhook/make-booking

Request Body: { "name": "John Doe", "email": "john@example.com", "phone": "+1234567890", "date": "2024-03-15", "time": "14:30", "source": "Website Form" }

Success Response (200): { "success": true, "message": "Booking confirmed successfully!", "bookingDetails": { "name": "John Doe", "email": "john@example.com", "phone": "+1234567890", "date": "2024-03-15", "time": "14:30", "eventId": "abc123def456", "eventLink": "https://calendar.google.com/event?eid=...", "calendarEvent": { /* Full calendar event object */ } }, "confirmationMessage": "Hi John Doe, your booking has been confirmed for 2024-03-15 at 14:30. You will receive a calendar invitation shortly." }

Error Response (400): { "success": false, "error": "Invalid email format", "message": "Booking request failed validation", "details": { /* Error context */ } }

šŸ“… Availability Check API

Endpoint: POST /webhook/check-booking-date

Request Body: { "date": "2024-03-15" }

Success Response (200): { "success": true, "isWorkingDay": true, "isWeekend": false, "holidayName": "", "availableSlots": [ { "time": "09:30", "display": "9:30 AM - 10:30 AM", "available": true }, { "time": "10:30", "display": "10:30 AM - 11:30 AM", "available": false, "status": "booked" } ], "totalConflicts": 3 }

šŸŽ›ļø Customization Guide

Business Hours Configuration Edit the ConfigTimeSlots node to modify available booking times:

const timeSlots = [ { time: '09:00', display: '9:00 AM - 10:00 AM', available: true }, { time: '10:00', display: '10:00 AM - 11:00 AM', available: true }, // Lunch break automatically excluded { time: '14:00', display: '2:00 PM - 3:00 PM', available: true }, // Customize as needed... ];

Timezone Adjustment Modify the Business Hours Check node:

// Change from Malaysia (UTC+8) to your timezone const timezone = 'America/New_York'; // UTC-5 const timezoneOffset = '-05:00';

Holiday Calendar Update calendar ID in holiday checking nodes:

// Replace with your country's holiday calendar "value": "en.usa#holiday@group.v.calendar.google.com"

Business Rules Customize validation in the Business Hours Check node:

// Business hours: Mon-Fri, 9am-6pm (example) const isWithinBusinessHours = timeInMinutes >= 540 && timeInMinutes <= 1080; // Remove lunch breaks if not needed const isNotLunchBreak = true; // Always allow

Start automating in under 15 minutes! šŸŽ‰

Made with ā¤ļø for the engineering community. Star this repo if it saves you time!

0
Downloads
1
Views
7.74
Quality Score
beginner
Complexity
Author:Sean Lon(View Original →)
Created:9/19/2025
Updated:11/17/2025

šŸ”’ Please log in to import templates to n8n and favorite templates

Workflow Visualization

Loading...

Preparing workflow renderer

Comments (0)

Login to post comments