Tasks as alternative to Callback in Amazon Connect

Amazon Connect has a built-in ability to add Callback option in IVR.
But unfortunately, it lacks some features that might be required for some users such as:
* Once callback is sent to queue - it cannot be removed. It will stay in the queue for 7 days until answered by agent or will be deleted by the system after 14 days
UPDATE (2022-04-23): You can now do it using  Amazon Connect API - StopContact action.
* Not possible to show additional information about callback if you use out of the box CCP
(can be added in Custom CCP)
* Not possible to schedule callback at a later time  (out of the box)

A not long time ago Amazon Connect introduced Tasks as an additional channel in contact center.
It is possible to add Callback using Tasks. 

How does it work:

1. First we will ask client to enter callback number
2. Instead of using block to send call to callback queue we can add Create task block
3. We will add callback number as one of the attributes in Create task block
4. We can use built-in features of Create task block to either send it to queue right away or schedule it for later.  Scheduled time can be based on selection made by client.
5. We can also add additional attributes to Create task block. In my example, I ask client to enter an account number and then I will add this attribute so that agent would be able to see this information.
6. When Callback comes to an agent they would see the following information:

7. Agent can click on phone number and it will initiate an outbound call to client.


Here is more detailed comparison of standard callback vs Callback using Tasks:

Functionality Standard
Manually remove callback from queue UPDATE (2022-04-23): 
Yes, can be removed from the queue using Amazon Connect API (StopContact action)
Yes, can be removed from the queue using Amazon Connect API (StopContact action)

Outbound call initiation

Outbound call automatically starts when an agent answers callback.

An agent has to click on the phone number to initiate an outbound call.
Possibility to show additional attributes in CCP. Not possible directly in CCP. Can be added in custom CCP. Yes. Possible out of the box.
Ability to schedule callback at a later time Not possible out of the box. Yes. Possible out of the box.

Multiple retries
Yes, it is possible to specify the number of retries and time between attempts. Not possible out of the box.
An agent can manually schedule the next attempt by creating a task in CCP interface. 
Different priority for callback Only possible if you use a separate queue for callbacks. Yes. It is possible since Task is a separate channel.
Different SLA for callback Only possible if you use a separate queue for callbacks. Yes. It is possible since Task is a separate channel.

Here is an example of contact flow that uses Tasks to enable Callback option.

1) First I ask client to enter account number and store it to attribute account_number
2) After that I ask client to enter phone number (10 digits) and save it to attribute callback_number
3) After that I create task and add callback_number & account_number as attributes.


Amazon Connect new features

 Amazon Connect having a blast this April.

They released multiple nice features. Some of them are really desired by many clients.

Full list is here:


What's new:

  • Play prompts from an Amazon S3 bucket
You can finally specify a path to prompt file. No need to create prompts and load them into Amazon Connect. That makes it easier to manage prompts. 
I have several articles about ability to disable/enable certain prompts in the IVR (Emergency Messages).
With this new functionality of Amazon Connect I can make it more flexible and use prompts directly from S3 bucket.

  • CloudTrail support for queues and routing profiles
Now Amazon Connect allows to track all the changes made for users, queues and routing profiles. System allows to track who did the change, when, and what was changed. Super important to keep track of all the changes in contact center.

  • Multi-party calls
Agent can now have multi-party call for up to 6 participants (before it was only up to 3 participants).


Configure internal extension for IVR in Genesys Cloud

Imagine that you need to setup an internal extension that will point to IVR flow.

The official documentation is not clear on this topic and it may seem that this is not supported.

I found a method that allows me to achieve it.


Let's say that in your dialplan you want to have a range of internal extensions that will be used to send calls to different IVR flows.

For example: 6XXX.

Step 1.

Go to configuration of the Site where your user phones are.

Click Edit Site and open Number Plans page

Step 2.

Add a new Number Plan and configure it this way:

  • Number Plan Name:  Internal  (or name it the way you like)
  • Match Type: Regular Expression
  • Match Expression: ^(6\d{3})$
  • Normalized Number Expression: sip:$1@localhost
  • Classification: Internal (or use default one Extension)
      • to create a new classification - just type new name instead of selecting existing

Regular expression ^(6\d{3})$ - means a number that starts with 6 and has 3 digits after, so exactly what we need 6XXX.

