Many countries try to use a hand band connected with a mobile to track quarantines. However, quarantines take off the hand band and leave the mobile at home, then they go out and potentially, infect others.

From Facebook

The healthy department calls them randomly and try to force them to stay home. However, to call ten thousand of quarantines is impossible! Therefore, we built a scalable AI call engine to call all quarantines to ensure they are all staying at home!

Also, due to COVID-19, although everyone needs to keep the distance from each other, we are still eager to know our friends' and families' health status and stay connected. However, that is difficult to keep tracking elderly or isolated people especially they are located in different cities or countries.

It is a tough situation for our institution when there is some critical and urgent announcement that needs to be provided to students (e.g. cancel class, all students please stay at home). Phone call is an effective way, but how can an educator make an urgent call to all students (e.g. 500 students)?

So we developed Callouts a simple and scalable way using Amazon Connect and Amazon Lex, to adapt to the recent quarantine in Hong Kong and the massive outbound call to all students.

How to enforce the quarantines to stay home?

Alt text

For those quarantines have a fixed-line phone at home, the system can call to their home randomly or on schedule to ask them a simple question to ensure they are at home.

For the case no fixed phone and uses a hand band or strap connected with GPS mobile phone i.e. Hong Kong, the system calls quarantines can ensure they cannot take off the hand band and leave the mobile phone at home and go to the street.

For the case with just smartphone, the workflow can send quarantines an SMS and call them to answer the content from SMS. They cannot leave the phone at home and go out.

For the case without smartphone, healthy departments have to set a fix low-cost phone at their home as giving a smartphone to them there are 2 main problems: they don’t know how to use it at all and some quarantines break the free smartphone shortly.

What it does

Callouts is an outbound call engine enables healthy department to call all quarantines immediately, in which consists of 3 parts :

  1. CalloutStateMachine: Keep track on the call whether successful or not

  2. Callout with Amazon Connect: To make individual call automatically

  3. Amazon Lex CalloutBot: To capture single word answer

Users only need to upload an excel file to the cloud or submit a JSON message to Amazon SQS, then all quarantines or students will receive a call immediately!

Quarantines have to answer the phone call with a simple answer, then the government can make sure they stay at home.

Ring up together Demo


Uploads an excel file to S3 Bucket and a class of students receive a call at the same time.


How We built it

Callouts is a solution build with a Serverless Application Model on AWS (Amazon Web Services), which saved a lot of resources. Below is the simplified system Architecture.

Simplified Architecture

When there is a user uploads an excel file (for a call task) into an Excel storage bucket, the excel file will then be converted into another data format (JSON message) and being queue up using an AWS queuing service SQS. Each item of the queue will work for an individual call job data and cached in another storage bucket. Finally, the calling tasking will be started by the CalloutStateMachine (it also keeps track of whether a call is successful or not), so that call task will be executed one by one using AWS Connect to make phone call.

And per each phone call, it is done by an Amazon Lex Chatbot. Just like the following conversation Demo video.

Conversation Demo


The call job proceeds with dynamic parallelism. For more information, see New – Step Functions Support for Dynamic Parallelism.

The step “Get Callout job” is a Lambda function to get the call job JSON from ExcelCallTaskBucket. The step “Callout with AWS Connect” sends the message to AsynCalloutQueue and waits for the callback with task token. For more information, see Call Amazon SQS with Step Functions.

“Calling out” contact flow contact flow

Although the contact flow may seem complicated, the logic is straightforward.

Calling out” architecture

The following diagram illustrates the “Calling out” architecture.

contact flowchart

Challenges We ran into

One of the most challenging parts is to create the workflow to keep track on which phone number is able to call or not, and all the process is being done in parallel to keep the callout process smooth and no one miss out, and at the end to have a report summarising the situation.

So the callout contact flow is quite complicated, then a number of cases happening at the same time.

Accomplishments that I'm proud of

Callouts is a simple solution for an organization to keep track of all quarantines or students in a consistent, and scalable way. This has been tested in our institution and we believe it will be applicable to either personal, caregivers and businesses.

What We learned

We gained a lot of experience in handling quite a number of callback cases. In which we have to use some cloud services which allow us to drag and drop different states and steps so that we can visualize the whole workflow. Instead of just looking at source codes, is difficult for our team to be on the same page.

What's next for Callouts

Due to the recent health quarantine in Hong Kong, for the people coming back from foreign countries need to conduct compulsory quarantine and wear electronic hand strap for 14 days to make sure they didn't go out.

Built With

  • amazon-connect
  • amazon-lex
  • serverless
Share this project: