AWS Contact Center
Routing contacts based on performance objectives in Amazon Connect: Service level (part 1)
Enterprise contact centers have performance objectives (service levels, agent occupancy, average speed to answer) to deliver a high-quality customer service experience. The strategies used to route incoming contacts have a direct influence on these performance metrics. Amazon Connect makes it possible to route contacts based on objectives that are important to the business. This is a multi-part blog post series to personalize and adapt routing in Amazon Connect based on performance objectives. Part 1 focuses on customer facing metrics like service level. Part 2 will focus on resource management metrics like agent occupancy (utilization).
Service level is the percentage of contacts answered within a given amount of time. With legacy providers, contact center managers are forced to react by juggling staffing across queues to maintain service levels. This constant firefighting is stressful, and counterproductive.
This blog post demonstrates how to route contacts based on service level objectives. The solution compares the current service level to the configured threshold, and makes routing decisions to meet service level objectives for the organization. These decisions could be routing to alternate queue, offering a callback, or reprioritizing the contact in the queue.
Solution overview
This blog post deploys an application to demonstrate routing based on service level objective. For example, consider a service level objective of 70% within 30 seconds. If 70% or more calls are answered within 30 seconds, the organization is meeting the service level objective. If less than 70% of the calls are answered within 30 seconds, the organization is not meeting the service-level objective. Service level is measured over a time period. Businesses may have different service level objectives between queues or customer segments.
Solution flow
In the preceding architecture, the following sequence of steps takes place for an incoming contact:
- Customer initiates a contact for service into a contact center.
- Amazon Connect contact flow determines which queue to route the call to, and invokes an AWS Lambda function.
- AWS Lambda function checks results table (queueMetricResultsTable) in Amazon DynamoDB for the current service level metric and threshold configured for the queue.
- If the metric validity is about to expire or is not found, AWS Lambda function updates the table to request a refresh of the metric.
- Amazon DynamoDB Streams invoke another AWS Lambda function to refresh the metric.
- Lambda function gets configuration values from queueMetricConfigTable in Amazon DynamoDB.
- Lambda function queries Amazon Connect for service level metrics.
- Lambda function updates the queueMetricResultTable.
- Amazon Connect contact flow uses the service level metric to determine the appropriate routing action.
Deployment walkthrough
Prerequisites
For this walkthrough, you should have the following prerequisites:
- An AWS account with administrator access
- An Amazon Connect instance
- Familiar with Amazon Connect Administration Guide
Step 1: Get Amazon Connect instance details
-
- Sign in to the AWS Management Console and open the Amazon Connect console.
- Select the Amazon Connect instance, and make a note of the instance id. This is the last part of the instance ARN (Amazon Resource Name) after the forward slash.
Step 2: Launch CloudFormation template
The AWS CloudFormation template creates the following resources required for this solution:
- Two Lambda functions getMetricsLambdaFunction, and checkMetricsLambdaFunction.
- Two DynamoDB tables – queueMetricsConfigTable, and queueMetricsResultsTable.
- One DynamoDB stream.
- One Amazon Connect contact flow – ServiceLevelExampleContactFlow.
- One IAM policy and one IAM role for Lambda function to access DynamoDB.
- One resource-based policy for Amazon Connect to invoke AWS Lambda.
Follow the steps to deploy the template:
-
- Launch the CloudFormation template in the same Region as your Amazon Connect instance.
-
- Accept the default values and choose Next.
- Enter Amazon Connect instance id from step 1 in the Amazon Connect Instance Id field. Provide a stack name (for example, Service-Level), and choose Next.
-
- Choose Next, and scroll down to the bottom of the page.
- Acknowledge IAM resources creation, and choose Create stack. This will take couple minutes to provision the resources.
Step 3: Configure service level routing
-
- Open the Amazon Connect console.
- In the navigation pane, under Routing, choose Queues.
-
- Select BasicQueue, and make a note of the Amazon Resource Name (ARN) of BasicQueue.
- Create a new queue (alternate).
- On the navigation menu, under Routing, choose Queues.
- Choose Add new queue.
- Add appropriate information about the queue and choose Add new queue.
- Select this newly created queue, choose Show additional queue information. Make a note of the ARN for this queue.
- Assign the queue to a routing profile.
Step 4: Update queueMetricConfigTable in Amazon DynamoDB
-
- Open the Amazon DynamoDB console.
- In the navigation pane, choose Tables.
- Select the table with queueMetricConfigTable in the name.
-
- In the navigation pane, choose Explore items, and choose Create item on top-right to create a new item.
-
- On Item editor window, select JSON on the top-right. Uncheck View DynamoDB JSON.
-
- Replace existing item with the following JSON in Item editor. Replace <Enter BasicQueue ARN> with the ARN of your BasicQueue. Replace <Enter alternate queue arn 1> with ARN of the alternate queue noted in step 3. For this example, replace both, alternate queue arn 1, and alternate queue arn 2, with the same alternate queue ARN. These can be different queues based on your use case.
{ "queue_name": "BasicQueue", "refresh_rate_secs": 180, "svl_params": { "1": { "alt_queue_arn": "<Enter alternate queue arn 1>", "svl_obj": "80", "svl_thresh": "30" }, "2": { "alt_queue_arn": "<Enter alternate queue arn 2>", "svl_obj": "80", "svl_thresh": "60" } }, "queue_arn": "<Enter BasicQueue ARN>" }
- Choose Create item to create an item in this table.
Step 5: Validate Lambda functions
- Validate Lambda function with name getMetrics.
-
- Open the AWS Lambda console.
- Select Lambda function containing getMetrics in the name.
-
- This Lambda function uses an environment variable LAST_X_SECONDS to calculate and retrieve service level metric for a specific start and end time. In this example, the value is set to 14400 seconds (effective 12:00 A.M. of current day). This value is used in getMetricData API, and can be adjusted based on your requirements.
-
- Under Test, choose select Create new event, enter Event name (for example, Test1), and Private to configure the following test event.
-
- Enter Event JSON
- Copy the following JSON, and paste it replacing existing default event.
{ "Records": [{ "dynamodb": { "NewImage": { "queue_name": { "S": "BasicQueue" }, "refresh_metrics": { "S": "Y" } } } }] }
-
- Choose Save to create the event.
- Choose Test to validate the Lambda function. A statusCode: 200 response completes the test successfully.
-
- Validate Lambda function with name checkMetrics.
-
- In the AWS Lambda console, choose function containing checkMetrics in the name.
- Under Test, choose select Create new event, enter Event name (for example, Test1), and Private to configure the following test event.
-
- Enter Event name (for example, Test1).
- Copy the following JSON and paste it replacing existing default event.
{ "Details": { "Parameters": { "QueueName": "BasicQueue", "SvlThreshold": "30" } } }
-
- Choose Create to create the event.
- Choose Test to validate the Lambda function. A statusCode: success response completes the test successfully.
Step 6: Configure Amazon Connect
-
- Sign in to the Amazon Connect console.
- On the navigation pane, under Routing, choose Phone Numbers.
- Choose Claim a number to claim a new phone number, or use an existing phone number if you have obtained previously.
- Assign the phone number to the contact flow with name containing ServiceLevelRoutingExample.
Choose Save.
Step 7: Testing
Service level metric is updated as contacts are placed in a queue, and are routed to agents. To test this capability, the solution prompts for a threshold service level. If current service level metric is lower than the threshold entered, the contact flow routes the call to the primary queue. If it is higher, the call is routed to an alternate queue.- Configure a routing profile in Amazon Connect with BasicQueue and an alternate queue.
- Configure an agent with this routing profile.
- Log in an agent. Optionally, you can have a second agent configured with the alternate queue in their Routing Profile.
- Set agent status to Offline in the Control Contact Panel (CCP).
- Place a test call
- You will be prompted to enter a service level threshold value.
- Enter the service level threshold seconds (for example, 30), followed by a #.
- Wait in the queue for a few seconds.
- Change agent status to Available.
- Accept the call, wait a few seconds, and End the call.
- Repeat steps 5 through 8 to place multiple calls. Use the same service level threshold value for all test calls. Wait in queue for a varying number of seconds; some higher than the threshold, and some lower.
Placing multiple calls updates the service level metric for testing the thresholds, and taking the next action. For this test, the contact flow routes the call to BasicQueue if the service level metric is lower than the threshold value. If service level metric exceeds the threshold, contact is routed to an alternate queue.
You’ve successfully configured and tested service level routing with your Amazon Connect instance.
Clean up
-
- Sign in to the Amazon Connect console.
- On the navigation pane, under Routing, choose Phone Numbers.
- Select the phone number with ServiceLevelRoutingExample contact flow and select x to remove the mapping of phone number to the contact flow.
- Click Save.
-
- Navigate to CloudFormation console, select the Service-Level stack, and choose Delete.
- Delete the stack by choosing Delete stack on confirmation screen.
Conclusion
In this post, we implemented service level routing using Amazon Connect by completing the following steps:
- Deployed CloudFormation stack that included AWS Lambda functions, Amazon DynamoDB tables, and Amazon Connect Contact flow.
- Configured Amazon DynamoDB table, and Amazon Connect.
Service level metric is an indicator of contact center availability to service customers. This blog post demonstrated how to route contacts based on service level objectives. Customers can be routed to an alternate queue, or offered callback to improve the experience. You can enhance the solution based on your organization’s requirements and reduce the need to make manual intraday adjustments.
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.
-