Quick overview
This workflow handles Vapi voice agent tool calls to check Google Calendar availability, book appointments into Google Calendar, and capture phone messages, then logs outcomes to Google Sheets and notifies the owner by email.
How it works
- Receives a POST webhook request from Vapi containing a tool call (or a status/transcript event).
- Normalizes the Vapi payload to extract the tool name, tool call ID, and arguments, then routes the request by tool name.
- For checkAvailability, fetches upcoming events from Google Calendar and computes the next available appointment slots based on configurable business-hour rules.
- Sends the available slot options back to Vapi in a spoken-ready JSON response that includes ISO timestamps to book against.
- For bookAppointment, creates a new Google Calendar event at the requested start time, appends a booking record to Google Sheets, and emails the owner a booking alert.
- For takeMessage, appends the caller’s message to Google Sheets, emails the owner the message details, and returns a confirmation response to Vapi.
- For any non-tool-call events, returns an empty acknowledgement to Vapi without taking action.
Setup
- In Vapi, create three server tools pointing to this workflow’s production webhook URL: checkAvailability (no args), bookAppointment (customerName, phoneNumber, service, startTime), and takeMessage (callerName, phoneNumber, message).
- Add a Google Calendar credential and ensure the workflow can access the calendar you want to book into (the template uses the primary calendar).
- Create/select a Google Sheets spreadsheet and sheet for the call log, with columns like Timestamp, Type, Caller Name, Phone, Details, and When, and set the document and sheet in both Google Sheets nodes.
- Add an SMTP email credential and update the From and To addresses in both email nodes.
- If needed, edit the availability rules in the open-slot calculation code (timezone, opening hours, working days, slot length, and minimum notice).
Requirements
- A Vapi account with an assistant configured with three server tools (names and arguments are on the canvas)
- A Google Calendar credential — the primary calendar is used by default, no selection needed
- An SMTP credential for owner notifications
- A Google Sheet for the call log with the six headers listed on the canvas
Customization
- Edit the CONFIGURE block in Compute Open Slots: timezone, opening hours, working days, slot length, notice period and how many slots to offer
- Change the appointment length (keep Create Event's duration in sync with SLOT_MINS)
- Reword the owner emails and the spoken confirmations the agent reads back
- Add more tools to the switch — cancellations, FAQs, transfer-to-human — using the same pattern
- Works for any business that books time: salons, clinics, trades, tutors, studios