Move it in the list so that it is somewhere at the top, let's say after Emergency but before Extension.

Step 3.

Now we will add new call route:


  • Name: 6001 - this is your internal extension
  • Regular routing - All Calls  --  TestFlow01   (name of your IVR flow)  

You can add additional routes the same way (for example 6002, 6003, etc...)

Step 4.

The last step - let's test it.

In dialpad enter 6001. You should hear your IVR flow.


You might ask - how does it work?

Well, maybe it is documented somewhere (but I did not find it). But I found out that Genesys Cloud allows you to dial the following entities by name:

  • Call Flow
  • Call Route
  • Queue

You can test it yourself.

In dialpad enter the name of your call flow or enter the name of any call route. Even if it contains characters Genesys Cloud will allow you to dial it. 


Exporting data from Interaction Administrator (Genesys PureConnect)

 Sometimes you need to export configuration data from Genesys PureConnect.

There are multiple ways to do that. Here are some of them:

1) use DSEditU utility (or directly use Regedit) on CIC server.

Most of the configuration items are stored in Windows Registry and can be viewed/exported using DSEditU.

After you export it you can parse it using scripts.

2) Using custom handlers.

There are several system tools available in Interaction Designer that allows you to export data


  • Get DS Attr
  • Get DS Attrs
  • Get DS Keys
  • Get DS Parameter
Directory Services (DS) is exactly the same Windows Registry where PureConnect CIC server keeps most of the configuration.

3) Use ICWS or ICE Lib API

Limitation: Both ICWS and ICE Lib API do not allow you to export Stations/Managed IP Phones information.

4) Custom tools/custom scripts

In the past, I created an article about 2 tools that were created by Genesys employees.
Both are using ICWS API and can help you with data export/bulk updates etc...
  • https://github.com/GenesysPureConnect/cli - Command line tool that allows interacting with CIC
  • https://github.com/gildas/posh-ic - Collection of PowerShell scripts to interact with CIC
Limitation: Both ICWS and ICE Lib API do not allow you to export Stations/Managed IP Phones information.

5) IA_Export script 

I developed my own PowerShell script that allows to export data from Interaction Administrator.
It uses WinAPI to grab data from SysListViews of Interaction Administrator.

You can download it from my GitHub:

How to use it:
1. Download PowerShell script IA_Export.ps1
2. Download ManagedWinapi.dll from http://mwinapi.sourceforge.net/
3. Place ManagedWinapi.dll and the script in the same directory
4. Open PowerShell (x86)
5. Open Interaction Administrator and select one of the views that you want to export.
For example "Managed IP Phones"
6. Run the script 
.\IA_Export.ps1 "Managed IP Phones"
7. It will start exporting data to CSV file in the same directory where your PowerShell script is located.

  • This script exports data exactly as you see it in Interaction Administrator. For example, if you applied a filter or sorted it - it will export only data that you see, exactly as you see it.
  • Make sure that you run it in PowerShell (x86)
  • Make sure that your Interaction Administrator is open and you selected the view that you want to export. Otherwise, it will not work.
  • Full list of commands that you can use:
      • .\IA_Export.ps1 "Managed IP Phones"
      • .\IA_Export.ps1 "Stations"
      • .\IA_Export.ps1 "Users"
      • .\IA_Export.ps1 "Structured Parameters"
      • .\IA_Export.ps1 "Roles"
      • .\IA_Export.ps1 "Workgroups"
      • .\IA_Export.ps1 "Schedules"
      • .\IA_Export.ps1 "Queue Columns"
      • .\IA_Export.ps1 "Client Buttons"
      • .\IA_Export.ps1 "Tables"
      • .\IA_Export.ps1 "Status Messages"
      • .\IA_Export.ps1 "Web Services Parameters"
      • .\IA_Export.ps1 "Licenses Allocation"



Estimated Wait Time for Chat in Amazon Connect

 Some time ago I presented a method of calculating Estimated Wait Time (EWT) using Lambda function that in turn uses Amazon Connect API to get this info.

The same function can be also used to calculate EWT for chats and then you can display EWT to clients.

Step 1.

Add the same Lambda function getEWT that I mentioned in my previous article.

Step 2.

Now we can add this Lambda function to the contact flow used by chat.

1) Add Set Working Queue block

