See llms.txt for all machine-readable content.

Back to Templates

Book and manage LINE OA appointments with OpenAI, Google Calendar and Sheets

Quick overview

This workflow lets customers book, reschedule, or cancel appointments by messaging your LINE Official Account, uses OpenAI to extract booking details, checks availability in Google Calendar, logs bookings in Google Sheets, and sends automated LINE reminders for upcoming appointments.

How it works

  1. Receives incoming LINE webhook events and verifies the request signature before acknowledging valid requests with a 200 response.
  2. Splits the webhook payload into individual text messages and uses OpenAI to extract the customer’s intent (book/cancel/reschedule) and booking details.
  3. Validates the requested service and time against your opening hours, then either asks the customer for missing details or continues.
  4. Checks Google Calendar for busy times on the requested day and, if the slot is taken, replies on LINE with up to three alternative times as quick-reply buttons.
  5. If the slot is free, creates or updates the Google Calendar event and writes the booking status and metadata to a Google Sheets “Bookings” tab.
  6. Sends a confirmation message to the customer on LINE (and pushes an alert to the owner for new bookings), or deletes the calendar event and marks the booking cancelled for cancellation requests.
  7. Runs hourly to find bookings starting within the next 24 hours in Google Sheets, pushes a LINE reminder to the customer, and marks the booking as reminded.

Setup

  1. In the LINE Developers Console, enable webhooks, generate a Channel access token, and add your Channel secret to the signature verification code.
  2. Create an HTTP Header Auth credential for LINE (Authorization: Bearer <CHANNEL_ACCESS_TOKEN>) and select it in the LINE HTTP request steps.
  3. Add OpenAI, Google Calendar OAuth2, and Google Sheets OAuth2 credentials, then select the target booking calendar and set the Google Sheets document URL/ID used by the workflow.
  4. Create a Google Sheet with a “Bookings” tab and the required columns (including bookingId, status, service, date, time, startISO, userId, eventId, reminded, and rawMessage).
  5. Update the booking settings (time zone, opening/closing hours, appointment length, services list, and owner LINE user ID) to match your business.
  6. Copy the production webhook URL from n8n into LINE as the webhook URL and verify it receives events successfully.