Skip to Main Content

When migrating from one system to another there are many business processes that can be affected, some of which cannot be easily changed. We have several customers who had this very scenario with regards to the Amazon Connect extension for agents. The routing of customers to agents within the Amazon Connect Contact Center is based around the concept of Queue Flow.

For direct to agent routing, Amazon Connect uses a concept of Personal Queues. Personal Queues are the agent ID used for login, which is typically an email address. Personal Queues provide the ability to send a customer to a specific agent, however, we are still missing those important "4 digit extension numbers" that your customers use. In this Blog we're going to show you a working solution along with instructions giving you the ability to build your own Amazon Connect extensions.

How do we get Amazon Connect extensions dialing?

With the system to send contacts to a specific agent via Personal Queues in place, we're just missing the ability for the customer to "enter the 4 digit extension number you require." To correct this issue you can enter some lambda, DynamoDB and an AdminUI for management.

First we ask the customer a question using a "get customer input" action block. We then use that input in a Lambda request, which looks at the DynamoDB Table, to return to the agent required. Amazon Connect then dials, or enters the agent extension.

Below is the screenshot of the Contact Queue Flow used in this journey.

Dial By Extension Contact Flow

Build your own Amazon Connect extensions:

Now that we've whetted your appetite, we're going to walk you through the process of creating this for your own testing purposes. Below is a guide on how to build your own, with cloud formation and the Amazon Connect contact flow code provided for you. This process will take you 15 minutes.

Short Guide:

1 - Launch the stack

2 - Add your extensions to the DynamoDB Table

3 - Add Lambda to your Amazon Connect Instance

4 - Import the Contact Flow

Detailed Steps:
Step 1: Create the stack

Create the DynamoDB Table, Lambda and IAM Role by using the below CloudFormation template in the region you have Amazon Connect. The template includes the inline Node.js code for the Lambda and the inline policies for the IAM Role, which is restricted to the resources the stack creates.

  • US - North Virgina
  • US - Oregon
  • EU - Frankfurt
  • AP - Sydney .
  • AP - Tokoyo
  1. Click on the correct region from the list above
  2. Next
  3. Next
  4. Add any Tags you required, then Next
  5. Scroll to the bottom, check this box then Create Stack.
Step 2: Add your agent extensions

Now that we have the infrastructure built, we need to check staffing to confirm agent IDs, and enter the agent extensions to the DynamoDB Table.

  1. Navigate to the DynamoDB Console
  2. Click on the 'VoiceFoundry-DialByExtension-DynamoTable' table
  3. Click on the Items tab and then Create Item button
  4. Enter the extension you require, for example, 2222
  5. Click on + then Append > String
  6. Key = agent, value = <agent login name from connect> (Case sensitive!)
  7. Press Save (Add any more extensions you require)
Step 3: Add Lambda to your Connect Instance
  1. Navigate to the Connect console for your instance
  2. In Contact Flow section under AWS Lambda, select the newly created function and click + Add Lambda Function
Step 4: Import the Contact Attributes From the Contact Flow
  1. Download the contact flow
  2. Create a new Contact Flow within Amazon Connect
  3. Import the downloaded flow
  4. Open the lambda Action Block and select "voicefoundry-dialByExtension-Lambda", save
  5. Save and Publish the contact flow
  6. Assign a Phone Number to this flow

In conclusion

By using Amazon Connect extensions, Lambda and DynamoDB, we're able to assist our customers in migrating to Amazon Connect while maintaining a key business process for them.


  • Amazon Connect will automatically prioritize the caller coming in on the agent’s personal queue, rather than a call from another queue assigned to the agent.
  • The code provided is for testing!