2022-01-05

Check Queue is out of service in Amazon Connect

I want to talk about one issue with Amazon Connect. This is something that in my opinion Amazon should be fixing ASAP.

Scenario 1
1. Agent opened Amazon Connect Contact Control Panel (CCP) and changed their status to Available.
2. Agent closed CCP without changing status to Offline
3. Agent is still considered as Available so if you check the number of Staffed or Online agents for the queue this agent is still counted.
4. Agent would stay Available  until 
  • they are logged back in 
  • Supervisor manually changed their status
5. Since they are Available system might send a contact to them and after 20 seconds their status will change to Missed.


Scenario 2
1. Agent logged in to CCP and changed their status to Available
2. Agent fell asleep / went out to buy milk / ... and forgot to close CCP
3. Agent is still considered as Available so they would receive a call and after 20 seconds if it was not answered agent will be marked as Missed.
4. But again agent will be counted in the number of Staffed or Online agents forever.


It is very surprising that Amazon Connect does not have some sort of timeout value like in other contact center solutions. The system should be able to detect that agent left and change their status to logged out automatically after some time. It is not wise to always rely on agents to do the right thing.
What if it is the night shift and you have a very small amount of agents (maybe 1-2 agents) without any supervision?


Another issue that is directly related to the previous one - if in your flow you want to check if Queue is out of service (meaning that you have 0 agents logged in that could answer calls for the specific queue) - you cannot use the number of Staffed or Online agents to make this decision. You also cannot use Available agents, since Available agents show agents that are available right now to take calls, but if an agent is on the call, he is no longer available for the duration of the call but that does not mean that you should be excluding this agent from the total count of agents that are available to take calls during the shift.

Ok. Now what we can do about it?

1. Custom CCP application 
  
Create a custom CCP application that will automatically change agent status to Offline when they close CCP.
  • It requires custom development
  • Still, not a bulletproof solution as agents might simply close the browser or shut down their PC (or some technical problem)
  • The situation with missed calls is still not resolved
You can find a detailed solution in the official Amazon Connect documentation:

This would bring additional relief but still, you have to rely on agents to do the right thing. 

2. Custom formula to check if Queue is OOS

 Instead of using the number of Staffed agents use the following formula:

Potentially Available agents in Queue = Staffed agents - Agents in Error state
So, if this number is equal to 0  = Queue is Out of service.

An agent is considered to be in an Error state if they missed the call. So as you can see this formula covers both scenarios. 

Now, the question is how to add this formula to contact flows.
In order to do that we need to use Lambda function.

I created a sample Lambda function that is called checkQueue (using Python 3.9)

How it works:
1) In the contact flow you need to use Set working queue block as you would normally do before transferring call to queue.
2) After that you need to call lambda function checkQueue
3) This function would first read all the details about current call (queue id, instance id, channel).
4) Then it will use Amazon Connect API to get realtime metrics data about the queue - Staffed and Error agents.
5) It would calculate the difference and return back Queue Out of service status.
6) If it returned OOS = false - your Queue is in service and you can use transfer block to transfer call to queue 
7) If OOS = true - Queue is out of service and you can offer client some alternative treatment:
      • callback
      • voicemail
      • transfer call to cell phone/external number
      • transfer call to another queue
      • simply play message "Please call us later" and disconnect)


Source code of this function you can find on my GitHub:

How to use it:

1) In your flow first add Set working queue block
2) After that add Invoke AWS Lambda function checkQueue


 3) After that use Check contact attributes to verify the output of lambda function.

If External attribute OOS = true -  Queue is out of service, otherwise, it is in service.




4) If Queue is OOS you can offer an alternative treatment to the client (in my case I just play announcement and disconnect call)
5) If Queue is in service - you can transfer call to Queue.

Some additional ideas:
  • the same checkQueue function can be used while the call is already waiting in the queue. Just add it to your customer queue flow. This would allow you to check if Queue is OOS in a loop, for example, once every 2-3 minutes.  If during the time client is waiting for an agent you can catch the situation when Queue goes to OOS. Again that would allow you to offer the client alternative treatment instead of waiting in the queue forever.
  • you can advise management that Queue is now OOS by sending Email/SMS/Task notifications. You just need to add additional Lambda blocks in your flow. You can read how to send SMS/Email/Task from IVR flows in my blog articles:



No comments:

Post a Comment