AWS Contact Center

Automate appointment reminders using Amazon Pinpoint and Amazon Connect

Missed appointments result in thousands of dollars in lost revenue per year across industries. No shows waste precious time for subject matter experts waiting for customers. Some businesses manually remind their customers before the appointments; however, this is inefficient, not scalable, and costs productivity and money.

An agentless outbound dialing campaign for appointment reminders is an efficient way to reduce no-shows by calling customers. Customers are given an option to confirm or reschedule the appointment. Consistent, specific, and personalized messaging improves customer retention.

This blog post demonstrates how to automate appointment reminders using Amazon Pinpoint and Amazon Connect outbound campaigns, formerly known as high-volume outbound communications.

Solution Overview

This solution walks through deploying an agentless outbound campaign that places calls to remind customers of upcoming appointments. A campaign administrator uploads a calling list to Amazon S3 using a pre-defined comma-separated file/template. Amazon Pinpoint and Amazon Connect orchestrate outbound calls and save contact results for reporting using Amazon QuickSight. Customers can reschedule their appointments without the need for an agent using Amazon Lex.

Solution Architecture

In the preceding architecture, the following sequence of steps takes place for an outgoing contact:

  1. A campaign administrator uploads contact list to an Amazon S3 bucket.
  2. The contact list is processed and uploaded by AWS Lambda to Amazon DynamoDB and an Amazon Pinpoint segment.
  3. An Amazon Pinpoint journey processes the segment data using a custom channel by calling an AWS Lambda function to generate calls.
  4. AWS Lambda checks Amazon DynamoDB to verify that the phone number is not on the Do-Not-Call (DNC) list. It then calls using StartOutboundVoiceContact API.
  5. Amazon Connect contact flow uses Answering Machine Detection (AMD) for the next action.
    1. If you answer the call, you have the option to confirm your appointment, or reschedule the appointment.
    2. If you request an agent, you are placed in a queue for the next available agent.
    3. If you confirm the appointment, the call ends.
    4. If the call is answered by voicemail or answering machine, you hear a message with the appointment details.
  6. If you choose to change the appointment, an Amazon Lex chatbot handles processing of appointment rescheduling via self-service.
  7. Amazon Lex invokes a Lambda function to update appointment change details to Amazon DynamoDB.
  8. After the call is completed, Amazon Connect updates the Amazon DynamoDB table with the call outcome.
  9. Amazon DynamoDB maintains status of calls in the campaign.
  10. Amazon QuickSight provides dashboards for monitoring, and for historical analytics to business users.

Deployment walkthrough


For this blog, you should have the following prerequisites:

Step 1: Get Amazon Connect instance details

  1. Sign in to the AWS Management Console and open the Amazon Connect console.
  2. Select your Amazon Connect instance, and make a note of the instance id. This is the last part of the instance Amazon Resource Name (ARN) after the forward slash.

Amazon Connect Instance ID

  1. Log in to your Amazon Connect instance.
  2. In the navigation pane, under Routing, choose Queues.

Access your queues in the Amazon Connect menu

  1. Select BasicQueue, and choose Show additional queue information. Make a note of the Queue id of BasicQueue. This is the last part of the Queue ARN after the last forward slash.

Amazon Connect Queue Id

  1. Download this sample contact flow.
  2. On the top-right drop-down, choose Import flow (beta). Select the Contact Flow downloaded in the previous step. Choose Import.In the navigation pane, under Routing, choose Contact flows, and choose Create contact flow.

Import Contact Flow

  1. Choose Save to save the contact flow, and then Publish to publish the contact flow.
  2. On the top-left, select Show additional flow information. Make a note of the Contact flow id. This is the last part of the Contact flow ARN after the forward slash.

  1. If this is a new Connect instance, follow steps here to claim a phone number.
  2. Review the contact flow block, Check call progress.

  1. The contact flow branches off this Check call progress block based on answer detection:
    1. Call answered: Answered by a person.
    2. Voicemail (beep): Call ended in a voicemail and it detects a beep.
    3. Voicemail (no beep):
      1. Call ended in a voicemail, but it doesn’t detect a beep.
      2. Call ended in a voicemail, but the beep is unknown.
    4. Not detected: Could not detect whether there is voicemail.
    5. Error: Error encountered.
  2. In the navigation pane, choose High Volume Outbound Communications.
    1. In the top-right corner, choose Create Campaign.
    2. Under Campaign Details, enter a name for your campaign.
    3. Under Outbound configuration, select the contact flow you imported from the list of flows. Select Basic Queue for the queue.
    4. If no phone number is associated with Basic Queue, select an existing phone number.
    5. Choose Progressive under Dialer Configuration, and then set the bandwidth configuration to a percentage between 1-100%.
    6. Choose Save in the top-right corner.
    7. Open the campaign and make a note of the Campaign id from the end of the URL. Note: depending on when your Amazon Connect instance was created, your URL may be different than the following screenshot.