2) Add Set contact attributes block with UserDefined attribute statInterval that allows you to provide a statistical interval for which we will calculate estimated wait time.

In my case, I use 15 minutes.

3) Now invoke lambda function getEWT

4) After that we need to get the result of it by using Check contact attributes block. It will be in External attribute EWT.

5) Based on the value of EWT you can show different messages using Play prompt blocks.

Here is complete flow:


Troubleshooting flows in Amazon Connect

 I would like to share several methods that I use to troubleshoot contact flows in Amazon Connect.

1) Enable Amazon CloudWatch Logs

Official Amazon Connect documentation explains how to enable CloudWatch logs for Amazon Connect.


IMPORTANT - By default logs will not be collected. You have to manually enable logs for each contact flow or module.

2) Contact search


Contact search is the built-in interface of Amazon Connect that allows searching for contacts.
Contact search only shows contacts that were answered by an agent.
Contacts appear in the contact search several minutes after the call was disconnected.

What could be helpful for troubleshooting - when you use Set contact attributes block in your flow - this information will be also available in the Contact search. 


And in Contact search:

3) Lambda Logger function 

Another method that I use for troubleshooting is a very simple custom made Lambda function - logger (written in Python 3.9)

Source code on my GitHub:

It is very simple:

1) You add Invoke AWS Lambda function block anywhere in your contact flow.  This block will execute logger function.

You can place this block as many times as you need in all the places of your flow that you want to troubleshoot/debug.

2) Optionally you can add any number of input parameters that you would like to be added to the log for debugging.


3) Then you make a test call.

4) Now you can go to CloudWatch  and see logs generated by this function:

5) As you can see in my example in the log you can see all the contact details including the input parameter that you entered previously.

This function can be helpful when you want to see all the contact details at a certain place of your contact flow.


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:


Export users and queues to CSV-file in Amazon Connect

I created 2 simple Lambda functions that allow exporting users and queues to CSV files.

1. Export users to CSV

How it works:

  • Uses Amazon Connect API to fetch all available information about users
  • Saves it in CSV format
  • Uploads CSV to S3 bucket

Here is the source code of my Lambda function (using Python 3.9)

Before running this script you need to edit the following values:

#Amazon Connect InstanceID 


 #csv-file name 


 #S3 bucket name 



Here is output format:

  • id  - id of user
  • username - username
  • firstname
  • lastname
  • email
  • phonetype  -  phone type SOFT_PHONE / DESK_PHONE
  • autoaccept - auto answer True/False
  • acw_timeout - after call work timeout
  • desk_number - phone number for Deskphone
  • security_profiles - list of security profiles, example = Agent|QualityAnalyst|CallCenterManager
  • hierarchy_group_name - agent hierarchy
  • routing_profile_name - routing profile
  • routing_profile_concurrency - concurrency configuration for routing profile - using following format CHAT|TASK|VOICE  (example - 4|10|1)
  • routing_profile_outbound_queue_name - default outbound queue for routing profile
  • routing_profile_details_list  - detailed configuration of routing profile in the following format:
    • QueueName1|Priority1|Delay1|Channel_type1,...QueueNameN|PriorityN|DelayN|Channel_typeN
    • Example:Tech_support|1|0|VOICE;BasicQueue|1|0|CHAT;BasicQueue|1|0|TASK;BasicQueue|1|0|VOICE

You can run it from Lambda or from AWS CLI. 

  • aws lambda invoke --function-name exportUsersToCSV --invocation-type Event return.json

2. Export queues to CSV

How it works:

  • Uses Amazon Connect API to fetch all available information about queues
  • Saves it in CSV format
  • Uploads CSV to S3 bucket

Here is the source code of my Lambda function (using Python 3.9)

Before running this script you need to edit the following values:

#Amazon Connect InstanceID 


 #csv-file name 


 #S3 bucket name 



Here is the output format:

  • id  - queue id
  • name - queue name
  • desc - queue description
  • status - queue status ENABLED/DISABLED
  • hours - hours of operation
  • ob_callerid_name - Outbound caller ID name
  • ob_phonenumber - Outbound caller ID number
  • ob_flow - Outbound whisper flow (optional)

You can run it from Lambda or from AWS CLI. 

  • aws lambda invoke --function-name exportQueuesToCSV --invocation-type Event return.json