Back to all templates

Scheduling Appointments Based on Incoming Emails

Turn appointment-request emails into concrete bookable time slots with AI.

Description:

Polls Gmail for new emails. For each email, OpenAI extracts the patient name, doctor type, and requested date-time period. Free time slots are fetched from Google Calendar for that period, the workflow loops over them keeping only slots at least 45 minutes long, and OpenAI proposes a list of concrete 45-minute appointment options. The workflow replies to the original email with the suggestions.

Key Features:
  • Email polling trigger
  • AI extraction of appointment details into structured JSON
  • Google Calendar free-slot lookup for the requested period
  • Slot filtering by minimum duration
  • AI appointment suggestion in a fixed text format
  • Automatic reply to the original email
Prerequisites:
  • Google Mail connection
  • OpenAI API key
  • Google Calendar connection with the target calendar
Ideal For:

Clinics or service businesses that want to turn appointment-request emails into concrete bookable time slots automatically.

STEPS
  1. Trigger: poll Gmail for new emails.
  2. Fetch the email from the trigger.
  3. Extract the patient name, doctor type, and requested date-time period with OpenAI.
  4. Get free time slots from Google Calendar for that period.
  5. Loop over the slots, keeping only those at least 45 minutes long.
  6. Read back the list of valid slots.
  7. Propose a list of 45-minute appointment options with OpenAI.
  8. Reply to the original email with the suggested appointments.
COMPONENTS
Google Mail
Open Ai
Google Calendar
CATEGORYSupport

How ByteChef works?

Focus on what matters,
automate the rest.

ByteChef