Step 2: Launch CloudFormation template

  1. Launch this CloudFormation template in the same Region as your Amazon Connect instance.

Create Stack - Initial Screen

  1. Accept the default values and choose Next.
  2. Enter a stack name and enter the IDs noted earlier:
    1. Amazon Connect instance id,
    2. Amazon Connect queue id,
    3. Amazon Connect contact flow id,
    4. Outbound Campaign id, and choose Next.

Create Stack - Second Screen

  1. Choose Next.
  2. Choose Next, and scroll down to the bottom of the page.
  3. Acknowledge IAM resources creation, and choose Create stack. This will take a couple of minutes to provision the required resources.
  4. On your AWS Management Console, navigate to CloudFormation, Stacks, select AppointmentReminder, and choose Outputs. Make a note of the two bucket names for AppointmentfileBucket and ReportsDataBucket.

Create Stack Outputs Tab with Bucket Names

Step 3: Configure appointment reminder

Appointment Reminder bot

  1. Download sample Appointment Reminder Amazon Lex bot.
  2. Navigate to Amazon Lex in the AWS Management Console.
  3. On the Amazon Lex V2 console, choose Bots. If you’re in the Amazon Lex V1 console, click on Switch to the new Amazon Lex V2 console located in the left-hand menu.
  4. Choose Action, and then Import.

Lex bot import menu option

  1. In the Import bot screen, enter the Bot name as AppointmentReminder. For the Input file, select the zip file downloaded in Step 1.

Lex bot Import screen

  1. For Runtime role, select Create a new role with basic Amazon Lex permissions.

Lex Bot Permissions

  1. As this bot is intended for demo, it’s not subject to COPPA, select No. Choose Import.

Lex bot import screen

  1. Once the bot is successfully uploaded, select the AppointmentReminder bot. Choose Aliases in the navigation pane, and select TestBotAlias in the right pane.

Lex bot Aliases List View

  1. In the Alias: TestBotAlias screen, select English (US) Language.

Lex bot Alias Language List

  1. In the Lambda function – optional screen, choose the source as appointment-reminders-scheduling-lambda. This Lambda function is created by the CloudFormation template. For the Lambda function version or alias, choose $LATEST. Click Save.

Lex bot Lambda Selection

  1. In the navigation pane, under English (US) language, Choose Intents, and choose Build at the bottom of the screen.

Lex Build

Associate Lambda function and Amazon Lex bot to Amazon Connect

  1. Navigate to your Amazon Connect instance, and select the instance alias.
  2. In the navigation pane, choose Contact flows.
  3. In the Amazon Lex section, choose your Region, and select the AppointmentReminders bot from the drop-down.
  4. Select TestBostAlias for Alias. Choose + Add Amazon Lex Bot.

Amazon Connect - Associate Lexbot with Instance

  1. Scroll down to the AWS Lambda section, select appointment-reminders-status-update-lambda, and choose +Add Lambda function.

Amazon Connect - Associate Lambda with Instance

Update contact flow references

  1. Open the Amazon Connect console.
  2. In the navigation pane, under Routing, choose Contact flows.
  3. Select the Blog-AppointmentReminders_Main contact flow.
  4. On the Get customer input block, add the AppointmentReminders bot associated in the preceding step, along with TestBotAlias as Alias. Choose Save.

  1. On the Invoke AWS Lambda function block, from the dropdown and select the appointment-reminders-status-update-lambda function, and choose Save.

  1. Publish the Contact flow.

