Why are contacts waiting a long time in the queue in Amazon Connect?
I want to know why a contact isn't being routed to the appropriate queue or is waiting in the queue for a long time.
"I want to know why a contact isn't being routed to the appropriate queue or is waiting in the queue for a long time.Short descriptionThe following are the most common reasons why contacts aren't routing to agents or are waiting in the queue for a long time:Misconfigured routing profilePriority and delayAgents aren't accepting the contactsConsider the following example to understand how contacts can route to agents:In this example, a contact is placed in queue A in your contact center.If queue A is assigned to routing profile A, then the agents that are associated with that routing profile receive the contact.If none of the agents that are associated with routing profile A are in an available status, then the contact keeps waiting in the queue.If multiple agents are available, then the agent who is idle the longest receives the contact.If multiple contacts are available, then the contact that is waiting for the longest time is routed to an agent. However, if priority and delay are configured then the contact's position in queue can be changed to route to an agent sooner.ResolutionMisconfigured routing profileYou can verify the configuration of your routing profile using the AWS Command Line Interface (AWS CLI) or Amazon Connect instance.Note: If you receive errors when running AWS CLI commands, make sure that you’re using the most recent version of the AWS CLI.Using the AWS CLITo verify the configuration of your routing profile using AWS CLI, do the following:1.    Run the following command to list the routing profiles, and get the routing profile IDs.Note: Replace instance-id with your Amazon Connect instance ID and aws-region with the AWS Region that your instance is located in.aws connect list-routing-profiles --instance-id <instance-id> --region <aws-region>You receive an output similar to the following:{    "RoutingProfileSummaryList": [        {            "Id": "routing-profile-id",            "Arn": "Routing-Profile ARN",            "Name": "RoutingProfile"        }        ]        }2.    Run the following command to describe the routing profile, and then check if the channel is activated in the routing settings configuration.Note: Replace instance-id with your Amazon Connect instance ID and aws-region with the AWS Region your instance is located in. Replace profile-id with the routing profile Id identified in step 1.aws connect describe-routing-profile --instance-id <instance-id> --routing-profile-id <profile-id> --region <aws-region>You receive an output similar to the following:{"RoutingProfile": {        "InstanceId": "<instance-id>",        "Name": "Basic Routing Profile",        "RoutingProfileArn": "<routing-profile-arn>,        "RoutingProfileId": "<routing-profile-id>",        "Description": "A simple routing profile.",        "MediaConcurrencies": [            {                "Channel": "CHAT", //Channel activated in routing profile settings                "Concurrency": 2 //how many chat conversations that an agent can have simultaneously            },            {                "Channel": "TASK",                "Concurrency": 1            },            {                "Channel": "VOICE",                "Concurrency": 1            }        ],        "DefaultOutboundQueueId": "<outbound-queue-id>",        "Tags": {}    }}For an agent to have the contact routed, the routing profile for an agent must have the Channel activated in the routing profile settings. In the preceding example, the "CHAT" channel is activated.3.    Run the following command to list the queues associated to the routing profile:Note: Replace instance-id with your Amazon Connect instance ID and aws-region with the AWS Region your instance is located in. Replace profile-id with the routing profile Id identified in step 1.aws connect list-routing-profile-queues --instance-id <instance-id> --routing-profile-id <profile-id> --region <aws-region>You receive an output similar to the following:{    "RoutingProfileQueueConfigSummaryList": [        {            "QueueId": "queue-id",            "QueueArn": "queue-arn",            "QueueName": "QueueName",            "Priority": 1, // Priority set for the queue<            "Delay": 0, //Delay set for the Queue            "Channel": "CHAT" // Channel activated for the queue        }        ]        }Using the Amazon Connect instanceTo verify the configuration of your routing profile using Amazon Connect instance, do the following:Log in to your Amazon Connect instance using your access URL (https://alias.awsapps.com/connect/login -or- https://domain.my.connect.aws).Important: You must log in as a user that has sufficient permissions required to view historical metrics reports.In the navigation menu, choose User, and then choose Routing profiles.Choose the Routing profile that is configured for the agent.ForSet channels and concurrency, review theChannels that are turned on. For example, check if the channel forChat is turned on.ForQueues, verify that the queue and its channel are turned on. You can also see thePriority andDelay (seconds) for the queue.For an agent to have a contact routed, the queue must be associated to the routing profile with the channel activated.Both the queue and associated routing profile must be configured for an agent's routing profile to get the contacts for the queue. If the routing profiles are correct but contacts are waiting in the queue, then review for priority and delay settings.Priority and delayThe flow block for change routing priority / age can change a contact's position in queue. If a contact's queue position is changed, then that might contribute to them waiting in the queue for a long time.To check if a contact's position in queue is changed, do the following:Activate flow logging for your instance to track the contact block Change routing priority / age.Search the flow logs to locate the log event for the contact that you want to review.Review the log entry to check if the contact's AbsolutePosition (priority) or TimeOffset (age) is changed**.**The following is an example log with the contact's priority set to 5:{    "ContactId": "<contact-id>",    "ContactFlowId": "contact-flow-id",    "ContactFlowName": "chat",    "ContactFlowModuleType": "UpdateRoutingPriority",    "Timestamp": "2022-12-20T14:02:49.898Z",    "Parameters": {        "AbsolutePosition": "5" //Priority Set    }}For example, if contact A's priority is set to 5 and contact B's priority is set to 1, then contact B is routed earlier. This example situation can happen even when contact A's call is received first. The AbsolutePosition can raise the priority of a contact, compared to other contacts in the queue, by using a higher priority, such as 1.The following is an example log with the contact's age set to add one minute:{    "ContactId": "<contact-id>",    "ContactFlowId": "contact-flow-id",    "ContactFlowName": "chat",    "ContactFlowModuleType": "UpdateRoutingPriority",    "Timestamp": "2022-12-20T14:14:13.794Z",    "Parameters": {        "TimeOffset": "60" //+ve age set in seconds, if -ve the value would be -60    }}For example, if a contact has a TimeOffset of 60, then that contact is routed earlier than calls in the same queue. This includes calls that are received in the same minute time frame.The TimeOffset adds or subtracts seconds or minutes from the amount of time that the current contact spends in queue. Contacts are routed to agents on a first-come, first-served basis. Changing a contact's amount of time in queue changes their position in queue when compared to other contacts in the same queue.For additional information on how priority and delay work together, see Queues: priority and delay.Agents aren't accepting the contactsUse the following methods to verify if agents are missing contacts for active or completed contacts:Active contactsFirst, review the Real Time metrics to see how many agents are available using the agent activity Available metric and Agent non-response metric. If Agent non-response is high, then this means that the missed contacts by the agents are high. However, be aware that contacts abandoned by the customer are also included in this metric.Then, review the agent activity audit report to analyze if the agent was routed a contact and if it was missed. When the agent is offered the contact, a Joining Customer status is present in the agent audit report. If the agent misses the contact, then a Contact Missed status is present.Completed contactsFirst, check the contact records for the contact and review the queue information to see the value of AgentConnectionAttempts. The AgentConnectionAttempts provides the number of times that the contact is routed to agents.Note: AgentConnectionAttempts doesn't refer to the number of agents. It refers to only the number of times the contact was routed to an agent. For example, if there are only two agents available and they collectively missed the contact 10 times, then the AgentConnectionAttempts is 10.Then, to check which agents the contact is routed to, review the agent activity audit report for the contact ID that was missed. When the agent is offered the contact, a Joining Customer status is present in the agent audit report. If the agent misses the contact, then a Contact Missed status is present.Follow"