Calendar Secretary Agent - Complete Tutorial
In this tutorial, you'll learn to create a complete Secretary Agent for a dental office, capable of:
- Querying availability in Google Calendar
- Scheduling appointments directly via WhatsApp
- Performing post-service analysis
- Automatically recording interactions in Google Sheets
Prerequisites
- Configured SipPulse AI account
- Configured WhatsApp Business (see guide)
- Google account with active Google Calendar
- Make.com account
- Google Sheets for data recording
1. Setting Up Automations in Make
1.1 Webhook to Query Availability
First, let's create a webhook that queries available times in the calendar.
Access Make and create a new scenario
Add a Webhook module as trigger:
- Click Create a webhook
- Name it
query_dentist_calendar - Copy the generated URL (will be used in the agent)
Configure Google Calendar:
- Add module Google Calendar → Search Events
- Configure Google credentials
- Important parameters:
Calendar ID: primary (or specific office ID) Time Min: {{query.start_date}} (comes from webhook) Time Max: {{query.end_date}} (comes from webhook) Max Results: 50
Processing and Response:
- Add module Tools → Set Variables to process data
- Add module Webhooks → Webhook Response to return JSON:
{
"busy_times": [
{
"start": "2024-01-15T09:00:00",
"end": "2024-01-15T10:00:00",
"title": "Appointment - John Silva"
}
],
"available_times": [
"09:00", "10:00", "11:00", "14:00", "15:00", "16:00"
],
"queried_date": "2024-01-15"
}1.2 Webhook to Schedule Appointment
Create another scenario in Make
Add Webhook trigger:
- Name:
schedule_dentist_appointment - Copy the URL
- Name:
Configure Google Calendar Create Event:
- Module: Google Calendar → Create an Event
- Parameters:
Calendar ID: primary Summary: Appointment - {{query.patient_name}} Start Date: {{query.start_date}} End Date: {{query.end_date}} Description: Scheduled via WhatsApp Location: Dr. Silva's Office
Confirmation response:
{
"success": true,
"event_id": "{{google_calendar_event_id}}",
"message": "Appointment successfully scheduled for {{query.patient_name}}"
}2. Creating the Secretary Agent
2.1 Basic Configuration
- Access Agents on the SipPulse AI platform
- Click "New Agent"
- Configure profile:
- Name: Dr. Silva's Secretary
- Description: Virtual assistant for dental appointment scheduling
- Model: GPT-4.1 (recommended for complex tasks)
2.2 System Instructions
# IDENTITY
You are Marina, the virtual secretary for Dr. Silva's dental office. You are professional, caring, and expert in scheduling.
# PERSONALITY
- Always polite and empathetic
- Efficient in scheduling
- Well-versed in office procedures
- Patient with client questions
- Proactive in offering solutions
# OFFICE HOURS
- Monday to Friday: 8am to 6pm
- Saturday: 8am to 12pm
- Sunday: Closed
- Appointment duration: 30 minutes each
- Lunch break: 12pm to 2pm
# AVAILABLE PROCEDURES
- Routine consultation (30 min)
- Cleaning (45 min)
- Root canal treatment (60 min)
- Extraction (45 min)
- Whitening (60 min)
# SCHEDULING FLOW
1. Greet the patient and ask for their name
2. Identify the desired type of procedure
3. Query availability using the query_calendar tool
4. Present available time options
5. Confirm details with the patient
6. Schedule the appointment using the schedule_appointment tool
7. Provide important information (address, recommendations)
# IMPORTANT RULES
- Always confirm full name and phone before scheduling
- Don't schedule outside office hours
- For long procedures (>45min), preferably in the morning
- Always ask if it's a first visit to the office
- Offer rescheduling if no time available on requested day
# OFFICE INFORMATION
- Address: Flower Street, 123 - Downtown
- Phone: (11) 99999-9999
- Dr. Silva - CRO 12345
- Free parking available
- Accepts card and PIX
# FINAL INSTRUCTIONS
- For dental emergencies, advise calling directly
- Always end by asking if there are any other questions
- Be clear about cancellation policy (24h advance notice)2.3 Enabling Tools
Tool 1: Query Calendar
- Click "+ New tool"
- Select "API Integration"
- Configure:
- Name:
query_calendar - Description: Queries available times in the office's Google Calendar
- Structure:json
{ "start_date": "string", "end_date": "string" } - URL: Paste the Make webhook URL (query)
- Method: GET
- Mode: Query Parameters
- Name:
Tool 2: Schedule Appointment
- Add another tool
- Configure:
- Name:
schedule_appointment - Description: Schedules a new appointment in Google Calendar
- Structure:json
{ "patient_name": "string", "phone": "string", "procedure": "string", "start_date": "string", "end_date": "string" } - URL: Paste the Make webhook URL (schedule)
- Method: POST
- Mode: Body
- Name:
3. Creating Post-Service Analysis
3.1 New Structured Analysis
- Access "Structured Analyses"
- Click "New Analysis"
- Configure:
- Name:
dental_secretary_service - Description: Evaluates service quality and scheduling success
- Model: GPT-4.1-mini
- Name:
3.2 Analysis Structure
Configure the following fields:
Name: dental_secretary_service
Description: Post-service analysis to evaluate appointments and patient satisfaction at the dental office.
Structure:
appointment_scheduled
- Type: Boolean
- Name: appointment_scheduled
- Description: Whether an appointment was effectively scheduled
patient_name
- Type: Text
- Name: patient_name
- Description: Full name of the patient served
procedure_type
- Type: Text
- Name: procedure_type
- Description: Type of procedure requested (Routine consultation, Cleaning, Root canal treatment, Extraction, Whitening, Not defined)
scheduled_date
- Type: Text
- Name: scheduled_date
- Description: Scheduled date and time (format YYYY-MM-DD HH:mm)
service_satisfaction
- Type: Text
- Name: service_satisfaction
- Description: Satisfaction assessment based on conversation tone (Very satisfied, Satisfied, Neutral, Dissatisfied, Very dissatisfied)
no_scheduling_reason
- Type: Text
- Name: no_scheduling_reason
- Description: If no appointment was made, what was the reason
first_visit
- Type: Boolean
- Name: first_visit
- Description: Whether this is the patient's first time at the office
notes
- Type: Text
- Name: notes
- Description: Important observations about the service
3.3 Activating Post-Analysis in Agent
- Edit the created agent
- Go to "Post-Analysis" tab
- Enable the toggle for the
dental_secretary_serviceanalysis - Save the agent
4. Connecting to WhatsApp
4.1 Channel Configuration
- In the agent, click "⋮ → Deploy"
- On the WhatsApp card, click "Connect"
- Follow the authentication process (see detailed guide)
4.2 Configure Preferences
- Click "⋮ → Preferences" on the WhatsApp card
- Configure:
- Inactivity closure: 10 minutes
- Closing message: "Thank you for reaching out! If you need anything else, I'll be here. Have a great day! 😊"
- Audio support: Enabled with model
pulse-precision-v3
5. Configuring Webhook for Google Sheets
5.1 Creating Webhook on the Platform
- Access "Webhooks" in the top menu
- Click "Create"
- Configure:
- URL: Make webhook URL (which we'll create next)
- Secret:
my_secret_key_dentist_2024 - Events: Check only
thread.closed
5.2 Make Automation for Google Sheets
- Create new scenario in Make
- Add Webhook module as trigger
- Configure Google Sheets:
- Module: Google Sheets → Add a Row
- Select your spreadsheet
- Configure columns:
Date/Time: {{webhook.data.timestamp}}
Patient Name: {{webhook.data.post_analysis.patient_name}}
Appointment Scheduled: {{webhook.data.post_analysis.appointment_scheduled}}
Procedure: {{webhook.data.post_analysis.procedure_type}}
Scheduled Date: {{webhook.data.post_analysis.scheduled_date}}
Satisfaction: {{webhook.data.post_analysis.service_satisfaction}}
First Visit: {{webhook.data.post_analysis.first_visit}}
Notes: {{webhook.data.post_analysis.notes}}5.3 Security Validation in Make
Add a Tools → Set Variables module before Google Sheets to validate the webhook:
// HMAC Validation (adapted for Make)
const crypto = require('crypto');
const secret = 'my_secret_key_dentist_2024';
const signature = headers['x-signature'];
const timestamp = headers['x-timestamp'];
const payload = JSON.stringify(webhook_data);
const expectedSignature = crypto
.createHmac('sha256', secret)
.update(`${payload}:${timestamp}`)
.digest('hex');
if (expectedSignature !== signature) {
throw new Error('Invalid signature');
}6. Testing the Complete System
6.1 Testing on WhatsApp
Send a message to the connected number:
User: Hi, I'd like to schedule an appointment
Marina: Hello! I'm Marina, Dr. Silva's virtual secretary. It's my pleasure to help you! 😊
May I have your full name, please?
User: Maria Santos
Marina: Nice to meet you, Maria! What type of procedure would you like to schedule?
- Routine consultation (30 min)
- Cleaning (45 min)
- Root canal treatment (60 min)
- Extraction (45 min)
- Whitening (60 min)
User: Routine consultation
Marina: Perfect! When would you like to schedule it? Can you tell me your preferred date?6.2 Verify Integrations
- Calendar: Check if events appear in Google Calendar
- Sheets: Confirm data is recorded after session closure
- Analysis: View results in the thread interface
7. Monitoring and Improvements
7.1 Important Metrics
Track in Google Sheets:
- Conversion rate (appointments/services)
- Most requested procedure types
- Peak demand times
- Patient satisfaction
7.2 Suggested Optimizations
- Add reminders: Create automation to send reminders 1 day before
- Cancellations: Implement tool to cancel/reschedule
- Waiting list: System to notify about newly available slots
- Proactive templates: Post-appointment follow-up messages
Conclusion
Now you have a complete WhatsApp scheduling system that:
✅ Queries availability in real-time ✅ Automatically schedules in Google Calendar ✅ Analyzes service quality ✅ Records data for later analysis ✅ Maintains complete interaction history
The system is ready to receive patients and can be easily adapted for other types of businesses that rely on scheduling
