

# Set up routing in Amazon Connect
Set up routing

In Amazon Connect, routing consists of three parts: queues, routing profiles, and flows. This topic discusses queues and routing profiles. For information about flows, see [Flows in Amazon Connect](connect-contact-flows.md).

A queue holds contacts waiting to be answered by agents. You can use a single queue to handle all incoming contacts, or you can set up multiple queues.

Queues are linked to agents through a routing profile. When you create a routing profile, you specify: 
+ Which queues will be in it.
+ Whether one queue should be prioritized over another.
+ What channels agents will handle in the Contact Control Panel (CCP).
+ How many contacts agents can handle simultaneously for each channel.
+ Whether individual queues are for all channels or specific ones.
+ What channel and queue combinations will an agent be able to manually prioritize work from.

Each agent is assigned to one routing profile.

**Topics**
+ [How routing works](about-routing.md)
+ [Queues: standard and agent](concepts-queues-standard-and-agent.md)
+ [Queues: priority and delay examples](concepts-routing-profiles-priority.md)
+ [Queue-based routing](concepts-queue-based-routing.md)
+ [Channels and concurrency](channels-and-concurrency.md)
+ [Create a queue](create-queue.md)
+ [Disable a queue temporarily](disable-a-queue.md)
+ [Delete a queue](delete-queue.md)
+ [Set queue capacity](set-maximum-queue-limit.md)
+ [Route contacts based on queue capacity](route-based-on-queue-capacity.md)
+ [Set the hours of operation](set-hours-operation.md)
+ [Create a routing profile](routing-profiles.md)
+ [How Amazon Connect uses routing profiles](concepts-routing.md)
+ [Delete a routing profile](delete-routing-profiles.md)
+ [Set up queue-based routing](set-up-queue-based-routing.md)
+ [Set up routing based on agent proficiencies](proficiency-routing.md)

# How routing works in Amazon Connect
How routing works

Contacts are routed through your contact center based on these factors: 
+ The routing profile assigned to the agent.
+ The hours of operation for a given queue.
+ The routing logic you define in your flows.

For example, you use routing profiles to route specific types of contacts to agents with specific skill sets. If no agent with the required skill set is available, you can place the contact in the queue defined in the flow. 

Here's the logic Amazon Connect uses to route contacts:
+ Contacts in a queue are automatically prioritized and forwarded to the next available agent (that is, the agent who has been idle longest).
+ Contacts are placed on hold if there are no available agents. The order in which they are serviced is determined by their time in queue, on a first-come, first-served basis.
+ If multiple agents are ready for a contact, by default an inbound contact is routed to the agent who has been in the **Available** status for the longest time.
**Tip**  
For information about how queue priority and delay work, see [Queues: priority and delay examples](concepts-routing-profiles-priority.md).

  Handling either inbound or outbound contacts causes agents to drop to the bottom of the list for inbound contacts. You can set up your [routing profile](routing-profiles.md) to ignore outbound contacts in this calculation by choosing the **Outbound calls should not impact routing order** option. Consider choosing this option if your organization wants agents to take outbound calls and still get a fair share of inbound contacts. 

  For example:
  + An agent named Joe is idle. He is third in line to receive an inbound contact. He would rather handle an inbound contact than an outbound contact because he knows he will speak to a customer, whereas an outbound contact may not pick up the phone. Talking to an inbound contact increases his odds of getting recognition in his role. 
  + Because he is idle, Joe decides to make an outbound contact to chip away at the backlog. He may or may not reach someone.
  + By default, when Joe makes the outbound contact, he moves from third in line to the bottom of the list of agents waiting to receive an inbound contact. (If there are 10 agents, he is moved to 10th place). If instead he should remain in third place, you can override the default behavior.
+ A routing profile may assign a priority to one queue over another, but the priority within the queue is always set by the order the contact was added to the queue.
+ If the contact belongs to a queue and channel combination that is **only** listed under the manually assigned section of a routing profile, that contact is **not** routed automatically to agents assigned to that routing profile.

## How routing transfers works


As the previous section explains, the order in which contacts in queue are handled in Amazon Connect depends on multiple factors, including the enqueue time, routing age adjustment, and contact priority. In the case of contacts that experience a transfer, however, Amazon Connect handles the routing age adjustment slightly differently: it depends on whether the contact was transferred by an agent, or if it was transferred by a queue-to-queue transfer in a flow or an API. 

The following two scenarios demonstrate how Amazon Connect handles the routing age adjustment.
+ **Agent transfers the contact using a quick connect**: A contact is originally enqueued at time **X** and is then handled by an agent. The agent then transfers it back to a queue using a quick connect at time **Y**. In this scenario: 
  + The original enqueue time **X** is used to calculate the order in which this contact is ranked in the subsequent queue. 
  + Any routing age adjustments are applied relative to that contact enqueue time.
+ **Queue-to-queue transfer**: A contact was in a queue from time **S** and is eventually transferred to a different queue at time **T**. In this scenario:
  + The new enqueue time **T** is used to calculate the order in which the contact is ranked. 
  +  Any routing age adjustments are applied relative to that contact enqueue time.

## How routing works with multiple channels


When you set up a routing profile to handle multiple channels, you must specify whether agents can handle contacts while already on another channel. This is called cross-channel concurrency. 

When using cross-channel concurrency, Amazon Connect checks which contact to offer the agent as follows: 

1. It checks what contacts/channels the agent is currently handling.

1. Based on what channels they are currently handling, and the cross-channel configuration in the agent's routing profile, it determines whether the agent can be routed the next contact.

