Skip to content

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.

  1. Access Make and create a new scenario

  2. 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)
  3. 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
  4. Processing and Response:

    • Add module Tools → Set Variables to process data
    • Add module Webhooks → Webhook Response to return JSON:
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

  1. Create another scenario in Make

  2. Add Webhook trigger:

    • Name: schedule_dentist_appointment
    • Copy the URL
  3. 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
  4. Confirmation response:

json
{
  "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

  1. Access Agents on the SipPulse AI platform
  2. Click "New Agent"
  3. 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

markdown
# 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

  1. Click "+ New tool"
  2. Select "API Integration"
  3. 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

Tool 2: Schedule Appointment

  1. Add another tool
  2. 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

3. Creating Post-Service Analysis

3.1 New Structured Analysis