Out of the box Amazon Connect allows you to play the following information:
- Number of contacts waiting in the queue
- How much time oldest contact waiting in the queue
- Various information about how many agents are available, busy, etc...
What if you want to play Estimated Wait Time (also called Average wait time or Expected wait time in different contact center solutions)?
What it does?
1) It takes the following attributes from the call
- statInterval - allows to define time interval that we will use to calculate Estimated Wait Time. It could be last 15 minutes or longer depending on your requirements. If statInterval attribute is missing my function will use 15 minutes as the default value.
- channel - this parameter identifies the type of contact (Calls, Chat, Tasks) - if your Queue allows receiving different types of contacts normally you would want to have separate Estimated Wait Time for different types of contacts.
- queueARN - this is identificator of the queue. We need to get the last 36 characters of it to get queueID- we need this parameter to be able to get real-time stats for the queue.
- InstanceARN - ARN of your Amazon Connect instance. We need it to get InstanceId of your Amazon Connect instance which is required to use Amazon Connect API function
3) I get a metric called QUEUE_ANSWER_TIME - the average time that contacts wait in the queue before being answered by an agent. I use this metric as equivalent for Estimated Wait Time.
Now you can use this Lambda function in your Customer queue flows (flow that is used when a call is waiting in queue).
1) At first you need to assign the required statistical interval to user-defined attribute statInterval using "Set contact attributes" block.
In my example, I use 15 minutes intervals.
2) After that you can invoke getEWT function
3) It will return the external attribute EWT that contains the estimated wait time value in seconds.
Based on the returned value you can play different messages to clients or make decisions of what to do with the call.
Here is a sample call flow that I use:
Step 3.
You can also use this function in inbound contact flows or modules.
How to do it:
1) Use Set contact attributes block to define statInterval
2) Use Set working queue block to define Queue
3) Now you can use Invoke AWS Lambda function to call getEWT function
4) Use Check contact attribute to check external attribute EWT


