Let Agents WorkWORKFLOW

Free guide

The Midnight Booking Workflow

Turn lost after-hours patient texts into confirmed appointments while you sleep.


What You Need

Total cost: Under $5 a month.


Step-by-Step Build Guide

Step 1: Capture the Incoming Text

  1. Open n8n and create a new workflow.
  2. Add a Twilio Trigger node.
  3. Set the event to Message Received.
  4. Connect your Twilio account using your Account SID and Auth Token.
  5. Copy the webhook URL provided by n8n and paste it into your Twilio phone number configuration under "A message comes in".

Step 2: Read Intent with OpenAI

  1. Add an Advanced AI node (OpenAI Chat Model) connected after the Twilio trigger.
  2. Set the Model to gpt-4o-mini.
  3. Paste this exact System Prompt: > "You are a friendly, professional front-desk receptionist for a dental clinic. Your job is to read incoming patient texts, determine if they want to book an appointment, and ask for their preferred day if they haven't provided it."
  4. Pass the incoming Twilio message body as the user input.

Step 3: Check Google Calendar Availability

  1. Add a Google Calendar node.
  2. Set the operation to Get Many (or use a Custom API tool if building an agentic loop).
  3. Connect your clinic's Google Calendar account.
  4. Filter events for the current week to pull open time blocks.

Step 4: Send Available Slots Back to the Patient

  1. Add a second OpenAI formatting node to turn the raw calendar JSON into a clean, readable text message.
    • Prompt example: "Take these available calendar slots [insert data] and format them into a short, friendly SMS list for the patient. Give them 3 options."
  2. Add a Twilio node set to Send Message.
  3. Map the phone number from the original trigger and the AI-formatted text as the message body.

Step 5: Lock in the Appointment

  1. When the patient replies with their chosen number (e.g., "1 for Tuesday at 2 PM"), use an If node to route the response.
  2. Add a Google Calendar node set to Create Event.
  3. Map the patient's name, phone number, and selected time slot into the event details.
  4. Send a final confirmation text via Twilio: "You're all set for Tuesday at 2 PM. See you then!"

Common Mistakes & Fixes


Want more practical builds like this? Follow @letagentswork for weekly automations that save time.

Best AI agents this week, every Friday

One short email: the agents and workflows we built, with the free guides. No spam.

Made by Let Agents Work โ€” follow @letagentswork
From the reel: Automate Dental Bookings With AI and n8n