Step 4: Configure Amazon Pinpoint

  1. Download the sample segment file and use a text editor to replace the +1xxxxxxxxxx with a valid phone number in the Address field. Phone numbers must be in E.164 format.
    • Note: If using MS Excel for editing the CSV. You must prefix the Address with a ‘ to keep the + symbol from dropping. The ‘ will not be saved as part of the file.
  2. Navigate to Amazon S3, and upload the csv file to the bucket name starting with appointmentreminders-calllistbucket.
  3. Open the Amazon Pinpoint console.
  4. In the navigation pane, choose All Projects. Select the appointment-reminders project that was created, and choose Segments.
  5. You should see two segments, one segment has the same name as your csv, and one named Appointment-Reminders-Dynamic.
  6. In the navigation pane, choose Journeys. Choose Create journey.

Amazon Pinpoint Journey configuration

  1. When prompted with Welcome to journeys, click through, or close it.
  2. Enter a name for the journey in the top-left, then choose Set entry condition in the Journey entry block.

Amazon Pinpoint Journey configuration

  1. Choose Add participants from a segment and select Appointment-Reminders-Dynamic from the Segments list. Under Specify how often… select Once every and set it to 1 hour. Select the Refresh on segment update box. Enter a description and select Save.

Amazon Pinpoint Journey configuration

  1. Choose Add activity, choose Send through a custom channel from the list.

Amazon Pinpoint Journey configuration

  1. Select the appointment-reminders-call-initiator-lambda from the list of Lambda functions. Add a description and choose Save.

Amazon Pinpoint Journey configuration

  1. On the top right, choose Review. Verify that there are no errors, then click Next. Choose Mark as reviewed.
  2. Choose Publish.
  3. When the publishing is completed, choose Close. Your journey will start in 5 minutes. After the 5-minute wait, you should receive a call on the number that you entered into the csv.

Amazon Pinpoint Journey publish

For additional testing, upload a second csv with new phone numbers. Add one of the phone numbers to the do-not-call-list (DNC) DynamoDB table. Check that the number is in E.164 format. At the next scheduled refresh, the new numbers will enter the journey. You should not receive a call on the number entered into the DNC table.

Note: By default, you cannot use the same endpoint (phone number) over and over. If you must use the same number, change the journey settings for endpoints to re-enter the journey multiple times. Additional information on journeys is available in the Amazon Pinpoint User Guide.

Step 5: Configure reporting

Configure Amazon Athena

  1. Navigate to Amazon Athena console. Expand the menu in the navigation pane, and choose Workgroups.
  2. CloudFormation should have created an appointment-reminder-workgroup.

Amazon Athena Workgroup List

  1. On the navigation pane, choose Data sources, and choose Create data source.
  2. Select Amazon DynamoDB, and choose Next. For the Data source name, enter appointment-reminder-data-source.
  3. Choose Create Lambda function.

Amazon Athena Data Source Configuration

  1. The Athena DynamoDB Connector screen will open in a new browser tab.
    1. In the Application settings section, Update SpillBucket with the ReportsDataBucket name noted earlier, that starts with appointmentreminder-athenadatabucket.
    2. For the AthenaCatalogName, enter appointment-reminder-data-catalog-lambda.
    3. Acknowledge IAM resources creation, and choose Deploy.

Athena Data Source - Lambda Creation Configuration

  1. When the Lambda function creation is complete, switch back to the Athena tab in your browser.
  2. Select the Lambda function with name containing appointment-reminder-data-catalog-lambda from the drop-down. Select refresh if you do not see the Lambda function.
  3. Choose Next, and on the Review and Create screen, choose Create data source.

Amazon Athena Data Source Configuration

Configure Amazon QuickSight

  1. Navigate to Amazon QuickSight on your AWS Management Console.
  2. Choose the drop-down for the account on the top-right, and select Manage QuickSight.
  3. On the navigation pane, choose Security and permissions, and choose Manage.

Amazon QuickSight Permissions

  1. Uncheck and check the Amazon Athena selection.
  2. Choose Next on the pop-up. The next screen will show the list of buckets. Select the bucket name starting with appointmentreminder-athenabucket. Select Write permission for Athena Workgroup.

QuickSight Bucket Permissions

  1. Choose Lambda and select the Lambda function appointment-reminder-data-catalog-lambda. Choose Finish.

QuickSight - Lambda Permissions for Athena

  1. A warning message for Athena Query Federation is displayed. Choose Save.

