In this guide you’ll build a WhatsApp AI agent that acts as a dental clinic receptionist — collecting patient information and automatically creating a calendar booking via Cal.com. The same pattern works for any business that takes appointments.
What you’ll build
- An AI agent that chats with patients on WhatsApp
- A Save Attribute tool that stores appointment details against the contact record
- A Create Calendar Event tool that calls the Cal.com API to confirm the booking
Prerequisites
- A WhatsApp Business number connected to Swiftsell (Settings → WhatsApp)
- A Cal.com account with an API key and an event type configured
Step 1 — Create a new automation
- In the sidebar, go to Automation and click New Bot.
- Name it something descriptive, e.g. AI Receptionist.
- In the Start Flow block, select your WhatsApp Business number.
Step 2 — Add an AI Agent node
Inside the automation canvas, click + and choose AI Agent. An AI Agent node has four components:| Component | Purpose |
|---|---|
| Prompt | System prompt that defines the agent’s personality and task |
| Knowledge Base | Websites or PDFs the agent can reference to answer questions |
| Tools | Third-party integrations the agent can call to take actions |
| Routes | Exit paths triggered when specific outcomes occur (e.g. appointment confirmed) |
Step 3 — Write the system prompt
Open the Prompt tab. You can write a prompt manually or use the Generate with AI button. Example input to the prompt generator:- Greet the patient warmly and introduce the clinic
- Collect the required booking information one step at a time
- Confirm all details before creating the appointment
Step 4 — Add the Save Attribute tool
Switch to the Tools tab and click Add Tool → Save Attribute.| Field | Value |
|---|---|
| Name | save_appointment_info |
| Description | Use this tool to save appointment booking information |
appointment_date— Date of the appointmentappointment_time— Time of the appointmentemail— Email address of the patientservice— Type of service requested
Step 5 — Add the Create Calendar Event tool
Still in the Tools tab, click Add Tool → HTTP Request and configure it as follows. General| Field | Value |
|---|---|
| Name | create_calendar_event |
| Description | Creates a booking on the clinic’s Cal.com calendar |
| Method | POST |
| URL | https://api.cal.com/v2/bookings |
| Key | Value |
|---|---|
cal-api-version | 2024-08-13 |
Authorization | Bearer <your_cal_api_key> |
start_datetimeis marked as a dynamic variable — the LLM generates an ISO 8601 datetime string (e.g.2025-03-26T11:00:00Z) based on the date and time the patient provided.contact.name,contact.email, andcontact.phoneare pulled automatically from the contact’s Audience attributes.
Make sure your Cal.com event type allows API bookings and that the timezone on your event type matches what your patients expect.
Step 6 — Deploy and test
- Click Deploy (or toggle the automation live).
- Send a message to your WhatsApp Business number from any phone.
- The agent will greet you and walk through the booking flow.
- Audience → Contact profile —
appointment_date,appointment_time,email, andserviceare saved as attributes. - Cal.com dashboard — the booking appears in your calendar with the patient’s details.
- Live Chat — a full transcript of the conversation is available in real time.
What’s next?
Add a Route
Trigger a follow-up email or assign a ticket to a human agent once the appointment is confirmed.
Explore the AI Agent block
Learn about knowledge bases, multiple tools, and advanced routing options.
View Live Chat transcripts
Monitor all WhatsApp conversations in real time from the Live Chat view.
Connect a Voice Agent
Extend the same receptionist experience to inbound phone calls.