For a detailed example of how Amazon Connect routes contacts when cross-channel concurrency is set up, see [Example of how a contact is routed with cross-channel concurrency](routing-profiles.md#example-routing-concurrency). 

## How routing works with manual assignment


When you set up a routing profile that has queues and channels listed for manual assignment, Amazon Connect does not automatically route these contacts.

Agents with this routing profile can view queued contacts (currently only supported for Tasks, Emails, and Chats) in the worklist app in their agent workspaces based on their security profile settings and determine the next important work item to assign to themselves.

## Learn more about routing
Learn more

See the following topics to learn more about routing:
+  [Queues: priority and delay examples](concepts-routing-profiles-priority.md).
+ [How Amazon Connect uses routing profiles](concepts-routing.md) 
+ [Queue-based routing to route customers to a specific contact center agent](concepts-queue-based-routing.md)
+ [Set up queue-based routing](set-up-queue-based-routing.md) 

# Standard queues and agent queues in your Amazon Connect contact center
Queues: standard and agent

There are two types of queues:
+ **Standard queues**: This is where contacts wait before they are routed to and accepted by agents.
+ **Agent queues**: These queues are created automatically when you add an agent to your contact center.

  Contacts are only routed to agent queues when explicitly sent there as part of a flow. For example, you might route contacts to a specific agent who's responsible for certain customer issues, such as billing or premium support. Or you might use agent queues to route to an agent's voice-mail. 

Contacts waiting in agent queues are higher priority than contacts waiting in standard queues. Contacts in agent queues have the highest priority and zero delay: 
+ Highest priority: If there's another contact in the basic queue, Amazon Connect chooses to give the agent the contact from the agent queue first.
+ Zero delay: If the agent is available, the contact immediately gets routed to them.

## Queues in metrics reports


In a [real-time metrics report](real-time-metrics-reports.md), you can monitor how many contacts are in standard queues and agent queues. The following image shows a sample real-time metrics Queues report where an Agents table and Agent queues table have been added. It shows:
+ **BasicQueue**, which is a standard queue. It shows one agent (John) is online.
+ **Agents** table, which shows the agent John has set his CCP to **Available** and is ready to take contacts. A supervisor can change an agent's status from here. For example, set to **Offline**.
+ **Agent queues** table, which shows John's agent queue. It shows John is online and can take contact from this queue, too.

![\[A queues report with Agents table and Agent queues table.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/rtm-standard-and-agent-queues.png)


When an agent gets a contact from a standard queue, the contact never appears in the agent queue. It just goes directly to the agent. 

In a [historical metrics report](historical-metrics.md), by default agent queues don't appear in a Queues table. To show them, choose the **Settings** icon, then choose **Show agent queues**. 

![\[The agent queues dropdown menu on the Table settings page.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/hmr-queues-settings-agent-queues.png)


**Tip**  
The metrics APIs don't support agent queues.

## Default queue: BasicQueue


Amazon Connect includes a default queue named **BasicQueue**. Along with the [default flows](contact-flow-default.md) and default routing profile (named **Basic routing profile**), it powers your contact center so you don't need to do any customization. This is what enables you to get started quickly. 

# Queue priority and delay examples to help you load balance Amazon Connect contacts
Queues: priority and delay examples

This topic provides several example priority and delay settings for queues, and explains how contacts are routed in each scenario. Use these examples to load balance contacts using the priority and delay features. 

## Example 1: Different priority but same delay


For example, one group of agents is assigned to a Sales routing profile. Since their primary job is sales, the Sales queue is Priority 1 and Delay is 0. But they can help with Support too, so that queue is Priority 2 and Delay is 0. This shown in the following table:


| Queue | Priority | Delay (in seconds) | 
| --- | --- | --- | 
|  Sales  |  1  |  0  | 
|  Support  |  2  |  0  | 

If there are no contacts in the Sales queue, then the agents will be presented with contacts from the Support queue. 

## Example 2: Same priority but different delay


Say you set the Support queue to Priority 1 and Delay of 30 seconds, as shown in the following table: 


| Queue | Priority | Delay (in seconds) | 
| --- | --- | --- | 
|  Sales  |  1  |  0  | 
|  Support  |  1  |  30  | 

These agents will always get contacts from the Sales queue first because the delay is 0. However, when a contact in the **Support** queue ages past 30 seconds, it will also be treated as priority 1. The agents will then be presented with the contact from the **Support** queue. 

## Example 3: Different Priorities and Delays


Here's a more complicated example for a Support routing profile:


| Queue | Priority | Delay (in seconds) | 
| --- | --- | --- | 
|  Tier 1 Support  |  1  |  0  | 
|  Tier 2 Support  |  1  |  0  | 
|  Tier 3 Support  |  2  |  20  | 
|  Tier 4 Support  |  3  |  80  | 

This routing profile prioritizes the Tier 1 Support and Tier 2 Support queues equally because each is priority 1.
+ Agents may take contacts from the Tier 3 Support queue when:
  + Customers for Tier 3 Support are waiting for 20 seconds or longer.
  + And no contacts are in the Tier 1 Support or Tier 2 Support queues.
+ Agents may take contacts from the Tier 4 Support queue when:
  + Customers in the Tier 4 Support queue have been waiting 80 seconds or longer.
  + And no contacts are in the Tier 1 Support, Tier 2 Support or Tier 3 Support queues.

  **Priority takes precedence**. (You might think that agents take contacts from Tier 4 Support when contacts are in Tier 1 Support, Tier 2 Support, or Tier 3 Support and waiting 20 seconds or longer, but that's not right.) 

## Example 4: Same Priority and Delay


In this example a routing profile has only two queues, and they have the same priority and delay:


| Queue | Priority | Delay (in seconds) | 
| --- | --- | --- | 
|  Sales  |  1  |  0  | 
|  Support  |  1  |  0  | 

For this routing profile, the oldest contact is routed first. It goes to the agent who has been idle for the longest time.

## Example 5: Agent is idle and Contact is in 30 second delay queue


Let's say the agent is idle and the contact is in delay (for a 30 second delay queue, the contact is 15 seconds old). What happens? 

The **Delay** setting in the routing profile means that X seconds must pass before this contact can be offered to agents with this routing profile. Whether the agents are idle or not isn't taken into account. So in this case, this agent isn't offered the contact until the contact is at least 30 seconds old.

## Example 6: Different routing profiles, same queues, different priorities


For example: 


| Agent | Priority | Queue | 
| --- | --- | --- | 
|  Agent A  |  1  |  1  | 
|  Agent B  |  5  |  1  | 
+ **Both agents are available. Who will get the call? It depends ... **
  + Routing always attempts to route to the longest available agent first.

    Agent A has a profile with Priority 1 for Queue 1, and Agent B has a profile with Priority 5 for Queue 1. Contact Z is added to Queue 1 while both agents are available. In this case, Contact Z will always be routed to whichever agent has been available for longer. If Agent B has been available longer, Contact Z will be routed to Agent B.
  + Priority for queues is relevant to searching for queues for an individual agent. It does not determine which agent out of multiple available agent will be routed contacts. 

    Let's say Contact Y is in Queue 2 and has been there longer than Contact Z in Queue 1. Agent A will be routed Contact Z even though it is newer. This is because Queue 1 has a higher priority in the agent's profile.
+ **Do Priority 5 agents get calls only when agents with higher priorities are not available? **

  No. Priority 5 agents receive calls from that queue only if their other priority queues are empty. One agent's priority setting for a queue does not impact when the queue is routed a contact relative to other agents, but relative to other queues in the agent's profile.

For instructions on how to set priority and delay for a routing profile, see [Create a routing profile in Amazon Connect to link queues to agents](routing-profiles.md).

# Queue-based routing to route customers to a specific contact center agent
Queue-based routing

In your business, you might want to route customers to specific agents based on certain criteria, such as the skill of the agent. This is called queue-based routing, also known as skills-based routing. 

For example, an airline might have some agents who handle reservations for English-speaking customers, others who handle Spanish-speaking customers, and a third group that handles both types of customers, but only over the phone.

The following illustration shows you can: 
+ Assign the same routing profile to multiple agents.
+ Assign multiple queues to a routing profile.
+ Assign a queue to multiple routing profiles.

![\[A graphic of four routing profiles.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/routing-profile-example2.png)


For an overview of the steps to set up queue-based routing, see [Set up queue-based routing](set-up-queue-based-routing.md). 

# Channels and concurrency for routing contacts in Amazon Connect
Channels and concurrency

Agents can handle voice, chat, tasks and email in Amazon Connect. When you set up a routing profile to handle multiple channels, you have two options: 
+ Option 1: Set up agents so they can handle contacts while already on another channel. This is called *cross-channel concurrency*. 
+ Option 2: Set up agents so they can be offered voice, chat, tasks, or email if they are fully idle, depending on what is in queue. When you choose this option, after the agent starts work on contacts from one channel they will no longer be offered contacts from any other channels.

When using cross-channel concurrency, Amazon Connect checks which contact to offer the agent as follows: 

1. It checks what contacts/channels the agent is currently handling.

1. Based on what channels they are currently handling, and the cross-channel configuration in the agent's routing profile, it determines whether the agent can be routed the next contact.

1. Amazon Connect prioritizes the longest waiting contact if Priority and Delay are equal. Even though it's evaluating multiple channels at the same time, First-In First-Out is still respected.

For a detailed example of how Amazon Connect routes contacts when cross-channel concurrency is set up, see [Example of how a contact is routed with cross-channel concurrency](routing-profiles.md#example-routing-concurrency). 

To learn more about what the agent experiences in the Contact Control Panel when handling multiple chats, see [Use the Contact Control Panel (CCP) in Amazon Connect to chat with contacts](chat-with-connect-contacts.md).

# Create a queue using the Amazon Connect admin website
Create a queue

This topic explains how to create a queue using the Amazon Connect admin website. To create queues programmatically, see the [create-queue](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/connect/create-queue.html) AWS CLI or [CreateQueue](https://docs.aws.amazon.com/connect/latest/APIReference/API_CreateQueue.html) in the *Amazon Connect API Reference*.

**How many queues can I create?** To view your quota of **Queues per instance**, open the Service Quotas console at [https://console.aws.amazon.com/servicequotas/](https://console.aws.amazon.com/servicequotas/).

**To create a queue**

1. Log in to the Amazon Connect admin website at https://*instance name*.my.connect.aws/. Use an **Admin** account, or an account that has **Routing** - **Queues** - **Create** permission in its security profile.

1. On the Amazon Connect admin website, on the navigation menu, choose **Routing**, **Queues**, **Add new queue**.

1. Add the appropriate information about your queue and choose **Add new queue**.

   The following image shows the queue information for the BasicQueue.  
![\[The Edit queue page for the Basic queue.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/add-a-new-queue.png)

   See the following topics for detailed information about each of the above areas:

   1. [Set the hours of operation and time zone for a queue using Amazon Connect](set-hours-operation.md)

   1. [Set up outbound caller ID in Amazon Connect](queues-callerid.md)

   1. [Set up email in Amazon Connect](setup-email-channel.md)

   1. [Set the limit of maximum contacts in a queue using Amazon Connect](set-maximum-queue-limit.md)

   1. [Create quick connects in Amazon Connect](quick-connects.md)

   The queue is automatically active.

1. Assign the queue to a routing profile; for information, see [Create a routing profile in Amazon Connect to link queues to agents](routing-profiles.md). The routing profile links the queue and agents together.

1. Add tags to identify, organize, search for, filter and control who can access this queue. For more information, see [Add tags to resources in Amazon Connect](tagging.md).

To learn how queues work, see [How Amazon Connect uses routing profiles](concepts-routing.md) and [Queue-based routing to route customers to a specific contact center agent](concepts-queue-based-routing.md).

## APIs to create and manage queues
APIs to create and manage queues

Use the following APIs to create and manage queues programmatically:
+ [CreateQueue](https://docs.aws.amazon.com/connect/latest/APIReference/API_CreateQueue.html)
+ [DeleteQueue](https://docs.aws.amazon.com/connect/latest/APIReference/API_DeleteQueue.html)
+ [DescribeQueue](https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribeQueue.html)
+ [ListQueues](https://docs.aws.amazon.com/connect/latest/APIReference/API_ListQueues.html)
+ [SearchQueues](https://docs.aws.amazon.com/connect/latest/APIReference/API_SearchQueues.html)
+ [UpdateQueueHoursOfOperation](https://docs.aws.amazon.com/connect/latest/APIReference/API_UpdateQueueHoursOfOperation.html)
+ [UpdateQueueMaxContacts](https://docs.aws.amazon.com/connect/latest/APIReference/API_UpdateQueueMaxContacts.html)
+ [UpdateQueueName](https://docs.aws.amazon.com/connect/latest/APIReference/API_UpdateQueueName.html)
+ [UpdateQueueOutboundCallerConfig](https://docs.aws.amazon.com/connect/latest/APIReference/API_UpdateQueueOutboundCallerConfig.html)
+ [UpdateQueueOutboundEmailConfig](https://docs.aws.amazon.com/connect/latest/APIReference/API_UpdateQueueOutboundEmailConfig.html)
+ [UpdateQueueStatus](https://docs.aws.amazon.com/connect/latest/APIReference/API_UpdateQueueStatus.html)

# Disable a queue temporarily using Amazon Connect
Disable a queue temporarily

You can quickly control the flow of contacts to queues by temporarily disabling a queue. When a queue is disabled, it's put in an offline mode. No new contacts are routed to the queue, but any existing contacts already in the queue are routed to agents. 

Only users who have a security profile with **Routing** - **Queues** - ** Enable/Disable** permission can disable a queue.

![\[Security profile permissions table showing Queues row with Create checkbox selected.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/disable-queue.png)


**To temporarily disable an active queue**

1. Log in to the Amazon Connect admin website at https://*instance name*.my.connect.aws/. Use an **Admin** account, or an account that has **Routing** - **Queues** - ** Enable/Disable** permission in its security profile.

1. On the Amazon Connect admin website, on the navigation menu, choose **Routing**, **Queues**.

1. For the queue you want to disable, toggle the **Status** to **Disabled**, as shown in the following image.  
![\[The Queues page, the Status toggle.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/disable-queue-power-button.png)

1. Choose **Disable** to confirm you want to disable the queue, as shown in the following image. You can immediately re-enable the queue if needed by toggling the button back to **Enabled**.  
![\[The Disable queue confirmation box.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/disable-queue-confirm.png)

# Delete a queue from your Amazon Connect instance
Delete a queue

There are three ways to delete a queue from your Amazon Connect instance: 
+ Amazon Connect admin website

  1. Log in to the Amazon Connect admin website at https://*instance name*.my.connect.aws/. Use an **Admin** account, or an account that has **Routing** - **Queues** - **Delete** permission in its security profile.

  1. On the Amazon Connect admin website, on the navigation menu, choose **Routing**, **Queues** and then select the delete icon.  
![\[The Queues page, the Status option and the Delete option.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/delete-queue.png)
**Important**  
You cannot undo a deleted queue. To temporarily disable a queue, toggle its status to **Disabled**.
+ [DeleteQueue](https://docs.aws.amazon.com/connect/latest/APIReference/API_DeleteQueue.html) API
+ [delete-queue](https://docs.aws.amazon.com/cli/latest/reference/connect/delete-queue.html) AWS CLI

# Set the limit of maximum contacts in a queue using Amazon Connect
Set queue capacity

By default a queue can contain up to your [service quota](amazon-connect-service-limits.md) for voice, chat, tasks, and email: 
+ **Concurrent active calls per instance**
+ **Concurrent active chats per instance (includes SMS)**
+ **Concurrent active tasks per instance**
+ **Concurrent active emails per instance**

To increase one of these quotas, you must request a quota increase. For more information, see [Amazon Connect service quotas](amazon-connect-service-limits.md).

There may be situations where you want a specific queue to allow fewer contacts than the allowed quota. For example:
+ You have a queue that is dedicated to calls about complicated issues that take an average of 15 minutes to resolve, you may want to limit the number of calls allowed in the queue to be less than **Concurrent active calls per instance**. This prevents customers from waiting for hours. 
+ You may have a queue dedicated to chats. Your service quota is 100 but you want only up to 20 chats at a time. You can set that value so Amazon Connect limits the number of active chats routed to that queue.
+ You have a queue that combines more than one channel, and you set a custom value. Note that the queue stops accepting new contacts after that number is reached, regardless of the distribution of contacts. For example, if you set the value to 50, and the first 50 contacts are chats, then voice calls are not routed to this queue.

This topic explains how to reduce the allowed number of contacts in a queue for these situations.

## Reduce the number of contacts allowed in a queue
Reduce the number of contacts allowed in a queue

To reduce the number of contacts allowed in a [standard queue](concepts-queues-standard-and-agent.md) at the same time, you set the **Maximum contacts in queue** limit for the standard queue. This setting does not apply to [agent queues](concepts-queues-standard-and-agent.md).

![\[Option to set a maximum limit for contacts in queue across all channels.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/maximum-contacts-in-queue3.png)


When you enter a number in **Maximum contacts in queue**, Amazon Connect validates that the number is less than the sum of your concurrent active contacts service quotas: **Concurrent calls per instance** \$1 **Concurrent active chats per instance** \$1 **Concurrent active tasks per instance** \$1 **Concurrent active emails per instance**. 

**Important**  
You must set **Maximum contacts in queue** to be less than the sum of the following quotas combined: **Concurrent calls per instance** \$1 **Concurrent active chats per instance** \$1 **Concurrent active tasks per instance** \$1 **Concurrent active emails per instance**.
Incoming calls and queued callbacks count towards the queue size limit.
For information about default service quotas and how to request an increase, see [Amazon Connect service quotas](amazon-connect-service-limits.md).

**To reduce the number of contacts allowed in a specific queue**

1. On the navigation menu, choose **Routing**, **Queues**, **Add new queue**. Or, edit an existing queue.

1. In **Maximum contacts in queue**, choose **Set a limit across all channels**. If the queue is also used for chats, tasks, and email, then all channels will be capped at the same maximum. 

1. In the box, specify how many contacts can be in the queue before it's considered full. The value cannot exceed the sum of **Concurrent active calls per instance** \$1 **Concurrent active chats per instance** \$1 **Concurrent active tasks per instance** \$1**Concurrent active emails per instance**.  
![\[Input field for setting maximum contacts in queue, with a value of 7 displayed.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/maximum-contacts-in-queue2.png)

## What happens to calls when a queue is full
What happens to calls when a queue is full
+ Incoming calls: Ideally you've [set up queued callback](setup-queued-cb.md), or have another contingency implemented. If not, the next incoming call gets a reorder tone (also known as a fast busy tone), which indicates no transmission path to the called number is available.
+ Queued callbacks: The next queued callback is routed down the error branch.

## What happens if Maximum contacts in queue is set to 0
What happens if Maximum contacts in queue is set to 0

If you set **Maximum contacts in queue** to 0 it renders the queue unusable. The behavior is the same as when a queue is full. 

## Queue maximum limit exceptions
Queue limit additional details

There are times when you can add more contacts to a queue than the set **Maximum contacts in queue** limit.
+ There may be a slight delay between the time that a queue reaches its capacity limit and when this limit is enforced in the flow. This delay could cause incoming contacts to be queued during that time, particularly during bursts of traffic.

Additionally, Amazon Connect includes a 20 percent buffer to the queue capacity for the following exceptional scenarios:
+ A contact was transformed into a Queued Callback, scheduled to be added to the queue at X time using the **Initial delay** setting in the flow. However, when the scheduled time arrived, the target queue had reached its **Maximum capacity in queue** limit. In this scenario, Amazon Connect allows the Queued Callback to be enqueued up to a 20 percent buffer of the **Maximum capacity in queue** limit for the queue.
+ A contact, previously queued in Queue1, is now being transferred to Queue2 through the flow. However, when the transfer is attempted, Queue2 has already reached its **Maximum capacity in queue** limit. In this scenario, Amazon Connect allows the transfer to proceed, up to a 20 percent buffer of the **Maximum capacity in queue** limit for Queue2.
+ An agent initiates a manual transfer of a contact into a queue through quick connects. However, when the transfer is attempted, the queue has already reached its **Maximum capacity in queue** limit. In this scenario, Amazon Connect allows the transfer to proceed, up to a 20 percent buffer of the **Maximum capacity in queue** limit.

# Route contacts based on queue capacity using Amazon Connect
Route contacts based on queue capacity

To define routing decisions based on queue capacity, use a [Transfer to queue](transfer-to-queue.md) block to check whether a queue is full ([Maximum contacts in queue](set-maximum-queue-limit.md)), and then route the contact accordingly.

The [Transfer to queue](transfer-to-queue.md) block checks the [Maximum contacts in queue](set-maximum-queue-limit.md). If no limit is set, the queue is limited to the number of total concurrent contacts for the following quotas: 
+ Active tasks per instance
+ Concurrent active emails per instance
+ Concurrent calls per instance
+ Concurrent chats per instance

# Set the hours of operation and time zone for a queue using Amazon Connect
Set the hours of operation

This topic explains how to set hours of operating by using the Amazon Connect admin website. To set hours programmatically, see [Hours of operations actions](https://docs.aws.amazon.com/connect/latest/APIReference/hours-of-operation-api.html).

The first thing you need to do when you set up a queue is to specify the hours of operation and timezone. The hours may be referenced in flows. For example, when routing contacts to agents, you might use the [Check hours of operation](check-hours-of-operation.md) block first, and then route the contact to the appropriate queue. 

![\[An Hours of operation page with overrides.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/hoop-listpage.png)


**Topics**
+ [How many hours of operation and overrides can I create?](#howmany-hours)
+ [Set the hours of operation](#set-hoop)
+ [

## How to specify midnight
](#set-hours-operation-midnight)
+ [

## Examples
](#set-hours-operation-examples)
+ [

## Add lunch and other breaks
](#add-lunch-breaks)
+ [Daylight saving time](#daylight-savings-time)
+ [

## How flows leverage hours of operation
](#use-check-hours-of-operation-block)
+ [Set overrides for extended, reduced, and holiday hours](hours-of-operation-overrides.md)
+ [View calendar that illustrates effective hours of operation](view-hours-of-operation-calendar.md)

## How many hours of operation and overrides can I create?
How many hours of operation and overrides can I create?

To view your quota of **Hours of operation per instance**, open the Service Quotas console at [https://console.aws.amazon.com/servicequotas/](https://console.aws.amazon.com/servicequotas/).

## Set the hours of operation
Set the hours of operation

1. Log in to the Amazon Connect admin website with an Admin account or an account that has **Routing - Hours of operation - Create** security profile permission.

1. On the navigation menu, choose **Routing**, **Hours of operation**.

1. To create a set of operating hours, choose **Add new set of hours** and enter a name and a description.

1. Choose **Time zone** and select a value.

1. Choose **Operational hours** to set new hours.

1. Optionally, in the **Tags** section, add tags to identify, organize, search for, or filter who can access this hours of operation record. For more information, see [Add tags to resources in Amazon Connect](tagging.md).

1. Choose **Save**.

1. Now you can specify these the hours of operation when you [create a queue](create-queue.md), and check them in the [Check hours of operation](check-hours-of-operation.md) block.

## How to specify midnight


To specify midnight, enter 12:00AM.

For example, if you want to set your hours to 10:00AM to midnight, you would enter: 10:00AM to 12:00AM. Your call center would be open for 14 hours. Here's the math: 
+ 10:00AM-12:00PM = 2 hours
+ 12:00PM-12:00AM = 12 hours
+ Total = 14 hours

## Examples


**Schedule for 24x7**

![\[An example of a weekly, 24-hour contact center schedule.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-hours-of-operation-24x7.png)


**Schedule for Monday to Friday 9:00 AM to 5:00 PM**

Select the button to **Expand to individual days**.

Remove Sunday and Saturday from the schedule.

![\[An example of removing days from a contact center schedule.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-hours-of-operation-closed-weekends-remove.png)


## Add lunch and other breaks


Select **\$1 Add more time** at the bottom of the Operational hours section to create more rows, then set the hour ranges within each day. For example, if Saturday the hours are 8-11 then 1-5:

![\[A diagram showing lunch breaks in a contact center schedule.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/hours-of-operation-lunch.png)


In most contact centers breaks are staggered. While some agents are at lunch, for example, others are still available to handle contacts. Instead of specifying this in the hours of operation, you [add custom agent statuses](agent-custom.md) that appear in the agent's Contact Control Panel (CCP). 

For example, you might create a custom status named **Lunch**. When the agent goes to lunch, they change their status in the CCP from **Available** to **Lunch**. During this time, no contacts are routed to them. When they return from lunch and are ready to take contacts again, they change their status back to **Available**. 

Supervisors can change an agent's status using the real-time metrics report.

For more information, see these topics: 
+ [Add a custom agent status to the Amazon Connect Contact Control Panel (CCP)](agent-custom.md)
+ [Agent status in the Contact Control Panel (CCP)](metrics-agent-status.md)
+ [Change the "Agent activity" status in a metrics report in the Contact Control Panel (CCP)](rtm-change-agent-activity-state.md)

## What happens during daylight saving time
Daylight saving time

Amazon Connect uses the timezone to determine whether daylight saving time is in effect for the queues, and **adjusts automatically** for all timezones that observe daylight saving time. When a contact comes in, Amazon Connect looks at the hours and timezone of your contact center to determine whether the contact can be routed to the given queue. 

**Important**  
Amazon Connect provides options for EST5EDT, PST8PDT, CST6CDT, and more. For example, EST5EDT is defined as:  
 [Eastern Standard Time (EST)](https://en.wikipedia.org/wiki/Eastern_Time_Zone) is used when observing standard time. It is five hours behind Coordinated Universal Time (UTC).  
 [Eastern Daylight Time (EDT)](https://en.wikipedia.org/wiki/Eastern_Time_Zone) is used when observing daylight saving time. It is four hours behind Coordinated Universal Time (UTC).  
We recommend researching your choice of timezone to ensure you understand it.

### Example
Example

1. A person initiates a call or chat with your contact center.

1. Amazon Connect looks at the hours of operation for your call center right now.
   + The contact is from timezone A.
   + Your call center's hours are 9 AM - 5 PM in timezone B. 
   + If the current time in timezone B is 2 PM then the call or chat is queued.
   + If the current time in timezone B is 7 AM then the call or chat is not queued.

## How flows leverage hours of operation


Flows can be configured to check whether a contact is within or outside the hours of operation defined by the block. The flow can then branch to follow a different path based on the results, for example, so a message plays after hours that offers a callback when operations resume. To learn more, go to [Check hours of operation](check-hours-of-operation.md).

# Identify dates where you need to override standard operating hours
Set overrides for extended, reduced, and holiday hours

You can override the standard operating hours for future dates where operations will be closed, have reduced hours, or will be open longer than normal.

**Note**  
Up to 50 overrides can be created for each hours of operation resource. This quota is not adjustable.

**Create an override**

1. Navigate to the **Routing** menu and open **Hours of operation**.

1. Open a record by selecting its name.

1. In the **Overrides** section, select **Create**.
**Note**  
If you have view-only permissions, you will not see this action.

1. Build your list of overrides by choosing between:

   1. **Add recurring event** — Use for holidays and other dates that follow a repeating pattern (e.g. early closure the last Friday of every month).

   1. **Create temporary hours** — Use for dates with non-standard hours that are not recurring and where the configured hours must supersede all other settings for that date/range.

   1. **Copy from another Hours of Operation** - Use when it is helpful to pull together overrides already configured on other records, but you want the option to make changes (for example, to remove certain dates).
**Note**  
Rather than setting up a list of dates and times directly, you can link to the overrides set up on a different Hours of operation resource. Use this approach if you wish to share a master list that is maintained in one place.

1. Follow the instructions on the window that opens.

1. Select **Apply** to commit your selected date(s) and hours.

1. Select **Save** at the top right of the hours of operation resource page.

![\[Hours of operations overrides table actions dropdown.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/hours-of-operations-overrides.png)


**Recurring events**  
If you choose recurring event:

1. Provide a meaningful **Name** for this override.

1. Select the **Effective dates** for this override.
**Note**  
These dates are used by Flows to determine if this override should be considered. If today's date falls before or after this range, the override will be ignored.

1. Indicate if operations are **Closed** or **Open**.

1. Choose the **Recurrence pattern**. Based on your selections, you will be able to provide additional details.

In this example, operations are closed on a specific date each year, no matter what day of the week it falls on:

![\[Dialog to add a recurring event for any day of the week.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/add-annual-recurring-hours-of-operation-override.png)


In this example, extended hours have been set up for every other week:

![\[Dialog to add a recurring event for every other week.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/add-daily-recurring-hours-of-operation-override.png)


**Temporary hours**  
If you choose temporary hours:

1. Provide a meaningful **Name** for this override.

1. Select the **Effective dates** for this override.
**Note**  
These dates are used by Flows to determine if this override should be considered. If today's date falls before or after this range, the override will be ignored.

1. Select the **Hours** for the specified date(s), that will replace the standard day of the week schedule.
**Note**  
Recurring open/closed overrides take precedence over temporary hours.

In this example, operations are only open every other day and for partial hours:

![\[Dialog to create temporary hours for every other day.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/create-temporary-hours-of-operations.png)


**Copy overrides**  
If you choose **Copy from another Hours of Operations**:

1. Find the parent resource and select it.

1. Next, click to **Save link**.

![\[Dialog to copy overrides from a different hours of operation.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/copy-hours-of-operation-overrides.png)


After copying a list, the override records are *distinct from their source*. They are unaffected by changes made to that original list (for example, if Labor Day changes from closed to a half day).

**Note**  
Copied overrides count towards the 50 override service quota.

**Note**  
If you want to instead rely on a global list and ensure your override dates and times are automatically kept in sync, then follow instructions for *linking* rather than copying.

**Link overrides**  
An alternative to setting up a list of overrides within an hours of operation record is to link to another resource that contains a master list. For example, you can set up a “parent” hours of operations to house a list of global corporate holidays, and another for regional blocked dates, and so on. Each “child” that is linked to a parent record inherits its overrides. As changes are made to the parent, the child automatically benefits without additional effort.

![\[Link overrides from a different hours of operation table.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/linked-hours-of-operations.png)


To create a link so overrides are inherited from another hours of operations:

1. Open a record and navigating to the **Linked hours of operations** section.

1. Select the button to **Add link**.  
![\[Dialog to link overrides from a different hours of operation.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/link-hours-of-operation-overrides.png)

1. Choose the link mode titled **Inherit**.

1. Search for the hours of operation that will provide the source override list.

1. Select the **Save link** button.

1. Repeat as needed.
**Note**  
Parent overrides do not count towards the 50 override service quota.
**Note**  
A child can link to up to 3 parents. This quota is not adjustable.
**Note**  
After an hours of operation record becomes a child, it cannot have children itself.

To create a link that shares overrides:

1. Open a record and navigating to the **Linked hours of operations** section.

1. Select the button to **Add link**.

1. Choose the link mode titled **Share**.

1. Search an hours of operation that you wish to provide overrides to.

1. Select the **Save link** button.

1. Repeat as needed.
**Note**  
The number of children that can reference the same parent is not limited. All of the hours of operations in the instance can share the same parent override list.
**Note**  
After an hours of operation record becomes a parent, it cannot have a parent itself.

The list of overrides in a linked list cannot be modified in any way from a child record. Changes can only be made from the parent record. If linkage is made in error, it can be removed.

If only a subset of users with permission to edit hours of operations should have access to a parent record, you can set up granular access control. For more information, see [Apply tag-based access control in Amazon Connect](tag-based-access-control.md).

**Dates with competing overrides**  
There may be times where the overrides on a given hours of operation resource conflict with each other. Connect prioritizes the various types as follows:

1. Closed recurring overrides are considered first.

1. Open recurring overrides are considered next.

1. Temporary hours are considered next.

1. Standard day-of-the-week hours are considered last.

In the following example, there are numerous competing configurations, but because the recurring closed hours cover the entire day, the other overrides and operating hours are ignored. The contact center is closed for the full day.

![\[Hours of operation override example to close for the day.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/hours-of-operation-overrides-example-1.png)


In a different example, the standard operating hours would normally not be open on a Sunday. However, this is a special exception, as the company prides itself on supporting its customers on one of the busiest shopping days of the year. In this case, the contact center is open from 10am - 10pm.

![\[Hours of operation override example to open on a normally closed day.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/hours-of-operation-overrides-example-2.png)


In a final example, the contact center opens at 8am, then closes from noon to 4pm, then reopens for two hours before closing at 8pm.

![\[Hours of operation override example with multiple override types.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/hours-of-operation-overrides-example-3.png)


**Note**  
Test any configuration that will impact your customers, to be sure they produce the desired results.

**View audit history for overrides**  
An audit history of overrides appears on the **Hours of operation** page, distinct from the standard hours of operations audit history. Each audit record refers to the ID of the related hours of operation record.

![\[Hours of operation overrides audit history table.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/hours-of-operation-overrides-audit-history.png)


**Note**  
AWS CloudTrail tracks the history of all resource changes. For more information, see Log Amazon Connect API calls with AWS CloudTrail.

# View calendar that illustrates effective hours of operation
View calendar that illustrates effective hours of operation

You can review operating hours and overrides together in a calendar. Select the **View in Calendar** button on the top of the detail page.

![\[Calendar view for effective hours of operation.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/hours-of-operation-calendar-view.png)


Choose day, week or month to see open and closed hours. Override names are provided where applicable.

# Create a routing profile in Amazon Connect to link queues to agents
Create a routing profile

This topic is for administrators and contact center managers. It explains how to create routing profiles using the Amazon Connect admin website. For the APIs used to create and manage routing profiles programmatically, see [APIs to create and manage routing profiles](#apis-routing-profiles). 

While queues are a 'waiting area' for contacts, a routing profile links queues to agents. When you create a routing profile, you specify: 
+ Channels: Which channels—voice, chat, task, and email—are routed to this group of agents; whether to allow channels concurrently.
+ Queues: Which queues are in the routing profile; whether one queue should be prioritized over another.

Each agent is assigned to one routing profile. For more information about routing profiles and queues, see [How Amazon Connect uses routing profiles](concepts-routing.md).

**How many routing profiles can I create?** To view your quota of **Routing profiles per instance**, open the Service Quotas console at [https://console.aws.amazon.com/servicequotas/](https://console.aws.amazon.com/servicequotas/).

**To create a routing profile**

1. On the navigation menu, choose **Users**, **Routing profiles**, **Add routing profile**.

1. In the **Routing Profile Details** section, in the **Name** box, enter a searchable display name. In the **Description** box, enter what the profile is used for. 

1. In the **Channel Settings** section, enter or choose the following information:    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/connect/latest/adminguide/routing-profiles.html)

1. In the **Queues** section, enter the following information:    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/connect/latest/adminguide/routing-profiles.html)

1. Optionally, add tags to identify, organize, search for, filter, and control who can access this routing profile. For more information, see [Add tags to resources in Amazon Connect](tagging.md).

1. Choose **Save**.

## Tips for setting up channels and concurrency

+ Use **Channel availability** to toggle on and off whether agents assigned to a profile get voice, chat, task, and email contacts.

  For example, there are 20 queues assigned to a profile. All of the queues are enabled for voice, chat, task, and email. By removing the **Voice** option at the routing profile level, you can stop all voice calls to these agents, across all queues in the profile. When you want to restart voice contacts for these agents again, select **Voice**. 
+ When using **Cross-channel concurrency**, Amazon Connect checks which contact to offer the agent as follows: 

  1. It checks what contacts/channels the agent is currently handling.

  1. Based on what channels they are currently handling, and the cross-channel configuration in the agent's routing profile, it determines whether the agent can be routed the next contact.

  1. Amazon Connect prioritizes the longest waiting contact if Priority and Delay are equal. Even though it's evaluating multiple channels at the same time, First-In First-Out is still respected.

  See [Example of how a contact is routed with cross-channel concurrency](#example-routing-concurrency).
+ For each queue in the profile, choose whether it's for voice, chat, task, email, or all channels. 
+ If you want a queue to handle voice, chat, task, and email but want to assign a different priority to each channel, add the queue twice. For example, in the following image, voice is priority 1 but chat, task, and email are priority 2.   
![\[Queue configuration showing two BasicQueue entries with different channel and priority settings.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-channels-and-concurrency-2.png)

## Example of how a contact is routed with cross-channel concurrency


For example, assume an agent is assigned to the routing profile that has the channel settings shown in the following image. They can be routed voice, chat, task, and email contacts. They can receive cross-channel contacts when on tasks. 

![\[The create routing profile page, channel settings section.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/routing-profile-cross-channel-concurrency.png)


The agent will experience the following routing behavior:

1. Assume the agent is fully idle. Next, the agent accepts a chat and begins working on it. Meanwhile, a task comes into queue.
   + Chat is set to **No other channels allowed**. 
   + So even though there is a task in queue, it will not be offered to this agent.

1. Next, there is a chat in queue.
   + The agent's maximum chat concurrency is 2, so they are routed another chat for total of 2 chats. The agent continues working on both of the chats.

1. There are no other chats in queue. The agent finishes both chats (closes ACW). 
   + There is still a task waiting in queue.
   + At this point, the task is offered to the agent because they are fully idle again. The agent begins working the task.

1. Another chat comes into queue.
   + Tasks is set to **Allow other channels concurrently**. So, even though the agent is already working on a task, they can still be offered the chat. 
   + The chat gets routed to the agent, who now works on both the 1 chat and 1 task concurrently.

1. Now there is a Voice call in queue.
   + The agent is still working on 1 chat and 1 task. 
   + Even though **Task** is set to **Allow other channels concurrently**, the agent is still working on 1 chat, and **Chat** is set to **No other channels while agent is on a Chat contact**. So, the voice call is not routed to the agent. The agent continues working on both the chat and the task.

1. The agent completes the chat, but still works on the task.
   + Now, because the only contact still assigned to the agent is a task, and **Tasks** are set to **Allow other channels concurrently**, this means that the agent can be offered the voice call. 
   + The agent picks up the voice call and is now working concurrently on both the voice call and the task. 

1. Now there is another task in queue.
   + The agent is currently working on a voice call AND a task. Once again, Amazon Connect checks the cross channel settings and Voice is set to **No other channels while agent is on a Voice contact**. 
   + Because the agent is working on a voice call, they cannot be offered any tasks until they are done with the voice call. 
   + Also, because **Task** is set to **Maximum contacts per agent** is 1, even after the agent handles the voice call, they still won't be offered the task until they finish their current task. 

## APIs to create and manage routing profiles
APIs to APIs to create and manage routing profiles

Use the following APIs to create and manage routing profiles programmatically:
+ [CreateRoutingProfile](https://docs.aws.amazon.com/connect/latest/APIReference/API_CreateRoutingProfile.html)
+ [DescribeRoutingProfile](https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribeRoutingProfile.html)
+ [UpdateRoutingProfileConcurrency](https://docs.aws.amazon.com/connect/latest/APIReference/API_UpdateRoutingProfileConcurrency.html)
+ [UpdateRoutingProfileQueues](https://docs.aws.amazon.com/connect/latest/APIReference/API_UpdateRoutingProfileQueues.html)
+ [UpdateRoutingProfileDefaultOutboundQueue](https://docs.aws.amazon.com/connect/latest/APIReference/API_UpdateRoutingProfileDefaultOutboundQueue.html)

# How Amazon Connect uses routing profiles
How Amazon Connect uses routing profiles

A routing profile determines what types of contacts an agent can receive and the routing priority. 
+ Each agent is assigned to one routing profile.
+ A routing profile can have multiple agents assigned to it.

![\[A graphic that shows a group of agents mapped to one routing profile.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/agents-routing-profile.png)


Amazon Connect uses routing profiles to allow you to manage your contact center at scale. To quickly change what a group of agents does, you only need to make an update in one place: the routing profile.

## Default routing profile: Basic routing profile


Amazon Connect includes a default routing profile named **Basic routing profile**. Along with the [default flows](contact-flow-default.md) and default queue (named **BasicQueue**), it powers your contact center so you don't need to do any customization. This is what enables you to get started quickly. 

## Routing Profiles Link Queues and Agents


When you create a routing profile, you specify: 
+ The channels the agents will support.
+ The queues of customers that the agents will handle. You can use a single queue to handle all incoming contacts, or you can set up multiple queues. Queues are linked to agents through a routing profile.
+ Priority and delay of the queues.

The following image shows a graphic of a group of agents mapped to a routing profile. The routing profile specifies multiple channels and queues for the agents.

![\[A graphic that shows a group of agents mapped to a routing profile.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/routing-profile-3.png)


# Delete a routing profile from an Amazon Connect instance
Delete a routing profile

There are three ways to delete a routing profile from your Amazon Connect instance: 
+ Amazon Connect admin website: On the left side menu, choose **Users**, **Routing profiles** and then select the delete icon.  
![\[The Routing profiles page, the Delete option.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/delete-routingprofile.png)
**Important**  
You cannot undo a deleted routing profile. 
+ [DeleteRoutingProfile](https://docs.aws.amazon.com/connect/latest/APIReference/API_DeleteRoutingProfile.html) API
+ [delete-routing-profile](https://docs.aws.amazon.com/cli/latest/reference/connect/delete-routing-profile.html) AWS CLI

# Set up queue-based, or skills-based, routing in Amazon Connect
Set up queue-based routing

Here's an overview of the steps to set up queue-based routing:

1. [Create the queues](create-queue.md), for example, one for each skill you want to use for routing.

1. [Create the routing profiles](routing-profiles.md):
   + Specify the channels supported by this routing profile.
   + Specify the queues: the channel, priority, and delay.

1. [Configure agent settings](configure-agents.md) to assign the routing profiles to them.

When you [create your flows](create-contact-flow.md), you'll add the queues to them. If a contact chooses to speak to an agent in Spanish, for example, they will be routed to the Spanish Reservations queue. 

For information about how routing works, and queue-based routing, see these topics:
+ [How routing works with multiple channels](about-routing.md#routing-profile-channels-works)
+ [Queue-based routing to route customers to a specific contact center agent](concepts-queue-based-routing.md)

# Set up routing in Amazon Connect based on agent proficiencies
Set up routing based on agent proficiencies

Following is an overview of the steps to set up routing based on agent proficiencies: 

1. [Create predefined attributes for routing contacts to agents](predefined-attributes.md)
   + You create the predefined attributes that you want to use to make a routing decision. In the next step, you can use predefined attributes individually, or you can combine them by using the `AND` or `OR` operators to form a routing step.

1. [Assign proficiencies to agents in your Amazon Connect instance](assign-proficiencies-to-agents.md)
   + You select predefined attributes and associate them with an agent. All available agents that meet a routing step requirement of a contact within the same queue will be considered for a match.

1. Set routing criteria
   + Use the [Set routing criteria](set-routing-criteria.md) flow block to set a routing criteria manually or dynamically.

1. Transfer to queue

   Use the [Transfer to queue](transfer-to-queue.md) flow block to transfer the contact to a queue. After the contact is transferred, Amazon Connect runs the routing criteria. 

![\[Proficiency routing 4 step chart.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/proficiency-routing-chart.png)


## Example of how to use agent proficiencies for routing
Example of how to use agent proficiencies for routing

Consider a scenario where a contact enters a queue **General Inbound Queue** and two agents, Agent1 and Agent2, are available. A customer who speaks French is seeking assistance regarding AWS DynamoDB. This is their second time calling regarding the same issue and you would prefer to match them with an expert in AWS DynamoDB. In order to preserve the customer experience, you want to implement the following routing requirements:
+ First look for an agent who is highly proficient in **French (>=4)** and an expert in **AWS DynamoDB (>=5)** for the first 30 seconds.
+ If an agent is not found at this time, look for an agent who is highly proficient in **French (>=3)** and highly proficient in **AWS DynamoDB (>=5)** for the next 30 seconds. The requirement for French is relaxed to further expand the pool of eligible agents to meet the requirement.
+ If no join is made at this point, look for an agent who is proficient in **French (>=3)** and highly proficient in **AWS DynamoDB (>=4)** and keep looking until an agent is found. Here the AWS DynamoDB requirement is relaxed to expand the pool of eligible agents who meet the requirement.
**Note**  
For regulatory or compliance use cases you can use the **Never Expire** option for the expiration timer to ensure any agent who is joined on the contact meets a minimum requirement.

**To route the contact to the above requirements, complete the following steps:**

1. **Create predefined attributes**: For example, add `Technology` as a predefined attribute in **User Management**, **Predefined Attributes** with `AWS DynamoDB` as one of the values.    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/connect/latest/adminguide/proficiency-routing.html)
**Note**  
**Connect:French** is already available as a value in system attribute **Connect:Language** as a predefined attribute. You can use this in your routing criteria. You can also add up to 128 customer languages as values to **Connect:Language**.

1. **Associate proficiencies to users**: There are 2 agents, Agent1 and Agent 2, who speak French and are proficient in AWS DynamoDB as shown below. In **User Management**, **Show Advanced Settings** associate the following proficiencies to the Agent1 and Agent2.    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/connect/latest/adminguide/proficiency-routing.html)

1. **Set routing criteria**: Use this flow block to create the following routing criteria manually or dynamically using JSON that is created by invoking a Lambda function as shown in a potential Inbound flow. Create the following routing criteria:

   1. Step 1: connect:Language(connect:French) >=4 **AND** Technology (AWS DynamoDB) >=5 **[30 seconds]**

   1. Step 2: connect:Language(connect:French) >=4 **AND** Technology (AWS DynamoDB) >=4 **[30 seconds]**

   1. Step 3: connect:Language(connect:French) >=3 **AND** Technology (AWS DynamoDB) >=4 **[Never expire]**

   The following image shows an example inbound flow that is configured for routing by agent proficiencies. This flow includes the following blocks: [AWS Lambda function](invoke-lambda-function-block.md), [Set routing criteria](set-routing-criteria.md), [Set working queue](set-working-queue.md), [Transfer to queue](transfer-to-queue.md), and [Disconnect / hang up](disconnect-hang-up.md).  
![\[A flow that is configured for routing by agent proficiencies.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/proficiency-routing-example-flow-block.png)

1. **Transfer to queue**: After the contact is transferred to the "General Inbound Queue," Amazon Connect immediately starts running the routing criteria. The following steps occur before the contact is joined to Agent1.

   1. **Routing Step 1**: For the first 30 seconds (no match) as neither agent has an AWS DynamoDB proficiency >= 5, Amazon Connect does not match with any agent.

   1. **Routing Step 2**: In the next 30 seconds (no match) as neither agent is both highly proficient (>=4) in both French and AWS DynamoDB

   1. **Routing Step 3**: As soon as the previous step expires, Amazon Connect finds the available agent, Agent1 (French 3, AWS DynamoDB 4) is proficient in French and highly proficient in AWS DynamoDB. Therefore, the contact is matched with Agent1.

There is a [one-click drill-down](one-click-drill-downs.md) in the real-time metrics for queues table which shows you a list of the routing steps in use for active contacts on the queue. You can find the definitions for the routing step specific metrics under [Metric definitions in Amazon Connect](metrics-definitions.md).

## Contact record, contact event stream, and agent event stream updates for agent proficiencies
Contact record, contact event stream, and agent event stream updates for agent proficiencies

Models have been added for proficiency routing in the following sections:
+ [Data model for Amazon Connect contact records](ctr-data-model.md)
+ [Agent event streams data model in Amazon Connect](agent-event-stream-model.md)
+ [Contact events data model](contact-events.md#contact-events-data-model)

## Frequently asked questions
Frequently asked questions
+  **Are queues still relevant?** 
  + Yes, queues are still necessary. The routing criteria is only activated when a contact is enqueued. Agent proficiencies provide additional control to target specific agents within a queue.
+  **When should we model something as a proficiency instead of modeling it as a queue?** 
  + This is a business decision. You should consider the impact on the number of queues you can eliminate and consolidate while using agent proficiencies. 
+  **Do agent proficiencies work across all channels?** 
  + Yes, routing using agent proficiencies works for all channels.
+  **How do I remove a routing criteria?** 
  + You can interrupt a routing criteria using a customer queue flow.
  + You can also update the routing criteria this way.
+  **How many times can I change a routing criteria on a queued contact?** 
  + You can change the routing criteria an unlimited number of times. However, only the latest 3 routing criteria updates are stored on the contact record. 
+  **With agent proficiencies, do queue priority and delay operate as usual?** 
  + Yes, queue priority and delay operate as they already do in a non-agent-proficiencies environment.
+  **Which operators are supported for creating a routing criteria?** 
  +  The following Boolean operators are supported:
    + AND
    + OR
  + The following comparison operators are supported:
    +  >= 
  + You can also define a range of minimum and maximum proficiency levels such as:
    + connect:English(1-3)
    + connect:Chat(4-4)
  + You cannot use the same attribute more than once in an expression. For example, connect:English(1-3) AND connect:English(5-5) are not allowed.
  + NOT (for exclusion) - You can use the NOT operator to exclude agents with certain proficiencies when routing such as:
    + NOT connect:French(1-5)
+  **Which characters can be used for predefined attributes?** 
  + The pattern for predefined attribute name and value is `^(?!(aws:|connect:))[\p{L}\p{Z}\p{N}_.:/=+-@']+$`. For example, it can contain any letter, numeric value, whitespace, or `_.:/=+-@'` special characters, but can't start with `aws:` or `connect:`.
+  **Can I add the same attribute multiple times in a routing criteria?** 
  +  Yes, you can the same attribute multiple times in a routing criteria. 
+  **When triggering a transfer (quick connect), is it possible to set the routing criteria?** 
  + You use the [Set routing criteria](set-routing-criteria.md) block in the transfer flow to set the routing criteria on the transferred contact segment. It is not possible to carry forward the routing criteria of previous contact to the new contact segment created after an agent has been joined.
+  **What happens to the routing criteria if a contact is being transferred queue to queue, before it was routed?** 
  + The routing criteria starts from the first step in the new queue in case a contact was transferred before being joined to an agent. For this, we carry-forward the routing criteria of previous contact to the new contact segment created due to queue transfer.
+  **Does the contact record have a snapshot of the proficiencies of the matched agent?** 
  +  No, the contact record does not carry the proficiencies of an agent. 
  +  The agent event stream does have a snapshot of the agent's proficiencies at the time of joining.
+  **Can we search for an agent by proficiency using APIs?** 
  +  No, this is not supported.
+  **What happens if we delete an attribute if it is on an active contact?** 
  + You can delete an attribute that is used on active contacts. However, any routing step with that attribute will not find a matching agent and the contact stays in the queue until the routing criteria expires.
  + All new contacts with that attribute start taking the error branch on the [Set routing criteria](set-routing-criteria.md) block in the flow.
+  **What happens to the routing criteria steps / expiration when an agent rejects a call?** 
  + Routing considers a join to be complete when an agent accepts the contact and a join is completed. When an agent rejects a contact, the routing engine continues to run through the routing criteria with the timer continually running.
+  **Will the agent who rejected the step be part of the pool when routing runs again?** 
  + Yes, the agent continues to be a part of the pool when routing runs again.
+  **Are historical metrics available?** 
  + No, historical metrics are not available in analytics.
  + The contact record, agent event stream, and contact event stream contain all the required information.
+  **Where can I find a sample Lambda function for setting routing criteria?** 
  + For a sample Lambda function for setting routing criteria, see [Sample Lambda function for setting routing criteria](set-routing-criteria.md#set-routing-criteria-sample-lambda-function). 
+  **What happens to the routing criteria set on a contact if the contact is being transferred to an agent queue?** 
  + The routing criteria has no effect on contacts present in an agent queue. If a contact with routing criteria is transferred from an agent queue to a standard queue, then the routing criteria is forwarded to the new contact segment created due to queue transfer.