UChat Official

Introduction

This detailed overview explores the appointment cancellation process as described in the provided transcript.

The workflow is designed to enable users to cancel appointments efficiently through an AI-powered system, ensuring proper verification, status checks, and notifications.

The process emphasizes automation, error handling, and clear communication, all orchestrated via AI functions and conditional logic.

Overview of the Cancellation Process

The cancellation workflow is structured into sequential steps, integrating user prompts, backend function triggers, status validations, and notifications. The core goal is to cancel an appointment reliably while maintaining transparency and providing fallback mechanisms in case of failures.

Key Components

  • User Prompt & Confirmation

  • Fetching Appointment Details

  • Triggering Cancellation Function

  • Status Verification & Conditional Handling

  • Logging & Notifications

  • Error Handling & Manual Intervention

Step-by-Step Breakdown

1. Initiating Cancellation with User Prompt

The process begins with a simple prompt to the user:

"If the user wants to cancel the appointment details, then Jane needs to fetch the available appointment details."

This involves displaying relevant appointment data, such as:

Data Type

Description

Date

Scheduled date of the appointment

Time

Scheduled time

Details

Additional appointment info

The user is then asked to confirm the cancellation.

2. Fetching Appointment Details

Jane retrieves the appointment data via a function:

  • Function Triggered: kel_cancel_appointment

  • Purpose: To access the appointment's current status and details.

3. Handling Cancellation via AI Skill

The cancel appointment skill is designed to:

  • Confirm the user's intent (Yes/No)

  • Gather the reason for cancellation

  • Execute the cancellation if confirmed

Flow of the skill:

  • Prompt for confirmation: "Do you want to cancel the appointment scheduled for [date]?"

  • Collect reason: User provides a reason (e.g., scheduling conflict, personal reasons)

  • Proceed with cancellation based on confirmation

4. Internal AI Function & Parameters

The AI function responsible for cancellation captures two key parameters:

Parameter

Description

Confirmation

Yes or No, indicating user approval

Reason

Text explaining why the appointment is canceled

Once parameters are captured, the system triggers the workflow: AI agent calendar cancel booking.

5. Validating Booking Status

Before canceling, the system checks the appointment's current status:

  • If status is "booked":

    • Use the booking UID from the original appointment JSON data (kel_appointment_details)

    • Proceed to cancel the booking

  • If status is "rescheduled":

    • Use the rescheduled appointment details stored separately (cal_rescheduled_appointment_details)

    • Cancel the rescheduled appointment instead

This distinction ensures correct handling based on the appointment's latest state.

6. Executing Cancellation & Logging

Upon validation:

  • Cancellation is executed via the booking UID

  • Cancellation reason is stored in a dedicated JSON field

  • Booking status is updated to "cancelled"

Notes added:

"Username has canceled the appointment for the following reason: [reason]"

This provides auditability and traceability.

7. Handling Success & Failure

  • On success:

    • Set booking status to "cancelled"

    • Notify the user and team via SMS or other communication channels

    • Confirm the cancellation to the user

  • On failure:

    • Set status to "cancellation failure"

    • Add a note for the team: "Cancellation failed, please check manually"

    • Fetch appointment details for manual review

    • Send an SMS alert to notify the team of the issue

8. Notifications & Final Steps

The system ensures transparent communication:

  • SMS notifications inform the user and team about the cancellation status

  • Error notes guide manual intervention if needed

  • The process is designed to be robust, minimizing manual effort

Visual Representation of the Workflow

Step

Action

Outcome

Notes

1

User requests cancellation

Fetch appointment details

Display date, time, details

2

Confirm cancellation

User confirms or denies

Prompt for reason if confirmed

3

Capture confirmation & reason

Parameters stored

Use in AI function

4

Check booking status

Booked or rescheduled

Use appropriate JSON fields

5

Execute cancellation

Update status, log reason

Success or failure handled

6

Notify user/team

SMS or notes

Based on outcome

7

Handle errors

Manual review if needed

Add notes, send alerts

Summary Table of Key Functions & Data Fields

Function/Skill

Purpose

Parameters

Notes

kel_cancel_appointment

Initiates cancellation

Confirmation, Reason

Triggers workflow

AI agent calendar cancel booking

Validates & cancels booking

Booking UID, Status

Checks if booked or rescheduled

JSON Fields

Stores appointment data



kel_appointment_details

Original appointment info

Booking UID, Status

Used for cancellation

cal_rescheduled_appointment_details

Rescheduled appointment info

Booking UID, Status

Used if rescheduled

kel_cancellation_appointment_details

Stores cancellation info

Reason, timestamp

For audit trail

Final Thoughts & Best Practices

  • Automation & Error Handling: The process emphasizes automated status checks and fallback procedures to ensure reliability.

  • User Experience: Clear prompts and confirmations reduce accidental cancellations.

  • Data Integrity: Storing reasons and statuses in JSON fields maintains a comprehensive record.

  • Notification Strategy: Multiple notification channels (SMS, notes) keep all stakeholders informed.

  • Scalability: The modular design allows easy updates, such as adding new notification types or handling additional appointment states.