Amazon QuickSight Permissions

  1. On the top-left click on QuickSight, select Datasets in the navigation pane. Click New Dataset in the top-right.
  2. Select Athena as the data source.
  3. Enter a data source name, such as AppointmentReminders, and then select the appointment-reminders-workgroup Athena workgroup. Choose Validate and verify that the connection is working. Click Create data source.

QuickSight Data Connection

  1. When prompted for the database, select the appointments-reminder-data-source you created in the preceding step. Select the appointment-reminders-data table and choose Select.

QuickSight Data Table Selection

  1. On the Finish dataset creation screen, choose Directly query your data, then choose Visualize.

QuickSight Dataset Configuration

  1. After a minute, you should see the fields from the DynamoDB representing your appointment data.

Amazon QuickSight Report

  1. Create a report to monitor your campaign:
    1. Drag the CallStatus field onto the right side. Under Visual types, on the bottom-left corner, select the Donut chart.

Amazon QuickSight Report

    1. In the top-left navigation pane, under + Add, choose Add visual to add another chart.
    2. Drag another field, such as Timezone, into the second visualization. This will create a bar chart of the different time-zones from your campaign file.

Amazon QuickSight Report

    1. Choose Add > Add visual and position this visual following the other two.
    2. Under Visual types, choose the Table type.
    3. Choose one or more fields to show in the table and then resize the visual to show all the fields. The order you select the fields determines the initial order in the table.
    4. Change the order of fields in the table by selecting the field in the table, and then selecting the move arrows. Alternatively, if you select the table, drag and drop the fields in the Group By at the top to get the right order.

Amazon QuickSight Report

    1. When you are satisfied with the layout, choose Share > Publish Dashboard on the top-right. Set the name to Appointment Reminders Dashboard and choose Publish dashboard.

Amazon QuickSight Report

You’ve successfully configured and tested the appointment reminders outbound campaign.

Clean up

  1. Navigate to Amazon S3, and select bucket names starting with appointmentreminder-athenadatabucket and appointmentreminder-calllistbucket.
    1. Choose each bucket and choose Empty.
    2. Confirm by typing permanently delete.
    3. Choose Empty.
  2. Navigate to AWS CloudFormation in your AWS Management Console.
    1. Select the AppointmentReminder stack, and choose Delete.
    2. On the confirmation dialog box, choose Delete stack.
  3. Navigate to Amazon Lex in your AWS Management Console.
    1. Choose AppointmentReminder bot.
    2. In Action drop-down, choose Delete.
    3. On confirmation dialog box, choose Delete.
  4. Navigate to Amazon Connect in your AWS Management Console.
    1. Select Contact flows on the navigation pane.
    2. Remove association with AWS Lambda and Amazon Lex.
  5. Navigate to Amazon Athena in your AWS Management Console.
    1. Choose Data sources from on the navigation pane.
    2. Select appointment-reminder-data-sources.
    3. From the Actions menu, select Delete.
  6. Navigate to Amazon QuickSight in your AWS Management Console.
    1. Select Dataset on the navigation pane.
    2. Select appointment-reminder-data.
    3. Choose Delete dataset.
    4. Select Dashboards on the navigation pane.
    5. Select the dots in the bottom right corner of your dashboard.
    6. Choose Delete.
    7. Choose Delete in the confirmation window.
  7. The Amazon Connect contact flow cannot be deleted from the console. The contact flow is reusable by modifying the contact flow blocks.


In this post, we implemented an agentless appointment reminder outbound campaign using the following steps:

  • Deployed AWS resources using AWS CloudFormation.
  • Stepped through configuring resources to create and run a campaign.
  • Uploaded a pre-defined csv to Amazon S3 to start the campaign.

This automated outbound campaign for appointment reminders checked the campaign list against a ‘do not call’ list before making an outbound call. Your customers are able to confirm, or reschedule by speaking to an agent. You monitored the results of the calls on a dashboard in near real-time using Amazon QuickSight.

With Amazon Connect, you pay for what you use. There are no upfront payments, long-term commitments, or minimum monthly fees. The price metrics are detailed on Amazon Connect pricing.

Should you need help with setting this up, you can get assistance from AWS Professional Services. You can also seek assistance from Amazon Connect partners available worldwide.