Build Your First Workflow — Appointment Reminder

Create an automated appointment reminder workflow that contacts members via SMS and handles rescheduling requests.

Intermediate
7 min read

Build Your First Workflow — Appointment Reminder

What You'll Accomplish

By the end of this tutorial, you'll have a working appointment reminder system that automatically sends SMS reminders to members before their scheduled appointments. When a member replies, your AI agent handles confirmation, rescheduling requests, or cancellations — and routes complex situations to your team.

What You'll Need

  • A Gravity Rail workspace
  • A phone number with SMS enabled (see Step 1)
  • Members in your workspace with upcoming appointments
  • A workflow for handling reminder conversations (you'll build this)

Step 1: Set Up a Phone Number for SMS

Your reminder system needs a phone number to send and receive text messages.

  1. Go to Channels > Phone Numbers
  2. Click Add Phone Number
  3. Configure the number:
    • Name: "Appointment Reminders"
    • Enable SMS: Yes
    • Enable Voice: Optional (enable if you also want voice reminders)
  4. Skip the Default Workflow for now — you'll connect it in Step 4

For full phone number setup details, see the Phone & Voice guide.


Step 2: Create an Appointment Form

You need a form to store appointment data so your workflow knows when and where each appointment is.

  1. Go to Knowledge > Forms

  2. Click Create Form

  3. Configure the form:

    • Name: "Appointments"
    • Slug: appointments
    • Collection: Enabled (members can have multiple appointments)
    • Prompt: "Collect appointment details including date, time, provider, and location."
  4. Add these fields:

Field NameTypeSlugRequired
Appointment DateDate & Timeappointment_dateYes
Provider NameTextprovider_nameYes
LocationTextlocationNo
Appointment TypeDropdownappointment_typeYes
StatusDropdownstatusYes
  1. For the Appointment Type dropdown, add options like: "New Patient Visit", "Follow-Up", "Annual Physical", "Lab Work", "Specialist Consultation"

  2. For the Status dropdown, add: "Scheduled", "Confirmed", "Cancelled", "Rescheduled", "No Show"

For more on forms, see the Forms guide.


Step 3: Build the Reminder Workflow

Now create the workflow that handles the reminder conversation.

Create the workflow

  1. Go to Workflows and click Create Workflow
  2. Name it "Appointment Reminder"
  3. Assign your agent

Add the tasks

Create the following tasks and connect them:

Task 1: Send Reminder (Starting Task)

  • Name: "Send Reminder"
  • Prompt:
    You are an appointment reminder assistant. The member has an upcoming appointment.
    Introduce yourself, state the appointment details, and ask the member to confirm,
    reschedule, or cancel. Be friendly and professional.
    
    Appointment details:
    - Date: {{member.collections.appointments.latest.data.appointment_date}}
    - Provider: {{member.collections.appointments.latest.data.provider_name}}
    - Location: {{member.collections.appointments.latest.data.location}}
    - Type: {{member.collections.appointments.latest.data.appointment_type}}
    
  • Goal: "Member has confirmed, requested rescheduling, or cancelled"
  • Sub-Tasks: Confirm Appointment, Reschedule, Cancel

Task 2: Confirm Appointment

  • Name: "Confirm Appointment"
  • Prompt: "The member has confirmed their appointment. Thank them and remind them of anything they need to bring (insurance card, ID, relevant medical records). Wish them well."
  • Goal: "Confirmation message delivered"

Task 3: Reschedule

  • Name: "Reschedule"
  • Prompt: "The member wants to reschedule. Collect their preferred new date and time. Let them know someone from the office will confirm the new appointment. Be helpful and accommodating."
  • Goal: "New preferred date and time collected"
  • Data Types: Attach the Appointments form so the agent can update the record

Task 4: Cancel

  • Name: "Cancel"
  • Prompt: "The member wants to cancel. Ask if there's a reason (optional). Let them know the cancellation is noted and they can call to reschedule anytime. Be understanding and professional."
  • Goal: "Cancellation acknowledged"

Connect the tasks

Use the visual Task Flow editor to connect:

  • Send Reminder > Confirm Appointment
  • Send Reminder > Reschedule
  • Send Reminder > Cancel

Set "Send Reminder" as the Starting Task.

For more on workflow creation, see the Workflows guide.


Step 4: Connect the Workflow to Your Phone Number

Link the workflow to your SMS number so replies are handled automatically.

  1. Go to Channels > Phone Numbers
  2. Open the phone number you created in Step 1
  3. Set the Default Workflow to "Appointment Reminder"
  4. Save

Now when a member replies to a reminder SMS, the workflow picks up the conversation.


Step 5: Create the Send SMS Action

Set up the action that sends the initial reminder message.

  1. Go to Actions and click New Action
  2. Configure:
    • Trigger: Task Entered, targeting the "Send Reminder" task
    • Action Type: Send SMS
    • Phone Number: The number from Step 1
    • Message: Use template variables for personalization:
      Hi {{member.first_name}}, this is a reminder about your
      {{member.collections.appointments.latest.data.appointment_type}}
      appointment on {{member.collections.appointments.latest.data.appointment_date}}
      with {{member.collections.appointments.latest.data.provider_name}}.
      Reply CONFIRM, RESCHEDULE, or CANCEL.
      

For more on SMS actions, see the Send SMS Action guide.


Step 6: Schedule the Reminder Event

Create a scheduled event that triggers reminders at the right time.

  1. Go to Events and click New Event
  2. Configure:
    • Schedule Type: CRON
    • CRON Expression: 0 9 * * * (daily at 9 AM)
    • Targeting: Member Filter — create a filter for members with appointments in the next 24-48 hours
  3. Attach the Send SMS action from Step 5
  4. Save and activate the event

Build the member filter

In the Members view, create a saved filter:

  • Filter by members who have appointment records
  • Use conditions to match appointments within your reminder window

For details on filters, see Member Filters. For scheduling options, see Scheduled Events.


Step 7: Set Up Escalation (Optional)

For rescheduling requests that need staff attention, add an action to notify your team.

  1. Go to Actions and click New Action
  2. Configure:
    • Trigger: Task Entered, targeting the "Reschedule" task
    • Action Type: Member Notify
    • Recipients: Your scheduling team
    • Message: "{{member.name}} has requested to reschedule their appointment."

This ensures your team sees rescheduling requests promptly while the AI handles the immediate conversation.


Confirm the Result

  1. Test with a member. Create a test member with an appointment record, then manually run the scheduled event to trigger a reminder. Verify the SMS is sent.

  2. Reply to the SMS. Text back "confirm", "reschedule", or "cancel" and verify the AI handles each path correctly.

  3. Check the Chats view. Go to Chats and filter by the "Appointment Reminder" workflow to see all reminder conversations.

  4. Review appointment data. Check that the Appointments form records are updated when members confirm or cancel.

If SMS messages aren't being sent, verify the phone number is active, SMS is enabled, and the action is correctly attached to the workflow task.


What's Next

  • Add voice reminders. Enable voice on your phone number and create a Phone Call Action for members who don't respond to SMS.
  • Multi-step reminders. Schedule a second reminder 2 hours before the appointment for members who haven't confirmed. Use a Delayed Action or a second scheduled event with a filter for unconfirmed appointments.
  • Integrate with your calendar. Add the Calendar Booking ability to let members reschedule directly through the conversation.
  • Track no-shows. Create an action that labels members who don't respond and updates their appointment status to "No Show" after the appointment time passes.