

# Sample flows in Amazon Connect
Sample flows

Amazon Connect includes a set of sample flows that show you how to perform common functions. They are designed to help you learn how to create your own flows that work in a similar way. For example, if you want to add a queued callback flow to your call center, take a look at the [Sample queued callback flow in Amazon Connect](sample-queued-callback.md) flow.

**To explore how the sample flows work**

1. Claim a number if you haven't already: go to **Channels**, **Phone numbers**, **Claim a number**.

1. Choose the **DID** tab, then choose a number.

1. In **Flow / IVR** use the drop down to choose the sample flow you want to try. Click **Save**.

1. Call the number. The sample flow that you selected starts. 

   We recommend opening the sample flow in the flow designer and following along to see how it works while you're experiencing it.

**To open a sample flow in the flow designer**

1. In Amazon Connect choose **Routing**, **Flows**. 

1. On the **Flows** page, scroll down to the flows with names that start with **Sample**. 

1. Choose the flow you want to view.

The topics in this section describe how each of the sample flows work.

**Topics**
+ [Sample inbound flow](sample-inbound-flow.md)
+ [

# Sample flow in Amazon Connect for A/B contact distribution testing
](sample-ab-test.md)
+ [

# Sample customer queue priority flow in Amazon Connect
](sample-customer-queue-priority.md)
+ [

# Sample disconnect flow in Amazon Connect
](sample-disconnect.md)
+ [

# Sample queue configurations flow in Amazon Connect
](sample-queue-configurations.md)
+ [

# Sample queue customer flow in Amazon Connect
](sample-queue-customer.md)
+ [

# Sample queued callback flow in Amazon Connect
](sample-queued-callback.md)
+ [

# Sample interruptible queue flow with callback in Amazon Connect
](sample-interruptible-queue.md)
+ [

# Sample Lambda integration flow in Amazon Connect
](sample-lambda-integration.md)
+ [

# Sample recording behavior in Amazon Connect
](sample-recording-behavior.md)
+ [

# Sample Screenpop flow in Amazon Connect
](sample-note-for-screenpop.md)
+ [

# Sample secure customer data entry input in a call with a contact center agent
](sample-secure-input-with-agent.md)
+ [

# Sample secure customer data entry input in a call with no contact center agent
](sample-secure-input-with-noagent.md)

# Sample inbound flow in Amazon Connect for the first contact experience
Sample inbound flow

**Note**  
This topic explains a sample flow that is included with Amazon Connect. For information about locating the sample flows in your instance, see [Sample flows in Amazon Connect](contact-flow-samples.md). 

Type: Flow (inbound)

This sample flow is automatically assigned to the phone number that you claimed when you first set up flows. For more information, see [Get started](amazon-connect-get-started.md). 

It uses the [Check contact attributes](check-contact-attributes.md) block to determine if the contact is contacting you by phone or chat, or if it is a task, and to route them accordingly.
+ If the channel is chat or task, the contact is transferred to the [Sample queue configurations flow in Amazon Connect](sample-queue-configurations.md).
+ If the channel is voice, then based on user input the contact is either transferred to the other sample flows or a sample follow-up agent task is created for this contact. 

The following image shows the sample inbound flow. We recommend viewing the flow in the flow designer so you can see the details.

![\[The sample inbound flow.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/sample-inbound-flow.png)


# Sample flow in Amazon Connect for A/B contact distribution testing


**Note**  
This topic explains a sample flow that is included with Amazon Connect. For information about locating the sample flows in your instance, see [Sample flows in Amazon Connect](contact-flow-samples.md). 

Type: Flow (inbound)

This flow shows how to perform an A/B call distribution based on a percentage. Here's how it works: 

1. The **Play prompt** block uses Amazon Polly, the text-to-speech service, to say "Amazon Connect will now simulate rolling dice by using the Distribute randomly block. Now rolling."

1. The contact reaches the **Distribute by percentage** block, which routes the customer randomly based on a percentage.

   **Distribute by percentage** simulates a dice roll, resulting in a values between 2 to 12 with different percentages. For example, there is 3 percent chance for the "2" option, 6 percent chance for the "3" option, and so on. 

1. After the contact gets routed, the **Play prompt** tells the customer which number the dice rolled.

1. At the end of the sample, the **Transfer to flow** block transfers the customer back to the [Sample inbound flow](sample-inbound-flow.md).

# Sample customer queue priority flow in Amazon Connect


**Note**  
This sample flow is available in previous Amazon Connect instances. In new instances, you can see this functionality in [Sample queue configurations flow in Amazon Connect](sample-queue-configurations.md). 

Type: Flow (inbound)

By default the priority for new contacts is 5. Lower values raise the priority of the contact. For example, a contact assigned a priority of 1 is routed first.

This sample shows how you can use the **Change routing priority/age block** to raise or lower the priority of a contact in a queue. Using this block, there are two ways you can raise or lower a customer's priority: 
+ Assign them a new priority value, such as 1, to raise their priority.
+ Or, increase the routing age of the contact. Customers who are queued longer are routed first, when all contacts have the same queue priority value (such as 5).

## Option 1: Raise the priority

+ The **Get Customer Input** block prompts the customer to press 1 to move to the front of the queue. This block gets the customer's input; it doesn't actually change the customer's priority. 
+ If the customer presses 1, they go down the "Pressed 1" branch, which takes them to the **Change routing priority/age block**. This block changes their priority in the queue to 1, which is the highest priority. 

## Option 2: Change the routing age

+ The **Get Customer Input** block prompts the customer to press 2 to move behind existing contacts already in queue. This block gets the customer's input; it doesn't actually change the customer's priority. 
+ If the customer presses 2, they go down the "Pressed 2" branch, which takes them to a different **Change routing priority/age** block. This block increases their routing age by 10 minutes. This has the effect of moving them ahead of others in the queue who have been waiting longer.

# Sample disconnect flow in Amazon Connect


**Note**  
This topic explains a sample flow that is included with Amazon Connect. For information about locating the sample flows in your instance, see [Sample flows in Amazon Connect](contact-flow-samples.md). 

Type: Flow (inbound)

This sample works with voice, chat, and task contacts.

**Chat contacts**

1. The **Play prompt** block shows a text message that the agent has disconnected.

1. A **Wait** block sets the timeout period for 15 minutes. If the customer returns in 15 minutes, the customer is transferred to a queue to chat with another agent. 

1. If the customer doesn't return, the timer expires and the chat disconnects. 

**Voice contacts**

1. Sets a user-defined attribute, DisconnectFlowRun. If it = Y, disconnect.

1. Gets customer input, whether they were happy with service.

1. Terminates flow.

**Task contacts**

1. Checks contact attributes, whether Agent ARN = NULL.

1. Transfers to agent's queue.

1. If at capacity, disconnects.

For a list and description of all the disconnect reasons, see **DisconnectReason** in the [ContactTraceRecord](ctr-data-model.md#ctr-ContactTraceRecord). 

# Sample queue configurations flow in Amazon Connect


**Note**  
This topic explains a sample flow that is included with Amazon Connect. For information about locating the sample flows in your instance, see [Sample flows in Amazon Connect](contact-flow-samples.md). 

Type: Flow (inbound)

This flow shows different ways you can put a customer in queue: you can change the priority of the customer, determine the wait time in queue, and give them an option for a callback. Here's how it works: 

1. The customer is put in the BasicQueue.

1. After that, the **Default customer queue** flow is invoked. This block runs a **Loop prompts** block that plays the following: 

   *Thank you for calling. Your call is very important to us and will be answered in the order it was received.*

1. The hours of operation are checked with a **Check hours of operation** block.

1. The channel is checked with a **Check contact attributes** block:
   + If chat, we check the time in queue. If it's less than 5 minutes, the customer is placed in queue for an agent. If it's more, we check the channel again and if it's chat, put the customer in queue for an agent. 
   + If voice, the customer is routed down the **No Match** branch, to a **Play prompt** block and then to a **Get customer input** block. 

     In the **Get customer input** block, we give the customer the option to press 1 to move to the front of the queue or 2 to move to the end of the queue. 

     The two **Change routing priority / age** blocks move the customer to the front or back of the queue.

     The following image of the sample flow shows this page highlighted:  
![\[The No match path in the sample queue configurations flow.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/sample-queue-configurations-priority.png)

1. Next we use a **Check queue status** block to check whether the time in queue is less than 300 seconds. 

1. We use a **Play prompt** block to tell the customer the results. 

1. We use a **Check contact attributes** block again to check the customer's channel: chat or voice/No Match. 

These next steps apply to customers who were routed down the voice/**No Match** branch, as shown in the following image:

![\[The No match path in the sample queue configurations flow.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/sample-queue-configurations.png)


1. In the **Get customer input** block, we prompt customers to *Press 1 to go into queue or 2 to enter a callback number.* 

1. If customers press 2, they are routed down the **Pressed 2** branch to the **Store customer input** block.

1. The **Store customer input** block prompts the customer for their phone number.

1. The customer's phone number is stored in the **Stored customer input attribute**, by the **Set callback number** block.

1. We use a **[Transfer to queue](transfer-to-queue.md)** block to put the customer in a callback queue. 

1. The **[Transfer to queue](transfer-to-queue.md)** block is configured so Amazon Connect waits 5 seconds between the time the callback contact is initiated and the contact is enqueued, where it sits until it is offered to an available agent. 

   If the initial callback doesn't reach the customer, Amazon Connect will attempt 1 callback. If it were configured for 2 attempted callbacks, it would wait 10 minutes between each one. 

   Also, no special callback queue is specified. Rather, customers are in the BasicQueue, which was set at the beginning of the flow.   
![\[The transfer to callback queue tab, minimum time between attempts is 10 minutes.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/sample-queue-configurations-transfer-to-queue-block.png)

For information about queued callbacks, see the following topics:
+ [Set up queued callback by creating flows, queues, and routing profiles in Amazon Connect](setup-queued-cb.md) 
+ [Flow block in Amazon Connect: Transfer to queue](transfer-to-queue.md) 
+ [Queued callbacks in real-time metrics in Amazon Connect](about-queued-callbacks.md) 

# Sample queue customer flow in Amazon Connect


**Note**  
This topic explains a sample flow that is included with Amazon Connect. For information about locating the sample flows in your instance, see [Sample flows in Amazon Connect](contact-flow-samples.md). 

Type: Flow (inbound)

This flow performs checks before placing customer into a queue. Here's how it works:

1. The **Set working queue** block determines which queue to transfer the customer to.

1. The **Check hours of operation** block perform checks to avoid the customer being queued during non-working hours.

1. The customer is transferred to the queue if it is within business hours, and the queue can handle this call. Otherwise, the customer is played a message "We are not able to take your call right now. Goodbye." And then the customer is disconnected.

# Sample queued callback flow in Amazon Connect


**Note**  
This sample flow is available in previous Amazon Connect instances. In new instances, you can see examples of queued callback in [Sample interruptible queue flow with callback in Amazon Connect](sample-interruptible-queue.md) and [Sample queue configurations flow in Amazon Connect](sample-queue-configurations.md).

Type: Flow (inbound)

This flow provides callback queue logic. Here's how it works: 

1. After a voice prompt, a working queue is selected and its queue status is checked.

1. A voice prompt tells the customer if the wait time for the selected queue is longer than 5 minutes. Customers are offered a choice to wait in the queue or to be placed into a callback queue. 

1. If the customer decides to wait in the queue, the **Set customer queue flow** block places them in a queue flow that provides a callback option. That is, it places them in **Sample interruptible queue flow with callback**. 

1. If the customer chooses to be placed into a callback queue, their number is stored in the **Store customer input** block. Then their callback number is set, and they are transferred to the callback queue.

For information about queued callbacks, see the following topics:
+ [Set up queued callback by creating flows, queues, and routing profiles in Amazon Connect](setup-queued-cb.md) 
+ [Flow block in Amazon Connect: Transfer to queue](transfer-to-queue.md) 
+ [Queued callbacks in real-time metrics in Amazon Connect](about-queued-callbacks.md) 

# Sample interruptible queue flow with callback in Amazon Connect


**Note**  
This topic explains a sample flow that is included with Amazon Connect. For information about locating the sample flows in your instance, see [Sample flows in Amazon Connect](contact-flow-samples.md). 

Type: Customer queue

This flow shows you how to manage what the customer experiences while in queue. It uses **Check contact attributes** to determine if the customer is contacting you by phone or chat, and to route them accordingly.

If the channel is chat, the customer is transferred to the **Loop prompts**.

If the channel is voice, the customer hears a looping audio that interrupts every 30 seconds to give them two options from the **Get customer input** block:

1. The customer can press 1 to enter a callback number. Then the **Get customer input** block prompts the customer for their phone number. Then the flow ends. 

1. Press 2 ends the flow, and the customer remains in the queue.

# Sample Lambda integration flow in Amazon Connect


**Note**  
This topic explains a sample flow that is included with Amazon Connect. For information about locating the sample flows in your instance, see [Sample flows in Amazon Connect](contact-flow-samples.md). 

Type: Flow (inbound)

This flow shows you how to invoke a Lambda function and do a data dip, that is, retrieve information about the customer. The data dip uses the caller's phone number to look up the US state they are calling from. If the customer is using chat, it returns a fun fact. Here's how it works:

1. A prompt tells the customer that a data dip is being performed. 

1. The [AWS Lambda function](invoke-lambda-function-block.md) block triggers **sampleLambdaFlowFunction**. This sample Lambda function determines the location of the phone number. The function times out in 4 seconds. If it times out, it plays a prompt that says "Sorry, we failed to find the state for your phone number's area code." 

1. In the first **Check contact attributes** block, it checks the channel the customer is using: voice, chat, task. If chat, it returns a fun fact. 

1. If voice, the second **Check contact attributes** block is triggered. It checks the match conditions of **State**, which is an external attribute. It uses an external contact attribute because it's getting data by using a process that's external to Amazon Connect

1. A prompt tells you that it's returning you back to **Sample inbound flow**, and then starts the **Transfer flow** block. 

1. If the transfer fails, it plays a prompt and then disconnects the contact. 



For more information about using attributes, see [Store a value from a Lambda functions as a contact attribute in Amazon Connect](attribs-with-lambda.md).

# Sample recording behavior in Amazon Connect


**Note**  
This topic explains a sample flow that is included with Amazon Connect. For information about locating the sample flows in your instance, see [Sample flows in Amazon Connect](contact-flow-samples.md). 

Type: Flow (inbound)

This flow starts by checking the channel of the contact:
+ If the contact is a task, it is transferred to the Sample inbound flow.
+ If the customer is using chat, they get a prompt that the **Set recording block** enables managers to monitor chat conversations. (To *record* chats, you only need to specify an Amazon S3 bucket where the conversation will be stored.)

  To monitor chats, the **Set recording block** is configured to record both the **Agent and Customer**.
+ If the contact is using voice, a **Get customer input** block prompts them to enter the number for who they want to record. Their entry triggers the **Set recording behavior** block with the appropriate configuration.

It ends with the customer being transferred by to the [Sample inbound flow](sample-inbound-flow.md). 

For more information, see the following topics:
+ [When, what, and where for contact recordings in Amazon Connect](about-recording-behavior.md)
+ [Enable contact recording](set-up-recordings.md)
+ [Enable enhanced multi-party contact monitoring in Amazon Connect](monitor-conversations.md)
+ [Review recorded conversations between agents and customers using Amazon Connect](review-recorded-conversations.md)

# Sample Screenpop flow in Amazon Connect


**Note**  
This topic explains a sample flow that is included with Amazon Connect. For information about locating the sample flows in your instance, see [Sample flows in Amazon Connect](contact-flow-samples.md). 

Type: Flow (inbound)

This flow shows you how to use Screenpop, a Contact Control Panel feature, to load a web page with parameters based on attributes. 

In this sample flow, a **Set contact attributes** block is used to create an attribute from a text string. As an attribute, the text can be passed to the CCP to display a note to an agent.

# Sample secure customer data entry input in a call with a contact center agent


**Note**  
This topic explains a sample flow that is included with Amazon Connect. For information about locating the sample flows in your instance, see [Sample flows in Amazon Connect](contact-flow-samples.md). 

Type: Queue transfer

This flow shows you how to allow customers to input sensitive data while putting the agent on hold. In a production environment, we recommend [using encryption](encrypt-data.md) instead of this solution. 

Here's how it works: 

1. This flow begins with checking the customer's channel. If they are using chat, they are put in a queue.

1. If they are using voice, the agent and customer are put in a conference call.

1. A **Play prompt** tells the customer that the agent will be put on hold while customer enters their credit card information. 

1. When the prompt is finished playing, the agent is put on hold using a **Hold customer or agent** block. If an error occurs, a prompt is played that agent was unable to put on hold, after which the contact flow is ended.

1. The customer's input is stored using the **Store Customer Input** block. This block encrypts the sensitive customer information using a signing key that must be uploaded in .pem format. 

1. After the customer's data is collected, the agent and customer are put back on call using the **Conference All** option in another **Hold customer or agent** block. 

1. The error branch runs if there's an error while capturing the customer's data.

# Sample secure customer data entry input in a call with no contact center agent


**Note**  
This topic explains a sample flow that is included with Amazon Connect. For information about locating the sample flows in your instance, see [Sample flows in Amazon Connect](contact-flow-samples.md). 

Type: Flow (inbound)

This flow shows you how to capture sensitive customer data and encrypt it using a key. Here's how it works:

1. It begins by checking the contact's channel. If they are using chat, a prompt is played that this doesn't work with chat, and they are transferred to [Sample inbound flow](sample-inbound-flow.md).

1. If they are using voice, the **Store customer input** block prompts them to enter their credit card number. The block stores and also encrypts the data using a signing key that must be uploaded in a .pem format. 

   In the **Set contact attributes** block, the encrypted card number is set as contact attribute.

1. After the card number is successfully set as contact attribute, the customer is transferred back to the [Sample inbound flow](sample-inbound-flow.md). 