

# Flows in Amazon Connect
<a name="connect-contact-flows"></a>

A *flow* defines the customer experience with your contact center from start to finish. Amazon Connect includes a set of [default flows](contact-flow-default.md) so you can quickly set up and run a contact center. However, you may want to create custom flows for your specific scenario.

**Topics**
+ [Keyboard shortcuts](keyboard-shortcuts.md)
+ [Required permissions](contact-flow-permissions.md)
+ [Default flows](contact-flow-default.md)
+ [Sample flows](contact-flow-samples.md)
+ [Flow block definitions](contact-block-definitions.md)
+ [Create a flow](create-contact-flow.md)
+ [Configure Amazon Nova Sonic Speech-to-Speech](nova-sonic-speech-to-speech.md)
+ [Associate a phone number with a flow](associate-claimed-ported-phone-number-to-flow.md)
+ [Flow modules](contact-flow-modules.md)
+ [Agent-initiated flows](agent-initiated-flows.md)
+ [Create prompts](prompts.md)
+ [Set up contact transfers](transfer.md)
+ [Set up queued callback](setup-queued-cb.md)
+ [Use customer first callback mode](customer-first-cb.md)
+ [Import and export flows between flow designers](contact-flow-import-export.md)
+ [Create conversational AI bots](connect-conversational-ai-bots.md)
+ [Invoke Lambda functions](connect-lambda-functions.md)
+ [Live media streaming of customer audio](customer-voice-streams.md)
+ [Encrypt customer input](encrypt-data.md)
+ [Monitor flow performance](monitor-flow-performance.md)
+ [Track events in flows](about-contact-flow-logs.md)
+ [Use contact attributes](connect-contact-attributes.md)
+ [Migrate flows](migrate-contact-flows.md)

# Keyboard shortcuts for the Amazon Connect flow designer
<a name="keyboard-shortcuts"></a>

The Amazon Connect flow designer includes keyboard shortcuts to help you use the designer efficiently.

To access the complete list of keyboard shortcuts, press Ctrl \$1 / or choose **Keyboard shortcuts**, as shown in the following image.

![\[The Keyboard shortcuts on the flow designer.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/flow-designer-keyboard-shortcuts.png)


The **Keyboard shortcuts** pane displays three tabs:
+ **General**. Provides a summary of the most important keyboard shortcuts.
+ **Canvas**. Lists shortcuts that are active only when the cursor is focused on the canvas area.
+ **Other**. Includes all remaining keyboard shortcuts not covered in the previous tabs.

The following sections explain how use some of the keyboard shortcuts.

## **Home** key: Go to **Entry** block
<a name="go-to-entry-block"></a>

Press Home to jump to the **Entry** block.

When the canvas is in motion, a blue indicator appears at the center of the viewport to signify active movement. 

The following GIF shows how to use the Home keyboard shortcut to jump to the **Entry** block.

![\[A GIF that shows how to jump to the Entry block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/GIF/go-to-entry-block.gif)


## Move viewport
<a name="move-viewport"></a>

After pressing the Home key, you can use W, A, S, and D to scroll through the canvas; hold to move faster. 

The following GIF shows how to use these keyboard shortcuts to scroll through the flow designer canvas.

![\[A GIF that shows how use W, A, S, and D to scroll through the canvas.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/GIF/move-viewport.gif)


## Select and move item
<a name="select-and-move-item"></a>

Use Arrow keys to navigate and select.

Press Space to pick up/drop, and move with Arrow keys.

The following GIF shows how to use the **Arrow keys** to navigate through, select, and move blocks on the flow designer canvas.

![\[A GIF that shows how to navigate through, select, and move blocks on the flow designer canvas.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/GIF/arrowkeys.gif)


The following GIF shows pressing **Space** to pick up/drop and move with **Arrow keys**.

![\[A GIF that shows how to navigate through, and select and move blocks on the canvas.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/GIF/space-select-and-move.gif)


## Auto-Arrange
<a name="auto-arrange"></a>

The Auto-Arrange feature enables blocks to align within a structured, grid-based layout.

Use Ctrl \$1 A to select all blocks, and Ctrl \$1 Alt \$1 A to auto-arrange them.

If **one or more blocks** are selected, **only the selected blocks** are auto-arranged.

This function is also accessible from the toolbar.

The following GIF shows how to use the keyboard shortcut to navigate between blocks on the flow designer canvas.

![\[A GIF that shows how to auto-arrange blocks on a canvas.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/GIF/auto-arrange.gif)


## Navigate between blocks
<a name="navigate-between-blocks"></a>

When a block is selected, press K to cycle the outgoing branches of a block, and press L to select the cycled target.

This eliminates the need to manually trace the path to a connected block.

The following GIF shows how to use these keyboard shortcuts to navigate between blocks on the flow designer canvas.

![\[A GIF that shows how to navigate between blocks on a canvas.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/GIF/kcycle.gif)


Press J to trace the incoming branches to a block, as shown in the following GIF.

![\[A GIF that shows how to trace the incoming branches to a block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/GIF/j-cycle-navigate-between-blocks.gif)


## Sequentially step through all items
<a name="sequentially-step-through-all-items"></a>

After clicking on the canvas, use the Page Up and Page Down keys to step through items sequentially, following a row-wise order.

The following GIF shows how to use these keyboard shortcuts to step through items sequentially.

![\[A GIF that shows stepping through items sequentially using the Page Up and Page Down keys.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/GIF/upage.gif)


## Notes
<a name="notes"></a>

After pressing the Home key, press N to create a new note.

Use Alt \$1 N to fold or unfold the selected note.

When a note is selected, press Enter to begin editing.

The following GIF shows how to create notes using these keyboard shortcuts.

![\[A GIF that shows how to create notes using keyboard shortcuts.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/GIF/notes.gif)


# Permissions required to work with flows in Amazon Connect
<a name="contact-flow-permissions"></a>

To view, edit, create, and publish flows you need **Flows** permissions added to your security profile. 

By default, users who are assigned to the **Admin** and **CallCenterManager** security profiles have Flows permissions.

# Default flows in Amazon Connect for your contact center
<a name="contact-flow-default"></a>

Amazon Connect includes a set of default flows that have already been published. It uses them to power your contact center. 

For example, say you create a flow that includes putting the customer on hold, but you don't create a prompt for it. The default flow, **Default agent hold**, will be played automatically. This is a way to help you get started with your contact center quickly.

**Tip**  
If you want to change the behavior of a default flow, we recommend creating a new customized flow based on the default. Then call the new flow intentionally in your flows rather than defaulting to it. This gives you better control over how your flows work.

To see the list of default flows in the Amazon Connect admin website, go to **Routing**, **Flows**. They all start with **Default** in their name. 

**Topics**
+ [Change a default flow](change-default-contact-flow.md)
+ [Default agent hold](default-agent-hold.md)
+ [Default agent transfer](default-agent-transfer.md)
+ [Default customer queue](default-customer-queue.md)
+ [Default customer whisper](default-customer-whisper.md)
+ [Default agent whisper](default-agent-whisper.md)
+ [Set the default whisper flow for chat](set-default-whisper-flow-for-chat.md)
+ [Default customer hold](default-customer-hold.md)
+ [Default outbound](default-outbound.md)
+ [Default queue transfer](default-queue-transfer.md)
+ [Default prompts from Amazon Lex](default-prompts-from-lex.md)

# Change a default flow in your Amazon Connect contact center
<a name="change-default-contact-flow"></a>

You can override the way the default flows work by editing them directly. 

Generally we recommend creating new flows based on the defaults, rather than editing the default flow directly. You can make a copy of the default flow, assign a name that indicates it's a custom version, and then edit that one. This gives you more control over how your flows work.

## Change how a default flow works in Amazon Connect
<a name="change-default-customer-hold"></a>

The following steps show how to change the default message customers hear when they are put in a queue to wait for the next available agent.

1. On the navigation menu, choose **Routing**, **Flows**.

1. Choose the default flow you want to customize. For example, choose **Default customer queue** if you want to create your own message when a customer is put in queue instead of using the one we've provided. This is shown in the following image.  
![\[The flows page, the default customer queue.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customize-default-contact-flow1.png)

1. To customize the message, choose the **Loop prompts** block to open the properties page.   
![\[The Loop prompts block in the default customer queue flow.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customize-default-contact-flow2.png)

1. On the **Properties** page of the **Loop prompts** block, use the dropdown box to either choose different music, or set to **Text to Speech**. Type a message to be played. 

   For example, the following image shows the message "*Thank you for calling. Did you know you can reset your own password at the login page? Choose Reset now, and following the prompts.*"   
![\[A text message on the Properties page.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customize-default-contact-flow3.png)

1. Choose **Save** at the bottom of the properties page. 

1. Choose **Publish**. Amazon Connect starts playing the new message almost immediately (it may take a few moments for it to fully take effect).  
![\[The publish button on the flow designer.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customize-default-contact-flow4.png)

## Copy a default flow before customizing it
<a name="create-new-default"></a>

Use the following steps to create a new flow based a current default.

1. On the navigation menu, choose **Routing**, **Flows**.

1. Choose the default flow you want to customize. 

1. In the upper right corner of the page, choose the **Save** drop-down arrow. Choose **Save as**, as shown in the following image.  
![\[The Save dropdown box, the Save as option.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customize-default-contact-flow.png)

1. Assign a new name for the flow, for example, **Customer hold message**.  
![\[The Save as dialog box.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customize-default-customer-hold.png)

1. Add the new flow (in this case, **Customer hold message**) to the flows you create so it's run instead of the default. 

# Default agent hold flow in Amazon Connect: You are on hold
<a name="default-agent-hold"></a>

The **Default agent hold** flow is the experience the agent receives when placed on hold. During this flow, a **Loop prompt** block plays the message "You are on hold" to the agent every 10 seconds. 

![\[The properties page of the loop prompts block, the message You are on hold.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/default-agent-hold-loop-prompt.png)


You can set **break time** to a maximum of 10 seconds. This means the maximum amount time you can specify between **You are on hold** messages is 10 seconds. To make the time between longer, add multiple prompts to the loop. For example, if you want 20 seconds between **You are on hold** messages:
+ The first prompt may say **You are on hold** with **break time="10s"** 
+ Add another prompt with a blank message and break time="10s".

![\[break time = 10s in the text-to-speech box.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/default-agent-hold-loop-prompt-example.png)


For instructions about how to override and change a default flow, see [Change a default flow in your Amazon Connect contact center](change-default-contact-flow.md).

**Tip**  
Wondering if a default flow has been changed? Use [flow version control](flow-version-control.md) to view the original version of the flow. 

# Default agent transfer flow in Amazon Connect: "Transferring now"
<a name="default-agent-transfer"></a>

This default transfer flow is what the "from" agent experiences when they transfer a contact to another agent by using [Create quick connects in Amazon Connect](quick-connects.md). The "from" agent hears a **Play prompt** play the message "Transferring now." Then the **Transfer to agent** block is used to transfer the contact to the agent. 

When the contact is transferred, the "to" agent hears the [Default agent whisper](default-agent-whisper.md). 

**Tip**  
The **Transfer to Agent** block is a beta feature and only works for voice interactions. To transfer a chat contact to another agent, follow these instructions: [Use contact attributes to route contacts to a specific agent](transfer-to-agent.md#use-attribs-agent-queue).

For instructions about how to override and change a default flow, see [Change a default flow in your Amazon Connect contact center](change-default-contact-flow.md).

**Tip**  
Wondering if a default flow has been changed? Use [flow version control](flow-version-control.md) to view the original version of the flow. 

# Default customer queue flow in Amazon Connect: queue message and music
<a name="default-customer-queue"></a>

This default flow is run when a customer is placed in a queue. 

1.  The loop has a one-time voice prompt:

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

1. It plays queue music in .wav format that's been uploaded to the Amazon Connect instance. 

1. The customer remains in this loop until their call is answered by an agent.

**Important**  
The **Default customer queue flow** does not support chat, tasks, or email contacts out of the box. It will fail if you use it for these contacts without any changes. The **Default customer queue** flow contains a [Loop prompts](loop-prompts.md) block, and that block only supports voice contacts.  
We recommend you create a new flow, and use it to check the channel and then route the contact to the appropriate queue. For instructions specific to tasks, see [How to send tasks to a queue](tasks.md#example-enqueue-task). 

## Change the default message a customer hears when they are put in queue
<a name="change-default-customer-queue"></a>

The following steps show how to change the default message customers hear when they are put in a queue to wait for the next available agent.

1. On the navigation menu, choose **Routing**, **Flows**.

1. On the **Flows** page, choose **Default customer queue**, as shown in the following image.  
![\[Default customer queue flow on the flows page.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customize-default-contact-flow1.png)

1. To customize the message, choose the **Loop prompts** block to open the properties page.   
![\[Loop prompts block on the flow designer.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customize-default-contact-flow2.png)

1. Use the dropdown box to either choose different music, or set to **Text to Speech** and then type a message to be played,

   For example, the following image shows the message "*Thank you for calling. Did you know you can reset your own password at the login page? Choose Reset now, and following the prompts.*"   
![\[Loop prompts block configured with a text-to-speech message.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customize-default-contact-flow3.png)

1. Choose **Save** at the bottom of the properties page. 

1. Choose **Publish**. Amazon Connect starts playing the new message almost immediately (it may take a few moments for it to fully take effect).  
![\[The publish button on the flow designer.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customize-default-contact-flow4.png)

# Default customer whisper flow in Amazon Connect: play a beep sound
<a name="default-customer-whisper"></a>

This flow uses a [Set whisper flow](set-whisper-flow.md) block to play a message for the customer when the customer and agent are joined. It uses a "beep" sound to notify a customer that their call has been connected to an agent. 

Use the [Set whisper flow](set-whisper-flow.md) block to override or disable the default customer whisper in a voice conversation.

**Important**  
Chat conversations do not include a default whisper. You need to include a [Set whisper flow](set-whisper-flow.md) for default agent or customer whispers to play. For instructions, see [Set the default whisper flow in Amazon Connect for a chat conversation](set-default-whisper-flow-for-chat.md).

# Default agent whisper in Amazon Connect: name of the queue
<a name="default-agent-whisper"></a>

This flow uses a [Set whisper flow](set-whisper-flow.md) block to play a message for the agent when the customer and agent are joined. 

The name of the queue is played to the agent. It identifies the queue that the customer was in. The name of the queue is retrieved from the system variable `$.Queue.Name`. 

Use the [Set whisper flow](set-whisper-flow.md) block to override or disable the default agent whisper in a voice conversation.

**Important**  
Chat conversations do not include a default whisper. You need to include a [Set whisper flow](set-whisper-flow.md) for default agent or customer whispers to play. For instructions, see [Set the default whisper flow in Amazon Connect for a chat conversation](set-default-whisper-flow-for-chat.md).

For more information about system variables, see [System attributes](connect-attrib-list.md#attribs-system-table).

**Tip**  
Wondering if a default flow has been changed? Use [flow version control](flow-version-control.md) to view the original version of the flow. 

# Set the default whisper flow in Amazon Connect for a chat conversation
<a name="set-default-whisper-flow-for-chat"></a>

For chat conversations, you need to include a **Set whisper flow** block for default agent or customer whispers to play.

For example, to set the default whisper flow for chats that use the [Sample inbound flow](sample-inbound-flow.md):

1. Go to **Routing**, **Flows**, and choose the Sample inbound flow. 

1. Add a **Set whisper flow** block after the chat channel has branched, as shown in the following image:  
![\[A set whisper flow block in the sample inbound flow.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-whisper-flow-default-chat-sample.png)

1. In the **Set whisper flow** block, open the properties page, and choose the flow you want to play as the default for chat conversations. For example, you might choose **Default whisper flow** to show agents the name of the originating queue in the chat window. This is helpful when agents are managing more than one queue.   
![\[The properties page of the set whisper flow block, set to default agent whisper.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-whisper-flow-properties3.png)

1. Choose **Save**.

# Default customer hold: hold music
<a name="default-customer-hold"></a>

This flow starts when the customer is put on hold. It plays the audio that the customer hears while on hold. 

For instructions about how to override and change a default flow, see [Change a default flow in your Amazon Connect contact center](change-default-contact-flow.md).

**Tip**  
Wondering if a default flow has been changed? Use [flow version control](flow-version-control.md) to view the original version of the flow. 

# Default outbound flow in Amazon Connect: "This call is not being recorded"
<a name="default-outbound"></a>

**Important**  
Before using the **Send message** block in an outbound flow, see [Important information about using the Send message block in outbound flows](send-message.md#send-message-outboundflow-important) for recommended safeguards you should implement.

This flow is an outbound whisper that manages what the customer experiences as part of an outbound call, before being connected with an agent. 

1. It starts with an optional **Set recording behavior** block. Then a prompt plays the following message: 

   *This call is not being recorded.*

1. The flow ends.

1. The customer remains in the system (on the call) after the flows ends. 

When thinking about how to design an outbound flow, keep in mind how an outbound flow works: 
+ Before the call is made, all the blocks before the first **Play prompt** are run. 
+ After the customer picks up, the first **Play prompt** and all the blocks after it are run. 

For instructions about how to override and change a default flow, see [Change a default flow in your Amazon Connect contact center](change-default-contact-flow.md).

**Tip**  
Wondering if a default flow has been changed? Use [flow version control](flow-version-control.md) to view the original version of the flow. 

# Default queue transfer flow in Amazon Connect: "Now transferring"
<a name="default-queue-transfer"></a>

This flow manages what the agent experiences when they transfer a customer to another queue.

It starts with a **Check hours of operation** block to check the hours of operation for the current queue. The **In hours** option branches to the **Check staffing** block to determine whether agents are available, staffed, or online. 

If it returns **True** (agents are available), the flow goes to the **Transfer to queue** block. If it returns **False** (no agents are available), the flow plays a prompt and disconnects the call.

For instructions about how to override and change a default flow, see [Change a default flow in your Amazon Connect contact center](change-default-contact-flow.md).

**Tip**  
Wondering if a default flow has been changed? Use [flow version control](flow-version-control.md) to view the original version of the flow. 

# Default prompts from Amazon Lex: Sorry
<a name="default-prompts-from-lex"></a>

If you add an Amazon Lex classic bot (not Amazon Lex V2) to your contact center, know that it also has some default prompts that it uses for error handling. For example: 
+ Sorry, can you please repeat that?
+ Sorry, I could not understand. Goodbye.

**To change default Amazon Lex prompts**

1. In Amazon Lex, go to your bot.

1. On the Editor tab, choose Error Handling.

1. Change the text as needed. Choose **Save**, then **Build** and **Publish**.

# Sample flows in Amazon Connect
<a name="contact-flow-samples"></a>

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
<a name="sample-inbound-flow"></a>

**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
<a name="sample-ab-test"></a>

**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
<a name="sample-customer-queue-priority"></a>

**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
<a name="option1-sample-customer-queue-priority"></a>
+ 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
<a name="option2-sample-customer-queue-priority"></a>
+ 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
<a name="sample-disconnect"></a>

**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
<a name="sample-queue-configurations"></a>

**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
<a name="sample-queue-customer"></a>

**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
<a name="sample-queued-callback"></a>

**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
<a name="sample-interruptible-queue"></a>

**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
<a name="sample-lambda-integration"></a>

**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
<a name="sample-recording-behavior"></a>

**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
<a name="sample-note-for-screenpop"></a>

**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
<a name="sample-secure-input-with-agent"></a>

**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
<a name="sample-secure-input-with-noagent"></a>

**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). 

# Flow block definitions in the flow designer in Amazon Connect
<a name="contact-block-definitions"></a>

Use flow blocks to create flows in the flow designer. Drag flow blocks and drop them onto a canvas to arrange a flow.

The following table lists all available flow blocks that you can use. Choose any block name in the Block column for more information.


| Block | Description | 
| --- | --- | 
|   [Connect assistant](connect-assistant-block.md)  |  Associates an Connect AI agents domain to a contact to enable real-time recommendations.  | 
| [Authenticate Customer](authenticate-customer.md)  | Enables the customer to authenticate by leveraging Amazon Cognito and Amazon Connect Customer Profiles. | 
| [Call phone number](call-phone-number.md)  | Initiates an outbound call from an outbound whisper flow. | 
| [Cases](cases-block.md)  | Gets, updates, and creates cases.  | 
|  [Change routing priority / age](change-routing-priority.md)   |  Changes the priority of the contact in queue. You may want to do this, for example, based on the contact's issue or other variable.  | 
|  [Check call progress](check-call-progress.md)   |  Engages with the output provided by an answering machine, and provides branches to route the contact accordingly. This block works with outbound campaigns only.  | 
|  [Check contact attributes](check-contact-attributes.md)   |  Checks the values of contact attributes.  | 
|   [Check hours of operation](check-hours-of-operation.md)  |  Checks whether the contact is occurring within or outside of the hours of operation defined for the queue.  | 
|   [Check queue status](check-queue-status.md)   |  Checks the status of the queue based on specified conditions.  | 
|   [Check Voice ID](check-voice-id.md)   |  Branches based on the enrollment status, voice authentication status, or status of detection of fraudsters in a watchlist of the caller returned by Voice ID.  | 
|   [Check staffing](check-staffing.md)   |  Checks the current working queue, or queue you specify in the block, for whether agents are available, staffed, or online. Staffed availability could be on call, or after contact work status.  | 
|   [Contact tags](contact-tags-block.md)   |  Create and apply user-defined tags (key:value pairs) to your contacts.  | 
|   [Create persistent contact association](create-persistent-contact-association-block.md)   |  Specify an attribute to create a persistent contact association, enabling conversations to continue from where they left off.  | 
|   [Create task](create-task-block.md)   |  Creates a new task, sets the tasks attributes, and initiates a contact flow to start the task. To learn more about Amazon Connect Tasks, see [The task channel in Amazon Connect](tasks.md).   | 
|   [Customer profiles](customer-profiles-block.md)   |  Enables you to retrieve, create, and update a customer profile.  | 
|   [Data Table](data-table-block.md)   |  Evaluate, list, or write data from data tables within your contact flows.  | 
|  [Disconnect / hang up](disconnect-hang-up.md)  |  Disconnects a contact.  | 
|   [Distribute by percentage](distribute-by-percentage.md)   |  Routes customers randomly based on a percentage.  | 
|   [End flow / Resume](end-flow-resume.md)   |  Ends the current flow without disconnecting the contact.  | 
|   [Get customer input](get-customer-input.md)   |  Branches based on customer intent.  | 
| [Get metrics](get-queue-metrics.md) | Retrieves real-time metrics about queues and agents in your contact center and returns them as attributes. | 
| [Get stored content](get-stored-content.md) | Retrieves content stored in S3 and returns them as attributes to be used within flows. | 
|  [Hold customer or agent](hold-customer-agent.md)  |  Places a customer or agent on or off hold.  | 
|  [AWS Lambda function](invoke-lambda-function-block.md)  |  Calls AWS Lambda, optionally returns key-value pairs.  | 
|  [Invoke module](invoke-module-block.md)  |  Calls a published module.  | 
|  [Loop](loop.md)  |  Loops through, or repeats, the **Looping** branch for the number of loops specified or the number of elements in the provided array.  | 
|  [Loop prompts](loop-prompts.md)  |  Loops a sequence of prompts while a customer or agent is on hold or in queue.   | 
|   [Play prompt](play.md)  |  Plays an interruptible audio prompt, delivers a text-to-speech message, or delivers a chat response.  | 
|   [Resume contact](resume-contact.md)  |  Resumes a contact from a paused state.  | 
|   [Return (from module)](return-module.md)  |  Exits the flow module after it has run successfully.  | 
|   [Send message](send-message.md)   |  Sends a message to your customer based on a template or custom message you specify.  | 
|   [Set callback number](set-callback-number.md)   |  Sets a callback number.  | 
|   [Set contact attributes](set-contact-attributes.md)   |  Stores key-value pairs as contact attributes.  | 
|  [Set customer queue flow](set-customer-queue-flow.md)  |  Specifies the flow to invoke when a customer is transferred to a queue.  | 
|   [Set disconnect flow](set-disconnect-flow.md)   |  Sets the flow to run after a disconnect event.  | 
|   [Set event flow](set-event-flow.md)   |  Specifies which flow to run during a contact event.  | 
|   [Set hold flow](set-hold-flow.md)   |  Links from one flow type to another.  | 
|   [Set logging behavior](set-logging-behavior.md)   |  Enables flow logs so you can track events as contacts interact with flows.  | 
|   [Set recording and analytics behavior](set-recording-behavior.md)  |  Sets options for recording conversations.  | 
|   [Set recording, analytics and processing behavior](set-recording-analytics-processing-behavior.md)   |  Sets options to configure recording behavior for agent and customer, enable automated interaction, enable screen recording, set analytics behavior for contacts, and set custom processing behavior.  | 
|   [Set routing criteria](set-routing-criteria.md)   |  Sets routing criteria on contacts of any channel, such as Voice, Chat, and Task, to define how the contact should be routed within its queue. A routing criteria is a sequence of one or more routing steps.  | 
|   [Set Voice ID](set-voice-id.md)   |  When the call is connected to a flow, sends audio to Amazon Connect Voice ID to verify the caller's identity and match against fraudsters on a watch list.   | 
|  [Set voice](set-voice.md)   |  Sets the text-to-speech (TTS) language and voice to be used in the flow.  | 
|   [Set whisper flow](set-whisper-flow.md)  |  Overrides the default whisper by linking to a whisper flow.  | 
|   [Set working queue](set-working-queue.md)   |  Specifies the queue to be used when **Transfer to queue** is invoked.  | 
|  [Show view](show-view-block.md)  | Configures UI based workflows that you can surface to users in front end applications. | 
|  [Start media streaming](start-media-streaming.md)  | Starts capturing customer audio for a contact. | 
|  [Stop media streaming](stop-media-streaming.md)  | Stops capturing customer audio after it is started with a **Start media streaming** block. | 
|   [Store customer input](store-customer-input.md)   |  Stores numerical input to a contact attribute.  | 
|   [Transfer to agent (beta)](transfer-to-agent-block.md)  |  Transfers the customer to an agent.  | 
|   [Transfer to flow](transfer-to-flow.md)  |  Transfers the customer to another flow.  | 
|   [Transfer to phone number](transfer-to-phone-number.md)  |  Transfers the customer to a phone number external to your instance.  | 
|   [Transfer to queue](transfer-to-queue.md)   |  In most flows, this block ends the current flow and places the customer in queue. When used in a customer queue flow, this block transfers a contact already in a queue to another queue.  | 
|   [Wait](wait.md)  |  Pauses the flow.  | 

# Supported channels for flow blocks in Amazon Connect
<a name="block-support-by-channel"></a>

The following table lists all available flow blocks, and whether they support routing a contact through the specified channels. 


| Block | Voice | Chat | Task | Email | 
| --- | --- | --- | --- | --- | 
|   [Connect assistant](connect-assistant-block.md)  | Yes | Yes | No - Error branch | Yes | 
| [Authenticate Customer](authenticate-customer.md)  | No - Error branch | Yes | No - Error branch | No - Error branch | 
| [Call phone number](call-phone-number.md)  | Yes | No - Error branch | No - Error branch | No - Error branch | 
| [Cases](cases-block.md)  | Yes | Yes | Yes | Yes | 
|  [Change routing priority / age](change-routing-priority.md)   | Yes | Yes | Yes | Yes | 
|  [Check call progress](check-call-progress.md)   | Yes | No - Error branch | No - Error branch | No - Error branch | 
|  [Check contact attributes](check-contact-attributes.md)   | Yes | Yes | Yes | Yes | 
|   [Check hours of operation](check-hours-of-operation.md)  | Yes | Yes | Yes | Yes | 
|   [Check queue status](check-queue-status.md)   | Yes | Yes | Yes | Yes | 
|   [Check Voice ID](check-voice-id.md)   | Yes | No - Error branch | No - Error branch | No - Error branch | 
|   [Check staffing](check-staffing.md)   | Yes | Yes | Yes | Yes | 
|   [Contact tags](contact-tags-block.md)   | Yes | Yes | Yes | Yes | 
|  [Create persistent contact association](create-persistent-contact-association-block.md)   | No - Error branch | Yes | No - Error branch | No - Error branch | 
|   [Create task](create-task-block.md)   | Yes | Yes | Yes | Yes | 
|   [Customer profiles](customer-profiles-block.md)   | Yes | Yes | Yes | Yes | 
|  [Disconnect / hang up](disconnect-hang-up.md)  | Yes | Yes | Yes | Yes | 
|   [Distribute by percentage](distribute-by-percentage.md)   | Yes | Yes | Yes | Yes | 
|   [End flow / Resume](end-flow-resume.md)   | Yes | Yes | Yes | Yes | 
|   [Get customer input](get-customer-input.md)   | Yes | Yes when Amazon Lex is used Otherwise, No - Error branch | No | No | 
| [Get metrics](get-queue-metrics.md) | Yes | Yes | Yes | Yes | 
|  [Hold customer or agent](hold-customer-agent.md)  | Yes | No - Error branch | No - Error branch | No - Error branch | 
|  [AWS Lambda function](invoke-lambda-function-block.md)  | Yes | Yes | Yes | Yes | 
|  [Invoke module](invoke-module-block.md)  | Yes | Yes | Yes | Yes | 
|  [Loop](loop.md)  | Yes | Yes | Yes | Yes | 
|  [Loop prompts](loop-prompts.md)  | Yes | No - Error branch | No - Error branch | No - Error branch | 
|   [Play prompt](play.md)  | Yes | Yes | No - takes the **Success** branch, but it has no effect | No - takes the **Success** branch, but it has no effect | 
|   [Resume contact](resume-contact.md)   | No - Error branch | No - Error branch | Yes | No - Error branch | 
|   [Return (from module)](return-module.md)   | Yes | Yes | Yes | Yes | 
|   [Set callback number](set-callback-number.md)   | Yes | No - Error branch | No - Error branch | No - Error branch | 
|   [Set contact attributes](set-contact-attributes.md)   | Yes | Yes | Yes | Yes | 
|  [Set customer queue flow](set-customer-queue-flow.md)  | Yes | Yes | Yes | Yes | 
|   [Set disconnect flow](set-disconnect-flow.md)   | Yes | Yes | Yes | Yes | 
|   [Set hold flow](set-hold-flow.md)   | Yes | No - Error branch | No - Error branch | No - Error branch | 
|   [Set logging behavior](set-logging-behavior.md)   | Yes | Yes | Yes | Yes | 
|   [Set recording and analytics behavior](set-recording-behavior.md)  | Yes | Yes | No - Error branch | No - Error branch | 
|   [Set recording, analytics and processing behavior](set-recording-analytics-processing-behavior.md)   | Yes | Yes | Yes | Yes | 
|   [Set routing criteria](set-routing-criteria.md)  | Yes | Yes | Yes | Yes | 
|   [Set Voice ID](set-voice-id.md)   | Yes | No - Error branch | No - Error branch | No - Error branch | 
|  [Set voice](set-voice.md)   | Yes | No - Success branch | No - Success branch | No - Success branch | 
|   [Set whisper flow](set-whisper-flow.md)  | Yes | Yes | Yes | Yes | 
|   [Set working queue](set-working-queue.md)   | Yes | Yes | Yes | Yes | 
|   [Show view](show-view-block.md)   | No - Error branch | Yes | No - Error branch | Yes | 
|  [Start media streaming](start-media-streaming.md)  | Yes | No - Error branch | No - Error branch | No - Error branch | 
|  [Stop media streaming](stop-media-streaming.md)  | Yes | No - Error branch | No - Error branch | No - Error branch | 
|   [Store customer input](store-customer-input.md)   | Yes | No - Error branch | No - Error branch | No - Error branch | 
|   [Transfer to agent (beta)](transfer-to-agent-block.md)  | Yes | No - Error branch | No - Error branch | No - Error branch | 
|   [Transfer to flow](transfer-to-flow.md)  | Yes | Yes | Yes | Yes | 
|   [Transfer to phone number](transfer-to-phone-number.md)  | Yes | No - Error branch | No - Error branch | No - Error branch | 
|   [Transfer to queue](transfer-to-queue.md)   | Yes | Yes | Yes | Yes | 
|   [Wait](wait.md)  | No - Error branch | Yes | Yes | Yes | 

# Flow block in Amazon Connect: Connect assistant
<a name="connect-assistant-block"></a>

This topic defines the flow block for Connect assistant.

## Description
<a name="connect-assistant-block-description"></a>
+ Associates an Connect assistant domain to a contact to enable real-time recommendations.
+ For more information about enabling Connect AI agents, see [Use Connect AI agents for real-time assistance](connect-ai-agent.md). 

**Tip**  
If you choose to [customize](customize-connect-ai-agents.md) your Connect AI agents, instead of adding this block to your flows, you need to create a Lambda and then use the [AWS Lambda function](invoke-lambda-function-block.md) block to add it to your flows.

## Supported channels
<a name="connect-assistant-block-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 

**Note**  
Nothing happens if an outbound mail is sent to this block, however, **you will be charged**. To prevent this, add a [Check contact attributes](check-contact-attributes.md) block before this one and route tasks and outbound emails accordingly. For instructions, see [Personalize a contact's experience based on how they contact your contact center](use-channel-contact-attribute.md).


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | Yes | 
| Email | Yes | 

## Flow types
<a name="connect-assistant-block-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Inbound flow
+ Customer Queue flow
+ Outbound whisper flow
+ Transfer to Agent flow
+ Transfer to Queue flow

## How to configure this block
<a name="connect-assistant-block-properties"></a>

The following image shows the **Config** tab of the **Connect assistant** block setting. It specifies the full Amazon Resource Name (ARN) of the Connect assistant domain to associate to the contact. It also specifies the Orchestration AI agent to use for Agent Assistance.

![\[The Config tab of the Connect assistant block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/connect-assistant-block-config.png)


## Configuration tips
<a name="connect-assistant-block-tips"></a>
+ To use Connect AI agents with calls, you must enable Amazon Connect Contact Lens in the flow by adding a [Set recording and analytics behavior](set-recording-behavior.md) block that is configured for Contact Lens real-time. It doesn't matter where in the flow you add the [Set recording and analytics behavior](set-recording-behavior.md) block. 

  Connect AI agents, along with Contact Lens real-time analytics, are used to recommend content that is related to customer issues detected during the current call.
+ Contact Lens is not required to use Connect AI agents with chats.

## Configured block
<a name="connect-assistant-block-configured"></a>

The following image shows an example of what this block looks like when it is configured. It has the following branches: **Success** and **Error**. 

![\[A configured Connect assistant block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/connect-assistant-block-configured.png)


# Flow block in Amazon Connect: Authenticate Customer
<a name="authenticate-customer"></a>

This topic defines the flow block to authenticate customers and route them to specific paths within a flow based on the authentication result. 

**Note**  
Before you can use this block:  
The customer authentication capability must be enabled for your Amazon Connect instance. In addition, a new Amazon Cognito user pool must be created with your identity provider. For instructions, see [Set up customer authentication in Amazon Connect for chat contacts](customer-auth.md). 
Customer Profiles must be [enabled](enable-customer-profiles.md) for your Amazon Connect instance.

## Description
<a name="authenticate-customer-description"></a>
+ Enables your customers to authenticate during a chat. 
+ After a customer successfully signs in, and an ID token is retrieved from Amazon Cognito, Amazon Connect either updates an existing customer profile or creates a new customer profile, depending on the identifier used to store the information into customer profiles.
+ If the First Name field is present in the customer profile, the customer's display name is updated to that name.

## Use cases for this block
<a name="scenarios-authenticate-customer"></a>

This flow block is designed to be used in the following scenarios:
+ You can prompt your customers to sign in and authenticate during a chat. For example, unauthenticated customers can be prompted to sign in:
  + When engaged with a chat bot, before to being routed to an agent.
  + To perform a transaction, such as making a payment.
  + To validate their identity before providing account status or allowing them to update their profile information.
+ You can also use this block to authenticate customers during chats over [Apple Messages for Business](enabling-authentication-for-apple-messages-for-business.md).

## Contact types
<a name="play-channels"></a>


| Contact type | Supported? | 
| --- | --- | 
| Voice | No - **Error** branch | 
| Chat | Yes   | 
| Task | No - **Error** branch  | 
| Email | No - Error branch | 

## Flow types
<a name="authenticate-customer-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):


| Flow type | Supported? | 
| --- | --- | 
| Inbound flow | Yes | 
| Customer queue flow | No | 
| Customer hold flow | No | 
| Customer whisper flow | No | 
| Outbound whisper flow | No | 
| Agent hold flow | No | 
| Agent whisper flow | No | 
| Transfer to agent flow | No | 
| Transfer to queue flow | No | 

## How to configure this block
<a name="authenticate-customer-properties"></a>

You can configure the **Authenticate Customer** block by using the Amazon Connect admin website or by using the [AuthenticateParticipant](https://docs.aws.amazon.com/connect/latest/APIReference/participant-actions-authenticateparticipant.html) action in the Amazon Connect Flow language. 

The following image shows an example of the Properties page for the **Authenticate Customer** block. 

![\[The properties page of the Authenticate Customer block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/authenticate-customer-properties.png)


**Amazon Cognito**
+ **Select an Amazon Cognito User Pool**: After you associate the user pool on the console page, choose the name of the user pool from the drop-down list. 
+ **Select an Amazon Cognito App Client**: After you select the user pool, choose the name of the app client from the drop-down list. 

**Amazon Connect Customer Profiles Configuration**
+ **Store by default template**: By choosing the default template, Amazon Connect Customer Profile ingests [Amazon Cognito standard attributes](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html#cognito-user-pools-standard-attributes) into a unified standard profile object based on the predefined Customer Profile object type. This template uses phone number and email to map the customer to a profile. 
+ **Enter a unique identifier**: You can customize how Customer Profiles ingests data by [creating an object type mapping](create-object-type-mapping.md). If you want to customize the data mapping or key, create your own object type mapping in advance, select **Enter a unique identifier** and enter the mapping name. 

**Timeout**: Enter how long until inactive customers who haven't signed in are routed down the Timeout branch. 
+ Minimum (default): 3 minutes
+ Maximum: 15 minutes

### Flow block branches
<a name="authenticate-customer-branches"></a>

This block supports the following output branches:

![\[A configured Authenticate Customer block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/authenticate-customer-configured.png)

+ **Success**: The customer was authenticated.
+ **Timeout**: The customer was inactive and did not sign in within the allocated amount of time.
+ **Opted out**: The customer chose not to sign in.
+ **Error**: One of the [error scenarios](#authenticate-customer-errorscenarios) occurred.

### Additional configuration tips
<a name="authenticate-customer-tips"></a>
+ We recommend that you enable flow logs in an Amazon CloudWatch log group provide you with real-time details about events in your flows as customers interact with them. You can also use flow logs to help debug your flows as you are creating them. For more information, see [Enable Amazon Connect flow logs in an Amazon CloudWatch log group](contact-flow-logs.md).
+ For information about enabling customer authentication for Apple Messages for Business Chats, see [Enable authentication for Apple Messages for Business](enabling-authentication-for-apple-messages-for-business.md).

### Data generated by this block
<a name="authenticate-customer-data"></a>

This block does not generate any data.

## Error scenarios
<a name="authenticate-customer-errorscenarios"></a>

A contact is routed down the **Error** branch in the following situations:
+ Customer Profiles has not been enabled in your Amazon Connect instance. The option to enable Customer Profiles is selected by default when you create an instance, but it's possible to unselect this option. For instructions about enabling Customer Profiles manually, see [Enable Customer Profiles for your Amazon Connect instance](enable-customer-profiles.md). 
+ The chat subtype is not supported. 
+ The provided authentication code is incorrect. 
+ Error from Amazon Cognito token endpoint because the client or request is not configured correctly (`invalid_request`, `invalid_client`, `unauthorized_client`)
+ The Region is not supported. For a list of supported Regions, see [Customer authentication availability by Region](regions.md#customerauthentication_region).

# Flow block in Amazon Connect: Call phone number
<a name="call-phone-number"></a>

This topic defines the flow block for the call phone number used for voice interactions with contact center customers.

## Description
<a name="call-phone-number-description"></a>
+ Use to place an outbound call from an **Outbound Whisper** flow.

## Supported channels
<a name="call-phone-number-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | No  | 
| Task | No | 
| Email | No | 

## Flow types
<a name="call-phone-number-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Outbound Whisper flow

## Properties
<a name="call-phone-number-properties"></a>

The following image shows an example of what the **Call phone number** properties page looks like when you select a phone number manually. The **Select a number from your instance** option is selected, and the dropdown menu displays a list of available phone numbers claimed for your instance.

![\[The Call phone number properties page. The Select a number from your instance option.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/call-phone-number1.png)


The following image shows an example of what the **Call phone number** properties page looks like when you select a phone number dynamically. The **Use Attribute** option is selected. The **Namespace** box is set to **User-defined**. The **Attribute** box is set to **MainPhoneNumber**. 

![\[The properties page of the Call phone number block. The Use Attribute option is selected, Namespace is set to User-defined.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/call-phone-number2.png)


Outbound whisper flows run in Amazon Connect immediately after an agent accepts the call during direct dial and callback scenarios. When the flow runs: 
+ The caller ID number is set if one is specified in the [Call phone number](#call-phone-number) block.
+ If no caller ID is specified in the [Call phone number](#call-phone-number) block, the caller ID number defined for the queue is used when the call is placed.
+ When there is an error with a call that is initiated by the [Call phone number](#call-phone-number) block, the call is disconnected and the agent is placed in **AfterContactWork** (ACW).

Only published flows can be selected as the outbound whisper flow for a queue.

**Note**  
To use a custom caller ID, you must open an Support ticket to enable this feature. For more information, see [Set up outbound caller ID](https://docs.aws.amazon.com/connect/latest/adminguide/queues-callerid.html).

## Configured block
<a name="call-phone-number-configured-block"></a>

The following image shows an example of what this block looks like when it is configured. It shows the **Caller ID** phone number, and a **Success** branch.

![\[A configured Call phone number block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/call-phone-number-configured.png)


There is no error branch for the block. If a call is not successfully initiated, the flow ends and the agent is placed in an **AfterContactWork** (ACW). 

## Sample flows
<a name="call-phone-number-sample-flows"></a>

Amazon Connect includes a set of sample flows. For instructions that explain how to access the sample flows in the flow designer, see [Sample flows in Amazon Connect](contact-flow-samples.md). Following are topics that describe the sample flows which include this block.
+ [Sample customer queue priority flow in Amazon Connect](sample-customer-queue-priority.md)
+  [Sample queue configurations flow in Amazon Connect](sample-queue-configurations.md)

## Scenarios
<a name="call-phone-number-scenarios"></a>

See these topics for more information about caller ID works:
+ [Set up outbound caller ID in Amazon Connect](queues-callerid.md)

# Flow block in Amazon Connect: Cases
<a name="cases-block"></a>

**Tip**  
Be sure to [enable](enable-cases.md) Amazon Connect Cases before using this block. Otherwise, you can't configure its properties.

This topic defines the flow block for updating and creating cases.

## Description
<a name="create-case-description"></a>
+ Gets, updates, and creates cases. 
+ Searches for case linked to a contact.
+ You can link a contact to a case, and then the contact will be recorded in the **Activity feed** of the case. When the agent accepts a contact that is linked to a case, the case automatically opens as a new tab in the agent application.
+ While you can link contacts to multiple cases, there is a limit of five new case tabs automatically opening in the agent application. These will be the five most recently updated cases.
+ For more information about cases, see [Amazon Connect Cases](cases.md).

## Supported channels
<a name="create-case-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | Yes | 
| Email | Yes | 

## Flow types
<a name="create-case-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ All flows

## Properties: Get case
<a name="get-case-properties1"></a>

**Tip**  
The following screenshots refer to the legacy flow designer.

When configuring properties to get a case:
+ You can specify to **Link contact to case** (Yes/No). If "Yes," then you can choose from the following options:
  + **Current contact** is the contact on which the current flow is being executed.
  + **Related contact** is the contact that is [related](https://docs.aws.amazon.com/connect/latest/adminguide/chat-persistence.html#relatedcontactid) to this contact.
+ You must provide at least one search criteria. Otherwise this block will take the **Error** branch.

  You can either use attribute in the Cases namespace or set manually. If you set manually, see to the syntax in [How to persist fields throughout the flow](#cases-persist-fields).
+ To get cases for a given customer, add a [Customer profiles](customer-profiles-block.md) block to the flow before creating the case. The following image shows the flow designer with a **Customer profiles** block linked from the Success branch to a **Cases** block.  
![\[The flow designer with a Customer profiles block on it, linked from the Success branch to a Cases block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/cases-block-get-case-properties5.png)

  Configure the [Customer profiles](customer-profiles-block.md) block to get the customer profile. The following image shows an example of the **Customer profiles** properties page when it is configured. The **Action** box is set to **Get profile**. The **Select a search key** box is set to **Email address**. The **Use attribute** option is selected. The **Type** box is set to **Customer**. The **Attribute** box is set to **Email address**. The **Response fields** are set to **First name**, **Last name**.  
![\[The Customer profiles properties page configured for the Get profile action.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/cases-block-get-case-properties4.png)

  In the **Cases** block, on the **Properties** page configure the **Customer ID** section as shown in the following image. The **Link contact to case** option is set to **Yes**. The **Request fields** box is set to **Customer Id**. In the **Customer Id** section, the **Use attribute** option is selected. The **Type** box is set to **Customer**. The **Attribute** box is set to **Profile ARN**.  
![\[The Cases block configured to search for a case by customer ID.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/cases-block-get-case-properties3.png)
+ You can specify to get only the last updated case for any search criteria. This can be achieved by selecting **Get last updated case**.
+ You can persist case fields in the case namespace to make use of them in blocks that are in your flow after the **Cases** block that is configured to **Get case**. This can be achieved by making use of the **Response fields** section and selecting fields that you want to use in the other blocks.

  You can either use attribute in the Cases namespace or set manually. If you set manually, see to the syntax in [How to persist fields throughout the flow](#cases-persist-fields).
+ The **Get case** properties show the options for the single-select field type.
+ The **Get case** properties use the Contains function for text field type.
+ The **Get case** properties use the EqualTo function for fields of type: number, boolean.
+ The **Get case** properties use greater than or equal to for any date field search.
+ Contacts can be routed down the following branches:
  + **Success**: The case was found.
  + **Contact not linked**: If you specify to link the contact to case, then this error branch will appear. It might be that the contact was not linked after the case is retrieved (partial success/partial failure). If this happens, then the flow will follow this branch.
  + **Multiple found**: Multiple cases are found with the search criteria.
  + **None found**: No cases are found with the search criteria.
  + **Error**: An error was encountered while trying to find the case. This may be due to a system error or how **Get case** is configured.

The following images show an example of a Cases **Properties** page that is configured for the **Get case** action. 

The first image shows the **Properties** page configured to search for a case by **Customer Id** and **Title**. The **Customer Id** is being pulled in from the **Profile ARN** of the customer. In this image, the **Link contact to case** option is set to **Yes**. The **Request field** is set to **Customer Id, Title**. In the **Customer Id** section, the **Use attribute** option is selected. The **Type** box is set to **Customer**. The **Attribute** box is set to **Profile ARN**. 

![\[The Cases block properties page configured to search for a case by customer ID and title.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/cases-block-get-case-properties1.png)


This next image shows the block configured to search by **Late Arrival**. Under **Title**, the **Set manually** option is set to **Late Arrival**. The **Get last updated cases** option is selected. The **Response field** option shows the three fields that will be shown to the agent: **Status**, **Summary**, and **Title**.

![\[The Cases block properties page configured to search cases by late arrival.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/cases-block-get-case-properties2.png)


## Properties: Get case id
<a name="get-case-id-properties1"></a>

When configuring properties to get a case id:
+ You can specify to **Link contact to case** (Yes/No). If "Yes," then you can choose from the following options:
  + **Current contact** is the contact on which the current flow is being executed.
  + **Related contact** is the contact that is [related](https://docs.aws.amazon.com/connect/latest/adminguide/chat-persistence.html#relatedcontactid) to this contact.
+ If you link the contact to the case, then the contact and a link to contact details appear on the case that the agent sees in the agent application.
+ You can specify the **Contact to search** to fetch a case linked to another contact in the current contact's [contact chain](https://docs.aws.amazon.com/connect/latest/adminguide/contacts-contact-chains-attributes.html#contact-chains). This enables you to link follow-up contacts such as email replies, call transfers, persistent chats, and queued callbacks to the same case more easily.
  + **Current contact**
  + **Initial contact**
  + **Task contact**
  + **Previous contact**
  + **Related contact**
+ If a case is found, for the **Contact to search**, the case ID for that case will be persisted in the case namespace. It can be used in other blocks by accessing the case namespace case ID attribute value.
+ Contacts can be routed down the following branches:
  + **Success**: The case was found. If you specify to link the contact to case, the contact was also successfully linked.
  + **Contact not linked**: If you specify to link the contact to case, then this error branch will appear. It might be that the contact was not linked after the case is retrieved (partial success/partial failure). If this happens, then the flow will follow this branch.
  + **Multiple found**: Multiple cases are found with the search criteria.
  + **None found**: No cases are found with the search criteria.
  + **Error**: An error was encountered while trying to find the case. This may be due to a system error or how **Get case id** is configured.

## Properties: Update case
<a name="update-case-properties1"></a>

When configuring properties to update a case:
+ You can specify to **Link contact to case** (Yes/No). If "Yes," then you can choose from the following options:
  + **Current contact** is the contact on which the current flow is being executed.
  + **Related contact** is the contact that is [related](https://docs.aws.amazon.com/connect/latest/adminguide/chat-persistence.html#relatedcontactid) to this contact.
+ Add a **Get case** block before an **Update case**, as shown in the following image. Use the **Get case** block to find the case you want to update.  
![\[The flow designer with a Get case block on it, linked from the Success branch to an Update case block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/cases-block-get-case-update-case.png)
+ You must provide an update to at least one **Request** field. Otherwise, this block takes the **Error** branch.

  You can either use an attribute in the Cases namespace, or set the **Request** field manually. If you set manually, see the syntax in [How to persist fields throughout the flow](#cases-persist-fields).
+ Contacts can be routed down the following branches:
  + **Success**: The case was updated, and the contact was linked to the case.
  + **Contact not linked**: If you specify to link the contact to case, then this error branch will appear. It might be that the case was updated, but the contact was not linked to the case (partial success/partial failure). If this happens, then the flow will follow this branch.
  + **Error**: The case was not updated. The contact was not linked to the case, as the case was not updated.

The following images show an example of an **Update case** configuration. The first image shows that as part of the update the contact is going to be linked to the case. To identify which case to update, the **Case Id** is specified. (Case Id is the unique identifier of the case and the only field you can provide here. Other fields will not work and produce errors.)

![\[The Update case block, with the Link contact to case option set to Yes, Type set to Case, Attribute set to Case Id.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/cases-block-update-case-properties1.png)


The following image shows the **Request** field, where you specify the fields to update the case.

![\[The Update case block with Request field set to Title, the Set manually option set to Case updated through flows.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/cases-block-update-case-properties2.png)


## Properties: Create case
<a name="create-case-properties1"></a>

When configuring properties to create a case:
+ You can specify to **Link contact to case** (Yes/No). If "Yes," then you can choose from the following options:
  + **Current contact** is the contact on which the current flow is being executed.
  + **Related contact** is the contact that is [related](https://docs.aws.amazon.com/connect/latest/adminguide/chat-persistence.html#relatedcontactid) to this contact.
+ You must provide a case template. For more information, see [Create case templates to document customer issues in Amazon Connect Cases](case-templates.md).
+ Fields that are required appear in the **Required** fields section. You must assign values to them to create a case.
+ You must specify the customer to create a case.
  + We recommend adding a [Customer profiles](customer-profiles-block.md) block to the flow before the **Cases** block. Use the [Customer profiles](customer-profiles-block.md) block to get a customer profile with some prefetched data, or create a new customer profile and then use that to create a case.
  + To provide a value for **Customer Id** in the **Cases** block, configure the fields as shown in the following image, where **Use attribute** is selected, **Type** is set to **Customer**, and **Attribute** is set to **Profile ARN**.  
![\[The Create case block configured to provide the Use attribute value for Customer Id.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/create-case-block-properties2.png)

    If you are setting the value manually, you must provide the full customer profile ARN in this format:

    `arn:aws:profile:your AWS Region:your AWS account ID:domains/profiles domain name/profiles/profile ID `
+ You can specify values for fields other than the required ones in the Request fields section.

  You can either use attribute in the Cases namespace or set manually. If you set manually, see to the syntax in [How to persist fields throughout the flow](#cases-persist-fields).
+ You can specify that a contact should be linked to case. If you link the contact to the case, then the contact and a link to contact details appear on the case that the agent sees in the agent application.
+ After creating a case, the case ID that is created will be persisted in the case namespace. It can be used in other blocks by accessing the case namespace case ID attribute value.
+ Contacts can be routed down the following branches:
  + **Success**: The case was created, and the contact was linked to the case.
  + **Contact not linked**: If you specify to link the contact to case, then this error branch will appear. This is because it is possible that the case was created, but the contact was not linked to the case (partial success/partial failure). If this happens, then the flow will follow this branch.
  + **Error**: The case was not created. The contact was not linked to the case, as the case was not created.

The following images show an example of a **Create case** configuration. The first image shows the new case will be created using the General inquiry template: 

![\[The Create case block with the Template option set to General Inquiry.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/cases-block-create-case-properties1.png)


The next image shows the reason for the case will be set to **Shipment delayed**.

![\[The Create case block with the Case Reason box set to Set manually or Shipment delayed.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/cases-block-create-case-properties.png)


## How to persist fields throughout the flow
<a name="cases-persist-fields"></a>

Let's say you want customers to be able to call into your contact center and get the status of their case without ever talking to an agent. You want the IVR to read the status to the customer. You can get the status from a system field, or you might have a custom status field, for example, named *Detailed status*. 

Here's how to configure your flow to get and read the status to the customer: 

1. Add a **Cases** block to your flow. Configure it to **Get case** to find the case.  
![\[The Cases block properties page with Action set to Get case.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/cases-example-ivr-1.png)

1. In the **Request fields** section, search for the case by the customer **Profile ARN**:  
![\[The Request fields dropdown set to Customer Id, Type set to Customer, Attribute set to Profile ARN.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/cases-example-ivr-2.png )

1. In the **Response fields** section, add the field that you want passed throughout the flow. For our example, choose **Status**.  
![\[The Response fields dropdown set to Status.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/cases-example-ivr-3.png )

1. Add a [Play prompt](play.md) block to your flow. 

1. Configure [Play prompt](play.md) to set the attribute manually:   
![\[The Play prompt properties page configured to manually play a text-to-speech or chat text message.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/cases-example-ivr-4.png)

   Use the following syntax for reading the status of the case to the customer:
   + For system fields, you can read the syntax and understand which field it refers to. For example: `$.Case.status` refers to the case status. For a list of system field IDs, see the *Field ID* column in the [System case fields](case-fields.md#system-case-fields) topic.
   + For custom fields, the syntax uses a UUID (unique ID) to represent the field. For example, in the following image, the ID for the custom field named *Detailed status* is `12345678-aaaa-bbbb-cccc-123456789012`.  
![\[A text-to-speech message that contains the status ID for a custom field.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/cases-example-ivr-5.png)

## Find the custom field ID
<a name="get-case-properties-find-uuid"></a>

To find the UUID of a custom field: 

1. In Amazon Connect, on the navigation menu choose **Agent applications**, **Custom fields**, and then choose the custom field that you want.

1. While on the details page for the custom field, look at the URL of the page. The UUID is the last portion of the URL. For example, in the following URL:

   `https://instance alias.my.connect.aws/cases/configuration/fields/update/12345678-aaaa-bbbb-cccc-123456789012`

   The UUID is `12345678-aaaa-bbbb-cccc-123456789012`.

The following image shows where you find the custom field ID at the end of a URL:

![\[An Account ID page with a URL in the browser, with the custom field ID highlighted at the end of the URL.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/cases-block-custom-field-uuid.png)


## Configuration tips
<a name="create-case-tips"></a>
+ Be sure to check the [Cases service quotas](amazon-connect-service-limits.md#cases-quotas), and request increases. The quotas apply when this block creates cases.
+ You can specify up to 10 **Response fields** on a Cases block. If you specify more than 10 and then publish the flow, the following error is displayed: 

   `Invalid or missing parameter data` `One or more parameters are invalid or missing. Click on the block header to edit the block and fix the problematic parameters before publishing.`

## Configured block
<a name="create-case-configured"></a>

The following image shows an example of what this block looks like when it is configured. It shows this block is configured to create cases, and it has **Success** and **Error** branches. 

![\[A configured Cases block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/create-case-block-configured.png)


# Flow block in Amazon Connect: Change routing priority / age
<a name="change-routing-priority"></a>

This topic describes setting up the Change routing priority / age flow block for changing the priority or length of time of a customer in a queue.

## Description
<a name="change-routing-priority-description"></a>
+ Change a customer's position in the queue. For example, move the contact to the front of the queue, or to the back of the queue.

## Supported channels
<a name="change-routing-priority-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | Yes | 
| Email | Yes | 

## Flow types
<a name="change-routing-priority-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Inbound flow
+ Customer queue flow
+ Transfer to Agent flow
+ Transfer to Queue flow

## Properties
<a name="change-routing-priority-properties"></a>

The following image shows the **Properties** page of the **Change routing priority / age** block. It is configured to add 8 seconds to the routing age of the contact.

![\[The properties page of the Change routing priority / age block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/change-routing-priority-properties.png)


This block gives you two options for changing a contact's position in queue: 
+ **Set priority**. The default priority for new contacts is 5. You can raise the priority of a contact - compared to other contacts in the queue - by assigning them a higher priority, such as 1 or 2. 
  + Default priority: 5
  + Range of valid values: 1 (highest) - 9223372036854775807 (lowest). If you enter a number larger than that, it will fail when the flow is published. 
+ **Adjust by time**. You can add or subtract seconds or minutes from the amount of time the current contact spends in queue. Contacts are routed to agents on a first-come, first-served basis. So changing their amount of time in queue compared to others also changes their position in queue.

Here's how this block works:

1. Amazon Connect takes the actual "time in queue" for the contact (in this case, how long this specific contact has spent in queue so far), and adds the number of seconds you specified in the **Adjust by time** property.

1. The additional seconds makes this specific contact look artificially older than it is. 

1. The routing system now perceives this contact's "time in queue" as longer than it actually is, which affects its position within the ranked list.

## Configuration tips
<a name="change-routing-priority-tips"></a>
+ When using this block, it takes at least 60 seconds for a change to take effect for contacts already in queue. 
+ If you need a change in a contact's priority to take effect immediately, set the priority before putting the contact in queue, that is, before using a [Transfer to queue](transfer-to-queue.md) block.

## Configured block
<a name="change-routing-priority-configured"></a>

The following image shows an example of what this block looks like when it is configured. It shows the **Queue time** is set to \$18 seconds, and it has a **Success** branch.

![\[A configured Change routing priority age block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/change-routing-priority-configured.png)


## Sample flows
<a name="change-routing-priority-samples"></a>

Amazon Connect includes a set of sample flows. For instructions that explain how to access the sample flows in the flow designer, see [Sample flows in Amazon Connect](contact-flow-samples.md). Following are topics that describe the sample flows which include this block.
+ [Sample customer queue priority flow in Amazon Connect](sample-customer-queue-priority.md)
+  [Sample queue configurations flow in Amazon Connect](sample-queue-configurations.md)

## Scenarios
<a name="change-routing-priority-scenarios"></a>

See these topics for more information about how routing priority works:
+ [How Amazon Connect uses routing profiles](concepts-routing.md)
+ [How routing works in Amazon Connect](about-routing.md)

# Flow block in Amazon Connect: Check call progress
<a name="check-call-progress"></a>

This topic defines the flow block for engaging with the output provided by an answering machine, and providing the appropriate branches to route the contact. 

## Description
<a name="check-call-progress-description"></a>
+ Engages with the output provided by an answering machine, and provides branches to route the contact accordingly.
+ It supports the following branches:
  + **Call answered**: The call has been answered by a person. 
  + **Voicemail (beep)**: Amazon Connect identifies that the call ended in a voicemail and it detects a beep.
  + **Voicemail (no beep)**:
    + Amazon Connect identifies that the call ended in a voicemail but it doesn't detect a beep.
    + Amazon Connect identifies that the call ended in a voicemail, but the beep is unknown.
  + **Not detected**: Could not detect whether there is voicemail. This happens when Amazon Connect is unable to make a positive determination of whether a call was answered by a live voice or an answering machine. Typical situations that land in this state include long silences or excessive background noise.
  + **Error**: If any errors are encountered due to Amazon Connect not running correctly after media has been established on the call, this is the path that will be taken by the flow. Media is established when the call is either answered by a live voice or by an answering machine. If the call is rejected by the network or encounters a system error while placing the outbound call, the flow is not run.
+ This block is key in [customer first callback use cases](customer-first-cb.md).

## Supported channels
<a name="check-call-progress-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | No - Error branch | 
| Task | No - Error branch | 
| Email | No - Error branch | 

## Flow types
<a name="check-call-progress-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ All flow types

## Properties
<a name="check-call-progress-properties"></a>

The following image shows the **Properties** page of the **Check call progress** block.

![\[The properties page of the Check call progress block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/check-call-progress-properties.png)


## Configured block
<a name="check-call-progress-configured-block"></a>

The following image shows an example of what this block looks like when it is configured. It has branches for **Call answered**, **Voicemail (beep)**, **Voicemail (no beep)**, **Not detected**, and **Error**.

![\[A configured Check call progress block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/check-call-progress-configured.png)


# Flow block in Amazon Connect: Check contact attributes
<a name="check-contact-attributes"></a>

This topic defines the flow block for branching based on a comparison to the value of a contact attribute.

## Description
<a name="check-contact-attributes-description"></a>
+ Branches based on a comparison to the value of a contact attribute.
+ Supported comparisons include: **Equals**, **Is Greater Than**, **Is Less Than**, **Starts With**, **Contains**.

## Supported channels
<a name="check-contact-attributes-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | Yes | 
| Email | Yes | 

## Flow types
<a name="check-contact-attributes-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ All flows

## Properties
<a name="check-contact-attributes-properties"></a>

The following image shows the **Properties** page of the **Check contact attributes** block. In this example, the block is configured to check whether the contact is a **PremiumCustomer**, which is a [user-defined attribute](connect-attrib-list.md#user-defined-attributes). 

![\[The properties page of the Check contact attributes block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/check-contact-attributes-properties.png)


### Conditions to check can be dynamic
<a name="check-dynamic-attributes"></a>

You can check conditions like the following:
+ \$1.Attributes.verificationCode

To check for a NULL value, you need to use a Lambda. 

### Amazon Lex attributes
<a name="check-lex-attributes"></a>

You can set attributes that are **Type** = **Lex** as follows: 
+ **Alternative Intents**: Usually you configure flows to branch on the winning Lex intent. However, in some situations, you might want to branch on an alternate intent. That is, what the customer might have meant. 

  For example, in the following image of the **Check contact attributes** properties page, it is configured so the alternative intent indicates that if Amazon Lex is more than 70% confident the customer meant *fraud*, the flow should branch accordingly.  
![\[The properties page of the Check contact attributes block configured for an alternative intent.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/check-contact-attributes-alternate-intents.png)

  1. **Intent name** is the name of an alternate intent in Lex. It's case sensitive and must match what's in Lex exactly.

  1. **Intent Attribute** is what Amazon Connect is going to check. In this example, it's going to check the **Intent Confidence Score**.

  1. **Conditions to check**: If Lex is 70% certain the customer meant the alternate intent instead of the winning intent, branch.
+ **Intent Confidence Score**: How confident is the bot that it understands the customer's intent. For example, if the customer says "I want to update an appointment," *update* can mean *reschedule* or *cancel*. Amazon Lex provides the confidence score on a scale of 0 to 1:
  + 0 = not at all confident
  + .5 = 50% confident
  + 1 = 100% confident
+ **Intent Name**: The user intent returned by Amazon Lex.
+ **Sentiment Label**: What is the winning sentiment, the one with the highest score. You can branch on POSITIVE, NEGATIVE, MIXED, or NEUTRAL.
+ **Sentiment Score**: Amazon Lex integrates with Amazon Comprehend to determine the sentiment expressed in an utterance:
  + Positive
  + Negative
  + Mixed: The utterance expresses both positive and negative sentiments.
  + Neutral: The utterance does not express either positive or negative sentiments.
+ **Session Attributes**: Map of key-value pairs representing the session-specific context information.
+ **Slots**: Map of intent slots (key/value pairs) Amazon Lex detected from the user input during the interaction.

## Configuration tips
<a name="check-contact-attributes-tips"></a>
+ If you have multiple conditions to compare, Amazon Connect checks them in the order they are listed. 

  For example, in the following image of the **Check contact attributes** properties page, it is configured so Amazon Connect compares the **greater than 60** condition first and compares **greater than 2** last.   
![\[The properties page of the Check contact attributes block set up to compare multiple conditions.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/check-contact-attributes-tips-order-conditions-are-checked.png)
+ This block doesn't support case-insensitive pattern matching. For example, if you're trying to match against the word **green** and the customer types **Green**, it would fail. You would have to include every permutation of upper and lower-case letters.

## Configured
<a name="check-contact-attributes-configured"></a>

The following image shows an example of what this block looks like when it is configured. It shows the block has four branches, one for each condition: greater or equal to 60, greater to equal to 10, greater or equal to 2, or **No match**.

![\[A configured Check contact attributes block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/check-contact-attributes-configured.png)


## Sample flows
<a name="check-contact-attributes-samples"></a>

Amazon Connect includes a set of sample flows. For instructions that explain how to access the sample flows in the flow designer, see [Sample flows in Amazon Connect](contact-flow-samples.md). Following are topics that describe the sample flows which include this block.
+ [Sample inbound flow in Amazon Connect for the first contact experience](sample-inbound-flow.md)
+  [Sample interruptible queue flow with callback in Amazon Connect](sample-interruptible-queue.md)

## Scenarios
<a name="check-contact-attributes-scenarios"></a>

See these topics for scenarios that use this block:
+ [How to reference contact attributes in Amazon Connect](how-to-reference-attributes.md)
+ [Personalize a contact's experience based on how they contact your contact center](use-channel-contact-attribute.md)

# Flow block in Amazon Connect: Check hours of operation
<a name="check-hours-of-operation"></a>

This topic defines the flow block to checks whether a contact occurs within or outside of the defined hours of operation.

## Description
<a name="check-hours-of-operation-description"></a>

Set up the **Check hours of operation** flow block to determine what path a contact should take at any given time.
+ It checks for hours of operation defined directly on the block.
+ If none are specified, it checks the hours for the current defined on the queue.
+ It checks if the designed hours of operations are open (in hours) or closed (out of hours), and provides configuration for each branch.
+ If optionally provides a way to create additional branches for overrides related to the hours of operation, for example to play a special greeting on a holiday before taking the standard out of hours path.

## Supported channels
<a name="check-hours-of-operation-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | Yes | 
| Email | Yes | 

## Flow types
<a name="check-hours-of-operation-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Inbound flow
+ Customer queue flow
+ Transfer to Agent flow
+ Transfer to Queue flow

## Properties
<a name="check-hours-of-operation-properties"></a>

Select the **Check hours of operation** flow block to view its properties and define what path a contact should take based on the current date and time.

1. Within Amazon Connect, navigate to the **Routing** menu.

1. Select the **Flows** page.

1. Open the desired resource.

1. Find its **Check hours of operation** block. It has default branches:

   1. **In hours**

   1. **Out of hours**

   1. **Error**

1. Click on the flow block to optionally specify an hours of operation for this flow.

   1. If not specified, Amazon Connect will use the hours associated with a contact's queue.

1. If you wish to set up special branching for certain dates, find the **Optional branches** section.  
![\[Check hours of operation properties.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/check-hours-of-operation-properties.png)

1. Select **Check override**.

1. Specify the name of the override that should have its own path.

1. Select **Confirm** then save your change.

1. Repeat as needed.  
![\[Check hours of operation branches.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/check-hours-of-operation-branches.png)

1. Build out the desired flow path for each new node.

For more information on standard day-of-the-week configurations, see [Set the hours of operation and time zone for a queue using Amazon Connect](set-hours-operation.md).

To learn more about overrides, see [Set overrides for extended, reduced, and holiday hours](hours-of-operation-overrides.md).

## Agent queues
<a name="hours-of-operation-with-agent-queues"></a>

Agent queues that are automatically created for each agent in your instance do not include an hours of operation.

If you use this block to check the hours of operation for an agent queue, the check fails and the contact is routed down the **Error** branch.

## Sample flows
<a name="check-hours-of-operation-samples"></a>

Amazon Connect includes a set of sample flows. For instructions that explain how to access the sample flows in the flow designer, see [Sample flows in Amazon Connect](contact-flow-samples.md). Following are topics that describe the sample flows which include this block.

[Sample inbound flow in Amazon Connect for the first contact experience](sample-inbound-flow.md)

# Flow block in Amazon Connect: Check queue status
<a name="check-queue-status"></a>

This topic defines the flow block for checking the status of a customer queue based on conditions set for that queue.

## Description
<a name="check-queue-status-description"></a>
+ Checks the status of the queue based on specified conditions.
+ Branches based on the comparison of **Time in Queue** or **Queue capacity**. 
  + **Time in queue** is the amount of time the oldest contact spends in queue, before they are routed to an agent or removed from the queue.
  + **Queue capacity** is number of contacts waiting in a queue.
+ If no match is found, the **No Match** branch is followed.

## Supported channels
<a name="check-queue-status-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | Yes | 
| Email | Yes | 

## Flow types
<a name="check-queue-status-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Inbound flow
+ Customer queue flow
+ Transfer to Agent flow
+ Transfer to Queue flow

## Properties
<a name="check-queue-status-properties"></a>

The following image shows the **Properties** page of the **Check queue status** block. In this example, it checks whether a contact has been in the BasicQueue longer than 2 minutes.

![\[The properties page of the Check queue status.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/check-queue-status-properties.png)


## Configuration tips
<a name="check-queue-status-tips"></a>

The order in which you add conditions matters at the runtime. Results are evaluated against conditions in the same order in which you add them to the block. Contacts are routed down the first condition to match. 

For example, in the following condition order, every value matches one of first two conditions. None of the other conditions are ever matched.
+ Time in Queue <= 90
+ Time in Queue >= 90
+ Time in Queue >= 9
+ Time in Queue >= 12
+ Time in Queue >= 15
+ Time in Queue >= 18
+ Time in Queue > 20
+ Time in Queue > 21

In this next example, all contacts with a wait time in queue of 90 or less (<=90) match first condition only. This means less than or equal to 9 (<=9), <=12, <=15, <=18, <=20, <=21 are never run. Any value greater than 90 is routed down the greater than or equal to 21 (>=21) condition branch. 
+ Time in Queue <= 90
+ Time in Queue <= 9
+ Time in Queue <= 12
+ Time in Queue <= 15
+ Time in Queue <= 18
+ Time in Queue < 20
+ Time in Queue < 21
+ Time in Queue > 21

## Configured block
<a name="check-queue-status-configured"></a>

The following image shows an example of what this block looks like when it is configured. It has three branches: the **Time in Queue** condition, **No Match**, and **Error**. 

![\[A configured check queue status block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/check-queue-status-configured.png)


## Scenarios
<a name="check-queue-status-scenarios"></a>

See these topics for scenarios that use this block:
+ [Set up a flow to manage contacts in a queue in Amazon Connect](queue-to-queue-transfer.md)

# Flow block in Amazon Connect: Check Voice ID
<a name="check-voice-id"></a>

**Note**  
End of support notice: On May 20, 2026, AWS will end support for Amazon Connect Voice ID. After May 20, 2026, you will no longer be able to access Voice ID on the Amazon Connect console, access Voice ID features on the Amazon Connect admin website or Contact Control Panel, or access Voice ID resources. For more information, visit [Amazon Connect Voice ID end of support](https://docs.aws.amazon.com/connect/latest/adminguide/amazonconnect-voiceid-end-of-support.html). 

This topic describes how the Check Voice ID block branches based on data returned by Amazon Connect Voice ID.

## Description
<a name="check-voice-id-description"></a>

**Note**  
The [Set Voice ID](set-voice-id.md) block needs to be set in the flow before this one. That block sends audio to [Amazon Connect Voice ID](voice-id.md) to verify the customer's identity, and returns a status. 

The **Check Voice ID** block branches based on the results of the voice analysis and the status returned by Voice ID:
+ **Enrollment status**: 
  + **Enrolled**: The caller is enrolled in voice authentication.
  + **Not enrolled**: The caller has not yet been enrolled in voice authentication. When this status is returned, for example, you may want to directly route the call to an agent for enrollment.
  + **Opted out**: The caller has opted out of voice authentication.

  You are not charged for checking enrollment status. 
+ **Voice authentication status**:
  + **Authenticated**: The caller's identity has been verified. That is, the authentication score is greater than or equal to the threshold (default threshold of 90 or your custom threshold).
  + **Not authenticated**: The authentication score is lower than threshold that you configured.
  + **Inconclusive**: Unable to analyze a caller's speech for authentication. This is usually because Voice ID did not get the required 10 seconds to provide a result for authentication. 
  + **Not enrolled**: The caller has not yet been enrolled in voice authentication. When this status is returned, for example, you may want to directly route the call to an agent for enrollment.
  + **Opted out**: The caller has opted out of voice authentication.

  You are not charged if the result is **Inconclusive**, **Not enrolled** or **Opted out**.
+ **Fraud detection status**: 
  + **High risk**: The risk score meets or exceeds the set threshold.
  + **Low risk**: The risk score did not meet the set threshold.
  + **Inconclusive**: Unable to analyze a caller's voice for detection of fraudsters in a watchlist.

  You are not charged if the result is **Inconclusive**.

**Note**  
For **Enrollment status** and **Voice authentication**, the [Customer ID](connect-attrib-list.md) system attribute needs to be set in [Set contact attributes](set-contact-attributes.md) block because they are acting on a specific customer. You don't need to do this for **Fraud detection** because it's not acting on a specific customer but rather detecting whether the incoming caller matches a fraudster on your watch list. This means it's possible for a customer to be successfully authenticated and still have high fraud risk. 

## Supported channels
<a name="check-voice-id-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | No - Error branch | 
| Task | No - Error branch | 
| Email | No - Error branch | 

## Flow types
<a name="check-voice-id-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Inbound flow
+ Customer queue flow
+ Customer whisper flow
+ Outbound whisper flow
+ Agent whisper flow
+ Transfer to Agent flow
+ Transfer to Queue flow

## Properties
<a name="check-voice-id-properties"></a>

This block doesn't have any properties that you set. Rather, it creates branches for you to route contacts based on the result of the authentication threshold and voiceprint evaluation that [Set Voice ID](set-voice-id.md) returns.

The following image shows the **Properties** page for the **Check voice ID** block when it's configured to check for Enrollment status. Different status results are returned when it's configured for **Voice authentication** or **Fraud detection**.

![\[The properties page of the Check voice ID block, with the Enrollment status option selected.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/check-voice-id-properties.png)


## Configuration tips
<a name="check-voice-id-tips"></a>

When you create a flow that uses this block, add these blocks in the following order:

1. [Set Voice ID](set-voice-id.md) block. 

1. [Set contact attributes](set-contact-attributes.md) block: For **Enrollment status** and **Voice authentication**, the [Customer ID](connect-attrib-list.md) system attribute needs to be set in [Set contact attributes](set-contact-attributes.md) block because it is acting on a specific customer.

1. **Check Voice ID** block.

## Configured block
<a name="check-voice-id-configured"></a>

The following three images show what this block looks like when it's configured to check for: 

1. Fraud detection

1. Voice authentication

1. Enrollment status

![\[Three configured Check voice ID blocks.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/check-voice-id-configured.png)


## More information
<a name="check-voice-id-more-info"></a>

See the following topics for more information about this block:
+ [Use real-time caller authentication with Voice ID in Amazon Connect](voice-id.md)
+ [Enroll callers in Voice ID in the Contact Control Panel (CCP)](use-voiceid.md)

# Flow block in Amazon Connect: Check staffing
<a name="check-staffing"></a>

This topic defines the flow block for checking the current or specified customer queue to gauge agent availability.

## Description
<a name="check-staffing-description"></a>
+ Checks the current working queue, or queue you specify in the block, for whether agents are [available](metrics-definitions.md#available-real-time), [staffed](metrics-definitions.md#staffed-agents), or [online](metrics-definitions.md#online-agents).
+ Before transferring a call to agent and putting that call in a queue, use the **Check hours of operation** and **Check staffing** blocks. They verify that the call is within working hours and that agents are staffed to service.

## Supported channels
<a name="check-staffing-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | Yes | 
| Email | Yes | 

## Flow types
<a name="check-staffing-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Inbound flow
+ Customer queue flow
+ Transfer to Agent flow
+ Transfer to Queue flow

## Properties
<a name="check-staffing-properties"></a>

The following image shows the **Properties** page of the **Check staffing** block. It is configured to check whether agents in the BasicQueue are available so they can be routed contacts.

![\[The properties page of the Check staffing block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/check-staffing-properties.png)


In the **Status to check** dropdown box, choose one of the following options:
+ [Available](metrics-definitions.md#available-real-time) = Check whether at least one agent in the queue is **Available**.
+ [Staffed agents](metrics-definitions.md#staffed-agents) = Check whether at least one agent in the queue is **Available**, **On call**, or in **After Contact Work**.
+ [Online agents](metrics-definitions.md#online-agents) = Check whether at least one agent in the queue is **Available**, in the **Staffed** state, or in a custom state.

## Configuration tips
<a name="check-staffing-tips"></a>
+ You must set a queue before using a **Check staffing** block in your flow. You can use a [Set working queue](set-working-queue.md) block to set the queue.
+ If a queue is not set, the contact is routed down the **Error** branch.
+ When a contact is transferred from one flow to another, the queue that is set in a flow is passed from that flow to the next flow.

## Configured block
<a name="check-staffing-configured"></a>

The following image shows an example of what this block looks like when it is configured. It has three branches: **True**, **False**, and **Error**. 

![\[A configured Check staffing block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/check-staffing-configured.png)


## Scenarios
<a name="check-staffing-scenarios"></a>

See these topics for scenarios that use this block:
+ [Transfer contacts to a specific agent in Amazon Connect](transfer-to-agent.md)

# Flow block in Amazon Connect: Contact tags
<a name="contact-tags-block"></a>

This topic defines the flow block for creating and applying tags to your contacts.

## Description
<a name="contact-tags-description"></a>
+ Use this block to create and apply user-defined tags (key:value pairs) to your contacts. 
+ You can create up to 6 user-defined tags. 
+ You set a value that can be referenced later in a flow. You can also remove tags in a flow, for example, if the tags aren't relevant to the segment anymore.
+ For more information about how to use tags to obtain a more detailed view of your Amazon Connect usage, see [Set up granular billing for a detailed view of your Amazon Connect usage](granular-billing.md). 

## Supported channels
<a name="contact-tags-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | Yes | 
| Email | Yes | 

## Flow types
<a name="contact-tags-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ All

## Properties
<a name="contact-tags-properties"></a>

The following image shows the **Properties** page of the **Contact tags** block. It is configured to set a tag on the current contact with the key **Department** and the value **Finance**.

![\[The properties page of the Contact tags block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/granularbilling-contacttags-properties.png)


You can also configure the block to untag a contact, as shown in the following image. 

![\[The properties page of the Contact tags block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/granularbilling-contacttags-properties-untag.png)


## Configuration tips
<a name="contact-tags-tips"></a>
+ For more information about how Amazon Connect processes user-defined tags, see [Things to know about user-defined tags](granular-billing.md#about-user-defined-tags). 

## Configured block
<a name="contact-tags-configured"></a>

The following image shows an example of what this block looks like when it is configured. It has two branches: **Success** and **Error**. 

![\[A configured Contact tags block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/granularbilling-contacttaggingblock-config.png)


# Flow block in Amazon Connect: Create persistent contact association
<a name="create-persistent-contact-association-block"></a>

This topic defines the flow block for creating a persistent contact association, enabling conversations with contacts to continue where they left off.

## Description
<a name="create-persistent-contact-association-description"></a>
+ Enables persistent chat experience on the current chat.
+ This allows you to select the required rehydration mode. For more information about chat rehydration, see [Enable customers to resume chat conversations in Amazon Connect](chat-persistence.md). 

## Supported channels
<a name="create-persistent-contact-association-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | No - Error branch | 
| Chat | Yes | 
| Task | No - Error branch | 

## Flow types
<a name="create-persistent-contact-association-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Inbound flow
+ Customer Queue flow
+ Customer hold flow
+ Customer whisper flow
+ Outbound whisper flow
+ Agent hold flow
+ Agent whisper flow
+ Transfer to agent flow
+ Transfer to queue flow

## Properties
<a name="create-persistent-contact-association-properties"></a>

The following image shows the **Properties** page of the **Create persistent contact association** block.

![\[The properties page of the Create persistent contact associations block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/create-persistent-contact-association-properties.png)


## Configuration tips
<a name="create-persistent-contact-association-tips"></a>
+ To enable persistent chat you can add the **Create persistent contact association** block to your flow, or provide the previous `contactId` in the `SourceContactId` parameter of the [StartChatContact](https://docs.aws.amazon.com/connect/latest/APIReference/API_StartChatContact.html) API, but not both. You can enable persistence of a `SourceContactID` on a new chat only once.

  We recommend that you enable persistent chat by using the **Create persistent contact association** block when using the following features:
  + [Amazon Connect chat widget](add-chat-to-website.md)
  + [Apple Messages for Business](apple-messages-for-business.md)
+ You can configure persistent chats to rehydrate the entire past chat conversation or rehydrate from a specific segment of a past chat conversation. For information about rehydration types, see [Enable customers to resume chat conversations in Amazon Connect](chat-persistence.md).

## Configured block
<a name="create-persistent-contact-association-configured"></a>

The following image shows an example of what this block looks like when it is configured. It has two branches: **Success** and **Error**. 

![\[A configured Create persistent contact associations block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/create-persistent-contact-association-configured.png)


# Flow block in Amazon Connect: Create task
<a name="create-task-block"></a>

This topic defines the flow block for creating a new task manually or based on an existing task template.

## Description
<a name="create-task-description"></a>
+ Creates a new task manually or by leveraging a [task template](task-templates.md). 
+ Sets the tasks attributes.
+ Initiates a flow to start the task immediately or schedules it for a future date and time.

For more information about Amazon Connect Tasks, see [The task channel in Amazon Connect](tasks.md) and [Pause and resume tasks in Amazon Connect Tasks](concepts-pause-and-resume-tasks.md). 

**Note**  
If your Amazon Connect instance was created on or before October 2018, the contact is routed down the error branch. For the contact to be routed down the success path, create an IAM policy with the following permission and attach it to the Amazon Connect service role. You can find the Amazon Connect service role on the **Account overview** page for your Amazon Connect instance.  

```
{
     "Effect": "Allow",
     "Action": "connect:StartTaskContact",
     "Resource": "*"
}
```

## Supported channels
<a name="create-task-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | Yes | 
| Email | Yes | 

## Flow types
<a name="create-task-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ All flows

## Properties
<a name="create-task-properties"></a>

When you configure a **Create task** block, you choose either **Create manually** or **Use template**. Your choice dictates which fields you'll need to complete on the rest of **Properties** page. Following is more information about these two options.

### Option 1: Create manually
<a name="create-manually"></a>

The following image shows the **Properties** page when **Create manually** is selected. All settings on the page can be specified manually or dynamically.

![\[The properties page of the Create task block, the Create manually option.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/create-task-properties-manually.png)


If you choose **Use template** at bottom of the page, the entire page switches to that option. If needed, you can toggle back to **Create manually** and continue with your manual settings.

### Option 2: Use template
<a name="use-template"></a>

After you [create a template](task-templates.md), it's available for you to specify it in **Create task** block.

The following image shows the **Properties** page when **Use template** is selected. 
+ If the selected template does not include a flow, you must specify the flow that you want the task to run.
+ You cannot overwrite the settings of any fields on the page that are populated by the template.

![\[The Properties page, the Use template option.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/create-task-properties-template.png)


## Configuration tips
<a name="create-task-tips"></a>
+ The **Create task** block branches based on whether the task was successfully created:
  + **Success** if task was created. It responds with the contact ID of the newly created task.
  + **Error** if task wasn't created.
+ **Referencing a task contact ID**: The newly created task runs the flow that you specified in the **Flow** section of the block, or it runs the flow configured by the task template that you selected. You can reference the contact ID of the newly created task in subsequent blocks. 

  For example, you might want to reference the task contact ID in the **Play prompt** block. You can specify the task contact ID dynamically by using the following attribute:
  + **Namespace: System**
  + **Value: Task Contact id**
+ **Scheduling a task**: When you **Set date and time using attribute**: Values for date fields must be in Unix timestamp (Epoch seconds). Because of this, it's most likely that you'll choose a **User-defined** attribute for the **Namespace**. 

  For example, your flow might have a **Set contact attributes** block that sets a user-defined attribute with key named *scheduledTaskTime*. Then, in the **Create task** block, you would select **User-defined**, and the key would be *scheduledTaskTime*.

  To continue with this example, the value in *scheduledTaskTime* must be specified Unix timestamp. For example, 1679609303 is the Unix timestamp that corresponds to Thursday, March 23, 2023 10:08:23 PM UTC.

  When the date and time have passed, contacts are always routed down the **Error** branch. To avoid the **Error** branch, be sure to keep the Epoch seconds updated to a valid date and time in the future. 
+ Use the **Link to contact** option to automatically link the task to the contact. 
+ Be sure to check the [service quotas](amazon-connect-service-limits.md) for tasks and API throttling, and request increases, if needed. The quotas apply when this block creates tasks.

## Configured block
<a name="create-task-configured"></a>

The following image shows an example of what this block looks like when it is configured. It has two branches: **Success** and **Error**. 

![\[A configured Create task block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/create-task-configured.png)


## Sample flows
<a name="create-task-samples"></a>

Amazon Connect includes a set of sample flows. For instructions that explain how to access the sample flows in the flow designer, see [Sample flows in Amazon Connect](contact-flow-samples.md). Following are topics that describe the sample flows which include this block.
+ [Sample inbound flow in Amazon Connect for the first contact experience](sample-inbound-flow.md)

# Flow block in Amazon Connect: Customer profiles
<a name="customer-profiles-block"></a>

This topic defines the flow block for retrieving, creating, and updating a customer profile.

## Description
<a name="customer-profiles-block-description"></a>
+ Enables you to retrieve, create, and update a customer profile.
  + You can configure the block to retrieve profiles using up to five search identifiers of your choice.
+ Enables you to retrieve a Customer Profile's object and calculated attributes.
  + You can configure the block to retrieve objects using a search identifier of your choice.
  + You must provide a profile ID in this block. You can provide a **profileID** manually, or use the **profileID** saved in the Customer namespace after you have found a profile using the **Get profile** action.
+ Enables you to associate the contact, such as voice, chat, and tasks, to an existing customer profile.
+ When customer profile data is retrieved, the **Response fields** are stored in the [contact attributes for that customer](connect-attrib-list.md#customer-profiles-attributes), allowing you to use them in subsequent blocks.
+ You can also reference the **Response fields** by using the following JSONPath: `$.Customer.` For example, `$.Customer.City` and `$.Customer.Asset.Status`.
+ The following examples show how you might use this block:
  + Use a [Play prompt](play.md) block after retrieving a profile to provide a personalized call or chat experience by referencing the supported profile fields.
  + Use a [Check contact attributes](check-contact-attributes.md) block after retrieving profile data to route a contact conditional on the value.
  + See [How to persist fields throughout the flow](#customer-profiles-block-persist-fields) for more details.

## Supported channels
<a name="customer-profiles-block-channels"></a>

The following table lists how this block routes a contact that is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
|  Voice  |  Yes  | 
|  Chat  |  Yes  | 
|  Task  |  Yes  | 
| Email | Yes | 

## Flow types
<a name="customer-profiles-block-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ All flow types

## Configuration tips
<a name="customer-profiles-block-tips"></a>
+ Before using this block, make sure Customer Profiles is enabled for your Amazon Connect instance. For instructions, see [Use Amazon Connect Customer Profiles](customer-profiles.md).
+ A contact is routed down the **Error** branch in the following situations:
  + Customer Profiles is not enabled for your Amazon Connect instance.
  + Request data values are not valid. The request values cannot be over 255 characters.
  + The Customer Profiles API request has been throttled.
  + Customer Profiles is having availability issues.
+ The total size of [Customer Profiles contact attributes](connect-attrib-list.md#customer-profiles-attributes) is limited to 14,000 characters (56 attributes assuming max size of 255 each) for the entire flow. This includes all values persisted as **Response fields** in Customer Profiles blocks during the flow.

## Properties
<a name="customer-profiles-block-properties"></a>

The following property types are available in the Customer Profiles flow block:
+ **[Get Profile](#customer-profiles-block-properties-get-profile)**
+ **[Create Profile](#customer-profiles-block-properties-create-profile)**
+ **[Update Profile](#customer-profiles-block-properties-update-profile)**
+ **[Get Profile Object](#customer-profiles-block-properties-get-profile-object)**
+ **[Get Calculated Attributes](#customer-profiles-block-properties-get-calculated-attributes)**
+ **[Associate Contact to Profile](#customer-profiles-block-properties-associate.title)**

## Properties: Get profile
<a name="customer-profiles-block-properties-get-profile"></a>

When configuring properties to **Get profile**, consider the following:
+ You must provide at least one search identifier, up to five total. 
+ If multiple search identifiers are provided, you must provide one logical operator, either **AND** or **OR**. The logical operator is applied across all search identifiers like one of the following expressions:
  + (a **AND** b **AND** c) 
  + (x **OR** y **OR** z) 
+ Define attributes to persist in subsequent blocks, storing them in contact attributes under **Response fields**.
+  Contacts can be routed down the following branches 
  +  **Success: ** one profile was found. Response fields are stored to contact attributes 
  +  **Error:** An error was encountered while trying to find the profile. This may be due to a system error or how **Get profile** is configured. 
  +  **Multiple Found:** multiple profiles were found. 
  +  **None Found:** no profile was found. 

The following image shows an example of a Customer Profiles **Properties** page that is configured for the **Get profile** action.

The example block is configured to search for profiles that either match the caller's **Phone** number or share the same **Account** number stored in the user-defined attribute named "Account." When one profile is located, the following fields are stored in the contact attributes for that specific customer: **Response fields** - **AccountNumber**, **FirstName**, **LastName**, **PhoneNumber**, and **Attributes.LoyaltyPoints**.

![\[The properties page of the Customer Profiles GetProfile block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-profiles-block-properties-get-profile.png)


## Properties: Create profile
<a name="customer-profiles-block-properties-create-profile"></a>

When configuring properties for **Create profile**, consider the following:
+ Specify the attributes you intend to populate during profile creation in the **Request fields** 
+ Define attributes to persist in subsequent blocks, storing them in contact attributes under **Response fields**.

 Contacts can be routed down the following branches:
+  **Success: ** A profile is successfully created, and **Response fields** are stored in contact attributes.
+  **Error:** An error occurred during the profile creation process, possibly due to a system error or misconfiguration of the **Create profile** action.

The following example block is configured to create a profile with a **PhoneNumber** and a custom attribute named “Language". Following the profile creation, the **Attributes.Language** response field is stored in contact attributes, making it available for use in subsequent blocks.

![\[The properties page of the Customer Profiles CreateProfile block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-profiles-block-properties-create-profile.png)


## Properties: Update profile
<a name="customer-profiles-block-properties-update-profile"></a>

When configuring properties to **Update profile**, consider the following:
+ Before using an **Update profile** block, use a **Get profile** block, as shown in the following image. Use the **Get profile** block to locate the specific profile you intend to update.  
![\[The properties page of the Customer Profiles UpdateProfile block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-profiles-block-properties-update-profile-1.png)
+ Provide the attributes and values you wish to update the profile with **Request fields** and **Request field values**. 
+ Define attributes to persist in subsequent blocks, storing them in contact attributes under **Response fields**.

 Contacts can be routed down the following branches:
+  **Success:** The profile has been successfully updated, and **Response fields** are stored in contact attributes.
+  **Error:** An error occurred during the attempt to update the profile. This could result from a system error or misconfiguration of the **Update profile** action.

The displayed block below is configured to update a Profile with a **MailingAddress1** with user input as value. When a profile is updated, the **MailingAddress1** response field is stored in contact attributes, making it available for use in subsequent blocks.

![\[The properties page of the Customer Profiles UpdateProfiles block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-profiles-block-properties-update-profile-2.png)


## Properties: Check segment membership
<a name="customer-profiles-block-properties-check-segment-membership"></a>

**Important**  
 To use this action, your Amazon Connect instance must have permission for the following APIs: ListSegmentDefinitions, GetSegmentMembership, BatchGetProfile, and BatchGetCalculatedAttributeForProfile in either of the following Policies: **AmazonConnectServiceLinkedRolePolicy** or **AmazonConnectServiceCustomerProfileAccess**. 

**Important**  
If you are checking segment membership for a segment powered by Spark SQL, the segment checked is the last segment created and not updated in real-time. The lastComputedAt API attributes provides the last time the segment snapshot was created. You can run a new segment snapshot to refresh the segment. If you receive a 4XX error, ensure you have created a segment snapshot.

 When configuring properties to **Check segment membership**, consider the following: 
+  **Mandatory Profile ID:** A Profile ID is required for this block to function. The **Get profile object** action retrieves an object associated with the provided **ProfileID**. Ensure you provide the **ProfileID** by using a preceding **Get profile** block. Use the **Get profile** block to pinpoint the specific profile before moving forward to retrieve the profile's object in the subsequent block. 
  +  You have the option to manually input the Profile ID or use a pre-defined value stored in a pre-defined or user attribute.

    The following image shows an example flow configured to get profile, and then check segment membership.  
![\[A flow with a Get profile action and then a Check segment membership action.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-profiles-block-properties-check-segment-membership-1.png)
+  You must provide a value for segment. You have the option to manually select the segment or set dynamically by using a pre-defined value stored in a pre-defined or user attribute. 
+  When you set a segment dynamically, provide an attribute that refers to the customer segment's identifier. You can find the identifier on the **View segment detail** page or as SegmentDefinitionName in the [ListSegmentDefinitions](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_ListSegmentDefinitions.html) operation in the Customer Profiles API. 

  The following image shows the location of **Segment ID** on the **View segment details** page.  
![\[The Segment details section, the Segment ID.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-profiles-block-properties-check-segment-membership-2.png)
+ The following image shows an example of checking segment membership. **Profile ID** is set to be checked dynamically and **Segment** manually.   
![\[The Customer profiles block configured to check segment membership.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-profiles-block-properties-check-segment-membership-3.png)

**Contacts can be routed down the following branches**
+  **In segment**: The profile belongs to the customer segment. 
+  **Not in segment**: The profile does not belong to the customer segment. 
+  **Error**: An error occurred while attempting to check the segment membership. This may be due to a system error or misconfiguration of the **Check segment membership** action. To learn more about flow error logging, see [Enable Amazon Connect flow logs in an Amazon CloudWatch log group](contact-flow-logs.md).

## Properties: Get profile object
<a name="customer-profiles-block-properties-get-profile-object"></a>

When configuring properties to **Get profile object**, consider the following:
+ **Mandatory Profile ID:** A Profile ID is required for this block to function. The **Get profile object** action retrieves an object associated with the provided **ProfileID**. Ensure you provide the **ProfileID** by using a preceding **Get profile** block, as illustrated in the following image. Use the **Get profile** block to pinpoint the specific profile before moving forward to retrieve the profile’s object in the subsequent block.
  + You have the option to manually input the Profile ID or use a pre-defined value stored in a pre-defined or user attribute.  
![\[The properties page of the Customer Profiles GetProfileOject block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-profiles-block-properties-get-profile-object-1.png)
+ You must indicate the object type from which you intend to retrieve information.
+ You must choose one of the following options for object retrieval:
  +  **Use latest profile object:** This option consistently retrieves the most recent object.
  +  **Use search identifier:** This option involves searching for and retrieving the object using the provided search identifier.
+  Define attributes to persist in subsequent blocks, storing them in contact attributes under **Response fields **.

 Contacts can be routed down the following branches:
+  **Success:** The profile object is successfully located, and **Response fields** are stored in contact attributes.
+  **Error:** An error occurred during the attempt to retrieve the profile object. This may be due to a system error or misconfiguration of the **Get Profile** action.
+  **None Found:** no object is found. 

The displayed block below is configured to retrieve a profile object of type "Asset" associated with the **ProfileId** saved under the "Customer" namespace. In this specific scenario, the block is will search for an Asset using the Asset ID. After the Asset is located, **Asset.Price** and **Asset.PurchaseDate** are stored in contact attributes, making them available for subsequent blocks.

![\[The properties page of the Customer Profiles GetProfileObject block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-profiles-block-properties-get-profile-object-2.png)


## Properties: Get calculated attributes
<a name="customer-profiles-block-properties-get-calculated-attributes"></a>

**Important**  
To use this action, your Amazon Connect instance must have permission for the following APIs: `ListCalculatedAttributeDefinitions` and `GetCalculatedAttributeForProfile` in either of the following Policies: **AmazonConnectServiceLinkedRolePolicy** or **AmazonConnectServiceCustomerProfileAccess**.

When configuring properties to **Get calculated attributes**, consider the following:
+ **Mandatory Profile ID:** A Profile ID is required for this block to function. The **Get calculated attributes** action retrieves an object associated with the provided **ProfileID**. Ensure you provide the **ProfileID** by using a preceding **Get profile** block, as illustrated in the following image. Use the **Get profile** block to pinpoint the specific profile before moving forward to retrieve the profile's calculated attributes in the subsequent block.
  + You have the option to manually input the Profile ID or use a pre-defined value stored in a pre-defined or user attribute.  
![\[The properties page of the Customer Profiles GetCalculatedAttributes block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-profiles-block-properties-get-calculated-attributes-1.png)
+ Define attributes to persist in subsequent blocks, storing them in contact attributes under **Response fields**.
  + The options under **Response fields** are the Calculated Attribute definitions defined for your Customer Profiles domain
  + If the definition of calculated attributes uses a threshold, the calculated attribute value with be a Boolean and either return a True/False. Otherwise, they will return a numeric or string value. The return value of the calculated attribute can be used for branching purposes in a **Check Contact Attributes** block by using conditions such as **Equals** , **Is greater than** , **Is less than** , and **Contains**.

 Contacts can be routed down the following branches:
+  **Success:** A calculated attribute is found, and Response fields are stored in contact attributes.
+  **Error:** An error occurred while attempting to retrieve the calculated attribute. This may be due to a system error or misconfiguration of the **Get calculated attribute** action.
+  **None Found:** no calculated attribute is found.

The displayed block below is configured to get calculated attributes belonging to the provided **ProfileId** in contact attributes. The following **Response fields** will be retrieved and stored in contact attributes: **Average Call Duration**, and **Frequent Caller**.

![\[The properties page of the Customer Profiles GetCalculatedAttributes block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-profiles-block-properties-get-calculated-attributes-2.png)


## Properties: Associate contact to profile
<a name="customer-profiles-block-properties-associate"></a>

**Important**  
To use this action, your Amazon Connect instance must have permission for the following APIs: `ListCalculatedAttributeDefinitions` and `GetCalculatedAttributeForProfile` in either of the following Policies: **AmazonConnectServiceLinkedRolePolicy** or **AmazonConnectServiceCustomerProfileAccess**.

To use this action, you must also enable the Customer Profiles View permission in your security profile.

When configuring properties to **Associate contact to profile**, consider the following:
+  Add a **Get profile** block before an ** Associate contact to profile** , as shown in the following image. Use the **Get profile** block to find the profile first, then associate the contact and profile in the next block.
+ **Mandatory Profile ID:** A Profile ID is required for this block to function. Ensure you provide the **ProfileID** by using a preceding **Get profile** block, as illustrated in the following image. Use the **Get profile** block to pinpoint the specific profile you wish to associate the contact to in the next block.
  + You have the option to manually input the Profile ID or use a pre-defined value stored in a pre-defined or user attribute.  
![\[The properties page of the Customer Profiles AssociateContactToProfile block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-profiles-block-properties-associate-1.png)
+  You must provide a value for Contact ID.

 Contacts can be routed down the following branches:
+  **Success:** Associated the contact to profile.
+  **Error:** An error was encountered while attempting to associate the contact to profile. This may be due to a system error or misconfiguration of the **Associate contact to profile** action.

The following block is configured to associate the profile with **Profile ID** stored in contact attributes to the current Contact ID stored in contact attributes.

![\[The properties page of the Customer Profiles AssociateContactToProfile block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-profiles-block-properties-associate-2.png)


## Properties: Get profile recommendations
<a name="get-profile-recommendations"></a>

**Important**  
To use this action, your Amazon Connect instance must have permission for the following API: `GetProfileRecommendations` in either of the following Policies: **AmazonConnectServiceLinkedRolePolicy** or **AmazonConnectServiceCustomerProfileAccess**.

For more details on how to set up and use the** Get profile recommendations** block, please refer to [Step 4: Using Predictive Insights across customer engagement channels](predictive-insights-get-started.md#use-across-customer-engagement-channels).

## How to persist fields throughout the flow
<a name="customer-profiles-block-persist-fields"></a>

Let’s say you want customers to interact with your contact center and learn the status of their delivery order without directly communicating with an agent. Additionally, let’s say you want to prioritize incoming calls from customers who have experienced more than 10 minutes delay in the past. 

In these scenarios, the IVR needs to fetch the relevant information about the customer. This is achieved through the Customer Profiles block. Secondly, the IVR needs to leverage this customer data in other Flow blocks in order to personalize the experience and proactively service the customer. 

1.  Use **Play Prompt** to personalize the experience by greeting the customer by name and informing them of their status.   
![\[Use Play Prompt to personalize the experience by greeting the customer by name and informing them of their status.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-profiles-block-persist-fields-1.png)

1. Use **Check contact attributes** to conditionally route customers based on their Average Hold Time from previous interactions  
![\[Use Check contact attributes to conditionally route customers based on their Average Hold Time from previous interactions.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-profiles-block-persist-fields-2.png)

## Configured block
<a name="customer-profiles-block-configured"></a>

The following image shows an example of what this block looks like when it is configured. It shows four branches: **Success**, **Error**, **Multiple found**, and **None found**.

![\[A configured Customer profiles block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-profiles-block-configured.png)


# Flow block in Amazon Connect: Data Table
<a name="data-table-block"></a>

## Description
<a name="data-table-block-description"></a>

The Data Table block in Amazon Connect enables you to evaluate, list, or write data from data tables within your contact flows. This block facilitates dynamic decision-making, personalized customer experiences, and data management by interacting with structured data stored in your Amazon Connect data tables.

## Use cases
<a name="data-table-block-use-cases"></a>

Data Table blocks are useful for:
+ **Configuration retrieval** – Access business rules, routing parameters, or operational settings stored in data tables.
+ **Dynamic routing decisions** – Query data tables to determine the appropriate queue, agent, or flow path based on customer attributes.
+ **Status checks** – Verify account status, eligibility, or other conditions before proceeding with specific actions.

## Supported channels
<a name="data-table-block-channels"></a>

The following table lists how this block routes a contact who is using the specified channel.


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | Yes | 
| Email | Yes | 

## Flow types
<a name="data-table-block-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ All flows

## Configuration overview
<a name="data-table-block-configuration"></a>

### Select action
<a name="data-table-block-select-action"></a>

Choose the type of operation you want to perform:
+ Read from data table – Query or retrieve data (Evaluate or List actions)
+ Write to data table – Create new records or update existing records

### Define data table
<a name="data-table-block-define-table"></a>
+ Choose **Set manually** to directly select a data table
+ Select your target data table from the dropdown
+ Important: Once you select a specific data table, the interface automatically populates the available attributes from that table in the relevant configuration sections

## Evaluate Data Table values
<a name="data-table-block-evaluate"></a>

Use the Evaluate action to query data tables and retrieve specific attribute values based on defined criteria.

The following image shows the **Properties** page of the **Data Table** block configured to evaluate data table values.

![\[The properties page of the Data Table block configured for Evaluate action.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/data-table-evaluate.png)


### Configuration steps
<a name="data-table-evaluate-steps"></a>

1. Select **Read from data table** as the Action.

1. Select **Evaluate Data Table values** from the read action dropdown.

1. Configure Queries:
   + You can set up to 5 queries per Data Table block. At least one query is required for each Evaluate Data Table block.
   + For each query:
     + **Query Name (Required)** – Provide a descriptive name for the query. Important: Query names must be unique throughout the entire flow, not just within this specific block.
     + **Primary Attributes** – When you manually select a data table, the UI automatically populates the list of primary attributes from that table's schema. All primary attribute fields are required - you must provide values for each primary attribute displayed. These attributes act as filters to identify the specific row(s) in your data table.
     + **Query Attributes** – When you manually select a data table, the dropdown is automatically populated with all available attributes from that table. Select one or more attributes from the dropdown. These are the data fields that will be returned and made available for use in your flow. Retrieved values can be referenced in subsequent blocks using the query name.

### Key details for Evaluate
<a name="data-table-evaluate-details"></a>
+ **Query limit** – Up to 5 queries per block
+ **Minimum requirement** – At least one query must be configured
+ **Query name uniqueness** – Must be unique across the entire contact flow
+ **Attribute matching** – Primary attributes use exact matching to locate rows
+ **Required fields** – All primary attributes are mandatory

### Accessing retrieved data for Evaluate
<a name="data-table-evaluate-accessing-data"></a>

After executing an Evaluate action, you can access the retrieved attribute values using the following namespace format: `$.DataTables.QueryName.AttributeName`. Use brackets and single quotes to reference attribute names with special characters. For example, `$.DataTables.CustomQuery['my attribute name with spaces']`. If using the **Data tables** namespace dynamic dropdown selection, the root namespace, `$.DataTables.`, can be ommitted.
+ **Components:**
  + `QueryName` – The unique name you assigned to the query in the configuration
  + `AttributeName` – The name of the attribute you selected to retrieve
+ **Usage** – These values can be referenced in subsequent flow blocks such as:
  + Check contact attributes blocks (for conditional branching)
  + Set contact attributes blocks (to store in other namespaces)
  + Play prompt blocks (to provide personalized messages)
  + Invoke Lambda function blocks (to pass as input parameters)
+ **Example** – If you configured a query named "CustomerLookup" that retrieves attributes "accountStatus" and "loyaltyTier":
  + Access account status: `$.DataTables.CustomerLookup.accountStatus`
  + Access loyalty tier: `$.DataTables.CustomerLookup.loyaltyTier`
+ **Note:**
  + If the query returns no results or the attribute is not found, the reference will be empty or null.
  + Data table values of type list are not supported.
  + Subsequent data table blocks will clear previous queries from the data tables namespace.
  + Query results in the data tables namespace are only available in the flow that contains the data table flow block.

## List Data Table values
<a name="data-table-block-list"></a>

Use the List action to retrieve whole rows from a data table that match specified criteria.

The following image shows the **Properties** page of the **Data Table** block configured to list data table values.

![\[The properties page of the Data Table block configured for List action.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/data-table-list.png)


### Configuration steps
<a name="data-table-list-steps"></a>

1. Select **Read from data table** as the Action.

1. Select **List Data Table values** from the read action dropdown.

1. Configure Primary Value Groups:
   + You can add up to 5 primary value groups to define different sets of filtering criteria.
   + For each primary value group:
     + **Group Name (Required)** – Provide a descriptive name for the primary value group. This name will be used to reference the retrieved record set in subsequent flow blocks. Important: Group names must be unique throughout the entire flow, not just within this specific block.
     + **Primary Attributes** – When you manually select a data table, the UI automatically populates the list of primary attributes from that table's schema. All primary attribute fields are required - you must provide values for each primary attribute displayed. These attributes act as filters to identify the specific rows in your data table that will be returned.

   Note: Unlike the Evaluate action which retrieves specific attribute values, the List action returns entire records (all attributes) that match the primary attribute criteria.

### Key details for List
<a name="data-table-list-details"></a>
+ **Primary value group limit** – Up to 5 primary value groups per block
+ **Group name uniqueness** – Must be unique across the entire contact flow
+ **Attribute matching** – Primary attributes use exact matching to locate rows
+ **Return behavior** – Returns complete records, not just selected attributes. If no primary value group is configured, the entire table will be loaded with in 32KB limit.

### Accessing retrieved data for List
<a name="data-table-list-accessing-data"></a>

After executing a List action, the retrieved data is stored in a structured format. You can access the data using the following namespace patterns:
+ **Metadata Access:**
  + Data table ID: `$.DataTableList.ResultData.dataTableId`
  + Lock version: `$.DataTableList.ResultData.lockVersion.dataTable`
+ **List Data Access** – To access specific data from the list:
  + Access a specific row by index: `$.DataTableList.ResultData.primaryKeyGroups.GroupName[index]`
  + Access primary key value: `$.DataTableList.ResultData.primaryKeyGroups.GroupName[index].primaryKeys[index].attributeValue`
  + Access attribute value: `$.DataTableList.ResultData.primaryKeyGroups.GroupName[index].attributes[index].attributeValue`
+ **Usage** – These values can be referenced in subsequent flow blocks such as:
  + Set contact attributes blocks (to extract and store specific values)
  + Invoke Lambda function blocks or module (to pass the entire result set for processing)
+ **Example** – If you configured a primary value group named "OrderHistory":
  + Access first row: `$.DataTableList.ResultData.primaryKeyGroups.OrderHistory[0]`
  + Access first row's first attribute value: `$.DataTableList.ResultData.primaryKeyGroups.OrderHistory[0].attributes[0].attributeValue`
+ **Note:**
  + The list returns complete records (all attributes), not just selected ones
  + If no matching records are found, the primaryKeyGroups array will be empty
  + When no primary key group is configured, the entire table is loaded and results are accessible under a "default" group name: `$.DataTableList.ResultData.primaryKeyGroups.default[index]`
  + When accessing array elements in flow blocks, use backticks to wrap the JSONPath reference: ``$.DataTableList.ResultData.primaryKeyGroups.<GroupName>[index]``

## Write to Data Table
<a name="data-table-block-write"></a>

Use the Write action to create new records or update existing records in a data table.

The following image shows the **Properties** page of the **Data Table** block configured to write to a data table.

![\[The properties page of the Data Table block configured for Write action.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/data-table-write.png)


### Configuration steps
<a name="data-table-write-steps"></a>

1. Select **Write to data table** as the Action.

1. Configure Primary Value Groups:
   + You can add multiple primary value groups to define different records to write or update. At least one primary value group is required for each Write Data Table block.
   + The interface provides two input methods via tabs:
     + Input tab – Structured form-based configuration (recommended for most users)
     + Raw JSON tab – Direct JSON input for advanced users
   + For each primary value group:
     + **Group Name (Required)** – Provide a descriptive name for the primary value group. This name will be used to reference the write operation in subsequent flow blocks. Important: Group names must be unique throughout the entire flow, not just within this specific block.
     + **Primary Attributes** – When you manually select a data table, the UI automatically populates the list of primary attributes from that table's schema. All primary attribute fields are required - you must provide values for each primary attribute displayed. These attributes function as the key fields that determine which record will be created or updated. If a record with matching primary attribute values exists, it will be updated; otherwise, a new record will be created.
     + **Configure Attributes to Write**
       + **Attribute Name (Required)** – When you manually select a data table, the dropdown is automatically populated with all available attributes from that table. Select the attribute you want to write or update. You can add multiple attributes by clicking **Add attribute to write**.
       + **Attribute Value Configuration** – For each attribute, choose one of the following options:
         + Set attribute value (selected by default) – Specify the value to write to the attribute. This field is required when this option is selected. Values can be static text, contact attributes, or system variables.
         + Use default value – Uses the default value defined in the data table schema. No additional value input is required when this option is selected.
     + **Configure Lock Version** – The lock version setting controls how concurrent write operations to datatable are handled:
       + Use Latest option – Always writes to the most recent version of the record. Suitable for most use cases where concurrent updates are unlikely or acceptable.
       + Set dynamically option – Allows you to specify the version number dynamically at runtime via Lambda or module.

### Attribute limit for Write
<a name="data-table-write-attribute-limit"></a>

The Write action has a total attribute limit of 25 across all primary value groups in a single block. This limit is calculated as follows:
+ If a primary value group has no "Attributes to write" configured – The count of primary attribute values in that group is counted toward the total limit
+ If a primary value group has "Attributes to write" configured – The count of attributes to write is counted toward the total limit (primary attributes are not counted in this case)

**Examples:**
+ Example 1: A primary value group with 3 primary attributes and no attributes to write = 3 toward the limit
+ Example 2: A primary value group with 3 primary attributes and 5 attributes to write = 5 toward the limit
+ Example 3: Three primary value groups, each with 3 primary attributes and 5 attributes to write = 15 (5 \$1 5 \$1 5) toward the limit

Important: The sum of all counted attributes across all primary value groups must not exceed 25.

### Key details for Write
<a name="data-table-write-details"></a>
+ **Minimum requirement** – At least one primary value group must be configured
+ **No limit on primary value groups** – Unlike the List action, there is no fixed limit on the number of primary value groups
+ **Attribute limit** – The total sum of counted attributes across all primary value groups must not exceed 25
+ **Attribute matching** – Primary attributes use exact matching to identify the target record
+ **Required fields** – All primary attributes and selected attribute values (when "Set attribute value" is chosen) are mandatory
+ **Upsert behavior** – If a record with matching primary attributes exists, it will be updated; otherwise, a new record will be created

## Configured block
<a name="data-table-block-configured"></a>

When configured, this block has branches for **Success** and **Error**.

# Flow block in Amazon Connect: Disconnect / hang up
<a name="disconnect-hang-up"></a>

This topic defines the flow block for disconnecting a contact at the end of a call.

## Description
<a name="disconnect-hang-up-description"></a>
+ Disconnects the contact.

## Supported channels
<a name="disconnect-hang-up-channels"></a>

The following table lists how this block routes a contact that is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | Yes | 
| Email | Yes | 

## Flow types
<a name="disconnect-hang-up-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Inbound flow
+ Customer queue flow
+ Transfer to Agent flow
+ Transfer to Queue flow

# Flow block in Amazon Connect: Distribute by percentage
<a name="distribute-by-percentage"></a>

This topic defines the flow block for routing customers randomly to a queue based on a percentage.

## Description
<a name="distribute-by-percentage-description"></a>
+ This block is useful for doing A/B testing. It routes customers randomly based on a percentage.
+ Contacts are distributed randomly, so exact percentage splits may or may not occur.

## Supported channels
<a name="distribute-by-percentage-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | Yes | 
| Email | Yes | 

## Flow types
<a name="distribute-by-percentage-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Inbound flow
+ Customer queue flow
+ Outbound Whisper flow
+ Transfer to Agent flow
+ Transfer to Queue flow

## Properties
<a name="distribute-by-percentage-properties"></a>

The following image shows the **Properties** page of the **Distribute by percentage** block. It is configured to route 50% of contacts to the test branch.

![\[The properties page of the Distribute by percentage block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/distribute-by-percentage-properties.png)


## How it works
<a name="distribute-by-percentage-works"></a>

This block creates static allocation rules based on how you configure it. Internal logic generates a random number between 1-100. This number identifies which branch to take. It doesn't use current or historical volume as part of it's logic.

For example, say a block is configure like this:
+ 20% = A
+ 40% = B
+ 40% remaining = Default

When contact a is being routed through a flow, Amazon Connect generates the random number. 
+ If number is between 0-20, the contact is routed down the A branch.
+ Between 21-60 it's routed down the B branch.
+ Greater than 60 it's routed down the Default branch.

## Configured block
<a name="distribute-by-percentage-configured"></a>

The following image shows an example of what this block looks like when it is configured. It shows two branches: **50% test** and **50% default**.

![\[A configured distribute by percentage block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/distribute-by-percentage-configured.png)


## Sample flows
<a name="distribute-by-percentage-samples"></a>

Amazon Connect includes a set of sample flows. For instructions that explain how to access the sample flows in the flow designer, see [Sample flows in Amazon Connect](contact-flow-samples.md). Following are topics that describe the sample flows which include this block.
+ [Sample flow in Amazon Connect for A/B contact distribution testing](sample-ab-test.md)

# Flow block in Amazon Connect: End flow / Resume
<a name="end-flow-resume"></a>

## Description
<a name="end-flow-resume-description"></a>

**Important**  
The End flow / Resume block is a terminal flow block. It enables you to end a paused flow and return the contact without terminating the overall interaction. However, if you place the **End flow / Resume** block in an inbound flow or disconnect flow, it functions identically to the **Disconnect** block, and terminates the contact.
+ Ends the current flow without disconnecting the contact.
+ This block is often used for the **Success** branch of the **Transfer to queue** block. The flow doesn't end until the call is picked up by an agent.
+ You also might use this block when a **Loop prompts** block is interrupted. You can return the customer to the **Loop prompts** block.
+ You can also use this block to end a Paused flow and return the contact without terminating the overall interaction. For example, it's useful in flows where you are [ pausing and resuming tasks](concepts-pause-and-resume-tasks.md). 

## Supported channels
<a name="end-flow-resume-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | Yes | 
| Email | Yes | 

## Flow types
<a name="end-flow-resume-types"></a>

**Important**  
If you place the **End flow / Resume** block in an inbound flow or disconnect flow, it functions identically to the **Disconnect** block, and terminates the contact.
+ All flows

## Properties
<a name="end-flow-resume-properties"></a>

The following image shows the **Properties** page of the **End flow / Resume** block.

![\[The properties page of the End flow Resume block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/end-flow-properties.png)


## Configured block
<a name="end-flow-resume-configured"></a>

The following image shows an example of what this block looks like when it is configured. It does not have any The End flow / Resume termination event branches.

![\[The properties page of the End flow Resume block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/end-flow-configured.png)


# Flow block in Amazon Connect: Get customer input
<a name="get-customer-input"></a>

This topic defines the flow block for such tasks as capturing customer information, creating interactive phone menus for customer responses, and routing customers to specific paths within a flow.

## Description
<a name="get-customer-input-description"></a>

Captures interactive and dynamic input from customers. It supports interruptible prompts with DTMF input (input from a phone) and Amazon Lex bot.

This block accepts only individual digits (0-9) and the special characters \$1 and \$1. Multi-digit entries are not supported. For multiple entries, such as gathering a customer's credit card number, use the [Store customer input](store-customer-input.md) block.

## Use cases for this block
<a name="scenarios-get-customer-input"></a>

This block is designed to be used in the following scenarios:
+ Create interactive phone menus where customers can respond using touch-tone keypads. For example, "Press 1 for Sales, press 2 for Support."
+ Enable voice-activated prompts by using this block with Amazon Lex bots. Customers can interrupt the prompts by speaking. This provides them with a more natural and responsive interaction.
+ Route the customer to specific paths within the flow based on their input. This helps direct the customer to the appropriate department or service based on their needs.
+ Gather feedback from customers by presenting options that allow them to express their satisfaction or concerns.
+ Conduct surveys and poll customers to collect valuable feedback and insights.
+ Guide customers through troubleshooting processes by asking specific questions related to their issues. You can provide tailored solutions based on their responses.

## Contact types
<a name="get-customer-input-channels"></a>

The following table shows how this block routes a contact for each channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes, when Amazon Lex is used, otherwise it takes the **Error** branch  | 
| Task | No | 
| Email | No | 

## Flow types
<a name="get-customer-input-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):


| Flow type | Supported? | 
| --- | --- | 
| Inbound flow | Yes | 
| Customer queue flow | Yes | 
| Customer hold flow | No | 
| Customer whisper flow | No | 
| Outbound whisper flow | Yes | 
| Agent hold flow | No | 
| Agent whisper flow | No | 
| Transfer to agent flow | Yes | 
| Transfer to queue flow | Yes | 

## How to configure this block
<a name="get-customer-input-properties"></a>

You can configure the Get customer input block by using the Amazon Connect admin website, or by using the [GetParticipantInput](https://docs.aws.amazon.com/connect/latest/APIReference/participant-actions-getparticipantinput.html) action in the Amazon Connect Flow language, or the [ConnectParticipantWithLexBot](https://docs.aws.amazon.com/connect/latest/APIReference/participant-actions-connectparticipantwithlexbot.html) and [Compare](https://docs.aws.amazon.com/connect/latest/APIReference/flow-control-actions-compare.html) actions. 

**Topics**
+ [

### Select a prompt
](#get-customer-input-prompt)
+ [

### Configure for DTMF input
](#get-customer-input-dtmf)
+ [

### Configure for Amazon Lex input
](#get-customer-input-lex-tab-properties)
+ [

### Flow block branches
](#gci-branches)
+ [

### Additional configuration tips
](#get-customer-input-tips)
+ [

### Data generated by this block
](#gci-data)

### Select a prompt
<a name="get-customer-input-prompt"></a>

The following image shows the **Properties** page of the **Get customer input** block. It is manually configured to play an audio prompt that says "Welcome to Example Corp." 

![\[The properties page of the Get customer input block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/get-customer-input-properties1a.png)


Choose from the following options to select a prompt to be played to the customer:
+ **Select from the prompt library (audio)**: You can choose from one of the pre-recorded prompts included with Amazon Connect, or use the Amazon Connect admin website to record and upload your own prompt.
+ **Specify an audio file from an S3 bucket**: You can manually or dynamically specify an audio file from an S3 bucket.
+ **Text-to-speech or chat text**: You can enter prompt to be played in plain text or SSML. These text-based prompts are played as audio prompts to customers using Amazon Polly. SSML-enhanced input text gives you more control over how Amazon Connect generates speech from the text that you provide. You can customize and control aspects of speech, such as pronunciation, volume, and speed.

### Configure for DTMF input
<a name="get-customer-input-dtmf"></a>

The following image shows the DTMF section of the **Properties** page. Two conditions have been added to determine the appropriate branching, depending whether the customer presses 1 or 2. It times out after 5 seconds if the customer doesn't enter anything.

![\[The DTMF section of properties page.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/get-customer-input-properties2a.png)


Choose the following options:
+ **Set timeout**: Specify how long to wait while the user decides how they want to respond to the prompt. 
  + Minimum value: 1 second
  + Maximum value: 180 seconds

  After this time elapses, a timeout error occurs. For the Voice channel, this is the timeout until the first DTMF digit is entered. Must be defined statically, and must be a valid integer larger than zero. 
+ **Add condition**: The number against which the customer input is compared.

#### Flow language representation when DTMF is used
<a name="flow-language-dtmf"></a>

The following code example shows how a DTMF configuration would be represented by the [GetParticipantInput](https://docs.aws.amazon.com/connect/latest/APIReference/participant-actions-getparticipantinput.html) action in the Flow language.

```
{
      "Parameters": {
        "StoreInput": "False",
        "InputTimeLimitSeconds": "5",
        "Text": "Welcome to Example Corp. Please press 1 for sales, press 2 for support"
      },
      "Identifier": "Get Customer Input",
      "Type": "GetParticipantInput",
      "Transitions": {
        "NextAction": "d8701db7-3d31-4581-bd4c-cb49c38c6f43",
        "Conditions": [
          {
            "NextAction": "d8701db7-3d31-4581-bd4c-cb49c38c6f43",
            "Condition": {
              "Operator": "Equals",
              "Operands": [
                "1"
              ]
            }
          },
          {
            "NextAction": "d8701db7-3d31-4581-bd4c-cb49c38c6f43",
            "Condition": {
              "Operator": "Equals",
              "Operands": [
                "2"
              ]
            }
          }
        ],
        "Errors": [
          {
            "NextAction": "d8701db7-3d31-4581-bd4c-cb49c38c6f43",
            "ErrorType": "InputTimeLimitExceeded"
          },
          {
            "NextAction": "d8701db7-3d31-4581-bd4c-cb49c38c6f43",
            "ErrorType": "NoMatchingCondition"
          },
          {
            "NextAction": "d8701db7-3d31-4581-bd4c-cb49c38c6f43",
            "ErrorType": "NoMatchingError"
          }
        ]
      }
    }
```

### Configure for Amazon Lex input
<a name="get-customer-input-lex-tab-properties"></a>
+ **Select a Lex bot**: After you create your Amazon Lex bot, choose the name of the bot from the drop-down list. Only built bots appear in the drop-down list. 
+ Enter an ARN: Specify the Amazon Resource Name of the Amazon Lex bot. 
+ **Session attributes**: Specify [Amazon Lex session attributes](connect-attrib-list.md#attribs-lex-table) that apply to the current contact's session only. The following image shows the session attributes configured for a max speech duration of 8000 milliseconds (8 seconds).  
![\[The properties page of the Get customer input block, the session attributes section.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/get-customer-input-properties3.png)
+ **Intents**
  + **Add intent**: Choose to enter the name of the Amazon Lex bot intent to compare against.

    There are a few ways you can add intents:
    + Enter them manually in the text box.
    + Search for intents. 
    + Select intents from a dropdown list.
    + Filter the dropdown list of intents by locale. Based on the locale selected, intents for the bot are listed in the dropdown list.

    When you select a Lex bot ARN and alias from a dropdown lists, you can add intents for that bot by searching using locale. In order for intents to be listed, the bot must have an Amazon Connect tag and the bot alias must have a version associated with it.

    The **Intents** dropdown box does not list intents for Amazon Lex V1 bots, cross region bots, or if the bot ARN is dynamically set. For these intents, try the following options to find them.
    + Check whether the **AmazonConnectEnabled** tag is set to true:

      1. Open the Amazon Lex console, choose **Bots**, select the bot, then choose **Tags**.

      1.  If the **AmazonConnectEnabled** tag is not present, add **AmazonConnectEnabled = true**.

      1.  Return to the Amazon Connect admin website. Refresh the flow designer to see the selections in **Get customer input** block.
    + Check if the version is associated with the alias: 

      1. In Amazon Connect admin website, choose **Routing**, **Flows**, the bot, **Aliases**. Verify that **Use in flow and flow modules** is enabled, as shown in the following image.  
![\[The Aliases tab, the Use in flow and flow modules toggle.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/bot-alias-enabled.png)

      1. Refresh the flow designer to see the selections in **Get customer input** block.
  + **Use sentiment override**: Branch based on sentiment score, before the Amazon Lex intent. 

    The sentiment score is based on the last utterance of the customer. It is not based on the entire conversation.

    For example, a customer calls and they have a negative sentiment because their preferred appointment time isn't available. You can branch the flow based on their negative sentiment score, for example, if their negative sentiment is more than 80%. Or, a customer calls and has a positive sentiment of more than 80%, you can branch to upsell them on services.

    The following image shows the Intents section of the Amazon Lex tab. It is configured to route the contact when their negative sentiment score is 80%.  
![\[The properties page of the Get customer input block, the Intents section.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/get-customer-input-properties5.png)

    If you add both negative and positive sentiment scores, the negative score is always evaluated first. 

    For information about how to use sentiment score, alternative intents, and sentiment label with contact attributes, see [Check contact attributes](check-contact-attributes.md).
+ **Initialize bot with message**
  + **Purpose**: Select this option to pass the customer's initial message. Or, enter a custom message manually or dynamically to be the initial message used to initialize the Lex bot for an enhanced customer chat experience. Both options support text only.

    The initial message is sent to the newly created chat while invoking the [StartChatContact](https://docs.aws.amazon.com/connect/latest/APIReference/API_StartChatContact.html) API. 

    A custom message is set by typing in a manual initial message or dynamically passing an attribute. 
    + **User initial customer utterance (text-only)**: Always serializes the block with bot initialization message as ``$.Media.InitialMessage``.
    + **Set manually**: Accepts any plain text message or [attribute references](connect-attrib-list.md). Supports a maximum of 1024 characters.
    + **Set dynamically**: Accepts any selected attribute that has a text value. Supports a maximum of 1024 characters.
  + **Required**: No. This is not a required parameter.
  + **Use cases**:
    + Use **User initial customer utterance (text-only)** with web chat, SMS, WhatsApp, or Apple Messages for Business channels to have Lex respond with an intent to the customer's first chat message.
    + Use **Set manually** to statically jump to a Lex intent based on your use case in the flow.

      You can use this option to proactively display interactive messages when customers open the chat widget.
    + Use **Set dynamically** to dynamically jump to a Lex intent based on an attribute (for example, customer profile, contact details, case information) or additional information passed from the chat widget (for example, product page, customer's shopping cart details, or customer preferences assigned to [user-defined attributes](connect-attrib-list.md#user-defined-attributes)). 

      You can use this option to proactively display interactive messages when customers open the chat widget.

**Note**  
If the initial message attribute is not included as part of the contact, the contact is routed down the **Error** branch.   
To have separate flow configurations for different messaging types, such as web chat, SMS, or Apple Messages for Business, before the **Get customer input** block use the [Check contact attributes](check-contact-attributes.md) block to verify the initial message is available. 

The following image shows a **Get customer input** block. **Initialize bot with message** and **Set manually** are selected.

![\[The Get customer input block, the Initialize bot with message option.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/get-customer-input-properties-initialize-bot-1.png)


#### Configurable time-outs for voice input
<a name="get-customer-input-configurable-timeouts"></a>

To configure time-out values for voice contacts, use the following session attributes in the **Get customer input** block that calls your Lex bot. These attributes allow you to specify how long to wait for the customer to finish speaking before Amazon Lex collects speech input from callers, such as answering a yes/no question, or providing a date or credit card number. 

------
#### [ Amazon Lex ]
+ **Max Speech Duration**

  `x-amz-lex:audio:max-length-ms:[intentName]:[slotToElicit]`

  How long the customer speaks before the input is truncated and returned to Amazon Connect. You can increase the time when a lot of input is expected or you want to give customers more time to provide information. 

  Default = 12000 milliseconds (12 seconds). The maximum allowed value is 15000 milliseconds. 
**Important**  
If you set **Max Speech Duration** to more than 15000 milliseconds, the contact is routed down the **Error** branch. 
+ **Start Silence Threshold**

   `x-amz-lex:audio:start-timeout-ms:[intentName]:[slotToElicit]`

  How long to wait before assuming that the customer isn't going to speak. You can increase the allotted time in situations where you'd like to allow the customer more time to find or recall information before speaking. For example, you might want to give customers more time to get out their credit card so they can enter the number. 

  Default = 3000 milliseconds (3 seconds).
+ **End Silence Threshold**

  `x-amz-lex:audio:end-timeout-ms:[intentName]:[slotToElicit] ` 

  How long to wait after the customer stops speaking before assuming the utterance has concluded. You can increase the allotted time in situations where periods of silence are expected while providing input. 

  Default = 600 milliseconds (0.6 seconds)

------
#### [ Amazon Lex (Classic) ]
+ **Max Speech Duration**

  `x-amz-lex:max-speech-duration-ms:[intentName]:[slotToElicit]`

  How long the customer speaks before the input is truncated and returned to Amazon Connect. You can increase the time when a lot of input is expected or you want to give customers more time to provide information. 

  Default = 12000 milliseconds (12 seconds). The maximum allowed value is 15000 milliseconds. 
**Important**  
If you set **Max Speech Duration** to more than 15000 milliseconds, the contact is routed down the **Error** branch. 
+ **Start Silence Threshold**

   `x-amz-lex:start-silence-threshold-ms:[intentName]:[slotToElicit]`

  How long to wait before assuming that the customer isn't going to speak. You can increase the allotted time in situations where you'd like to allow the customer more time to find or recall information before speaking. For example, you might want to give customers more time to get out their credit card so they can enter the number. 

  Default = 3000 milliseconds (3 seconds).
+ **End Silence Threshold**

  `x-amz-lex:end-silence-threshold-ms:[intentName]:[slotToElicit]` 

  How long to wait after the customer stops speaking before assuming the utterance has concluded. You can increase the allotted time in situations where periods of silence are expected while providing input. 

  Default = 600 milliseconds (0.6 seconds)

------

#### Configurable time-outs for chat input during a Lex interaction
<a name="get-customer-input-configurable-timeouts-chat"></a>

Use the **Chat timeout** field under **Intents** to configure timeouts for chat input. Enter how long until inactive customers timeout in a Lex interaction.
+ Minimum: 1 minute
+ Maximum: 7 days

The following image shows the **Get customer input** block configured to timeout chats when the customer is inactive for 2 minutes.

![\[The Intents section of the properties page, the Chat timeout option.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/get-customer-input-chattimeout.png)


For information about setting up chat timeouts when all participants are human, see [Set up chat timeouts for chat participants](setup-chat-timeouts.md). 

#### Barge-in configuration and usage for Amazon Lex
<a name="get-customer-input-bargein"></a>

You can allow customers to interrupt the Amazon Lex bot mid-sentence using their voice, without waiting for it to finishing speaking. Customers familiar with choosing from a menu of options, for example, can now do so without having to listen to the entire prompt.

------
#### [ Amazon Lex ]
+ **Barge-in**

  Barge-in is enabled globally by default. You can disable it in the Amazon Lex console. For more information, see [Enabling your bot to be interrupted by your user](https://docs.aws.amazon.com/lexv2/latest/dg/interrupt-bot.html). Additionally, you can modify barge-in behavior, by using the `allow-interrupt` session attribute. For example, `x-amz-lex:allow-interrupt:*:*` allows interrupt for all intents and all slots. For more information, see [ Configuring timeouts for capturing user input](https://docs.aws.amazon.com/lexv2/latest/dg/session-attribs-speech.html) in the *Amazon Lex V2 Developer Guide*.

------
#### [ Amazon Lex (Classic) ]
+ **Barge-in**

  `x-amz-lex:barge-in-enabled:[intentName]:[slotToElicit]`

  Barge-in is disabled globally by default. You must set the session attribute in the **Get customer input** block that calls your Lex bot to enable it at the global, bot, or slot levels. This attribute only controls Amazon Lex barge-in; it doesn't control DTMF barge-in. For more information, see [How flow blocks use Amazon Lex session attributes](how-to-use-session-attributes.md).

  The following image shows the **Session attributes** section with barge-in enabled.  
![\[The session attributes section of the properties page, Value set to true.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/barge-in-session-attribute.png)

------

#### Configurable fields for DTMF input
<a name="get-customer-input-configurable-dtmf"></a>

Use the following session attributes to specify how your Lex bot responds to DTMF input. 
+ **End character**

  `x-amz-lex:dtmf:end-character:[IntentName]:[SlotName]`

  The DTMF end character that ends the utterance. 

  Default = \$1 
+ **Deletion character**

   `x-amz-lex:dtmf:deletion-character:[IntentName]:[SlotName]`

  The DTMF character that clears the accumulated DTMF digits and ends the utterance. 

  Default = \$1
+ **End timeout**

  `x-amz-lex:dtmf:end-timeout-ms:[IntentName]:[SlotName]` 

  The idle time (in milliseconds) between DTMF digits to consider the utterance as concluded.

  Default = 5000 milliseconds (5 seconds)
+ **Max number of allow DTMF digits per utterance**

  `x-amz-lex:dtmf:max-length:[IntentName]:[SlotName]` 

  The maximum number of DTMF digits allowed in a given utterance. This cannot be increased.

  Default = 1024 characters

For more information, see [How flow blocks use Amazon Lex session attributes](how-to-use-session-attributes.md).

#### Flow Language representation when Amazon Lex is used
<a name="flow-language-lex"></a>

The following code sample shows how an Amazon Lex configuration would be represented by the [ConnectParticipantWithLexBot](https://docs.aws.amazon.com/connect/latest/APIReference/participant-actions-connectparticipantwithlexbot.html) action in the Flow language:

```
{
    "Parameters": {
      "Text": "Welcome to Example Corp. Please press 1 for sales, press 2 for support",
      "LexV2Bot": {
        "AliasArn": "arn:aws:lex:us-west-2:23XXXXXXXXXX:bot-alias/3HL7SXXXXX/TSTALXXXXX"
      },
      "LexTimeoutSeconds": {
        "Text": "300"
      }
    },
    "Identifier": "Get Customer Input",
    "Type": "ConnectParticipantWithLexBot",
    "Transitions": {
      "NextAction": "d8701db7-3d31-4581-bd4c-cb49c38c6f43",
      "Errors": [
        {
          "NextAction": "d8701db7-3d31-4581-bd4c-cb49c38c6f43",
          "ErrorType": "InputTimeLimitExceeded"
        },
        {
          "NextAction": "d8701db7-3d31-4581-bd4c-cb49c38c6f43",
          "ErrorType": "NoMatchingError"
        },
        {
          "NextAction": "Get Customer Input-ygqIfPM1n2",
          "ErrorType": "NoMatchingCondition"
        }
      ]
    }
  }
```

#### Fragmented action representation
<a name="flow-language-frag-gci"></a>

The following code sample represents a fragmented [Compare](https://docs.aws.amazon.com/connect/latest/APIReference/flow-control-actions-compare.html) action for a Amazon Lex sentiment score returned from a Lex bot after the conversation. 

```
{
      "Parameters": {
        "ComparisonValue": "$.Lex.SentimentResponse.Scores.Negative"
      },
      "Identifier": "Get Customer Input-ygqIfPM1n2",
      "Type": "Compare",
      "Transitions": {
        "NextAction": "Get Customer Input-xDRo1hbBRB",
        "Conditions": [
          {
            "NextAction": "d8701db7-3d31-4581-bd4c-cb49c38c6f43",
            "Condition": {
              "Operator": "NumberGreaterOrEqualTo",
              "Operands": [
                "0.08"
              ]
            }
          }
        ],
        "Errors": [
          {
            "NextAction": "Get Customer Input-xDRo1hbBRB",
            "ErrorType": "NoMatchingCondition"
          }
        ]
      }
    }
```

### Flow block branches
<a name="gci-branches"></a>

The following image shows an example of what this block looks like when it is configured for DTMF input. It shows two branches for input: **Pressed 1** and **Pressed 2**. It also shows branches for **Timeout**, **Default**, and **Error**.

![\[A configured Get customer input block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/get-customer-input-branches.png)


1. **Timeout**: What to do when no input is provided by the customer for the specified chat timeout in Amazon Lex or the **Set timeout** value specified for DTMF.

1. **Default**: If the customer enters input that doesn't match any condition in DTMF, or an intent executed in Amazon Lex bot. This the preceding image, the contact is routed down the **Default** branch if they enter a value other than 1 or 2.

1. **Error**: If the block is run but results in an error for DTMF, or an intent is not fulfilled in Amazon Lex bot.

### Additional configuration tips
<a name="get-customer-input-tips"></a>
+ For information about choosing a prompt from the Amazon Connect library or an S3 bucket, see the [Play prompt](play.md) block.
+ You can configure this block to accept DTMF input or a chat response. You can also configure it work with Amazon Lex for example, a contact can be routed based on their utterance.
  + Session attributes available for the integration with Amazon Lex. This topic explains some of the session attributes available for the integration with Amazon Lex. For a list of all the available Amazon Lex session attributes, see [Configuring timeouts for capturing user input](https://docs.aws.amazon.com/lexv2/latest/dg/session-attribs-speech). When you use text, either for text-to-speech or chat, you can use a maximum of 3,000 billed characters (6,000 total characters).
  + Amazon Lex bots support both spoken utterances and keypad input when used in a flow.
  + For both voice and DTMF, there can be only one set of session attributes per conversation. Following is the order of precedence: 

    1. Lambda provided session attributes: Overrides to session attributes during customer Lambda invocation.

    1. Amazon Connect console provided session attributes: Defined in the **Get customer input** block.

    1. Service defaults: These are used only if no attributes are defined.
+ You can prompt contacts to end their input with a pound key \$1 and to cancel it using the star key \$1. When you use a Lex bot, if you don't prompt customers to end their input with \$1, they will end up waiting five seconds for Lex to stop waiting for additional key presses. 
+ To control time-out functionality, you can use Lex session attributes in this block, or in set them in your Lex Lambda function. If you choose to set the attributes in a Lex Lambda function, the default values are used until the Lex bot is invoked. For more information, see [Using Lambda Functions](https://docs.aws.amazon.com/lex/latest/dg/using-lambda.html) in the *Amazon Lex Developer Guide*. 
+ When you specify one of the session attributes described in this article, you can use wildcards. They let you set multiple slots for an intent or bots.

  Following are some examples of how you can use wildcards:
  + To set all slots for a specific intent, such as PasswordReset, to 2000 milliseconds:

    Name = `x-amz-lex:max-speech-duration-ms:PasswordReset:*`

    Value = 2000
  + To set all slots for all bots to 4000 milliseconds: 

    Name = `x-amz-lex:max-speech-duration-ms:*:*`

    Value = 4000

  Wildcards apply across bots but not across blocks in a flow. 

  For example, you have a Get\$1Account\$1Number bot. In the flow, you have two **Get customer input** blocks. The first block sets the session attribute with a wildcard. The second one doesn't set the attribute. In this scenario, the change in behavior for the bot applies only to the first **Get customer input** block, where the session attribute is set. 
+ Because you can specify that session attributes apply to the intent and slot level, you can specify that the attribute is set only when you're collecting a certain type of input. For example, you can specify a longer **Start Silence Threshold** when you're collecting an account number than when you're collecting a date. 
+ If DTMF input is provided to a Lex bot using Amazon Connect, the customer input is made available as a [Lex request attribute](https://docs.aws.amazon.com/lex/latest/dg/context-mgmt-request-attribs.html). The attribute name is `x-amz-lex:dtmf-transcript` and the value can be a maximum of 1024 characters. 

  Following are different DTMF input scenarios:    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/connect/latest/adminguide/get-customer-input.html)

  Where: 
  + [DEL] = Deletion character (Default is **\$1** )
  + [END] = End character (Default is **\$1** )

### Data generated by this block
<a name="gci-data"></a>

This block does not generate any data.

## Error scenarios
<a name="getcustomerinput-errorscenarios"></a>

Let's say you have the following scenario with two flows, each one capturing DTMF input from customers:

1. One flow uses the **Get customer input** block to request DTMF input from customers.

1. After the DTMF input is entered, it uses the **Transfer to flow** block to move the contact to the next flow.

1. In the next flow, there's a **Store customer input** block to get more DTMF input from the customer.

There's setup time between the first and second flows. This means if the customer enters DTMF input very quickly for the second flow, some of the DTMF digits might be dropped.

For example, the customer needs to press 5, then wait for a prompt from the second flow, then type 123. In this case, 123 is captured without problem. However, if they don't wait for the prompt and enter 5123 very quickly, the Store customer input block may capture only 23 or 3.

To guarantee the **Store customer input** block in second flow captures all of the digits, the customer needs to wait for the prompt to be played, and then enter their type DTMF input.

## Sample flows
<a name="get-customer-input-samples"></a>

Amazon Connect includes a set of sample flows. For instructions that explain how to access the sample flows in the flow designer, see [Sample flows in Amazon Connect](contact-flow-samples.md). Following are topics that describe the sample flows which include this block.
+ [Sample inbound flow in Amazon Connect for the first contact experience](sample-inbound-flow.md)
+ [Sample interruptible queue flow with callback in Amazon Connect](sample-interruptible-queue.md) 
+ [Sample queue configurations flow in Amazon Connect](sample-queue-configurations.md) 
+ [Sample recording behavior in Amazon Connect](sample-recording-behavior.md) 

## More resources
<a name="get-customer-input-scenarios"></a>

See the following topics to learn more about Amazon Lex and adding prompts. 
+ [Create conversational AI bots in Amazon Connect](connect-conversational-ai-bots.md)
+ [How to use the same Amazon Lex bot for voice and chat](one-bot-voice-chat.md)
+ [Add text-to-speech to prompts in flow blocks in Amazon Polly](text-to-speech.md)

# Flow block in Amazon Connect: Get metrics
<a name="get-queue-metrics"></a>

By default, this block returns queue metrics for the current queue. You can optionally choose to return metrics for a different queue/channel combination, or contact-level metrics such as the contact's position in queue. Metrics are returned as attributes that can be referenced via JSONPath or the Check contact attributes block.

## Description
<a name="get-metrics-description"></a>
+ Retrieves near real-time queue metrics with a 5-10 second delay for more granular routing decisions. 
+ You can route contacts based on queue or agent status, such as the number of contacts in queue or agents available. 
+  Queue metrics are aggregated across all channels by default and are returned as attributes. 
+  The current queue is used by default. 
+ For agent-based metrics (such as agents online, agents available, or agents staffed), if there are no agents, no metrics are returned.
+ For queue estimated wait time, the metric would only return when there's one single channel provided.
+ Following are the metrics that can be retrieved:
  + Queue name 
  + Queue ARN 
  + [Contacts in queue](metrics-definitions.md#contacts-in-queue)
  + [Oldest contact in queue](metrics-definitions.md#oldest-real-time)
  + [Agents online](metrics-definitions.md#online-agents)
  + [Agents available](metrics-definitions.md#available-real-time)
  + [Agents staffed](metrics-definitions.md#staffed-agents)
  + [Agent after contact work](metrics-definitions.md#agent-after-contact-work)
  + [Agents busy](metrics-definitions.md#agents-on-contact)
  + [Agents missed](metrics-definitions.md#agent-non-response) (Agent non-response)
  + [Agents non-productive](metrics-definitions.md#agent-non-productive)
  + [Queue estimated wait time](metrics-definitions.md#estimated-wait-time)
  + [Contact estimated wait time](metrics-definitions.md#estimated-wait-time)
  + [Contact position in queue](metrics-definitions.md#position-in-queue)
+ You can choose to return metrics by channel, for example, voice or chat. You can also filter by queue or agent. These options enable you to know how many chat and voice contacts are in a queue and if you have agents available to handle those contacts. 
+ You can route contacts based on queue status, such as number of contacts in queue or agents available. Queue metrics are aggregated across all channels and are returned as attributes. The current queue is used by default.
+ After a **Get metrics** block, use a [Check contact attributes](check-contact-attributes.md) to check metric values and define routing logic based on them, such as number of contacts in a queue, number of available agents, and oldest contact in a queue. 

## Supported channels
<a name="get-metrics-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | Yes | 
| Email | Yes | 

## Flow types
<a name="get-metrics-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ All flows

## Properties
<a name="get-metrics-properties"></a>

The following image shows the **Properties** page of the **Get metrics** block. It is configured to retrieve metrics for the **Voice** channel.

![\[The properties page of the Get metrics block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/get-metrics-properties1.png)


You can retrieve metrics by channel, and/or by queue or agent.
+ If you don't specify a channel, it returns metrics for all channels. 
+ If you don't specify a queue, it returns metrics for the current queue.
+ Dynamic attributes can only return metrics for one channel. 

For example, the following image shows the **Properties** page configured for the **Chat** channel and **BasicQueue**. If you choose these settings **Get queue metrics** would return metrics for only the BasicQueue, filtered to include only chat contacts. 

![\[The optional parameters section of the Properties page.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/get-metrics-properties3.png)


## Configuration tips
<a name="get-metrics-tips"></a>

### Specifying a channel in the Set contact attributes block
<a name="get-metrics-tips1"></a>

Dynamic attributes can only return metrics for one channel.

Before you use dynamic attributes in the **Get metrics** block, you need to set the attributes in the [Set contact attributes](set-contact-attributes.md) block, and specify which channel.

When you set a channel dynamically using text, as shown in the following image, for the attribute value enter **Voice** or **Chat**. This value is not case-sensitive. 

![\[The properties page of the Set contact attributes block, Value set to chat.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/get-metrics-properties2.png)


### Using the Check contact attributes block after the Get metrics block
<a name="get-metrics-tips2"></a>

After a **Get metrics** block, add a [Check contact attributes](check-contact-attributes.md) block to branch based on the returned metrics. Use the following steps:

1. After **Get metrics**, add a **Check contact attributes** block.

1. In the **Check contact attributes** block, set **Attribute to check** to **Queue metrics**.

1. In the **Value** dropdown box, you'll see a list of metrics that can be checked by the **Get metrics** block. Choose the metric that you want to use for the routing decision.   
![\[Attribute to check section, dropdown list of available metrics.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/get-metrics-block-returned-metrics.png)

### Why Get metrics block throws an error
<a name="get-metrics-tips3"></a>

The **Get metrics** block throws an error in the following scenario: 

1. You add this block to your flow.

1. The Real-time metrics report returns empty metrics because no activity is taking place.

1. The **Get metrics** block throws an error because there are no metrics to display.

## Configured block
<a name="get-metrics-configured"></a>

The following image shows an example of what this block looks like when it is configured. It has two branches: **Success** and **Error**.

![\[A configured Get metrics block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/get-metrics-configured.png)


## Scenarios
<a name="get-metrics-scenarios"></a>

See these topics for scenarios that use this block:
+ [How to reference contact attributes in Amazon Connect](how-to-reference-attributes.md)

# Flow block in Amazon Connect: Get stored content
<a name="get-stored-content"></a>

This topic specifies the flow block for getting stored content to be used within flows.

## Description
<a name="get-stored-content-description"></a>

Use this block to retrieve stored data from your S3 bucket when you need to make branching decisions in your flows. For example, this block can be used to access email message bodies stored in your Amazon S3 buckets. The following options are currently available for this flow block:

Email message (Plain text)  
This block will download the plain text version of the email message present in your S3 bucket and store it on the `$.Email.EmailMessage.Plaintext` flow attribute. The email message content is downloaded as a plain text file and the maximum size supported is currently 32 KB due to the maximum size of flow attributes limits. Make sure to [Enable email for your Amazon Connect instance](enable-email1.md) before using this option.

## Use cases for this block
<a name="get-stored-content-use-case"></a>

This flow block is designed to be used in the following scenarios::
+ Use it with the [Check contact attributes](check-contact-attributes.md) and [Send message](send-message.md) flow blocks to configure automated email responses and routing.
  + In the [Check contact attributes](check-contact-attributes.md) block, for namespace, choose **Email** and for **Key** choose **Email Message**. Then, add conditions depending on your use case. For example, if you wanted to route to a specific queue any time an email message contained the word “Refund” (**Note**: keywords are case-sensitive). 
  + In the [Send message](send-message.md) block, select an email template or type in a message to send the automated response.

### Properties configuration in CheckContactAttributes
<a name="get-stored-content-property-configuration"></a>

In the [Check contact attributes](check-contact-attributes.md) block, for namespace, choose **Email** and for **Key** choose **Email Message**. Then, add conditions depending on the use case.

## Contact types
<a name="get-stored-content-channels"></a>

The following table shows how this block routes a contact for each channel.


| Channel | Supported? | 
| --- | --- | 
| Voice | No | 
| Chat | No | 
| Task | No | 
| Email | Yes | 

## Flow types
<a name="get-stored-content-agent-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Inbound flow
+ Customer queue flow
+ Customer hold flow
+ Customer whisper flow
+ Outbound whisper flow
+ Agent hold flow
+ Agent whisper flow
+ Transfer to agent flow
+ Transfer to queue flow
+ Disconnect flow

## How to configure this block
<a name="get-stored-content-configure"></a>

You can configure the **Get stored content** block by using the Amazon Connect admin website or by using the `LoadContactContent` in the Amazon Connect Flow language.

## Flow language representation
<a name="get-stored-content-flow-language"></a>

The following code example shows how to use the `LoadContactContent` in the Amazon Connect Flow language.

```
{
      "Parameters": {
        "ContentType": enum "EmailMessage"
      },
      "Identifier": "string",
      "Type": "LoadContactContent",
      "Transitions": {
        "NextAction": "string",
        "Errors": [
          {
            "NextAction": "string",
            "ErrorType": "NoMatchingError"
          }
        ]
      }
    }
```

## Error scenarios
<a name="get-stored-content-error-scenarios"></a>

A contact is routed down the Error branch if the flows services runs into any of the following error scenarios:
+ When using Email message (Plain text):
  + When the size of the email message in plaintext format is more than 32KB.
  + Amazon Connect is unable to download the email body from the S3 bucket. This may be due to the S3 bucket policy not being set up correctly (see [Step 4: Enable email and create an Amazon S3 bucket](enable-email1.md#enable-email-buckets)), Amazon Connect does not have proper access to the S3 bucket (see [Step 5: Configure a CORS policy](enable-email1.md#config-email-attachments-cors1)), or there is no email message in plaintext format available on the contact.

# Flow block in Amazon Connect: Hold customer or agent
<a name="hold-customer-agent"></a>

This topic defines the flow block for placing a customer or agent on hold, and resuming the call afterward.

**Important**  
During a video call or screen sharing session, agents are able to see the customer's video or screen share even when the customer is on hold. It is the customer's responsibility to handle PII accordingly. If you want to change this behavior, you can build a custom CCP and communication widget. For more information, see [Integrate in-app, web, video calling, and screen sharing natively into your application](config-com-widget2.md).

## Description
<a name="hold-customer-agent-description"></a>
+ Places a customer or agent on or off hold. This is useful when, for example, you want to put the agent on hold while the customer enters their credit card information. 
+ If this block is triggered during a chat conversation, the contact is routed down the **Error** branch.

## Supported channels
<a name="hold-customer-agent-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | No - Error branch | 
| Task | No - Error branch | 
| Email | No - Error branch | 

## Flow types
<a name="hold-customer-agent-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Inbound flow
+ Outbound Whisper flow
+ Transfer to Agent flow 
+ Transfer to Queue flow

## Properties
<a name="hold-customer-agent-properties"></a>

The following image shows the **Properties** page of the **Hold customer or agent** block. It shows that the dropdown list has three options: **Agent on hold**, **Customer on hold**, and **Conference all**.

![\[The properties page of the Hold customer or agent block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/hold-customer-or-agent-properties.png)


These options are defined as follows:
+ **Agent on hold** = customer is on the call
+ **Conference all** = agent and customer are on the call
+ **Customer on hold** = agent is on the call

## Configured block
<a name="hold-customer-agent-configured"></a>

The following image shows an example of what this block looks like when it is configured. It configured for **Agent on hold**, and it has two branches: **Success** and **Error**.

![\[A configured Hold customer or agent block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/hold-customer-or-agent-configured.png)


## Samples flows
<a name="hold-customer-agent-samples"></a>

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

# Flow block in Amazon Connect: AWS Lambda function
<a name="invoke-lambda-function-block"></a>

This topic defines the flow block for calling AWS Lambda. The fetched response can be used in the [Set contact attributes](set-contact-attributes.md) block.

## Description
<a name="invoke-lambda-function-block-description"></a>
+ Calls AWS Lambda.
+ The returned data can be used to set contact attributes in the [Set contact attributes](set-contact-attributes.md) block.
+ For an example, see [Tutorial: Create a Lambda function and invoke in a flow](connect-lambda-functions.md#tutorial-invokelambda).

## Supported channels
<a name="invoke-lambda-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | Yes | 
| Email | Yes | 

## Flow types
<a name="invoke-lambda-function-block-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Inbound flow
+ Customer Queue flow
+ Customer Hold flow
+ Customer Whisper flow
+ Agent Hold flow
+ Agent Whisper flow
+ Transfer to Agent flow 
+ Transfer to Queue flow

## Properties
<a name="invoke-lambda-function-block-properties"></a>

The following image shows the **Properties** page of the **AWS Lambda function** block.

![\[The properties page of the AWS Lambda function block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/aws-lamdba-function-properties.png)


In the **Select an action** box, choose from the following options:
+ [Invoke Lambda](#properties-invoke-lamdba)
+ [Load Lambda result](#properties-load-lamdba) (if run asynchronously)

### Invoke Lambda
<a name="properties-invoke-lamdba"></a>

![\[The Select an action box set to Invoke Lambda, the Execution mode options.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/invoke-lambda-properties2.png)


When **Select an action** is set to **Invoke Lambda**, note the following properties: 
+ **Execution mode**:
  + **Synchronous**: When Synchronous is selected, the contact is routed to the next block only after the Lambda invocation completes.
  + **Asynchronous**: The contact is routed to the next block without waiting for the Lambda to complete.

    You can configure [Wait](wait.md) block to wait for a Lambda that is invoked using the asynchronous execution mode.
+ **Timeout**: Enter how long to wait for Lambda to time out. You can enter maximum of 8 seconds for **Synchronous mode** and 60 seconds for **Asynchronous mode**.

  If your Lambda invocation gets throttled, the request is retried. It is also retried if a general service failure (500 error) happens. 

  When a Lambda invocation returns an error, Amazon Connect retries up to three times, for maximum until timeout specified. At that point, the contact is routed down the **Error** branch.
+ **Response validation**: The Lambda function response may be either a STRING\$1MAP or JSON. You must set it when you configure the **AWS Lambda function** block in the flow. 
  + When the response validation is set to STRING\$1MAP, the Lambda function returns a flat object of key/value pairs of the string type.
  + When the response validation is set to JSON, the Lambda function returns any valid JSON including nested JSON.

### Load Lambda Result
<a name="properties-load-lamdba"></a>

![\[The Load Lambda Result action on the AWS Lambda Config tab.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/load-lambda-result.png)


When **Select an action** is set to **Load Lambda Result**, note the following properties: 
+ **Lambda Invocation RequestId**: This is the requestId of the Lambda when it is run in **Asynchronous mode**.

  `$.LambdaInvocation.InvocationId` contains the requestId of the most recent asynchronously run Lambda.

When you choose the **Load Lambda Result** action, choose the following options under **Lambda Invocation RequestId**:
+ **Namespace** = **Lambda Invocation**
+ **Key** = **Invocation ID**

## Configuration tips
<a name="invoke-lambda-function-block-tips"></a>
+ To use an AWS Lambda function in a flow, first add the function to your instance. For more information, see [Add a Lambda function to your Amazon Connect instance](connect-lambda-functions.md#add-lambda-function).
+ After you add the function to your instance, you can select the function from the **Select a function** drop-down list in the block to use it in the flow.

## Configured block
<a name="invoke-lambda-function-block-configured"></a>

The following image shows an example of what this block looks like when it is configured. It has two branches: **Success** and **Error**. It is configured for **Asynchronous** execution mode. When it's configured for **Synchronous** execution mode, it has a **Timeout** branch.

![\[A configured AWS Lambda function block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/invoke-lambda-configured.png)


## Sample flows
<a name="invoke-lambda-function-block-samples"></a>

Amazon Connect includes a set of sample flows. For instructions that explain how to access the sample flows in the flow designer, see [Sample flows in Amazon Connect](contact-flow-samples.md). Following are topics that describe the sample flows which include this block.

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

## Scenarios
<a name="invoke-lambda-function-block-scenarios"></a>

See these topics for scenarios that use this block:
+ [Grant Amazon Connect access to your AWS Lambda functions](connect-lambda-functions.md)

# Flow block in Amazon Connect: Invoke a published module
<a name="invoke-module-block"></a>

This topic defines the flow block for calling a published module to create reusable sections in a flow.

## Description
<a name="invoke-module-block-description"></a>

Calls a published module, which enables you create reusable sections of a contact flow.

For more information, see [Flow modules for reusable functions in Amazon Connect](contact-flow-modules.md).

## Supported channels
<a name="invoke-module-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | Yes | 
| Email | Yes | 

## Flow types
<a name="invoke-module-block-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Inbound flow

## Properties
<a name="invoke-module-block-properties"></a>

The following image shows the **Properties** page of the **Invoke module** block.

![\[The properties page of the Invoke module block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/invoke-module-properties.png)


## Configured block
<a name="invoke-module-block-configured"></a>

The following image shows an example of what this block looks like when it is configured. It has two branches: **Success** and **Error**.

![\[A configured Invoke module block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/invoke-module-configured.png)


# Flow block in Amazon Connect: Loop
<a name="loop"></a>

This topic defines the flow block for counting the number of times that customers are looped through the **Looping** branch.

## Description
<a name="loop-description"></a>
+ Loops over the same blocks for the configured number through the **Looping** branch.
+ After the loop is completed, the **Complete** branch is followed. 
+ If the provided input is incorrect, the **Error** branch is followed.
+ This block is often used with a **Get customer input** block. For example, if the customer doesn't succeed in entering their account number, you can loop to give them another opportunity to enter it. 

## Supported channels
<a name="loop-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
|  Voice  |  Yes  | 
|  Chat  |  Yes  | 
|  Task  |  Yes  | 
|  Email  |  Yes  | 

## Flow types
<a name="loop-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ All flows

## Properties
<a name="w2aac18c17c63b6"></a>

 The following image shows the **Properties** page of the **Loop** block. It is configured to repeat three times, and then it branches. 

![\[The properties page of the Loop block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set number of loops.png)


In the **Select an action** dropdown, choose from the following options:
+ Set number of loops
+ Set array for looping

## Set number of loops
<a name="w2aac18c17c63b8"></a>

![\[alt text not found\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set number of loops highlight.png)


When select an action is set to “Set number of loops”, note the following properties:
+ The loop block will loop over for the specified count
+ If the provided input is not a valid number, error branch is taken
+ If Loop Name is provided, you can access the current index through \$1.Loop.<yourLoopName>.Index, starts from 0

## Set array for looping
<a name="w2aac18c17c63c10"></a>

![\[alt text not found\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set array for looping.png)


When select an action is set to “Set array for looping”, note the following properties : 
+ You can provide an array or list to loop through each element in the loop block
+ The block will loop for the number of elements in the input
+ Loop name is required to loop over an array
+ You can access the following with the Loop Name
  + \$1.Loop.<yourLoopName>.Index - Current Index, starts from 0
  + \$1.Loop.<yourLoopName>.Element - Current looping element
  + \$1.Loop.<yourLoopName>.Elements - The provided input Array
+ Error branch is taken if invalid array is provided

## Configuration tips
<a name="loop-tips"></a>
+ If you enter 0 for the loop count, the **Complete** branch is followed the first time this block runs.
+ If a loop name is provided, it must be unique i.e. no other loop should be active with the same loop name.

## Configured block
<a name="loop-configured"></a>

The following image shows an example of what this block looks like when it is configured. It has three branches: **Looping**, **Complete**, and **Error** .

![\[A configured Loop block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/new loop block.png)


# Flow block in Amazon Connect: Loop prompts
<a name="loop-prompts"></a>

This topic defines the flow block for looping a sequence of prompts while a customer or agent is on hold or in a queue.

## Description
<a name="loop-prompts-description"></a>
+ Loops a sequence of prompts while a customer or agent is on hold or in queue.

## Supported channels
<a name="loop-prompts-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | No - Error branch | 
| Task | No - Error branch | 
| Email | No - Error branch | 

## Flow types
<a name="loop-prompts-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Customer Queue flow
+ Customer Hold flow
+ Agent Hold flow

## Properties
<a name="loop-prompts-properties"></a>

The following image shows the **Properties** page of the **Loop prompts** block. It shows there are three types of prompts you can choose from the dropdown list: **Audio recording**, **Text to Speech**, **S3 file path**.

![\[The properties page of the Loop prompts block, the dropdown list of prompt types.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/loop-prompts-properties.png)


### How the Interrupt option works
<a name="loop-prompts-properties-interrupt"></a>

Let's say you have multiple prompts and you set **Interrupt** to 60 seconds. Following is what will happen: 
+ The block plays prompts in the order that they are listed for the entirety of the prompt length.
+ If the combined play time for the prompts is 75 seconds, after 60 seconds the prompt is interrupted and reset to the 0 second point again. 
+ It's possible your customers would never hear potentially important information that is supposed to play after 60 seconds. 

This scenario is especially possible when using the default audio prompts that Amazon Connect provides since these audio prompts can be as long as 4 minutes. 

## How the interrupt option works
<a name="loop-prompts-interrupt"></a>

In the Loop prompts block, you can choose to enable the **Continue prompts during interrupt** option.

![\[Loop prompts interrupt option widget.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/loop-prompts-interrupt-1.png)


Consider a scenario where you've configured three 40-second prompts in this loop, with an Interrupt set to 60 seconds. Here's what happens in each case:

If you don't enable **Continue prompts during interrupt**:
+ The block plays prompts in order until the 60-second timeout. This means the first prompt plays entirely, followed by 20 seconds of the second prompt.
+ At 60 seconds, Connect executes the Flows logic in the timeout branch for the Loop prompts block. This may include different audio treatments, such as brief silences or a separate prompt via a Play prompt block.
+ After executing the Resume block in the timeout branch, Connect restarts the prompts from the beginning of the first prompt.
+ This behavior may prevent customers from hearing important information scheduled after 60 seconds (such as in the third prompt). This is particularly likely when using default Amazon Connect audio prompts, which can be up to 4 minutes long.

If you enable **Continue prompts during interrupt**:
+ The block plays prompts in order.
+ At 60 seconds, after playing the first prompt and 20 seconds of the second, Connect executes the Flows logic in the timeout branch for the Loop prompts block.
  + If your timeout branch doesn't use Flow blocks that play different audio (such as Play prompt, Get customer input, Store customer input, or Invoke Lex bot), Connect continues playing the prompt audio from where it was interrupted. To the customer, this sounds like uninterrupted playback of the second prompt, followed by the third.
  + If the timeout branch includes different audio configurations (like a callback offer prompt for long wait times), Connect interrupts the Loop prompts block to play this audio. It then executes the timeout branch logic before resuming at the start of the next prompt in the Loop prompts block. For example, if interrupted during the second prompt, Connect resumes at the beginning of the third prompt after executing the timeout branch logic.

## Configuration tips
<a name="loop-prompts-tips"></a>
+ The following blocks are not allowed before the **Loop prompts** block: 
  + [Get customer input](get-customer-input.md)
  + [Loop](loop.md)
  + [Play prompt](play.md)
  + [Start media streaming](start-media-streaming.md)
  + [Stop media streaming](stop-media-streaming.md)
  + [Store customer input](store-customer-input.md)
  + [Transfer to phone number](transfer-to-phone-number.md)
  + [Transfer to queue](transfer-to-queue.md), including **Transfer to callback queue**
+ For information about choosing a prompt from the Amazon Connect library or an S3 bucket, see the [Play prompt](play.md) block. 
+ When **Loop prompts** is used in a Queue flow, audio playback can be interrupted with a flow at preset times.
+ Always use an interruption period that's greater than 20 seconds. This is the amount of time an available agent has to accept the contact. If the interruption period is less than 20 seconds, you might get contacts going down the **Error** branch. This is because Amazon Connect doesn't support dequeuing the customer when they are being routed to an active agent and are in the 20 second window to join.
+ The internal counter for the loop is persisted for the call, not the flow. If you reuse the flow during a call, the loop counter isn't reset.
+ If this block is triggered during a chat conversation, the contact is routed down the **Error** branch.
+ Some existing flows have a version of the **Loop prompts** block that doesn't have an **Error** branch. In this case, a chat contact stops execution of the customer queue flow. The chat is routed when the next agent becomes available.

## Configured block
<a name="loop-prompts-configured"></a>

The following image shows what this block looks like when it is configured to play a prompt from the Amazon Connect library. Choose \$1 next to **Audio Recording** to view the full name of the file. The configured block has two branches: **Timeout** and **Error**.

![\[A Loop prompts block configured to play a prompt from the Amazon Connect library.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/loop-prompts-configured.png)


The following image shows what this block looks like when it is configured to play a prompt from Amazon S3. Choose \$1 next to **S3 path** to view the full path. The configured block has two branches: **Timeout** and **Error**.

![\[A Loop prompts block configured to play a prompt from Amazon S3.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/loop-prompts-configured2.png)


## Sample flows
<a name="loop-prompts-samples"></a>

Amazon Connect includes a set of sample flows. For instructions that explain how to access the sample flows in the flow designer, see [Sample flows in Amazon Connect](contact-flow-samples.md). Following are topics that describe the sample flows which include this block.
+ [Sample interruptible queue flow with callback in Amazon Connect](sample-interruptible-queue.md)

## Scenarios
<a name="loop-prompts-scenarios"></a>

See these topics for scenarios that use this block:
+ [Set up a flow to manage contacts in a queue in Amazon Connect](queue-to-queue-transfer.md)

# Flow block in Amazon Connect: Play prompt
<a name="play"></a>

This topic defines the flow block for playing audio prompts, text-to-speech messages, or chat responses to customers and agents.

## Description
<a name="play-description"></a>

Use this flow block to play an audio prompt or a text-to-speech message, or to send a chat response.

You can play prompts to customers (callers or customers using chat) and agents.

For calls, you have the following options:
+ **Use pre-recorded prompts**: Amazon Connect provides a library of ready-made options.
+ **Record your own prompts**. You have the following options:
  + Use the Amazon Connect library. Upload your recordings directly from the Amazon Connect admin website.
  + Use Amazon S3. Store your prompts on S3 and access them dynamically during calls.
+ **Text-to-speech**. Provide plain text or SSML (Speech Synthesis Markup Language) to have it spoken as audio.

For chats, you have the following option:
+ **Text prompts only**. Send plain text messages to both customers and agents. Audio options, like pre-recorded prompts, aren't available for chat.

## Use cases for this block
<a name="scenarios-play-prompt"></a>

This flow block is designed to be used in the following scenarios:
+ Play a greeting to customers. For example, "Welcome to our customer service line."
+ Provide information that is retrieved from a database back to customers or agents. For example, "Your account balance is \$1123.45."
+ Play pre-recorded audio while a customer is in queue or on hold.
+ Play pre-recorded audio in your own voice from your S3 buckets.
+ In an inbound flow, play an audio message or a text message to customers and agents simultaneously.

## Requirements for prompts
<a name="requirements-prompts"></a>
+ **Supported formats**: Amazon Connect supports .wav files to use for your prompt. You must use .wav files that are 8KHz, and mono channel audio with U-Law encoding. Otherwise, the prompt won't play correctly. You can use publicly available third-party tools to convert your .wav files to U-Law encoding. After converting the files, upload them to Amazon Connect.
+ **Size**: Amazon Connect supports prompts that are less than 50MB and less than five minutes long.
+ **When storing prompts in an S3 bucket:** For AWS Regions that are disabled by default (also called [opt-in](https://docs.aws.amazon.com/general/latest/gr/rande-manage.html) Regions) such as Africa (Cape Town), your bucket must be in the same Region.

## Contact types
<a name="play-channels"></a>


| Contact type | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes  If a chat contact is routed to this block, but the block is configured for calls, the contact is routed down the **Error** branch. | 
| Task | Yes If a task contact is routed to this block, but the block is configured for calls, the contact is routed down the **Error** branch.  | 
| Email | No - takes the **Success** branch but it has no effect | 

If a callback contact without an agent or customer is routed to this block, the contact is routed down the **Error** branch.

## Flow types
<a name="play-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):


| Flow type | Supported? | 
| --- | --- | 
| Inbound flow | Yes | 
| Customer queue flow | Yes. You can play prompts from the Amazon Connect library but not prompts stored in Amazon S3. | 
| Customer hold flow | No, use [Loop prompts](loop-prompts.md) flow block instead | 
| Customer whisper flow | Yes. You can play prompts from the Amazon Connect library but not prompts stored in Amazon S3. | 
| Outbound whisper flow | Yes. You can play prompts from the Amazon Connect library but not prompts stored in Amazon S3. | 
| Agent hold flow | No, use [Loop prompts](loop-prompts.md) flow block instead | 
| Agent whisper flow | Yes. You can play prompts from the Amazon Connect library but not prompts stored in Amazon S3. | 
| Transfer to agent flow | Yes | 
| Transfer to queue flow | Yes | 

## How to configure this block
<a name="play-properties"></a>

You can configure the **Play prompt** block by using the Amazon Connect admin website or by using the [MessageParticipant](https://docs.aws.amazon.com/connect/latest/APIReference/participant-actions-messageparticipant.html) action in the Amazon Connect Flow language. 

**Topics**
+ [

### Prompts stored in the Amazon Connect prompts library
](#play-properties-library)
+ [

### Prompts stored in Amazon S3
](#play-properties-s3)
+ [

### Text-to-speech or chat text
](#play-properties-text-to-speech)
+ [

### Flow block branches
](#play-branches)
+ [

### Additional configuration tips
](#play-tips)
+ [

### Data generated by this block
](#play-data)

### Prompts stored in the Amazon Connect prompts library
<a name="play-properties-library"></a>

1. In the flow designer, open the configuration pane for the **Play prompt** block.

1. Choose **Select from the prompt library (audio)**. 

1. Choose from one of the pre-recorded prompts included with Amazon Connect, or use the Amazon Connect admin website to [record and upload](prompts.md) your own prompt. There's no way to upload prompts in bulk.

   The following image shows the **Properties** page of the **Play prompt** block configured to play an Audio prompt from the prompt library.  
![\[The properties page of the Play prompt block, prompt library.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/playprompt-properties-library-manually.png)

The following code sample shows how this same configuration would be represented by the [MessageParticipant](https://docs.aws.amazon.com/connect/latest/APIReference/participant-actions-messageparticipant.html) action in the Flow language:

```
{
         "Identifier": "12345678-1234-1234-1234-123456789012",
         "Type": "MessageParticipant",
         "Parameters": {
             "PromptId": "arn:aws:connect:us-west-2:1111111111:instance/aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee/prompt/abcdef-abcd-abcd-abcd-abcdefghijkl"
         },
         "Transitions": {
             "NextAction": "a625f619-81b0-46c3-a855-89151600bdb1",
             "Errors": [
                 {
                     "NextAction": "a625f619-81b0-46c3-a855-89151600bdb1",
                     "ErrorType": "NoMatchingError"
                 }
             ]
         }
   }
```

### Prompts stored in Amazon S3
<a name="play-properties-s3"></a>



Store as many prompts as you need in an S3 bucket and then refer to them by specifying the bucket path. For best performance, we recommend creating the S3 bucket in the same AWS Region as your Amazon Connect instance.<a name="audiofile-s3"></a>

**To specify an audio file from an S3 bucket**

1. In the flow designer, open the configuration pane for the **Play prompt** block.

1. Choose **Specify an audio file from an S3 bucket**. 

1. Choose **Set manually**, and then specify the S3 file path that points to audio prompt in S3. For example, `https://u1.s3.amazonaws.com/en.lob1/welcome.wav`.

   The following image shows the **Properties** page of the **Play prompt** block configured to set the S3 file path manually.  
![\[The properties page of the Play prompt block, S3 file path specified manually.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/playprompt-properties-s3-manually.png)

   The following code sample shows how this same configuration would be represented by the [MessageParticipant](https://docs.aws.amazon.com/connect/latest/APIReference/participant-actions-messageparticipant.html) action in the Flow language:

   ```
   {
         "Identifier": "UniqueIdentifier",
         "Type": "MessageParticipant",
         "Parameters": {
             "Media": {
                 "Uri": "https://u1.s3.amazonaws.com/en.lob1/welcome.wav",
                 "SourceType": "S3",
                 "MediaType": "Audio"
             }
         },
         "Transitions": {
             "NextAction": "Next action identifier on success",
             "Errors": [
                 {
                     "NextAction": "Next action identifier on failure",
                     "ErrorType": "NoMatchingError"
                 }
             ]
         }
     }
   ```

**To use attributes to specify an audio file path from an S3 bucket**
+ You can specify the S3 bucket path using attributes, as shown in the following image:  
![\[The S3 file path specified manually using attributes.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/playprompt-properties-s3-jsonpath.png)

—OR—
+ You can provide the S3 path with concatenation, as shown in the following example. This enables you to personalize the prompt, for example, by line of business and language. For example: `https://example.s3.amazon.aws.com/$['Attributes']['Language']/$['Attributes']['LOB']/1.wav`

  The following code sample shows how this same configuration would be represented by the [MessageParticipant](https://docs.aws.amazon.com/connect/latest/APIReference/participant-actions-messageparticipant.html) action in the Flow language:

  ```
  {
           "Identifier": "UniqueIdentifier",
           "Type": "MessageParticipant",
           "Parameters": {
               "Media": {
                   "Uri": "https://u1.s3.amazonaws.com/$['Attributes']['Language']/$['Attributes']['LOB']/1.wav",
                   "SourceType": "S3",
                   "MediaType": "Audio"
               }
           },
           "Transitions": {
               "NextAction": "Next action identifier on success",
               "Errors": [
                   {
                       "NextAction": "Next action identifier on failure",
                       "ErrorType": "NoMatchingError"
                   }
               ]
           }
       }
  ```<a name="dynamic-s3"></a>

**To specify the S3 path dynamically by using user-defined contact attributes**

1. The following image shows a user-defined attribute named **S3filepath**.  
![\[The S3 file path set dynamically, the namespace set to User-defined.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/playprompt-properties-s3-attributes.png)

The following code sample shows how this same configuration would be represented by the [MessageParticipant](https://docs.aws.amazon.com/connect/latest/APIReference/participant-actions-messageparticipant.html) action in the Flow language:

```
{
   "Parameters": {
       "Media": {
           "Uri": "$.Attributes.MyFile",
           "SourceType": "S3",
           "MediaType": "Audio"
       }
   },
   "Identifier": "9ab5c4ee-7da8-44b3-b6c9-07f24e1846dc",
   "Type": "MessageParticipant",
   "Transitions": {
       "NextAction": "a625f619-81b0-46c3-a855-89151600bdb1",
       "Errors": [
           {
               "NextAction": "a625f619-81b0-46c3-a855-89151600bdb1",
               "ErrorType": "NoMatchingError"
           }
       ]
   }
}
```

The following image shows what this block looks like when the S3 path is set dynamically. It shows the S3 path, and it has two branches: **Success** and **Error**.

![\[A Play prompt block configured for an S3 path.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/play-prompt-configured2.png)


### Text-to-speech or chat text
<a name="play-properties-text-to-speech"></a>

You can enter a prompt in plain text or SSML. These text based prompts are played as audio prompts to customers using Amazon Polly.

For example, the following image shows a **Play prompt** block that is configured to play the message **Thank you for calling** to the customer. 

![\[A text-to-speech prompt set manually.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/play-prompt-sample-ssml.png)


The following code sample shows how this same configuration would be represented by the [MessageParticipant](https://docs.aws.amazon.com/connect/latest/APIReference/participant-actions-messageparticipant.html) action in the Flow language:

```
{
   "Parameters": {
       "Text": "<speak>Thank you for calling</speak>"
   },
   "Identifier": "9ab5c4ee-7da8-44b3-b6c9-07f24e1846dc",
   "Type": "MessageParticipant",
   "Transitions": {
       "NextAction": "a625f619-81b0-46c3-a855-89151600bdb1",
       "Errors": [
           {
               "NextAction": "a625f619-81b0-46c3-a855-89151600bdb1",
               "ErrorType": "NoMatchingError"
           }
       ]
   }
}
```

SSML-enhanced input text gives you more control over how Amazon Connect generates speech from the text you provide. You can customize and control aspects of speech such as pronunciation, volume, and speed.

For a list of SSML tags you can use with Amazon Connect, see [SSML tags supported by Amazon Connect](supported-ssml-tags.md). 

For more information, see [Add text-to-speech to prompts in flow blocks in Amazon Polly](text-to-speech.md).

The following image shows what a **Play prompt** block looks like when it's configured for text-to-speech. It shows the text to be played, and it has two branches: **Success** and **Error**.

![\[A Play prompt block configured for text-to-speech.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/play-prompt-configured.png)


### Flow block branches
<a name="play-branches"></a>

This block supports the following output branches:
+ **Success**: Indicates successfully played the provided audio or text message.
+ **Error**: Indicates a failure to play provided audio or text message.
+ **Okay**: Some existing flows have a version of the **Play prompt** block that doesn't have an **Error** branch. In this case, the **Okay** branch will always be taken at runtime. If you update the configuration of a **Play prompt** block that doesn't have an **Error** branch, an **Error** branch will be added to the block automatically in the editor.

### Additional configuration tips
<a name="play-tips"></a>
+ For step-by-step instructions about how to set up a dynamic prompt using contact attributes, see [Dynamically select which prompts to play in Amazon Connect](dynamically-select-prompts.md).
+ When playing prompts from an S3 bucket, for best performance we recommend creating the bucket in the same AWS Region as your Amazon Connect instance.
+ When you use text, either for text-to-speech or chat, you can use a maximum of 3,000 billed characters, which is 6,000 characters total. You can also specify text in a flow using a contact attribute.

### Data generated by this block
<a name="play-data"></a>

This block does not generate any data.

## Error scenarios
<a name="play-errorscenarios"></a>

A contact is routed down the **Error** branch in the following situations:
+ If a callback contact without an agent or customer is routed to this block, the contact is routed down the **Error** branch.
+ Amazon Connect is unable to download the prompt from S3. This may be due to an incorrect file path, or the S3 bucket policy is not set up correctly and Amazon Connect does not have access. For instructions about how to apply the policy, and a template you can use, see [Set up prompts to play from an S3 bucket in Amazon Connect](setup-prompts-s3.md).
+ Incorrect audio file format. Only .wav files are supported.
+ The audio file is larger than 50MB or longer than five minutes.
+ The SSML is incorrect. 
+ The text-to-speech length exceeds 6000 characters. 
+ The the Amazon Resource Name (ARN) for the prompt is incorrect.

## Sample flows
<a name="play-samples"></a>

All of the sample flows use the **Play prompt** block. Take a look at the [Sample inbound flow in Amazon Connect for the first contact experience](sample-inbound-flow.md) to see a **Play prompt** for chat and one for audio.

## More resources
<a name="prompts-moreresources"></a>

See the following topics to learn more about prompts. 
+ [Create prompts in Amazon Connect](prompts.md)
+ [Prompt actions](https://docs.aws.amazon.com/connect/latest/APIReference/prompts-api.html) in the Amazon Connect API Reference Guide.

# Flow block in Amazon Connect: Resume contact
<a name="resume-contact"></a>

This topic defines the flow block for resuming a task contact from a paused state.

## Description
<a name="resume-contact-description"></a>
+ Resumes a task contact from a paused state. This enables agents to free up an active slot so they can receive more critical tasks when their current task is stalled, for example, because of a missing approval or waiting on an external input.
+ For more information how pausing and resuming tasks works in Amazon Connect, see [Pause and resume tasks in Amazon Connect Tasks](concepts-pause-and-resume-tasks.md). 

## Supported channels
<a name="resume-contact-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | No - Error branch | 
| Chat | No - Error branch | 
| Task | Yes | 
| Email | No - Error branch | 

## Flow types
<a name="resume-contact-types"></a>

You can use this block on all flow types. 

## Properties
<a name="resume-contact-properties"></a>

The following image shows the **Properties** page of the **Resume contact** block.

![\[The properties page of the resume contact block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/resume-contact.png)


## Configuration tips
<a name="resume-contact-tips"></a>

When you design a flow to resume unassigned, paused tasks that are dequeued, be sure to add a [Transfer to queue](transfer-to-queue.md) block to the flow to queue the task after resuming. Otherwise, the task will stay in a de-queued state. 

## Configured block
<a name="resume-contact-configured"></a>

The following image shows an example of what this block looks like when it is configured. It has an **Error event** branch.

![\[A configured Resume contact block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/resume-contact-configured.png)


# Flow block in Amazon Connect: Return (from module)
<a name="return-module"></a>

This topic defines the flow block for resuming a task contact from a paused state.

## Description
<a name="return-module-description"></a>
+ Use the **Return** block to mark the terminal action or terminal step of a [flow module](contact-flow-modules.md). 
+ Use this block to exit the flow module after it has run successfully. Then continue running the flow in which the module is referenced.

## Supported types of flows
<a name="return-module-types"></a>

This block is only available in [flow modules](contact-flow-modules.md). It is not available in any other type of flow.


| Flow type | Supported? | 
| --- | --- | 
| Inbound Flow (contactFlow) | No | 
| Customer Queue Flow (customerQueue) | No | 
| Customer Hold Flow (customerHold) | No | 
| Customer Whisper Flow (customerWhisper) | No | 
| Outbound Whisper Flow (outboundWhisper)  | No | 
| Agent Hold Flow (agentHold) | No | 
| Agent Whisper Flow (agentWhisper) | No | 
| Transfer To Agent Flow (agentTransfer) | No | 
| Transfer To Queue Flow (queueTransfer) | No | 

## Supported types of contacts
<a name="return-module-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Contact type | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | Yes | 
| Email | Yes | 

## Flow block configuration
<a name="return-configuration"></a>

**To use a Return block**

1. In the Amazon Connect admin website choose **Routing**, **Flows**.

1. On the **Flows** page, choose the **Modules** tab, as shown in the following image:  
![\[The Flows page, the Modules tab.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/return-block-flow-module.png)

1. Choose **Create flow module** or choose the module you want to edit.

1. Select the **Return** block from the block dock and drag it onto the flow canvas.

### Return block in the Amazon Connect admin website (for Tag action)
<a name="return-userinterface"></a>

The following image shows what a **Return** block looks like on the flow editor canvas.

![\[The properties page of the resume contact block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/return-block-configured.png)


### Return block in the Flow language
<a name="return-flowlanguage"></a>

The **Return** flow block in the flow editor is stored as an `EndFlowModuleExecution` flow action in the Amazon Connect Flow Language.

For more information, see EndFlowModuleExecution in the *Amazon Connect API Reference*.

### How to configure Return block properties
<a name="return-properties"></a>

The following image shows the **Properties** pane of the **Return** block.

![\[The properties pane of the Return block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/return-block-properties.png)


1. You don't need to configure this block because it is a terminal block for a flow module.

1. Choose **Save** and publish when you are ready\$1

The following code shows how this same configuration is represented as an EndFlowModuleExecution action in the Amazon Connect Flow Language.

```
{
      "Parameters": {},
      "Identifier": "the identifier of the Return block",
      "Type": "EndFlowModuleExecution",
      "Transitions": {}
    },
```

#### Explanation of flow block outcomes
<a name="return-outtcomes"></a>

None. No conditions are supported.

## Data generated by the block
<a name="return-datagenerated"></a>

No data is generated by this block.

### How to use this data in different parts of a flow
<a name="return-datagenerated"></a>

No data is generated by this block that can be used in the flow.

### Fragmented action representation, if any
<a name="return-fragmented"></a>

This block does not support fragmented action.

## Known error scenarios
<a name="return-errorscenarios"></a>

Because this is a terminal block there are no error scenarios that the flow may encounter when this block is run.

## What this block looks like in a flow log
<a name="return-flowlogs"></a>

```
{
    "ContactId": "string",
    "ContactFlowId": "string",
    "ContactFlowName": "string",
    "ContactFlowModuleType": "Return",
    "Identifier": "string",
    "Timestamp": "2024-01-19T20:23:24.633Z",
    "Parameters": {}
}
```

# Flow block in Amazon Connect: Send message
<a name="send-message"></a>

This topic defines the flow block for sending a message to a customer.

**Important**  
Before using this block for sending text messages, enable SMS messaging or WhatsApp Business messaging. For instructions, see [Set up SMS messaging](setup-sms-messaging.md) or [Set up WhatsApp Business messaging](whatsapp-integration.md).

## Description
<a name="send-message-description"></a>
+ Use this flow block to send a message to your customer based on a template or custom message you specify. 

## Use cases for this block
<a name="scenarios-send-message"></a>

This flow block is designed to be used in the following scenarios:
+ Send an automatic acknowledgement when you receive a new email, SMS, or WhatsApp contact, for example, "Thank you for your message. We will get back to you in 24 hours." 
+ Send automated email, SMS, or WhatsApp responses that resolve the contact. For example, if a customer sends a text asking "How do I reset my password?" you can send a templated or generated email response that provides instructions. 
+ Send survey emails, SMS, or WhatsApp messages. For example, "Thank you for your time today. How did we do?" Use a Disconnect flow type for this use case. 

## Contact types
<a name="send-message-contacttypes"></a>


| Contact type | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes  | 
| Task | Yes  | 
| Email | Yes  | 

## Important information about using the Send message block in outbound flows
<a name="send-message-outboundflow-important"></a>

**Important**  
When configuring outbound flows in Amazon Connect, especially the [Default outbound flow](default-outbound.md), it is important to implement safeguards to prevent unintended email loops while using the EMAIL message type from the **Send message** block. 

When outbound email contacts are created by the **Send message flow** block, they use the **Default outbound flow** to send the email by default. This can cause an unintended email loop if there is a **Send message** block configured in the same flow without any safeguards in place.

Follow these guidelines to ensure your outbound flow configuration operates as intended:
+ Do not use the **Send message** block with the EMAIL message type in the **Default outbound flow** or any outbound flow type, if possible.
+ If you must use the **Send message** block with the EMAIL message type in any outbound flow type, make sure your flow logic will not cause any email loops.

We recommend implementing the following safeguards while using the **Send message** block in any outbound flow type:
+ Add a [Check contact attributes](check-contact-attributes.md) block immediately before the **Send message** block in your outbound flow.
+ Configure the **Check contact attributes** block to verify that the Channel System attribute (`$.Channel`) is set to branch on EMAIL.
+ Set the EMAIL branch of the **Check contact attributes** block to avoid using the **Send message** block, thus preventing any email loops when outbound email contacts use the outbound flow.
+ Set the **No Match** branch of the **Check attribute block** to use the **Send message** block. The **No Match** branch should route any VOICE, CHAT (including subtypes like SMS and WhatsApp), or TASK contacts to the **Send message** block as part of the flow.

Implementing these safeguards will help prevent scenarios where outbound email contacts that use the outbound flow type trigger additional unintended outbound email contacts to be created by using the same outbound flow, potentially creating an infinite loop. 

## Flow types
<a name="send-message-flowtypes"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):


| Flow type | Supported? | 
| --- | --- | 
| Inbound flow | Yes | 
| Customer queue flow | Yes | 
| Customer hold flow | Yes | 
| Customer whisper flow | Yes | 
| Outbound whisper flow | Yes | 
| Agent hold flow | Yes | 
| Agent whisper flow | Yes | 
| Transfer to agent flow | Yes | 
| Transfer to queue flow | Yes | 
| Disconnect flow | Yes | 

## Required permissions
<a name="sendmessage-block-perms"></a>

To configure this block to send SMS, WhatsApp, or email messages, you need the following permissions on your security profile:
+ **Channels and flows > Phone numbers > View**: To view the drop-down menu of phone numbers. 
+  **Email addresses** - **View**: To view the dropdown menu of From email addresses. 
+ **Content Management** - **Message templates** - **View**: To view the dropdown menu of message templates that are available for SMS messages, WhatsApp messages, and emails. 

If you don't have these permissions, you can still set the properties dynamically. For example, if a phone number has been set manually already on the block, and you view the block without the **View** permission, you'll still be able to see that resource, just not the list of resources in the dropdown menu.

## How to configure this block
<a name="sendmessage-block-properties"></a>

You can configure the **Send message** block by using the Amazon Connect admin website or by using the [StartOutboundChatContact](https://docs.aws.amazon.com/connect/latest/APIReference/contact-actions-startoutboundchatcontact.html) action in the Amazon Connect Flow language. 

**Topics**
+ [

### Send an SMS (text message)
](#sendmessage-block-sms)
+ [

### Send a WhatsApp Message
](#sendmessage-block-whatsapp)
+ [

### Send an email
](#sendmessage-block-email)
+ [About using templates](#sendmessage-block-email)
+ [About creating text messages](#sendmessage-block-text)

### Send an SMS (text message)
<a name="sendmessage-block-sms"></a>

The following image shows the **Send message** properties page when it's configured to send an SMS message.

![\[The properties page of the Send message block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/send-message-block-properties-sms.png)


Configure the following properties on the page to send an SMS message:
+ **From**: The phone number that the message is to be sent from. The dropdown menu shows a list of phone numbers that are claimed for your Amazon Connect instance. 
  + **Set manually**: Use the dropdown menu to search for a phone number that has been claimed to your Amazon Connect instance. 

    You must have the [required permission](#sendmessage-block-perms) in your security profile to view the dropdown list of templates.
  + **Set dynamically**: Accepts an attribute based on a **Namespace** and **Key** that points to an ARN of a phone number that has been claimed by your Amazon Connect instance.
+ **To**: The phone number that the message is to be sent to. 
  + **Set manually**: Enter the customer's phone number. This is where the SMS message will be sent. You can enter only one phone number. This is useful for testing the block.
  + **Set dynamically**: Accepts an attribute based on a **Namespace** and **Key** that is a phone number string the SMS is sent to. This must be in E.164 format.
+ **Message**: The message that will be sent to the customer.
  + **Use template**: Use the dropdown menu to choose from a list of SMS templates. You can choose one template to be sent to the customer. 

    An SMS template is a complete SMS message structure that contains only plain text. It provides the entire response or notification to the customer. 

    You must have the [required permission](#sendmessage-block-perms) in your security profile to view the dropdown list of templates.
  + **Use text**: Send a plain text message either **Set manually** by typing one in or **Set dynamically** by adding an attribute based on a **Namespace** and **Key**.
**Note**  
**Message** accepts plain text (including links and emojis), up to 1024 characters, including spaces.
+ **Flow**: The Amazon Connect flow that will handle the outbound contact created. This flow can be used to assign the outbound contact to an agent to respond to the customer.
  + **Set manually**: Use the drop-down menu to choose from a list of published flows.
  + **Set dynamically**: Accepts an attribute based on a **Namespace** and **Key** that points to a flow ARN.
+ **Link to contact**: This property gives you the option to link the outbound contact that is created to the inbound contact that initiated the flow. In some situations, you may not want to link the outbound contact that is created to avoid repetitive contact associations.
  + This property gives you the option to link the outbound SMS contact to the inbound contact that initiated the flow. 

    In some situations, you may not want to link the contact to avoid sending repetitive outbound SMS messages. For example, if the flow is configured to send the customer the message *Thank you for your message\$1 We will get back to you within 24 hours.* every time you receive a contact.

### Send a WhatsApp Message
<a name="sendmessage-block-whatsapp"></a>

The following image shows the **Send message** properties page when it's configured to send an WhatsApp message.

![\[The properties page of the Send message block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/send-message-block-properties-whatsapp.png)


Configure the following properties on the page to send an WhatsApp message:
+ **From**: The phone number that the message is to be sent from. The dropdown menu shows a list of WhatsApp numbers that are imported into your Amazon Connect instance. 
  + **Set manually**: Use the dropdown menu to search for a WhatsApp number that has been imported into your Amazon Connect instance. 

    You must have the [required permission](#sendmessage-block-perms) in your security profile to view the dropdown list of templates.
  + **Set dynamically**: Accepts an attribute based on a **Namespace** and **Key** that points to an ARN of a WhatsApp number that has been imported into your Amazon Connect instance.
+ **To**: The WhatsApp number that the message is to be sent to. 
  + **Set manually**: Enter the customer's WhatsApp number. This is where the WhatsApp message will be sent. You can enter only one WhatsApp number. This is useful for testing the block.
  + **Set dynamically**: Accepts an attribute based on a **Namespace** and **Key** that is a WhatsApp number string the message is sent to. This must be in E.164 format.
+ **Message template**: The template containing the message that will be sent to the customer.
  +  Use the dropdown menu to choose from a list of WhatsApp templates. Selecting a template is required for sending WhatsApp messages to customers. 

    A WhatsApp template is a complete WhatsApp message structure that can contain plain text, interactive components, and media content. It provides the entire response or notification to the customer. 
**Note**  
Whenever a WhatsApp user messages or calls a business, a 24-hour timer called a [ customer service window ](https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/send-messages#customer-service-windows) starts (or refreshes if one has already been started). Businesses can only send template messages to customers outside this window.   
If a customer has not messaged your business within the past 24 hours, they are outside the customer service window. In this case, you can still send them message from this Send Message flow block but subsequent messages from Play Prompt flow blocks will fail to deliver because they are not templated messages. 

    You must have the [required permission](#sendmessage-block-perms) in your security profile to view the dropdown list of templates.
+ **Flow**: The Amazon Connect flow that will handle the outbound contact created. This flow can be used to assign the outbound contact to an agent to respond to the customer.
  + **Set manually**: Use the drop-down menu to choose from a list of published flows.
  + **Set dynamically**: Accepts an attribute based on a **Namespace** and **Key** that points to a flow ARN.
+ **Link to contact**: This property gives you the option to link the outbound contact that is created to the inbound contact that initiated the flow. In some situations, you may not want to link the outbound contact that is created to avoid repetitive contact associations.
  + This property gives you the option to link the outbound WhatsApp contact to the inbound contact that initiated the flow. 

    In some situations, you may not want to link the contact to avoid sending repetitive outbound WhatsApp messages. For example, if the flow is configured to send the customer the message *Thank you for your message\$1 We will get back to you within 24 hours.* every time you receive a contact.

### Send an email
<a name="sendmessage-block-email"></a>

The following image shows the **Send message** properties page when it's configured to send an email.

![\[The properties page of the Send message block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/send-message-block-properties-email.png)


Configure the following properties on the **Send message** properties page to send an email message:
+ **From**: Use the dropdown menu to choose the email address the message is to be sent from. The menu shows a list of email addresses configured for your Amazon Connect instance.

  You must have the [required permission](#sendmessage-block-perms) in your security profile to view the dropdown list of emails.
  + **Set manually**: Use the dropdown menu to search for an email address that has been configured for your Amazon Connect instance. 
  + **Set dynamically**: Choose the Namespace and Key from the dropdown menus. For example, if you want the From email address to be the same as the one the customer sent the email to, choose **Namespace** =** System**,**Key** = **System email address**. 
+ **To**: The email address email message is sent to.
  + **Set manually**: Enter a single email address in the following format: *customer@example.com*. 
  + **Set dynamically**: Choose the Namespace and Key from the dropdown menus. For example, to send an email reply to the customer's email address, choose **Namespace** = **System**, **Key** = **Customer endpoint address**.
+ **CC**: The email address to go on the cc line of the email.
**Important**  
You can enter only one email address on the cc line.
  + **Set manually**: Use the text box to enter a list of email addresses, separated by a semicolon (;). These are the email addresses the message will be sent to.
  + **Set dynamically**: Enter an attribute based on a **Namespace** and **Key** For example, to send an email reply that is cc'ed to the same email addresses on that were cc'ed on the customer's original email to you, choose **Namespace** = **System**, **Key** = **CC Email Address List**.
+ **Message**: 
  + **Use template**: Use the dropdown menu to choose from a list of email templates that have been created for your contact center. You can choose one template to be sent to the customer. 
  + **Use text**: Enter a plain text message.
    + **Subject**: To enter the Subject dynamically, for example, to use the same subject that was in the customer's original email to you, choose **Namespace** = **Segment attribute**, **Key** = **Email Subject**. 
    + **Message**: To enter the Message dynamically, choose a **User-defined** attribute. 
+ **Link to contact**: 
  + This property gives you the option to link the outbound email contact to the inbound contact that initiated the flow. 

    In some situations, you may not want to link the contact to avoid sending repetitive outbound email messages. For example, if the flow is configured to send the customer the message *Thank you for your message\$1 We will get back to you within X hours.* every time you receive a contact.

### About using templates in the block
<a name="sendmessage-block-email"></a>

An email template is a complete email message that contains plain or rich text content. It serves as a pattern for part or all of an email message. An email template can be used by:
+ A flow to send acknowledgements or automated responses to an end customer without agent involvement.
+ A contact center manager to define the structure or outline of every agent response to ensure details such as signature, header/footer branding, and disclaimers are always included in the response to the customer. 

The following image shows an example dropdown menu with a list of available email templates. 

![\[The properties page of the Send message block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/send-message-block-template.png)


The email template contains the subject and body of an email message to be sent to a customer.

**Note**  
The subject from the template is not included when the **Send message** block is being used to Reply or Reply all to an inbound email contact. 

### About creating email and text messages in the block
<a name="sendmessage-block-text"></a>

In the case of email, when you use a message created in the **Send message** block, you need to enter a **Subject** and **Message** for the email.
+ **Subject**: You can enter up to 998 characters, including spaces. 
+ **Message**: Enter plain text, up to 5000 characters, including spaces. The message can be set manually by typing in a message or dynamically by a **User-defined** attribute set within the flow. The following image shows the character count for an email message.  
![\[The character count for an email message.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/send-message-block-email-characters.png)

In the case of SMS, when you use a message created in the **Send message** block, you need to enter only a **Message**, no subject.
+ **Message**: Enter plain text, up to 1024 characters, including spaces. Or, set the message dynamically by using a user-defined attribute set within the flow. 

## Error scenarios
<a name="sendmessage-errorscenarios"></a>

A contact is routed down the **Error** branch in the following situations:
+ Incorrect information passed to the block, such as a system email address that does not exist for the **From** field.
+ Email sending service failure.
+ Some attributes of the email template could not be populated before sending.

# Flow block in Amazon Connect: Set callback number
<a name="set-callback-number"></a>

This topic defines the flow block for setting the number to call back the customer.

## Description
<a name="set-callback-number-description"></a>
+ Specify the attribute to set the callback number.

## Supported channels
<a name="set-callback-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | No - Invalid number branch | 
| Task | No - Invalid number branch | 
| Email | No - Invalid number branch | 

## Flow types
<a name="set-callback-number-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Inbound flow
+ Customer Queue flow
+ Transfer to Agent flow
+ Transfer to Queue flow

## Properties
<a name="set-callback-number-properties"></a>

The following image shows the **Properties** page of the **Set callback number** block.

![\[The properties page of the Set callback number block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-callback-number.png)


## Configuration tips
<a name="set-callback-number-tips"></a>
+ The [Store customer input](store-customer-input.md) block often comes before this block. It stores the customer's callback number.

## Configured block
<a name="set-callback-number-configured"></a>

The following image shows an example of what this block looks like when it is configured. It has the following branches: **Success**, **Invalid number**, and **Not dialable**.

![\[A configured Set callback number block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-callback-number-configured.png)


1. **Invalid number**: The customer entered phone number that is not valid.

1. **Not dialable**: Amazon Connect is unable to dial that number. For example, if your instance is not allowed to make calls to \$1447 prefix phone numbers, and the customer requested callback to a \$1447 prefix number. Even though number is valid, Amazon Connect cannot call it. 

## Sample flows
<a name="set-callback-number-samples"></a>

Amazon Connect includes a set of sample flows. For instructions that explain how to access the sample flows in the flow designer, see [Sample flows in Amazon Connect](contact-flow-samples.md). Following are topics that describe the sample flows which include this block.
+ [Sample queue configurations flow in Amazon Connect](sample-queue-configurations.md)
+ [Sample queued callback flow in Amazon Connect](sample-queued-callback.md): this sample only applies to previous instances of Amazon Connect.

## Scenarios
<a name="set-callback-number-scenarios"></a>

See these topics for scenarios that use this block:
+ [Set up queued callback by creating flows, queues, and routing profiles in Amazon Connect](setup-queued-cb.md)
+ [Queued callbacks in real-time metrics in Amazon Connect](about-queued-callbacks.md)

# Flow block in Amazon Connect: Set contact attributes
<a name="set-contact-attributes"></a>

This topic defines the flow block for storing key-value pairs as contact attributes, and then setting a value that is later referenced in a flow.

## Description
<a name="set-contact-attributes-description"></a>

Stores key-value pairs as contact attributes. You set a value that is later referenced in a flow.

For example, create a personalized greeting for customers routed to a queue based on the type of customer account. You could also define an attribute for a company name or line of business to include in the text to speech strings said to a customer. 

The **Set contact attributes** block is useful, for example, for copying attributes retrieved from external sources to user-defined attributes.

For more information about contact attributes, see [Use Amazon Connect contact attributes](connect-contact-attributes.md). 

## Supported channels
<a name="set-contact-attributes-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | Yes | 
| Email | Yes | 

## Flow types
<a name="set-contact-attributes-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ All flows

## Properties
<a name="set-contact-attributes-properties"></a>

The following image shows the **Properties** page of the **Set contact attributes** block. It is configured to set a user-defined attribute on the **Current contact** with the key **greetingPlayed** and the value **true**.

![\[The properties page of the Set contact attributes block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-contact-attributes-properties.png)


You can choose to set attributes on:
+ **Current contact**: The attributes are set on the contact that this flow is running on. The attributes are accessible by other areas of Amazon Connect, such as other flows, modules, Lambdas, contact records, and the GetMetricDataV2 API. 
+ **Related contact**: The attributes are associated with a new contact that contains a copy of the original contact properties.

  In the contact record, this is the **RelatedContactId**.
+ **Flow**: The attributes are restricted to the flow in which they are configured. 

  Flow attributes are useful in situations where you don't want to persist the data throughout the contact, such as when you need to use sensitive information like the customer's credit card number to do a Lambda data dip.
  + Flow attributes are temporary variables stored locally and only used in the flow. They aren't visible anywhere outside the flow, not even when the contact is transferred to another flow. 
  + They can be up to 32 KB (the maximum size of the contact record attributes section).
  + They aren't passed to a Lambda unless they are explicitly configured as parameters: in the **Invoke AWS Lambda function** block, choose **Add a parameter**. 
  + They aren't passed to modules. You can set a flow attribute within a module, but it won't be passed out of the module.
  + They don't appear in the contact record. 
  + They don't appear to the agent in the CCP.
  + The `GetContactAttributes` API can't expose them.
  + If you have logging enabled on the flow, the key and value appear in the Cloudwatch log.

## How to reference attributes
<a name="set-contact-attributes-how-to-reference"></a>
+ For the JSON syntax for each attribute, see [List of available contact attributes in Amazon Connect and their JSONPath references](connect-attrib-list.md).
+ To reference attributes that contain special characters in their name, such as spaces, place brackets and single quotations around the attribute name. For example: ` $.Attributes.['user attribute name']`. 
+ To reference attributes in the same namespace, such as a system attribute, you use the attribute name, or the name you specified as the **Destination key**.
+ To reference values in a different namespace, such as referencing an external attribute, you specify the JSONPath syntax to the attribute.
+ To use contact attributes to access other resources, set a user-defined attribute in your flow and use the Amazon Resource Name (ARN) of the resource you want to access as the value for the attribute. 

### Lambda examples
<a name="set-contact-attributes-lambda-examples"></a>
+ To reference a customer name from a Lambda function lookup, use \$1.External.AttributeKey, replacing AttributeKey with the key (or name) of the attribute returned from the Lambda function.
+ To use an Amazon Connect prompt in a Lambda function, set a user-defined attribute to the ARN for the prompt, and then access that attribute from the Lambda function.

### Amazon Lex examples
<a name="set-contact-attributes-lex-examples"></a>
+ To reference an attribute from an Amazon Lex bot, you use the format \$1.Lex. and then include the part of the Amazon Lex bot to reference, such as \$1.Lex.IntentName.
+ To reference the customer input to an Amazon Lex bot slot, use \$1.Lex.Slots.*slotName*, replacing *slotName* with the name of the slot in the bot.

## What happens when attributes exceed 32 KB
<a name="set-contact-attributes-space"></a>

Attributes can be up to 32 KB, which is the maximum size of the contact record attributes section. When the attributes for a contact exceed 32 KB, the contact is routed down the **Error** branch. As a mitigation, consider the following options:
+ Remove unnecessary attributes by setting their values to empty.
+ If the attributes are only used in one flow and don't need to be referred to outside of that flow (for example, by a Lambda or another flow), then use flow attributes. This way you aren't needlessly persisting the 32 KB of information from one flow to another. 

## Configuration tips
<a name="set-contact-attributes-tips"></a>
+ When using a user-defined destination key, you can name it anything you want but don't include the **\$1** and **.** (period) characters. They are not allowed because they are both used in defining the attribute paths in JSONPath.
+ You can use the **Set contact attribute** block to set the language attribute required for an Amazon Lex V2 bot. (Your language attribute in Amazon Connect must match the language model used to build your Amazon Lex V2 bot.) The following image shows a language attribute set to Spanish.  
![\[The properties page for Set contact attributes, Value set to Spanish.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-contact-attributes-language.png)

  Or, you can use the [Set voice](set-voice.md) block to set the language required for an Amazon Lex V2 bot. 

For more information about how to use contact attributes, see [Use Amazon Connect contact attributes](connect-contact-attributes.md). 

## Configured block
<a name="set-contact-attributes-configured"></a>

The following image shows an example of what this block looks like when it is configured. It has two branches: **Success** and **Error**.

![\[A configured set contact attributes block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-contact-attributes-configured.png)


## Sample flows
<a name="set-contact-attributes-samples"></a>

Amazon Connect includes a set of sample flows. For instructions that explain how to access the sample flows in the flow designer, see [Sample flows in Amazon Connect](contact-flow-samples.md). Following are topics that describe the sample flows which include this block.
+ [Sample inbound flow in Amazon Connect for the first contact experience](sample-inbound-flow.md)

## Scenarios
<a name="set-contact-attributes-scenarios"></a>

See these topics for scenarios that use this block:
+ [How to reference contact attributes in Amazon Connect](how-to-reference-attributes.md)

# Flow block in Amazon Connect: Set customer queue flow
<a name="set-customer-queue-flow"></a>

This topic defines the flow block for specifying the flow to invoke when a customer is transferred to a queue.

## Description
<a name="set-contact-attributes-description"></a>
+ Specifies the flow to invoke when a customer is transferred to a queue.

## Supported channels
<a name="set-customer-queue-flow-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | Yes | 
| Email | Yes | 

## Flow types
<a name="set-contact-attributes-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Inbound flow
+ Transfer to Agent flow
+ Transfer to Queue flow

## Properties
<a name="set-contact-attributes-properties"></a>

The following image shows the **Properties** page of the **Set customer queue flow** block.

![\[The properties page of the Set customer queue flow block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-customer-queue-properties.png)


For information about using attributes, see [Use Amazon Connect contact attributes](connect-contact-attributes.md).

## Configured block
<a name="set-contact-attributes-configured"></a>

The following image shows an example of what this block looks like when it is configured. It has the following branches: **Success** and **Error**.

![\[A configured set customer queue flow block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-customer-queue-configured.png)


## Sample flows
<a name="set-contact-attributes-samples"></a>

Amazon Connect includes a set of sample flows. For instructions that explain how to access the sample flows in the flow designer, see [Sample flows in Amazon Connect](contact-flow-samples.md). Following are topics that describe the sample flows which include this block.
+ [Sample queued callback flow in Amazon Connect](sample-queued-callback.md)

# Flow block in Amazon Connect: Set disconnect flow
<a name="set-disconnect-flow"></a>

This topic defines the flow block for specifying which flow to run when a call is disconnected during a contact.

## Description
<a name="set-disconnect-flow-description"></a>
+ Specifies which flow to run after a disconnect event during a contact. 

  A disconnect event is when:
  + A chat, or task is disconnected.
  + A task is disconnected as a result of a flow action.
  + A task expires. The task is automatically disconnected when it completes its expiry timer. The default is 7 days and task expiry is configurable up to 90 days. 

  When the disconnect event occurs, the corresponding flow runs. 
+ Here are examples of when you might use this block:
  + Run post-contact surveys. For example, the agent asks the customer to remain on the line for a post-call survey. The agent hangs up and a disconnect flow is run. In the disconnect flow, the customer is asked a set of questions using the [Get customer input](get-customer-input.md) block. Their answers are uploaded using an [AWS Lambda function](invoke-lambda-function-block.md) block to an external customer feedback database. The customer is thanked and disconnected.

    For more information about creating post-contact surveys, see this blog: [Easily create and visualize post chat surveys with Amazon Connect and Amazon Lex](https://aws.amazon.com/blogs/contact-center/easily-create-and-visualize-post-chat-surveys-with-amazon-connect-and-amazon-lex/). And check out this workshop: [Building a contact survey solution for Amazon Connect](https://catalog.workshops.aws/amazon-connect-contact-survey/en-US).
  + In a chat scenario, if a customer stops responding to the chat, use this block to decide whether to run the disconnect flow and call a [Wait](wait.md) block, or end the conversation.
  + In task scenarios where a task may not be completed in 7 days, use this block to run a disconnect flow to determine whether the task should be re-queued, or completed/[disconnected](disconnect-hang-up.md) by a flow action.

**Tip**  
It's not possible to play a audio prompt to the agent or invoke a flow when the customer disconnects. After the customer disconnects, the flow ends and the agents starts After Call Work (ACW) for that contact.

## Supported channels
<a name="set-disconnect-flow-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | Yes | 
| Email | Yes | 

## Flow types
<a name="set-disconnect-flow-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ All flows

## Properties
<a name="set-disconnect-flow-properties"></a>

The following image shows the **Properties** page of the **Set disconnect flow** block.

![\[The properties page of the set disconnect flow block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-disconnect-flow-properties.png)


## Configured block
<a name="set-disconnect-flow-configured"></a>

The following image shows an example of what this block looks like when it is configured. It has the following branches: **Success** and **Error**.

![\[A configured set disconnect flow block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-disconnect-flow-configured.png)


## Sample flows
<a name="set-disconnect-flow-samples"></a>

Amazon Connect includes a set of sample flows. For instructions that explain how to access the sample flows in the flow designer, see [Sample flows in Amazon Connect](contact-flow-samples.md). Following are topics that describe the sample flows which include this block.
+ [Sample inbound flow in Amazon Connect for the first contact experience](sample-inbound-flow.md)

## Scenarios
<a name="set-disconnect-flow-scenarios"></a>

See these topics for scenarios that use this block:
+ [Example chat scenario](web-and-mobile-chat.md#example-chat-scenario)
+ [Easily create and visualize post chat surveys with Amazon Connect and Amazon Lex](https://aws.amazon.com/blogs/contact-center/easily-create-and-visualize-post-chat-surveys-with-amazon-connect-and-amazon-lex/)
+ [Building a contact survey solution for Amazon Connect](https://catalog.workshops.aws/amazon-connect-contact-survey/en-US)

# Flow block in Amazon Connect: Set event flow
<a name="set-event-flow"></a>

This topic defines the flow block for specifying a flow to run during an interaction with a contact.

## Description
<a name="set-event-flow-description"></a>
+ Specifies which flow to run during a contact event.
+ The following events are supported:
  + **Default flow for agent UI**: specifies the flow to be invoked when a contact comes into the Agent Workspace. You can use this event to set up a [step-by-step](step-by-step-guided-experiences.md) guide to be played to the agent in this scenario.
  + **Disconnect flow for agent UI**: specifies the flow to be invoked when a contact that is open in the Agent Workspace ends. You can use this event to set up a [step-by-step](step-by-step-guided-experiences.md) guide to be played to the agent in this scenario.
  + ** Flow at contact pause**: Specifies the flow to be invoked when a contact comes to paused state. For more information, see [Pause and resume tasks in Amazon Connect Tasks](concepts-pause-and-resume-tasks.md).
  + **Flow at contact resume**: Specifies the flow to be invoked when a contact comes to resume from paused state. For more information, see [Pause and resume tasks in Amazon Connect Tasks](concepts-pause-and-resume-tasks.md).

## Supported channels
<a name="set-event-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | Yes | 
| Email | Yes | 

## Flow types
<a name="set-event-flow-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ All flows

## Properties
<a name="set-event-flow-properties"></a>

The following image shows the **Properties** page of the **Set event flow** block.

![\[The properties page of the Set event flow block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-event-flow-properties.png)


## Configured block
<a name="set-event-flow-configured"></a>

The following image shows an example of what this block looks like when it is configured. It has the following branches: **Success** and **Error**.

![\[A configured Set event flow block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-event-flow-configured.png)


## Scenarios
<a name="set-event-flow-scenario"></a>

See these topics for scenarios that use this block:
+ [Invoke a guide at the start of a contact in Amazon Connect](how-to-invoke-a-flow-sg.md)

# Flow block in Amazon Connect: Set hold flow
<a name="set-hold-flow"></a>

This topic defines the flow block for specifying the flow to invoke when a customer or agent is put on hold.

## Description
<a name="set-hold-flow-description"></a>
+ Links from one flow type to another.
+ Specifies the flow to invoke when a customer or agent is put on hold.

  If this block is triggered during a chat conversation, the contact is routed down the **Error** branch.

## Supported channels
<a name="set-hold-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | No - Error branch | 
| Task | No - Error branch | 
| Email | No - Error branch | 

## Flow types
<a name="set-hold-flow-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Inbound flow
+ Customer Queue flow
+ Outbound whisper flow
+ Transfer to Agent flow
+ Transfer to Queue flow

## Properties
<a name="set-hold-flow-properties"></a>

The following image shows the **Properties** page of the **Set hold flow** block. It shows the dropdown list of namespaces that you can use to set the hold flow dynamically.

![\[The properties page of the Set hold flow block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-hold-flow-properties.png)


For information about using attributes, see [Use Amazon Connect contact attributes](connect-contact-attributes.md).

## Configured block
<a name="set-hold-flow-configured"></a>

The following image shows an example of what this block looks like when it is configured. It has the following branches: **Success** and **Error**.

![\[A configured set hold flow block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-hold-flow-configured.png)


# Flow block in Amazon Connect: Set logging behavior
<a name="set-logging-behavior"></a>

This topic defines the flow block for enabling flow logs to track events as contacts interact with flows.

## Description
<a name="set-logging-behavior-description"></a>
+ Enables flow logs so you can track events as contacts interact with flows.
+ Flow logs are stored in Amazon CloudWatch. For more information, see [Flow logs stored in an Amazon CloudWatch log group](contact-flow-logs-stored-in-cloudwatch.md).

## Supported channels
<a name="set-logging-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | Yes | 
| Email | Yes | 

## Flow types
<a name="set-logging-behavior-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ All flows

## Properties
<a name="set-logging-behavior-properties"></a>

The following image shows the **Properties** page of the **Set logging behavior** block. It has two options: enable logging behavior, or disable it.

![\[The properties page of the Set logging behavior block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-logging-behavior-properties.png)


## Scenarios
<a name="set-logging-behavior-scenarios"></a>

See these topics for more information about flow logs:
+ [Use flow logs to track events in Amazon Connect flows](about-contact-flow-logs.md)

# Flow block in Amazon Connect: Set recording and analytics behavior
<a name="set-recording-behavior"></a>

**Note**  
This block remains supported in existing flows for backwards compatibility, but it is replaced by [Set recording, analytics and processing behavior](set-recording-analytics-processing-behavior.md) for new flows or modifications.

This topic defines the flow block for setting options to record or monitor voice for agent and customer, enable automated interaction, enable screen recording, and to set analytics behavior for contacts.

## Description
<a name="set-recording-behavior-description"></a>

There is a lot of functionality in this block:
+ You configure what part of the call can be recorded be it either agent, customer or both. No additional charges apply. 
+ You can enable automated interaction call recording to hear how a customer is interacting with your IVR or conversational AI bot. No additional charges apply.
+ You can enable screen recording of agents, if agent screen recording has been set up as described in [Enable screen recording](enable-sr.md). For pricing information, see [Amazon Connect Pricing](https://aws.amazon.com/connect/pricing/).
+ You can configure Contact Lens analytics settings for chat and voice contacts. For pricing information, see [Amazon Connect Pricing](https://aws.amazon.com/connect/pricing/). This includes:
  + Language in which customers and agents will interact (to improve the speech to text transcript generation)
  + Redaction of sensitive data
  + Additional Contact Lens Generative AI capabilities
+ It enables Contact Lens conversational analytics on a contact. For more information, see [Analyze conversations using conversational analytics](analyze-conversations.md).

## Contact types
<a name="set-recording-channels"></a>


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | No - Error branch | 
| Email | No - Error branch | 

## Flow types
<a name="set-recording-behavior-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):


| Flow type | Supported? | 
| --- | --- | 
| Inbound flow | Yes | 
| Customer hold flow | No | 
| Customer queue flow | Yes | 
| Customer whisper flow | No | 
| Outbound whisper flow | Yes | 
| Agent hold flow | No | 
| Agent whisper flow | No | 
| Transfer to agent flow | Yes | 
| Transfer to queue flow | Yes | 

**Tip**  
 We recommend using the **Set recording behavior** block in an inbound or outbound whisper flow for the most accurate behavior.   
Using this block in a queue flow does not always guarantee that calls are recorded. This is because the block might run after the contact is joined to the agent.

## How to configure this block
<a name="set-recording-behavior-properties"></a>

You can configure the **Set recording and analytics behavior** block by using the Amazon Connect admin website or by using the [UpdateContactRecordingBehavior](https://docs.aws.amazon.com/connect/latest/APIReference/contact-actions-updatecontactrecordingbehavior.html) action in the Amazon Connect Flow language. 

The following image shows the **Set recording and analytics behavior** properties page in the Amazon Connect admin website. It is divided two sections: Enable recording and analytics, and Configure analytics settings. These sections are divided in subsections. Each subsection can be expanded and collapsed and summary is displayed in its header.

![\[The properties page of the Set recording and analytics behavior block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-recording-behavior-properties.png)


### Enable recording and analytics
<a name="set-recording-behavior-enable-analytics"></a>

In this section of the Properties page you configure recording and related analytics settings.
+ **Voice**:
  + **Agent and customer voice recording**: Choose who you want to record.
  + **Contact Lens speech analytics**: Choose whether to use speech analytics on agent and customer recordings.
  + **Automated interaction call recording**: Choose whether to enable voice recording when the customer is interacting with bots and other automation.
**Note**  
To include Lex bot transcripts and analytics as a part of your **Contact details** page and Amazon Connect analytics dashboards:  
In the Amazon Connect console, choose the name of your instance. For instructions, see [Find your Amazon Connect instance name](find-instance-name.md).
On the navigation pane choose **Flows**, and then choose **Enable Bot Analytics and Transcripts in Amazon Connect**.
+ **Screen**: Use to enable or disable recording of the agent's screen. For more information, see [Set up and review agent screen recordings in Amazon Connect Contact Lens](agent-screen-recording.md).
+ **Chat**: Use this option to enable chat analytics, a feature in Contact Lens. For more information, see [Enable conversational analytics in Amazon Connect Contact Lens](enable-analytics.md). 

### Configure analytics settings
<a name="configure-analytics-settings"></a>

This section of the properties page applies to Contact Lens conversational analytics. You specify supported languages, redaction, and generative AI capabilities. Unless specified otherwise, analytics settings apply to both speech and chat Contact Lens conversational analytics.
+ **Language**: You can dynamically enable the redaction of the output files based on the language of the customer. For instructions, see [Dynamically enable redaction based on the customer's language](enable-analytics.md#dynamically-enable-analytics-contact-flow).
+ **Redaction**: Choose whether to redact sensitive data. For more information, see [Enable redaction of sensitive data](enable-analytics.md#enable-redaction). 
+ **Sentiment**: Choose whether to enable sentiment analysis.
+ **Contact Lens Generative AI capabilities**: For more information, see [View generative AI-powered post-contact summaries](view-generative-ai-contact-summaries.md)

## Configuration tips
<a name="set-recording-behavior-tips"></a>
+ You can change call recording behavior in a flow, for example, change from "Agent and customer" to "Agent only." Perform the following steps:

  1. Add a second **Set recording and analytics behavior** block to the flow.

  1. Configure the second block to set agent and customer voice recording to **Off**.

  1. Add another **Set recording and analytics behavior** block.

  1. Configure the third block to the new recording behavior you want, such as **Agent only**. 
**Note**  
The settings in the **Analytics** section are overwritten by each subsequent **Set recording and analytics behavior** block in the flow.
+ **For calls**: Unselecting **Enable speech analytics on agent and customer voice recordings** disables Contact Lens conversational analytics.

  For example, let's say you have two **Set recording and analytics behavior** blocks in your flow. 
  + The first block has enabled real-time speech analytics on agent and customer voice recordings selected. 
  + The second block later in the flow has it unselected. 

  In this case, the analytics appear only during the time analytics was enabled. 

   Another example: let's say you have two **Set recording and analytics behavior** blocks in your flow. 
  +  The first block has **Enabled post-call speech analytics on agent and customer voice recordings** selected.
  + The second block later in the flow has it unselected.

  In this case, since post call happens at end of call and the latest configuration doesn't have analytics enabled, no post-call analytics will be available.
+ **For automated interaction call recording**: Recording starts as soon as it is set to On. Later in the flow, if it is set to off in a second block, recording is paused and can be turned on later to resume the recording.
**Note**  
When a call is transferred by using the [Transfer to phone number](transfer-to-phone-number.md) block, the recording continues.
+ **For chat**: Real-time chat starts analysis as soon as any block in the flow enables it. No block later in the flow disables the real time chat settings. 
+ If an agent puts a customer on hold, the agent is still recorded, but the customer is not.
+ If you want to transfer a contact to another agent or queue, and you want to continue using Contact Lens conversational analytics to collect data, you need to add to the flow another **Set recording behavior** block with **Enable analytics** turn on. This is because a transfer generates a second contact ID and contact record. Contact Lens conversational analytics needs to run on that contact record as well.
+ When you enable conversational analytics, the type of flow that the block is in, and where it is placed in the flow, determine **whether** agents receive the key highlights transcript, and **when** they receive it. 

  For more information and example use cases that explain how the block affects the agents experience with key highlights, see [Design a flow for key highlights](enable-analytics.md#call-summarization-agent).

## Configured block
<a name="set-recording-behavior-configured"></a>

This block supports one output branch: **Success**. 

The following image shows what a **Set recording and analytics behavior** block looks like when it's configured for both voice and automated interaction recording, along with speech analytics and screen recording enabled. 

![\[A configured Set recording and analytics behavior block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-recording-and-analytics-behavior-configured.png)


## Sample flows
<a name="set-recording-behavior-samples"></a>

Amazon Connect includes a set of sample flows. For instructions that explain how to access the sample flows in the flow designer, see [Sample flows in Amazon Connect](contact-flow-samples.md). Following are topics that describe the sample flows which include this block.
+ [Sample inbound flow in Amazon Connect for the first contact experience](sample-inbound-flow.md)

## Scenarios
<a name="set-recording-behavior-scenarios"></a>

See these topics for scenarios that use this block:
+ [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)
+ [Assign permissions to review past contact center conversations in Amazon Connect](assign-permissions-to-review-recordings.md)
+ [Analyze conversations using conversational analytics in Amazon Connect Contact Lens](analyze-conversations.md)

# Flow block in Amazon Connect: Set recording, analytics and processing behavior
<a name="set-recording-analytics-processing-behavior"></a>

This topic defines the flow block for setting options to configure recording behavior for agent and customer, enable automated interaction, enable screen recording, set analytics behavior for contacts, and set custom processing behavior.

## Description
<a name="set-recording-analytics-processing-behavior-description"></a>

There are two actions supported as part of this block:
+ **Set message processor**\$1 - this allows customers to configure their own lambda processor, which will be applied to in-flight messages
+ **Set recording and analytics behavior** - this allows customers to configure recording and analytics behavior for voice, chat, and email contacts, along with screen recording behavior.

\$1Unavailable in PDT

![\[The action dropdown showing the two actions in the block's Select action dropdown.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-recording-analytics-processing-behavior-action-dropdown.png)


The above screenshot shows the two actions in the block's "Select action" dropdown.

Once you select an action, you can select a channel to configure those settings for. Here are the supported channels for each action:


|  | Chat supported? | Email supported? | Tasks supported? | Voice supported? | 
| --- | --- | --- | --- | --- | 
| Set message processing | Yes | No | No | No | 
| Set recording and analytics behavior | Yes | Yes | Yes (only for screen recording behavior) | Yes | 

## Flow types
<a name="set-recording-analytics-processing-behavior-types"></a>

This block is supported for all flow types except journey flows.

**Tip**  
We recommend using the **Set recording** portion of this block in an inbound or outbound whisper flow for the most accurate behavior.  
Using this block in other flow types does not always guarantee that calls are recorded. This is because the block might run after the contact is joined to the agent.

## How to configure this block
<a name="set-recording-analytics-processing-behavior-properties"></a>

You can configure the **Set recording, analytics and processing behavior** block by using the Amazon Connect admin website. This guide will walk through how to configure each action in this block.

### Set message processing
<a name="set-message-processing"></a>

The following image shows a picture of the **Set message processor** action set in the block. This action currently only supports Chat channel type, which is selected in the next dropdown. The dropdown is followed by several settings to configure a custom lambda processor:

1. **Enable processing** - control whether you want to start or stop chat message processing.

1. **Function ARN** - define a lambda function that will perform the message processing. This function should be integrated with custom message processing. You can do so through the **CreateIntegrationAssociation** public API, using the MESSAGE\$1PROCESSOR IntegrationType. View documentation [here](https://docs.aws.amazon.com/connect/latest/APIReference/API_CreateIntegrationAssociation.html).

1. **Processing failure handling** - select whether you would like the original, unprocessed message to be delivered or not in case processing fails.

![\[The Set message processor action configuration with processing enabled.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-recording-analytics-processing-behavior-message-processor-enabled.png)


The below screenshot shows the block settings when processing is disabled:

![\[The Set message processor action configuration with processing disabled.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-recording-analytics-processing-behavior-message-processor-disabled.png)


### Set recording and analytics behavior
<a name="set-recording-analytics-behavior"></a>

The following guide will discuss the **Set recording and analytics** action in the block. There are multiple configurations in this part of the block:
+ You configure what part of the call can be recorded be it either agent, customer or both. No additional charges apply.
+ You can enable automated interaction call recording to hear how a customer is interacting with your IVR or conversational AI bot. No additional charges apply.
+ You can enable screen recording of agents, if agent screen recording has been set up as described in [Enable screen recording](https://docs.aws.amazon.com/connect/latest/adminguide/enable-sr.html). For pricing information, see [Amazon Connect Pricing](https://aws.amazon.com/connect/pricing/).
+ You can configure Contact Lens analytics settings for voice, chat, and email contacts. For pricing information, see [Amazon Connect Pricing](https://aws.amazon.com/connect/pricing/). This includes:
  + Language in which customers and agents will interact (to improve the speech to text transcript generation).
  + Redaction of sensitive data.
  + Additional Contact Lens Generative AI capabilities.

This action enables Contact Lens conversational analytics on a contact. For more information, see [Analyze conversations using conversational analytics](analyze-conversations.md). This action currently supports Chat, Email, Voice, and Tasks media channel types. However, for tasks, you are only able to configure screen recording behavior. Therefore, in the channel dropdown for this action, you will see the following options:

![\[The channel dropdown showing Chat, Email, Screen recording, and Voice options.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-recording-analytics-processing-behavior-channel-dropdown.png)


**Note**  
To configure both screen recording and channel recording or analytics, use two separate Set recording, analytics, and processing behavior blocks in sequence: one for screen recording and one for audio recording. Each block should be configured for only one recording type to avoid unexpected behavior.

Let's walk through what each channel's configuration looks like:

#### Chat
<a name="set-recording-analytics-processing-behavior-chat"></a>

As shown in the following image, the chat settings are split into two sections: **Enable** and **configure** conversational analytics.

![\[The Chat channel configuration showing conversational analytics settings.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-recording-analytics-processing-behavior-chat-config.png)


Once conversational analytics is enabled, you can configure settings such as language, redaction, and AI features (sentiment analysis, interaction summaries).
+ **Language**: You can dynamically enable the redaction of the output files based on the language of the customer. For instructions, see [Dynamically enable redaction based on the customer's language](https://docs.aws.amazon.com/connect/latest/adminguide/enable-analytics.html#dynamically-enable-analytics-contact-flow).
+ **Conversational Analytics Redaction**: Choose whether to redact sensitive data. For more information, see [Enable redaction of sensitive data](https://docs.aws.amazon.com/connect/latest/adminguide/enable-analytics.html#enable-redaction).
+ **In-flight Redaction**: Choose whether to redact sensitive data from messages in-flight. For more information, see [Enable in-flight sensitive data redaction and message processing](https://docs.aws.amazon.com/connect/latest/adminguide/redaction-message-processing.html).
+ **Sentiment**: Choose whether to enable sentiment analysis.
+ **Contact Lens Generative AI capabilities**: For more information, see [View generative AI-powered post-contact summaries](https://docs.aws.amazon.com/connect/latest/adminguide/view-generative-ai-contact-summaries.html)

#### Email
<a name="set-recording-analytics-processing-behavior-email"></a>

As shown in the following image, when you select the Email channel, you can enable and configure conversational analytics for email contacts. Because email contacts are asynchronous, analysis is initiated when the email contact is received, rather than following the real-time and post-contact model used for voice and chat.

![\[The Email channel configuration showing conversational analytics settings.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-recording-analytics-processing-behavior-email-config.png)


The email analytics settings include:
+ **Language**: Select the language of the email content. You can dynamically set the language using contact attributes. For instructions, see [Dynamically enable redaction based on the customer's language](https://docs.aws.amazon.com/connect/latest/adminguide/enable-analytics.html#dynamically-enable-analytics-contact-flow).
+ **Conversational Analytics Redaction**: Choose whether to redact sensitive data such as names, addresses, and credit card information from the email transcript. For more information, see [Enable redaction of sensitive data](https://docs.aws.amazon.com/connect/latest/adminguide/enable-analytics.html#enable-redaction).
+ **Contact Lens Generative AI capabilities**: Enable contact summaries for email contacts. For more information, see [View generative AI-powered post-contact summaries](https://docs.aws.amazon.com/connect/latest/adminguide/view-generative-ai-contact-summaries.html).

**Note**  
Sentiment analysis is not available for email contacts at this time.

#### Voice
<a name="set-recording-analytics-processing-behavior-voice"></a>

As shown in the following image, the voice settings are split into three sections: **Enable** recording, and **Enable** and **configure** conversational analytics.

![\[The Voice channel configuration showing recording and analytics settings.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-recording-analytics-processing-behavior-voice-config.png)


**Recording settings:**
+ **Agent and customer voice recording**: Choose who you want to record.
+ **Contact Lens speech analytics**: Choose whether to use speech analytics on agent and customer recordings.
+ **Automated interaction call recording**: Choose whether to enable voice recording when the customer is interacting with bots and other automation.

**Configuration:**
+ **Language**: You can dynamically enable the redaction of the output files based on the language of the customer. For instructions, see [Dynamically enable redaction based on the customer's language](https://docs.aws.amazon.com/connect/latest/adminguide/enable-analytics.html#dynamically-enable-analytics-contact-flow).
+ **Conversational Analytics Redaction**: Choose whether to redact sensitive data. For more information, see [Enable redaction of sensitive data](https://docs.aws.amazon.com/connect/latest/adminguide/enable-analytics.html#enable-redaction).
+ **Sentiment**: Choose whether to enable sentiment analysis.
+ **Contact Lens Generative AI capabilities**: For more information, see [View generative AI-powered post-contact summaries](https://docs.aws.amazon.com/connect/latest/adminguide/view-generative-ai-contact-summaries.html)

**Note**  
To include Lex bot transcripts and analytics as a part of your **Contact Details** page and Amazon Connect analytics dashboards:  
In the Amazon Connect console, choose the name of your instance. For instructions, see [Find your Amazon Connect instance name](https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-name.html).
On the navigation pane choose **Flows**, and then choose **Enable Bot Analytics and Transcripts in Amazon Connect**.

#### Screen recording
<a name="set-recording-analytics-processing-behavior-screen-recording"></a>

Though not a media channel, you can find this in the media channel dropdown of the block. You can configure this to enable or disable recording of the agent's screen. For more information, see [Set up and review agent screen recordings in Amazon Connect Contact Lens](https://docs.aws.amazon.com/connect/latest/adminguide/agent-screen-recording.html).

## Configuration tips
<a name="set-recording-analytics-processing-behavior-tips"></a>

**Note**  
The settings in the **Analytics** section are overwritten by each subsequent **Set recording and analytics behavior** block in the flow.
+ **For calls**: Unselecting **Enable speech analytics on agent and customer voice recordings** disables Contact Lens conversational analytics.

  For example, let's say you have two **Set recording, analytics and processing behavior** blocks in your flow.
  + The first block has enabled real-time speech analytics on agent and customer voice recordings selected.
  + The second block later in the flow has it unselected.

  In this case, the analytics appear only during the time analytics was enabled.

  Another example: let's say you have two **Set recording, analytics and processing behavior** blocks in your flow.
  + The first block has **Enabled post-call speech analytics on agent and customer voice recordings** selected.
  + The second block later in the flow has it unselected.

  In this case, since post call happens at end of call and the latest configuration doesn't have analytics enabled, no post-call analytics will be available.
+ **For automated interaction call recording**: Recording starts as soon as it is set to **On**. Later in the flow, if it is set to **Off** in a second block, recording is paused and can be turned on later to resume the recording.

**Note**  
When a call is transferred by using the [Transfer to phone number](https://docs.aws.amazon.com/connect/latest/adminguide/transfer-to-phone-number.html) block, the recording continues.
+ **For chat**: Real-time chat starts analysis as soon as any block in the flow enables it. No block later in the flow disables the real time chat settings.
+ If an agent puts a customer on hold, the agent is still recorded, but the customer is not.
+ If you want to transfer a contact to another agent or queue, and you want to continue using Contact Lens conversational analytics to collect data, you need to add to the flow another **Set recording, analytics and processing behavior** block with **Enable analytics** turned on. This is because a transfer generates a second contact ID and contact record. Contact Lens conversational analytics needs to run on that contact record as well.
+ **When** you enable conversational analytics, the type of flow that the block is in, and where it is placed in the flow, determine **whether** agents receive the key highlights transcript, and **when** they receive it.

  For more information and example use cases that explain how the block affects the agent's experience with key highlights, see [Design a flow for key highlights](https://docs.aws.amazon.com/connect/latest/adminguide/enable-analytics.html#call-summarization-agent).

## Configured block
<a name="set-recording-analytics-processing-behavior-configured"></a>

This block has three branches: **Success**, **Error** and **Channel mismatch**

The channel mismatch branch is taken if the media channel that begins the contact is not the same as the media channel selected in the block. In the case of screen recording, this branch is taken when the contact is not a voice contact.

![\[A configured Set recording, analytics and processing behavior block showing the Set recording and analytics behavior action with four branches.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-recording-analytics-processing-behavior-configured-recording-action.png)


In the case where **Set recording and analytics behavior** is selected as the action and **Chat** is selected as the media channel, there will be an additional branch called **In-flight redaction configuration failed**. This branch is taken if in-flight redaction fails to stop or start, but all other configurations are updated correctly.

When the **Set message processor** action is selected, the block shows three branches: **Success**, **Error** and **Channel mismatch**:

![\[A configured Set recording, analytics and processing behavior block showing the Set message processor action with three branches.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-recording-analytics-processing-behavior-configured-message-processor.png)


# Flow block in Amazon Connect: Set routing criteria
<a name="set-routing-criteria"></a>

This topic defines the flow block for routing a contact in any channel to the appropriate queue. 

## Description
<a name="set-routing-criteria-description"></a>

Sets routing criteria on a contact.
+ Routing criteria can be set on contacts of any channel, such as vice, chat, task, and email, to define how the contact should be routed within its queue. A routing criteria is a sequence of one or more routing steps.
+ A routing step is a combination of one or more requirements that must be met in order for this contact to be routed to an agent. You can set an optional expiration duration for each routing step. For example, you could create a routing step with a requirement to only offer this contact to a specific agent based on user ID, for a certain expiration duration. As another example, you could create a non-expiring routing step with the requirements: **Language:English >= 4 ** AND **Technology:AWS Kinesis >= 2**.
+ A requirement is a condition created using a predefined attribute name, it’s value, comparison operator and proficiency level. For example, **Technology:AWS Kinesis >= 2**. 
+ Use the **Set routing criteria** block with the **Transfer to queue** block, as the latter transfers the contact to the Amazon Connect queue and activate the routing criteria specified on the contact.
+ Routing criteria set on the contact does not take effect if the contact is transferred into an agent queue. For more information, see [Set up routing in Amazon Connect based on agent proficiencies](proficiency-routing.md).
+ When the expiration time (DurationInSeconds) is set too short, it can prevent the Amazon Connect from properly routing contacts to the next most proficient agent when the first agent misses the call. The default queue-based routing can compete with proficiency-based routing, leading to inconsistent routing behavior between these two methods.

## Supported channels
<a name="set-routing-criteria-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | Yes | 
| Email | Yes | 

## Flow types
<a name="set-routing-criteria-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Inbound flow
+ Customer queue flow
+ Transfer to Agent flow
+ Transfer to Queue flow

## Prerequisites for setting routing criteria using predefined attributes
<a name="set-routing-criteria-prerequisites"></a>

Before setting the routing criteria on a contact, you must complete the following steps: 

1.  Create [Create predefined attributes for routing contacts to agents](predefined-attributes.md). 

1.  [Assign proficiencies to agents in your Amazon Connect instance](assign-proficiencies-to-agents.md) using predefined attributes that were previously created 

## When to use the Set routing criteria block
<a name="set-routing-criteria-when"></a>

There are two ways to route contacts directly to an agent:
+ **Option 1: Use the **Set routing criteria** block to specify routing criteria to prefer an agent**. This option is better when: 
  + You want the ability to target multiple agents simultaneously. For example, a four-person support team that is primarily supporting a customer.
  + You want the option to fallback to a broader pool of agents in the queue if the preferred agent(s) are not available.
  + You want the contact to be reported within the standard queue's metrics.

  An advantage of choosing this option is that it uses the agent's userID (such as janedoe) so it's easier to configure than Option 2, which uses the ARN. 

  The main downside of routing criteria is that it impacts queue metrics (SLA, queue time, and more). If a contact in QueueA is waiting specifically for Agent12, then it won't get picked up by other agents that are available. It may breach your defined SLAs. The way you'd see this occurring is by looking at the real-time metrics report; see [Use one-click drill-downs](one-click-drill-downs.md).
**Note**  
When you set up routing and specify your timeout configurations, keep this scenario in mind to accommodate these impacts.
+ **Option 2: Use the agent's queue**. This option is usually better when: 
  + The contact is intended for **only** that specific agent and no one else.
  + You don't want the contact to be reported under a standard queue. For information about standard queues and agent queues, see [Queues: standard and agent](concepts-queues-standard-and-agent.md). 

  For instructions about setting up this option, see [Transfer contacts to agent queue](transfer-to-agent.md). 

## How routing criteria works
<a name="set-routing-criteria-how-it-works"></a>

When a contact is transferred to a standard queue, Amazon Connect activates the first step specified in the routing criteria of the contact. 

1. An agent is joined to the contact only when it meets the requirements specified in the active routing step of the contact. 

1. If no such agent is found till the expiration duration of the step, then Amazon Connect moves to the next step specified in the routing criteria until one of them is satisfied. 

1.  When all steps have expired, the contact is offered to the longest available agent who has the queue in their routing profile.

**Note**  
If an expiration duration is not specified on the routing step, the routing step never expires.

**You can use the following items in a routing criteria:**
+ Choose from the following:
  + One or more preferred agents, based on user ID or username.
  + Up to eight attributes using the `AND` condition.
  + Up to three OR conditions in a routing step. Each requirement separated by an OR can have up to eight attributes.
    + You can only use OR when setting attributes dynamically. For more information, see [How to set routing criteria](#set-routing-criteria-using-the-flow-block).
  + NOT operator to exclude a proficiency by chosen levels. You can only use NOT when setting attributes dynamically. For more information, see [How to set routing criteria](#set-routing-criteria-using-the-flow-block).

**Note**  
Nested expressions are supported but OR expressions must be at the top level. You can place an AND inside an OR, but not the other way around.

In addition, attributes and routing criteria must have the following;
+ Each attribute must have an associated proficiency level. 
+  Each proficiency level must use the “>=” comparison operator or a range of proficiency levels from 1 to 5.
+ Each step of the criteria must have a timed expiration timer.
+ The last step of the criteria can have a timed or non-expiring expiration timer.

## How to set routing criteria
<a name="set-routing-criteria-using-the-flow-block"></a>

You can set the desired routing criteria either manually in the flow block UI or dynamically based on the output from the [AWS Lambda function](invoke-lambda-function-block.md) block. 

![\[The Set routing criteria properties page.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-routing-criteria-using-the-flow-block.png)


### Set routing criteria manually
<a name="set-routing-criteria-set-manually"></a>

Using this option, you can set routing criteria on contacts as specified in the **Set routing criteria** block manually. See the example of a flow below to where the predefined attribute is added to a routing step manually by picking the attribute and value from a dropdown list. 

![\[Set routing criteria flow block manually.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-routing-criteria-set-manually.png)


 As needed, you can configure predefined attribute value dynamically using JSONPath reference even in this option. For example, you can specify ``$.External.language`` JSONPath reference instead of hard coding a `AWS DynamoDB` value on the ``Technology`` requirement of all of the contacts. For more information about JSONPath reference, see [List of available contact attributes in Amazon Connect and their JSONPath references](connect-attrib-list.md). 

### Set routing criteria dynamically
<a name="set-routing-criteria-set-dynamically"></a>

You can set routing criteria on a contact dynamically based on the output from the **Invoke AWS Lambda function** block. 
+ In the [AWS Lambda function](invoke-lambda-function-block.md) block, configure the Lambda function to return the routing criteria in JSON format and set the response validation as JSON. For more information about using the **Invoke AWS Lambda function**, see the [Grant Amazon Connect access to your AWS Lambda functions](connect-lambda-functions.md) documentation. 
+  In the `Set routing criteria` block, choose **Set dynamically** option with the above Lambda attributes - **Namespace** as `External` and **Key** as specified in above Lambda response. For example, the key would be `MyRoutingCriteria` as it points to the routing criteria in the sample Lambda response in the following section. 

### Sample Lambda function for setting routing criteria
<a name="set-routing-criteria-sample-lambda-function"></a>

 The following Lambda example uses `AndExpression` to return routing criteria: 

```
export const handler = async(event) => {
  return {
   "MyRoutingCriteria": {
    "Steps": [
      {
        "Expression": {
          "AndExpression": [
            {
              "AttributeCondition": {
                "Name": "Language",
                "Value": "English",
                "ProficiencyLevel": 4,
                "ComparisonOperator": "NumberGreaterOrEqualTo"
              }
            },
            {
              "AttributeCondition": {
                "Name": "Technology",
                "Value": "AWS Kinesis",
                "ProficiencyLevel": 2,
                "ComparisonOperator": "NumberGreaterOrEqualTo"
              }
            }
          ]
        },
        "Expiry": {
          "DurationInSeconds": 30
        }
      },
      {
        "Expression": {
          "AttributeCondition": {
            "Name": "Language",
            "Value": "English",
            "ProficiencyLevel": 1,
            "ComparisonOperator": "NumberGreaterOrEqualTo"
          }
        }
      }
    ]
  }
}
};
```

The following Lambda example uses `OrExpression` to return routing criteria:

```
export const handler = async(event) => {
  return {
   "MyRoutingCriteria": {
    "Steps": [
      {
        "Expression": {
          "OrExpression": [
            {
              "AttributeCondition": {
                "Name": "Technology",
                "Value": "AWS Kinesis Firehose",
                "ProficiencyLevel": 2,
                "ComparisonOperator": "NumberGreaterOrEqualTo"
              }
            },
            {
              "AttributeCondition": {
                "Name": "Technology",
                "Value": "AWS Kinesis",
                "ProficiencyLevel": 2,
                "ComparisonOperator": "NumberGreaterOrEqualTo"
              }
            }
          ]
        },
        "Expiry": {
          "DurationInSeconds": 30
        }
      }
    ]
  }
}
};
```

The following Lambda example uses `NOTAttributeCondidtion` and a range of proficiency levels to return routing criteria:

```
export const handler = async(event) => {
  const response = {
    "MyRoutingCriteria": {
        "Steps": [
            {
                "Expression": {
                    "NotAttributeCondition": {
                        "Name" : "Language",
                        "Value" : "English",
                        "ComparisonOperator": "Range",
                        "Range" : {
                            "MinProficiencyLevel": 4.0,
                            "MaxProficiencyLevel": 5.0
                        }
                    }
                },
                "Expiry" : {
                    "DurationInSeconds": 30
                }
            }
        ]
    }
}    
    return response;
};
```

## What are the statuses of a routing step and why are they needed?
<a name="set-routing-criteria-why-status-routing-step"></a>

1.  **Inactive:** When the routing criteria is activated the first step immediately becomes Inactive. The routing engine executes the criteria one step at a time as per the expiration timer. 

   1.  Every step starts as *Inactive* Until the previous step expires. 

1.  **Active:** When a step is actively being executed for a match the status is set to Active.

1.  **Expired:** When Amazon Connect does not find an agent during the duration of a step and the timer expires, the routing engine moves on to the next step. The previous step is considered *Expired*. 

1.  **Joined:** Whenever an agent is successfully matched with a contact for a particular step, the step status will be set as *Joined*. 

1.  **Interrupted:** If a contact has been waiting for too long or an operations leader may decide to interrupt the flow and change the routing criteria. This can be done while a particular step is active, for example, a task has been waiting for 24 hours and a manager wants to change the criteria. The step status will then be set to *Interrupted.* 

1.  **Deactivated:** When a customer drops a call or a connection is dropped, routing will stop. 

## Use routing criteria to target a specific preferred agent
<a name="set-routing-criteria-specific-preferred-agent"></a>

 You can also use routing criteria to restrict a contact in a queue to a specific preferred agent or set of preferred agents, based on user ID instead of predefined attributes. 

For example, if you have identified that a specific customer recently contacted your contact center about the same topic, you might want to try routing that customer to the same agent who handled their issue last time. To do so, you can set a routing step to target that specific agent for a certain amount of time before the routing step expires.

Following are frequently asked questions about how this functionality works. 

 **Can I use this feature together with Customer Profiles Last agent identifier to route a customer to the last agent who handled their issue?** 

Amazon Connect Customer Profiles provides seven out-of-the box default attributes based on contact records, including the Last agent identifier attribute, which identify the last agent the customer connected with. You can use this data to route new contacts from a given customer to the same agent who handled their contact previously. To do so, first use the Customer Profiles flow block to retrieve a customer profile using at least one search identifier, such as `Phone = $.CustomerEndpoint.Address`. For more information, see [Properties: Get profile](customer-profiles-block.md#customer-profiles-block-properties-get-profile).

You can then use the **Set manually** option in the **Set routing criteria** block to specify that each contact should be routed to `$.Customer.CalculatedAttributes._last_agent_id` (a JSONPath reference) instead of hard coding a specific user ID, and set an expiration timer for how long to restrict each contact to route to the last agent. For more information on JSONPath reference, see [List of available contact attributes in Amazon Connect and their JSONPath references](connect-attrib-list.md). For more information about the default attributes available through Amazon Connect Customer Profiles, see [Default calculated attributes in Amazon Connect Customer Profiles](customerprofiles-default-calculated-attributes.md).

 **If the preferred agent is not available, what happens?** 

 If you have a routing step set targeting a specific preferred agent, the contact will be restricted to that agent until such time that the routing step expires. This is regardless of the following: 

1.  Agent is online or not

1.  Agent is online but busy with other contacts and cannot be routed an additional contact right now 

1.  Agent is online but in a custom nonproductive status  

1.  Agent was deleted from instance (their userID is still considered valid)  

 For example, imagine you have restricted a particular contact to target agent Jane Doe with expiry of 30 seconds, but Jane Doe is currently offline. The contact will nonetheless be restricted to Jane Doe for 30 seconds, after which the routing step will expire and contact can be offered to another available agent in queue.  

 **What is the maximum number of agents can I target within a single preferred agent step?** 

 You can target up to 10 agents.  

 **Can I create a routing criteria that includes both routing steps based on preferred agent, and routing steps based on predefined attributes?** 

 Yes. For example, you could create a two-step routing criteria, where step 1 targets the contact to a specific preferred agent by user ID based on the agent predicted as the best-fit agent by your custom matching learning model with a given expiry, and then step 2 targets the contact based on predefined attributes such requiring a minimum proficiency level in Spanish. 

## Scenarios
<a name="set-routing-criteria-scenarios"></a>

 See these topics for scenarios that use this block: 
+  [How to reference contact attributes in Amazon Connect](how-to-reference-attributes.md) 

# Flow block in Amazon Connect: Set Voice ID
<a name="set-voice-id"></a>

**Note**  
End of support notice: On May 20, 2026, AWS will end support for Amazon Connect Voice ID. After May 20, 2026, you will no longer be able to access Voice ID on the Amazon Connect console, access Voice ID features on the Amazon Connect admin website or Contact Control Panel, or access Voice ID resources. For more information, visit [Amazon Connect Voice ID end of support](https://docs.aws.amazon.com/connect/latest/adminguide/amazonconnect-voiceid-end-of-support.html). 

This topic defines the flow block to enable audio streaming and set thresholds for voice authentication and fraud detection.

## Description
<a name="set-voice-id-description"></a>
+ Enables audio streaming and sets thresholds for voice authentication and detection of fraudsters in a watchlist. For more information about this feature, see [Voice ID](voice-id.md).
+ Sends audio to Amazon Connect Voice ID to verify the caller's identity and match against fraudsters in watch list, as soon as the call is connected to a flow.
+ Use a [Play prompt](play.md) block before **Set Voice ID** to stream audio properly. You can edit it to include a simple message such as "Welcome."
+ Use a [Set contact attributes](set-contact-attributes.md) block after **Set Voice ID** to set the customer ID for the caller.

  The `CustomerId` may be a customer number from your CRM, for example. You can create a Lambda function to pull the unique customer ID of the caller from your CRM system. Voice ID uses this attribute as the `CustomerSpeakerId` for the caller.

  `CustomerId` can be an alphanumeric value. It supports only \$1 and - (underscore and hyphen) special characters. It does not need to be UUID. For more information, see `CustomerSpeakerId` in the [Speaker](https://docs.aws.amazon.com/voiceid/latest/APIReference/API_Speaker.html) data type.
+ Use a [Check Voice ID](check-voice-id.md) block after **Set Voice ID** to branch based on the results of the enrollment check, authentication, or fraud detection. 
+ For information about how to use **Set Voice ID** in a flow, along with [Check Voice ID](check-voice-id.md) and [Set contact attributes](set-contact-attributes.md), see [Step 2: Create a new Voice ID domain and encryption key](enable-voiceid.md#enable-voiceid-step2) in [Get started enabling Voice ID in Amazon Connect](enable-voiceid.md). 

## Supported channels
<a name="set-security-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | No - Error branch | 
| Task | No - Error branch | 
| Email | No - Error branch | 

## Flow types
<a name="set-voice-id-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Inbound flow
+ Customer queue flow
+ Customer whisper flow
+ Outbound whisper flow
+ Agent whisper flow
+ Transfer to Agent flow
+ Transfer to Queue flow

## Properties
<a name="set-voice-id-properties"></a>

The following image shows the **Properties** page of the **Set Voice ID** block. It shows the **Voice authentication** section. In this example, the **Authentication Threshold** is set to 90. This is the recommended threshold.

![\[The properties page of the Set Voice ID block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-voice-id-properties.png)


### Start streaming audio for Voice ID
<a name="set-voice-id-properties-streaming-audio"></a>

When this option is selected, Amazon Connect begins streaming audio from the customer's channel to Voice ID.

You can add this block several places in a flow, but after **Start streaming audio** is selected, it cannot be disabled, even if later in the flow there are other **Set Voice ID** blocks that do not have it enabled.

### Voice authentication
<a name="set-voice-id-properties-voice-authentication"></a>

**Authentication threshold**: When Voice ID compares the voiceprint of the caller to the enrolled voiceprint of the claimed identity, it generates an authentication score between 0-100. This score indicates the confidence of a match. You can configure a threshold for the score which indicates whether the caller is authenticated. The default threshold of 90 provides high security for most cases. 
+ If the authentication score is below the configured threshold, Voice ID treats the call as not authenticated.
+ If the authentication score is above the configured threshold, Voice ID treats the call as authenticated.

For example, if the person is sick and calling from a mobile device in their car, the authentication score is going to be slightly lower than when the person is well and calling from a quiet room. If an imposter is calling, the authentication score is much lower.

### Authentication response time
<a name="set-voice-id-properties-authentication-response-time"></a>

You can set the authentication response time between 5 and 10 seconds, which determines how quickly you want Voice ID authentication analysis to complete. Lowering it makes the response time faster at the tradeoff of lower accuracy. When you're using self-service IVR options where callers do not talk a lot, you may want to reduce this time. You can then increase the time if the call needs to be transferred to an agent. 

The following image shows the Authentication Response time section of the block. The response time is set manually to 10 seconds.

![\[The Authentication Response time section of the Set voice ID block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-voice-id-properties2.png)


Choose **Set dynamically** to set the authentication threshold based on certain criteria. For example, you may want to raise the threshold based on the membership level of the customer, or the type of transaction or information they are calling about.

### Fraud detection
<a name="set-voice-id-properties-fraud-detection"></a>

The threshold you set for fraud detection is used to measure risk. Scores higher than the threshold are reported as higher risk. Scores lower than the threshold are reported as lower risk. Raising the threshold lowers false positive rates (makes result more certain), but raises false negative rates 

Choose **Set dynamically** to set the fraud threshold based on certain criteria. For example, you may want to lower the threshold for high wealth customers, or the type of transaction or information they are calling about.

![\[The Fraud detection section of the Set voice ID block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-voice-id-properties3a.png)


The watch list you select is used when evaluating the voice session. Choose **Use default watch list** to use your domain's default watch list. For **Set manually**, the watch list ID must be 22 alphanumeric characters.

Similarly for the watch list, choose **Set dynamically** to set the watch list based on criteria given. For example, you may want to use a stricter watch list given the type of transaction or information they are calling about.

## Configuration tips
<a name="set-voice-id-tips"></a>
+ For the **Authentication threshold**, we recommend that you start with the default of 90 and adjust until you find a good balance for your business.

  Every time you increase the value of the **Authentication threshold** beyond the default of 90, there's a tradeoff: 
  + The higher the threshold, the greater the false reject rate (FRR), that is, the likelihood that an agent will need to verify the customer's identity.

    For example, if you set it too high, such as greater than 95, agents will need to verify every customer's identity.
  + The lower the threshold, the greater the false acceptance rate (FAR), that is, the likelihood that Voice ID will incorrectly accept an access attempt by an unauthorized caller.
+ When Voice ID verifies that the voice belongs to the enrolled customer, it returns a status of **Authenticated**. Add a [Check Voice ID](check-voice-id.md) block to you flow branch based on the returned status.
+ For the **Fraud threshold**, we recommend that you start with the default of 50 and adjust until you find a good balance for your business.

  If the caller's score is above the threshold, it indicates there's a higher risk for fraud in that call.
+ For the **Fraud watch list**, the format is validated when the flow is published. 
  +  If a watch list is dynamically set and the format is not valid, the contact is routed down the **Error** branch of the **Set Voice ID** block.
  + If a watch list ID is set manually or dynamically with a valid format but the watch list is not available in the Voice ID domain of the instance, the contact is routed down the **Error** branch of [Check Voice ID](check-voice-id.md) block when the **Check Voice ID** block is used later in the flow.

## Configured block
<a name="set-voice-id-configured"></a>

The following image shows an example of what this block looks like when it is configured. It has the following branches: **Success** and **Error**. 

![\[A configured set Voice ID block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-voice-id-configured.png)


## More information
<a name="set-voice-id-more-info"></a>

See the following topic for more information about this block:
+ [Use real-time caller authentication with Voice ID in Amazon Connect](voice-id.md)
+ [Flow block in Amazon Connect: Check Voice ID](check-voice-id.md)
+ [Enroll callers in Voice ID in the Contact Control Panel (CCP)](use-voiceid.md)

# Flow block in Amazon Connect: Set voice
<a name="set-voice"></a>

This topic defines the flow block for setting the text-to-speech (TTS) language and voice to use for the contact flow.

## Description
<a name="set-voice-description"></a>
+ Sets the text-to-speech (TTS) language and voice to use for the contact flow.
+ The default voice is configured to Joanna (Conversational speaking style). 
+ You can choose **Override speaking style** to make it and other voices [Neural Voices](https://docs.aws.amazon.com/polly/latest/dg/neural-voices.html) or [Generative Voices](https://docs.aws.amazon.com/polly/latest/dg/generative-voices.html). 
  + Neural voices make automated conversations sound more lifelike by improving the pitch, inflection, intonation, and tempo.
  + For a list of supported neural voices, see [Neural Voices](https://docs.aws.amazon.com/polly/latest/dg/neural-voices.html#neural-voicelist) in the *Amazon Polly Developer Guide*.
  + Generative voices are the most human-like, emotionally engaged, and adaptive conversational voices available for the use via Amazon Polly
  + For a list of supported generative voices, see [Generative Voices](https://docs.aws.amazon.com/polly/latest/dg/generative-voices.html#generative-voicelist) in the *Amazon Polly Developer Guide*.
+ After this block is run, any TTS invocation resolves to theneural, standard or generative voice selected.
+ If this block is triggered during a chat conversation, the contact goes down the **Success** branch. It has no effect on the chat experience. 
+ You will be charged for using the Generative voices. For more details on pricing, see the [Amazon Polly Pricing Details](https://aws.amazon.com/polly/pricing/)
+ If you are onboarded to [Next Gen Amazon Connect](https://docs.aws.amazon.com/connect/latest/adminguide/enable-nextgeneration-amazonconnect.html), the Generative voices are included as part of the Next Gen Amazon Connect pricing.

**Note**  
If your instance was created before October 2018 and you have since migrated to a Service Linked Role (SLR), you need to add the following custom permissions to your Service Role (SR) to access the Generative engines.  

```
{
   "Sid": "AllowPollyActions",
   "Effect": "Allow",
   "Action": [
       "polly:SynthesizeSpeech"
   ],
   "Resource": [
       "*"
   ]
}
```

## Supported channels
<a name="set-voice-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | No - Success branch | 
| Task | No - Success branch | 
| Email | No - Success branch | 

## Flow types
<a name="set-voice-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ All flows

## Properties
<a name="set-voice-properties"></a>

The following image shows the **Properties** page of the **Set voice** block. It is configured for English, the voice is Joanna, and the speech style is Conversational.

![\[The properties page of the Set voice block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-voice-config-neural.png)


**Tip**  
For voices that support only neural speaking styles but not standard, the **Override speaking style** is automatically selected. You do not have the option to clear it.  
You can also set language, voice, engine and style dynamically. There are a few configurations that must be followed when modifying the block:  
If the language is selected dynamically, the voice must also be selected dynamically.
If the voice is selected dynamically and the speaking style is overridden, then the engine and style must be selected dynamically.
If the voice or engine are invalid, or the selected voice doesn’t support the selected engine, the error branch will be taken.  
Language code is only passed into a flow action if **Set language attribute** is selected. Therefore, invalid language codes will not take the error branch in this block but they may result in erroneous behavior when used with Lex V2 bots.
If a play prompt is added after the Error branch, the voice used for it will default to Joanna/standard.
If the defined speaking style is not supported by the defined voice, the **None** speaking style will be used.

## Configuration
<a name="set-voice-configuration"></a>

For a list of valid language codes, voices, and supported engines, see [Available voices](https://docs.aws.amazon.com/polly/latest/dg/available-voices.html) in the Amazon Polly Developer Guide . 

**Note**  
Amazon Connect supports standard, neural, and generative engines, so you can pass either standard, neural, or generative as values into the engine parameter.

To set the language attribute, pass in the specific language code into the parameter (for example, en-US or ar-AE). For the voice, simply pass the name of the voice (for example, Joanna or Hala).

Amazon Connect also supports speaking styles, which can be defined as None, Conversational, or Newscaster. The Newscaster and Conversational styles are both available for the following voices in the neural engine:
+ Matthew (en-US)
+ Joanna (en-US)
+ Lupe (es-US)
+ Amy (en-GB)

**Note**  
If you don't specify an engine, the standard engine is used by default. However, some voices, such as Ruth (en-US), don't support the standard engine. For these voices, you must specify a supported engine. If you don't, the operation fails because Ruth doesn't support the standard engine.

The following table contains some examples on configurations and their results:


**Configuration Examples**  

| Language Code | Voice | Engine | Speaking style | Result \$1 Reasoning | 
| --- | --- | --- | --- | --- | 
| en-US | Ruth | N/D | N/D | Error branch: engine is not specified, thus it defaults to standard. Ruth does not support standard engine, which results in error branch being taken. | 
| en-US | Ruth | neural | none | Success branch: Ruth supports neural engine | 
| en-US | Ruth | neural | conversational | Success branch: Even though Ruth does not support conversational speech style, the block does not take the error branch. Instead, when the voice is synthesized, it just uses no speaking style. | 
| ar-AE | Ruth | neural | none | Success branch: This block does not do validation on language code. Only the voice is used to synthesize speech. However, language code being incorrect may result in erroneous behavior when used with Lex V2 bots. | 

## Use an Amazon Lex V2 bot with Amazon Connect
<a name="set-voice-lexv2bot"></a>

If you're using an Amazon Lex V2 bot, your language attribute in Amazon Connect must match the language model used to build your Lex bot. This is different than Amazon Lex (Classic). 
+ If you build an Amazon Lex V2 bot with a different language model—for example, en\$1AU, fr\$1FR, es\$1ES, and more—under **Voice**, choose a voice that corresponds to that language, and then must choose **Set language attribute**, as shown in the following image.
+ If you're not using an en-US voice with an Amazon Lex V2 bot and don't choose **Set language attribute**, the [Get customer input](get-customer-input.md) block results in an error.
+ For bots with multiple languages (for example, en\$1AU and en\$1GB) choose **Set language attribute** for one of the languages, as shown in the following image.

![\[The properties page of the Set voice block configured for English (Australia).\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-voice-config-neural-arrows.png)


## Configuration tips
<a name="set-voice-tips"></a>
+ For the **Joanna** and **Matthew** neural voices, in American English (en-US), you can also specify a [Newscaster speaking style](https://docs.aws.amazon.com/polly/latest/dg/ntts-speakingstyles.html).

## Configured block
<a name="set-voice-configured"></a>

The following image shows an example of what this block looks like when it is configured. It has the following branches: **Success** and **Error**. 

![\[A configured Set voice block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-voice-configured.png)


## Scenarios
<a name="set-voice-scenarios"></a>

See these topics for scenarios that use this block:
+ [Add text-to-speech to prompts in flow blocks in Amazon Polly](text-to-speech.md)

# Flow block in Amazon Connect: Set whisper flow
<a name="set-whisper-flow"></a>

This topic defines the flow block for a message, or whisper, that displays in chat or told in a call when a conversation begins. The whisper provides the participants with pertinent information, such as telling an agent a customer's name, or telling the customer that the call is being recorded for training purposes.

## Description
<a name="set-whisper-description"></a>

A *whisper flow* is what a customer or agent experiences when they are joined in a voice or chat conversation. For example:
+ An agent and customer are joined in a **chat**. An agent whisper might display text to the agent telling them the name of the customer, for example, which queue the customer was in, or let the agent know they're talking to a club member.
+ An agent and customer are joined in a **call**. A customer whisper might tell the customer that the call is being recorded for training purposes, for example, or thank them for being a club member.
+ An agent and customer are joined in a **chat**. Using a contact attribute, an agent whisper flow records which agent is being connected to the conversation. This attribute is then used in a disconnect flow to route the contact back to the same agent if the customer has a follow-up question after the agent disconnects.

A whisper flow has the following characteristics:
+ It's a one-sided interaction: either the customer hears or sees it, or the agent does.
**Tip**  
For chat contacts, when an outbound flow runs, you can use a [Play prompt](play.md) block and the message will be displayed to both the agent and customer in the chat conversation. 
+ It can be used to create personalized and automated interactions.
+ It runs when a customer and agent are being connected.

For voice conversations, the **Set whisper flow** block overrides the [default agent whisper flow](default-agent-whisper.md) or the [customer whisper flow](default-customer-whisper.md). It does this by:
+ Linking to a different whisper flow that you create.

–OR–
+ Disabling the whisper flow from running. You may want to disable the default whisper flow so customers do not perceive any connection latency, for example, as part of an outbound campaign.

**Important**  
Chat conversations do not include a default whisper. You need to include a **Set whisper flow** block for the default agent or customer whispers to play. For instructions, see [Set the default whisper flow in Amazon Connect for a chat conversation](set-default-whisper-flow-for-chat.md).

### How the Set whisper flow block works
<a name="how-set-whisper-block-works"></a>
+ For inbound conversations (voice or chat), the **Set whisper flow** block specifies the whisper to be played to the customer or agent when they are joined.
+ For outbound voice calls, it specifies the whisper to be played to customer.
+ A whisper is one direction, which means only the agent or customer hears or sees it, depending on the type of whisper you selected. For example, if a customer whisper says "This call is being recorded," the agent does not hear it.
+ A whisper flow is triggered after the agent accepts the contact (either auto-accept or manual accept). The agent whisper flow runs first, before the customer is taken out of queue. After this is completed, the customer is taken out of queue and the customer whisper flow runs. Both flows run to completion before the agent and customer can talk or chat with each other. 
+  If an agent disconnects while the agent whisper is running, the customer remains in queue in order to be re-routed to another agent.
+  If a customer disconnects while the customer whisper is running, the contact ends.
+ If an agent whisper flow or customer whisper flow includes a block that chat does not support, such as [Start](start-media-streaming.md)/[Stop](stop-media-streaming.md) media streaming or [Set voice](set-voice.md), chat skips these blocks and triggers an error branch. However, it doesn't prevent the flow from progressing.
+ Whisper flows don't appear in transcripts.
+ Whispers can be a maximum of 2 minutes long. After that point, the contact or agent is disconnected.

## Supported channels
<a name="set-whisper-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | Yes | 
| Email | Yes | 

## Flow types
<a name="set-whisper-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Inbound flow
+ Customer Queue flow
+ Transfer to Agent flow
+ Transfer to Queue flow

## Properties
<a name="set-whisper-properties"></a>

The following image shows the **Properties** page of the **Set whisper flow** block. It shows the whisper to the agent is set manually to **Default agent whisper**. Use the dropdown box to choose a different whisper flow.

![\[The properties page of the Set whisper flow block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-whisper-flow-properties4.png)


If you choose to set a flow manually, in the **Search for flow** box, you can only select from flows that are type **Agent Whisper** or **Customer Whisper**.

For information about using attributes, see [Use Amazon Connect contact attributes](connect-contact-attributes.md).

To disable a previously set agent or customer whisper, choose the **Disable agent whisper** or **Disable customer whisper** option.

## Configuration tips
<a name="set-whisper-tips"></a>
+ In a single block, you can set either a customer whisper or an agent whisper, but not both. Instead, use multiple **Set whisper flow** blocks in your flow.
+ A maximum of one agent whisper and one customer whisper can be played. If you use multiple **Set whisper flow** blocks, the most recently specified one for each type (agent and customer) is played. 
+ Make sure your whispers are able to complete within two minutes. Otherwise, calls will be disconnected before being established.
+ If agents appear to be stuck in the "Connecting..." state before being forcefully disconnected from calls, make sure that your configured whisper flows meet the two minute maximum.

## Configured block
<a name="set-whisper-configured"></a>

The following image shows an example of what this block looks like when it is configured. It has the following branches: **Success** and **Error**. 

![\[A configured Set whisper flow block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-whisper-flow-configured.png)


# Flow block in Amazon Connect: Set working queue
<a name="set-working-queue"></a>

This topic defines the flow block for specifying the queue to transfer a contact when **Transfer to queue** is invoked.

## Description
<a name="set-working-queue-description"></a>
+ This block specifies the queue to be used when **Transfer to queue** is invoked.
+ A queue must be specified before invoking **Transfer to queue** except when used in a customer queue flow. It's also the default queue for checking attributes, such as staffing, queue status, and hours of operation.

## Supported channels
<a name="set-working-queue-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | Yes | 
| Email | Yes | 

## Flow types
<a name="set-working-queue-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Inbound flow
+ Transfer to Agent flow
+ Transfer to Queue flow

## Properties
<a name="set-working-queue-properties"></a>

The following image shows the **Properties** page of the **Set working queue** block. It is set to the **BasicQueue**.

![\[The properties page of the Set working queue block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-working-queue-properties.png)


Note the following properties:
+ **By queue > Set dynamically**. To set the queue dynamically, you must specify the queue ID for the queue rather than the queue name. To find the queue ID, open the queue in the queue editor. The queue ID is included as the last part of the URL displayed in the browser address bar after `/queue`. For example, `aaaaaaaa-bbbb-cccc-dddd-111111111111`.

## Configured block
<a name="set-working-queue-configured"></a>

The following image shows an example of what this block looks like when it is configured. It has the following branches: **Success** and **Error**.

![\[A configured Set working queue block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-working-queue-configured.png)


## Sample flows
<a name="set-working-queue-samples"></a>

Amazon Connect includes a set of sample flows. For instructions that explain how to access the sample flows in the flow designer, see [Sample flows in Amazon Connect](contact-flow-samples.md). Following are topics that describe the sample flows which include this block.
+ [Sample queue customer flow in Amazon Connect](sample-queue-customer.md)
+ [Sample queue configurations flow in Amazon Connect](sample-queue-configurations.md)

## Scenarios
<a name="set-working-queue-scenarios"></a>

See these topics for scenarios that use this block:
+ [Set up agent-to-agent transfers in Amazon Connect](setup-agent-to-agent-transfers.md)
+ [Transfer contacts to a specific agent in Amazon Connect](transfer-to-agent.md)

# Flow block in Amazon Connect: Show view
<a name="show-view-block"></a>

This topic defines the flow block to create step-by-step workflow guides to help agents provide consistent customer experiences, as well as guides to enable interactive customer experiences. 

## Description
<a name="show-view-block-description"></a>
+ Use this flow block to:
  + Create [step-by-step guides](step-by-step-guided-experiences.md) for agents who are using the Amazon Connect agent workspace. These guides are workflows that provide your agents with instructions to help them interact consistently with your customers.
  + Create forms to collect information from customers within a chat experience.
+ When a contact is routed to a flow that includes a **Show view** block, a UI page called a [View](view-resources-sg.md) renders on the agent workspace or within the customer's chat UI.

## Use cases for this block
<a name="scenarios-show-view"></a>

This flow block is designed to guide agents through the steps to:
+ Perform common tasks for customers, such as making reservations, managing payments, and submitting new orders.
+ Send emails based on a template that notifies a customer about a submitted refund request. The email structure is always the same, but specific values can vary, such as order number, refund amount, and payment account. You can configure the Show view block for the agent to provide these types of information.
+ Create new CRM entries in the existing agent workspace. Use contact attributes to pre-populate the form with relevant information, such as the customer's name and phone number.

And to guide customers through steps within a chat conversation to:
+ Make payments by providing their credit card information.
+ Provide PII information, such as a home address to update their profile.
+ Receive account information by providing their customer account ID.

## Contact types
<a name="show-view-flow"></a>

You can use the **Show view** block in a guide flow that is initiated—by the [Set event flow](set-event-flow.md) block—from any contact type including voice, chat, email or task. If you plan to surface a guide to a customer, you can use the **Show view** block in the main chat flow directly.


| Contact type | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes   | 
| Task | Yes  | 
| Email | Yes | 

## Flow types
<a name="show-view-block-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):


| Flow type | Supported? | 
| --- | --- | 
| Inbound flow | Yes | 
| Customer hold flow | No | 
| Customer whisper flow | No | 
| Outbound whisper flow | No | 
| Agent hold flow | No | 
| Agent whisper flow | No | 
| Transfer to agent flow | No | 
| Transfer to queue flow | No | 

## How to configure this block
<a name="show-view-block-properties"></a>

You can configure the **Show view** block by using the Amazon Connect admin website or by using the [ShowView](https://docs.aws.amazon.com/connect/latest/APIReference/participant-actions-showview.html) action in the Amazon Connect Flow language. 

**Topics**
+ [

### Choose the view resource
](#choose-viewresource)
+ [

### How to use the Set manually option
](#view-setmanually)
+ [

### How to use the Set dynamically option
](#view-setdynamically)
+ [

### How to use the Set JSON option
](#show-view-block-example-json)
+ [

### This view has sensitive data
](#showview-sensitive-data)
+ [

### Flow block branches
](#showview-branches)
+ [

### Additional configuration tips
](#showview-tips)
+ [

### Data generated by this block
](#showview-data)

### Choose the view resource
<a name="choose-viewresource"></a>

Amazon Connect includes a set of views that you can add your agent's workspace. You specify the view in the **View** box, as shown in the following image:

![\[The properties page of the Show view block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/show-view-block-form.png)


Following is a brief description of these AWS managed views. For detailed information about each one, see [Set up AWS managed views for an agent's workspace in Amazon Connect](view-resources-managed-view.md). Customer-managed views are also supported. For more information, see the [Customer-managed views](https://d3irlmavjxd3d8.cloudfront.net/?path=/docs/customer-managed-views-customer-managed-views--page) documentation.
+ **Detail view**: Display information to agents and provide them with a list of actions that they can take. A common use case of the Detail view is to surface a screen-pop to the agent at the start of a call.
+ **List view**: Display information as a list of items with titles and descriptions. Items can act as links with actions attached. It also optionally supports the standard back navigation and persistent context header.
+ **Form view**: Provide customers and agents with input fields to gather required data and submit data to backend systems. This view consists of multiple Sections with a predefined Section style with a header. The body consists of various input fields arranged in a column or a grid layout format.
+ **Confirmation view**: A page to show customers and agents after a form has been submitted or an action has been completed. In this pre-built template you can provide a summary of what has happened, any next steps, and prompts. The Confirmation view supports a persistent attribute bar, an icon or image, headline, and sub-headline, along with a back to home navigation button.
+ **Cards view**: Allows you to guide your customers and agents by presenting them with a list of topics to choose from when the contact is presented to the agent.

The properties of the **Show view** block are dynamically populated depending on which **View** resource you choose. For example, if you choose **Form**, you would configure **Next** and **Previous** actions, which are displayed. These are just a couple of the actions on the view. 

![\[The View set to Form and Version set to 1.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/show-view-block-version2.png)


The following sections explain how to configure the **Form** actions manually, dynamically, or by using the JSON option.

### How to use the Set manually option
<a name="view-setmanually"></a>

1. On the **Properties** page, in the **View** section, choose **Form** from the dropdown menu, and set **Use version** to 1, the default. The following image shows a **Properties** page configured with these options.  
![\[The View set to Form and Version set to 1.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/show-view-block-version1.png)

1. The **Properties** page displays a set of fields based on the Form view. Choose **Set manually** and enter text to be rendered on the View UI components. The following image shows the **Next** and **Previous** UI components. The display name of the components have been set manually to **Next** and **Previous**. That's what will appear on the agent workspace when the step-by-step guide is rendered.  
![\[The Next and Previous UI components set manually.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/show-view-block-version2.png)

### How to use the Set dynamically option
<a name="view-setdynamically"></a>

1. On the **Properties** page, in the **View** section, choose **Form** from the dropdown menu, and set **Use version** to 1, the default. The following image shows a **Properties** page configured with these options.  
![\[The View set to Form and Version set to 1.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/show-view-block-version1.png)

1. The **Properties** page displays a set of fields based on the Form view. Choose **Set dynamically**. In the **Namespace** dropdown menu, choose the contact attribute, and then choose the key. The following image shows a **Heading** that will be rendered dynamically in the step-by-step guide to show the customer's last name.  
![\[A heading in the View UI template.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/show-view-block-dynamic.png)

### How to use the Set JSON option
<a name="show-view-block-example-json"></a>

This section walks through an example of how to use the **Set JSON** option.

1. In the **View** section of the **Properties** page of the Show view block, choose **Form** from the dropdown menu and set **Version** to **1**, the default. These options are shown in the following image.  
![\[The View set to Form and Version set to 1.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/show-view-block-version1.png)

1. When you choose the **Form** view, the input schema of the view is displayed on the **Properties** page. The schema has the following sections where you can add information: **Sections**, **AttributeBar**, **Back**, **Cancel**, **Edit**, **ErrorText**, and more.

1. The following image shows the **AttributeBar** parameter, and the **Set using JSON** option. To view all of the JSON you pasted in, click the corner of the box and pull down.  
![\[The input parameters.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/show-view-block-json.png)
**Tip**  
Fix any errors if the JSON is invalid. The following image shows an example error message because there's an extra comma.  

![\[An error message that JSON is not valid.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/show-view-block-json-invalid.png)


1. When selecting a custom view, you will likely want to set the values of dynamic inputs through the **Set JSON** option. When doing this, you can choose **Apply Sample Data** to pre-populate the input with a JSON schema that contains sample data. 

   Ensure you [configure dynamic references](no-code-ui-builder-properties-dynamic-fields.md) for dynamic data (for example, \$1.Channel) in the UI builder to be populated at run time.

   The following image shows the **Apply Sample Data** option.  
![\[The Apply Sample Data option on the Show view block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/apply-sample-data.png)

1. Choose **Save** and publish when you are ready.

The following code sample shows how this same configuration would be represented by the [ShowView](https://docs.aws.amazon.com/connect/latest/APIReference/participant-actions-showview.html) action in the Flow language:

```
{
      "Parameters": {
        "ViewResource": {
          "Id": "arn:aws:connect:us-west-2:aws:view/form:1"
        },
        "InvocationTimeLimitSeconds": "2",
        "ViewData": {
          "Sections": "Sections",
          "AttributeBar": [
            {
              "Label": "Example",
              "Value": "Attribute"
            },
            {
              "Label": "Example 2",
              "Value": "Attribute 2"
            },
            {
              "Label": "Example 3",
              "Value": "Case 123456",
              "LinkType": "case",
              "ResourceId": "123456",
              "Copyable":true
            },
            {
              "Label": "Example 3",
              "Value": "Case 123456",
              "LinkType": "case",
              "ResourceId": "https:example.com"
            }
          ],
          "Back": {
            "Label": "Back"
          },
          "Cancel": {
            "Label": "Cancel"
          },
          "Edit": "Edit",
          "ErrorText": "ErrotText",
          "Heading": "$.Customer.LastName",
          "Next": "Next",
          "Previous": "Previous",
          "SubHeading": "$.Customer.FirstName",
          "Wizard": {
            "Heading": "Progress tracker",
            "Selected": "Step Selected"
          }
        }
      },
      "Identifier": "53c6be8a-d01f-4dd4-97a5-a001174f7f66",
      "Type": "ShowView",
      "Transitions": {
        "NextAction": "7c5ef809-544e-4b5f-894f-52f214d8d412",
        "Conditions": [
          {
            "NextAction": "7c5ef809-544e-4b5f-894f-52f214d8d412",
            "Condition": {
              "Operator": "Equals",
              "Operands": [
                "Back"
              ]
            }
          },
          {
            "NextAction": "7c5ef809-544e-4b5f-894f-52f214d8d412",
            "Condition": {
              "Operator": "Equals",
              "Operands": [
                "Next"
              ]
            }
          },
          {
            "NextAction": "7c5ef809-544e-4b5f-894f-52f214d8d412",
            "Condition": {
              "Operator": "Equals",
              "Operands": [
                "Step"
              ]
            }
          }
        ],
        "Errors": [
          {
            "NextAction": "b88349e3-3c54-4915-8ea0-818601cd2d03",
            "ErrorType": "NoMatchingCondition"
          },
          {
            "NextAction": "7c5ef809-544e-4b5f-894f-52f214d8d412",
            "ErrorType": "NoMatchingError"
          },
          {
            "NextAction": "b88349e3-3c54-4915-8ea0-818601cd2d03",
            "ErrorType": "TimeLimitExceeded"
          }
        ]
      }
    }
```

### This view has sensitive data
<a name="showview-sensitive-data"></a>

It’s recommended that you enable **This view has sensitive data** when collecting credit card data, home addresses, or any other type of sensitive data from customers. By enabling this option, the data submitted by a customer will not be recorded in transcripts or contact records, or be visible to agents (by default). Remember to turn off logging if **Set Logging Behavior** is turned on in your contact flow, to ensure sensitive customer data is not included in your flow logs.

![\[The sensitive data view check box.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/show-view-block-form-sensitive-data.png)


**Tip**  
Build a [Flow module](contact-flow-modules.md) with a Show view block that has **This view has sensitive data** enabled, a Lambda function, and prompts to create a re-usable payment experience module that can be placed in an existing inbound contact flow.

### Flow block branches
<a name="showview-branches"></a>

The following image shows an example of a configured **Show view** block. This block supports conditional branches—that is, the branches depend on which view is selected. It also supports **Error** and **Timeout** branches.

![\[A configured Show view block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/show-view-block-sq-config.png)

+ Conditional branches: These branches are based on which view is selected on the **Show view** block. The previous image shows the block is configured for the **Form** view, and the following actions: **Back**, **Next**, and **No Match**. 
  + For this particular configuration, at runtime, the chat contact is routed down the **Back** or **Next** branches depending on what the agent clicks on the view. **No match** is only possible if the user has an action component with a custom Action value.
+ **Error**: Failure to run (that is, failure to render the view on agent workspace or to capture the view output action) results in taking the **Error** branch.
+ **Timeout**: Specifies how long this step in the step-by-step guide should take the agent to complete. If it takes longer than Timeout for agent to complete the step (for example, the agent didn't provide required information in the specified amount of time) then that step takes the Timeout branch. 

  When a step times out, the step-by-step guide can follow logic defined in the flow to determine next step. For example, the next step could be to retry asking for information, or stop guide experience.

  The customer is connected to the agent at this point, so there is no change in the customer's experience because of Timeout. 

### Additional configuration tips
<a name="showview-tips"></a>

Build a flow module with this logging setting, this block, and Lambda to create a re-usable payment experience module that keeps logging off and can be placed in any existing inbound flow.

Assign the following security profile permission to agents so they can use the step-by-step guides:
+ **Agent Applications - Custom views - All**: This permission enables agents to see step-by-step guides in their agent workspace.

Assign the following security profile permission to managers and business analysts so they can create the step-by-step guides:
+ **Channels and flows - Views**: This permission enables managers to create step-by-step guides.

For information about how to add more permissions to an existing security profile, see [Update security profiles in Amazon Connect](update-security-profiles.md).

### Data generated by this block
<a name="showview-data"></a>

At runtime, the **Show view** block generates data that is the output when the View resource runs. Views generate two main pieces of data:
+ `Action` taken on the rendered View-UI (on agent workspace) and the `ViewResultData` which is the `Output` data.

  When using a **Show view** block, **Action** represents a branch and set to `$.Views.Action` contact attribute under Views namespace.
+ `Output` data is set to `$.Views.ViewResultData` contact attribute under Views namespace.

  The values of `Action` and the `Output` data are determined by which the component(s) the agent interacted with during their use of the view resource.

#### How to use this data in different parts of flow
<a name="useshowview-data"></a>
+ When the block receives a response back from the client application, to reference the output data in flows use ` `$.Views.Action` and `$.Views.ViewResultData`.
+ When using a view with the **Show view** block, `Action` represents a branch that is captured in the contact attribute under the Views namespace as `$.Views.Action`, and View Output data is set to the `$.Views.ViewResultData` contact attribute.
+ You can refer to the data generated by the **Show view** block by using the JSON path in contact attributes (you can specify contact attributes in the Set manually or Set JSON options) or by using the attribute selector dropdown when you choose **Set dynamically**.

## Error scenarios
<a name="play-errorscenarios"></a>

**Note**  
When the `ShowView` block takes an error branch (no match, timeout, or error), you might want to route your flow back to a previous point in the flow. If you create a loop in the flow like this, the contact flow can execute endlessly until the chat contact times out. We recommend using the `Loop` contact flow block to limit the number of retries for a particular `ShowView` block.

A contact is routed down the **Error** branch in the following situations:
+ Amazon Connect is unable to capture the user action on a View UI component in the agent workspace. This might be due to an intermittent network issue or an issue on the media-service side.

## Flow log entry
<a name="showview-log"></a>

Amazon Connect flow logs provide you with real-time details about events in your flow as customers interact with it. For more information, see [Use flow logs to track events in Amazon Connect flows](about-contact-flow-logs.md).

Following sample ShowView input (ingress log)

```
{
  "ContactId": "string",
  "ContactFlowId": "string",
  "ContactFlowName": "string",
  "ContactFlowModuleType": "ShowView",
  "Timestamp": "2023-06-06T16:08:26.945Z",
  "Parameters": {
    "Parameters": {
      "Cards": [
        {
          "Summary": {
            "Id": "See",
            "Heading": "See cancel options"
          }
        },
        {
          "Summary": {
            "Id": "Change",
            "Heading": "Change Booking"
          }
        },
        {
          "Summary": {
            "Id": "Get",
            "Heading": "Get Refund Status"
          }
        },
        {
          "Summary": {
            "Id": "Manage",
            "Heading": "Manage rewards"
          }
        }
      ],
      "NoMatchFound": {
        "Label": "Do Something Else",
        "type": "bubble"
      }
    },
    "TimeLimit": "300",
    "ViewResourceId": "cards"
  }
}
```

Following sample ShowView output (egress log)

```
{
  "Results": "string",
  "ContactId": "string",
  "ContactFlowId": "string",
  "ContactFlowName": "string",
  "ContactFlowModuleType": "ShowView",
  "Timestamp": "2023-06-06T16:08:35.201Z"
}
```

## Sample flows
<a name="show-view-samples"></a>

You can download a sample flow from Step 2 in the following blog: [Getting started with step-by-step guides](https://aws.amazon.com/blogs/contact-center/getting-started-with-step-by-step-guides-for-the-amazon-connect-agent-workspace/). We recommend performing the steps in the blog to learn how to create flows that are configured with AWS-managed Views and how to run these flows for inbound media contacts.

## More resources
<a name="show-view-more-resources"></a>

See the following topics to learn more about step-by-step guides and Views.
+ [Step-by-step Guides to set up your Amazon Connect agent workspace](step-by-step-guided-experiences.md)
+ Explore [how to implement sensitive data collection in Amazon Connect Chat](https://aws.amazon.com/blogs/contact-center/collecting-sensitive-information-with-amazon-connect-chat/).
+ For step-by-step instructions about how to set up a customer-managed Views, see [Customer-managed Views](https://d3irlmavjxd3d8.cloudfront.net/?path=/docs/customer-managed-views-customer-managed-views--page). 
+ For setting up a plug-and-play step-by-step guide experience in your instance, see [Getting started with step-by-step guides](https://aws.amazon.com/blogs/contact-center/getting-started-with-step-by-step-guides-for-the-amazon-connect-agent-workspace/). 
+ [AWS-managed Views - Common Configuration](https://d3irlmavjxd3d8.cloudfront.net/?path=/story/aws-managed-views-common-configuration--page)
+ [Views - UI Components](https://d3irlmavjxd3d8.cloudfront.net/?path=/story/ui-component-ui-components--page)
+ [View actions](https://docs.aws.amazon.com/connect/latest/APIReference/view-api.html) in the *Amazon Connect API Reference*.

# Flow block in Amazon Connect: Start media streaming
<a name="start-media-streaming"></a>

This topic defines the flow block for capturing what the customer hears and says during a contact. You can then analyze this information for training or determining customer sentiment.

## Description
<a name="start-media-streaming-description"></a>

Captures what the customer hears and says during a contact. You can then perform analysis on the audio streams to:
+ Determine customer sentiment.
+ Use the audio for training purposes.
+ Identify and flag abusive callers.

## Supported channels
<a name="start-media-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | No - Error branch | 
| Task | No - Error branch | 
| Email | No - Error branch | 

## Flow types
<a name="start-media-streaming-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Inbound flow
+ Customer Queue flow
+ Agent Whisper flow
+ Customer Whisper flow
+ Outbound Whisper flow
+ Transfer to Agent flow
+ Transfer to Queue flow

## Properties
<a name="start-media-streaming-properties"></a>

The following image shows the **Properties** page of the **Start media streaming** block. It has two options: start the stream from the customer or to the customer. 

![\[The properties page of the Start media streaming block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/start-media-streaming.png)


## Configuration tips
<a name="start-media-streaming-tips"></a>
+ You must enable live media streaming in your instance to successfully capture customer audio. For instructions, see [Set up live media streaming of customer audio in Amazon Connect](customer-voice-streams.md).
+ Customer audio is captured until a **Stop media streaming** block is invoked, even if the contact is passed to another flow.
+ You must use a **Stop media streaming** block to stop media streaming.
+ If this block is triggered during a chat conversation, the contact is routed down the **Error** branch.

## Configured block
<a name="start-media-streaming-configured"></a>

The following image shows an example of what this block looks like when it is configured. It has the following branches: **Success** and **Error**.

![\[A configured Start media streaming block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/start-media-streaming-configured.png)


## Sample flows
<a name="start-media-streaming-samples"></a>

Amazon Connect includes a set of sample flows. For instructions that explain how to access the sample flows in the flow designer, see [Sample flows in Amazon Connect](contact-flow-samples.md). Following are topics that describe the sample flows which include this block.

[Example flow for testing live media streaming in Amazon Connect](use-media-streams-blocks.md) 

# Flow block in Amazon Connect: Stop media streaming
<a name="stop-media-streaming"></a>

This topic defines the flow block to stop capturing customer audio. 

## Description
<a name="stop-media-streaming-description"></a>
+ Stops capturing customer audio after it is started with a **Start media streaming** block.
+ You must use a **Stop media streaming** block to stop media streaming.

## Supported channels
<a name="stop-media-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | No - Error branch | 
| Task | No - Error branch | 
| Email | No - Error branch | 

## Flow types
<a name="stop-media-streaming-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Inbound flow
+ Customer Queue flow
+ Customer Whisper flow
+ Outbound Whisper flow
+ Agent Whisper flow
+ Transfer to Agent flow
+ Transfer to Queue flow

## Properties
<a name="stop-media-streaming-properties"></a>

This block doesn't have any properties.

## Configuration tips
<a name="stop-media-streaming-tips"></a>
+ You must enable live media streaming in your instance to successfully capture customer audio. For instructions, see [Set up live media streaming of customer audio in Amazon Connect](customer-voice-streams.md).
+ Customer audio is captured until a **Stop media streaming** block is invoked, even if the contact is passed to another flow.
+ If this block is triggered during a chat conversation, the contact is routed down the **Error** branch.

## Configured block
<a name="stop-media-streaming-configured"></a>

The following image shows an example of what this block looks like when it is configured. It has the following branches: **Success** and **Error**.

![\[A configured Stop media streaming block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/stop-media-streaming-configured.png)


## Sample flows
<a name="stop-media-streaming-samples"></a>

Amazon Connect includes a set of sample flows. For instructions that explain how to access the sample flows in the flow designer, see [Sample flows in Amazon Connect](contact-flow-samples.md). Following are topics that describe the sample flows which include this block.

[Example flow for testing live media streaming in Amazon Connect](use-media-streams-blocks.md) 

# Flow block in Amazon Connect: Store customer input
<a name="store-customer-input"></a>

This topic defines the flow block to store input as a contact attribute and then encrypting it.

## Description
<a name="store-customer-input-description"></a>

This block is similar to **Get customer input**, but this one stores the input as a contact attribute (in the [Stored customer input](connect-attrib-list.md#attribs-system-table) system attribute) and allows you to encrypt it. This way, you can encrypt sensitive input such as credit card numbers. This block:
+ Plays a prompt to get a response from the customer. For example, "Please enter your credit card number" or "Please enter the phone number we should use to call you back." 
+ Plays an interruptible audio prompt or play text-to-speech for a customer to respond to. 
+ Stores numerical input as in the [Stored customer input](connect-attrib-list.md#attribs-system-table) system attribute.
+ Allows you to specify a custom terminating keypress.
+ If during a call the customer doesn't enter any input, the contact is routed down the **Success branch** branch with a value of Timeout. Add a **Check contact attributes** block to check for timeouts.

## Supported channels
<a name="store-customer-input-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | No - Error branch | 
| Task | No - Error branch | 
| Email | No - Error branch | 

## Flow types
<a name="store-customer-input-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Inbound flow
+ Customer Queue flow
+ Outbound whisper flow
+ Transfer to Agent flow
+ Transfer to Queue flow

## Properties
<a name="store-customer-input-properties"></a>

The following image shows the **Properties** page of the **Store customer input** block. It shows the **Prompt** section configured to play the **Audio prompt**. 

 For information about choosing a prompt from the Amazon Connect library or an S3 bucket, see the [Play prompt](play.md) block. 

![\[The properties page of the Store customer input block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/store-customer-input-properties1.png)


The following image shows the **Customer input** section of the page. It is configured to allow up to 20 digits. 

![\[The Customer input section of the properties page.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/store-customer-input-properties1b.png)


Note the following properties:
+ **Maximum Digits**: Define the maximum number of digits that a customer can enter.
+ **Phone number**: This option is useful for queued callback scenarios.
  + **Local format**: If all of your customers all calling from the same country that your instance is in, choose that country from the dropdown list. Amazon Connect then auto-populates the country code for customers so that they don't have to enter it.
  + **International format**: If you have customers calling from different countries, choose **International format**. Amazon Connect then requires customers to enter their country code.

The following image shows the **Input settings** section of the page. It is set to timeout after 15 seconds of no input and 3 seconds for any subsequent inputs.

![\[The Input settings section of the properties page.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/store-customer-input-properties2b.png)


Note the following properties:
+ **Timeout before first entry**: Specify how long to wait for a customer to start entering their reply by voice or DTMF. For example, you might enter 20 seconds, to give the customer time to get their credit card.
+ **Timeout in between each entry**: Specify how long to wait for the next input digit from the customer, by voice or DTMF. For example, you set this field to 10 seconds. When collecting the customer's credit card number, after the customer enters the first digit of their card number, Amazon Connect waits up to 10 seconds for them to press the next digit. If they take longer than 10 seconds between any two digits, Amazon Connect considers the input complete or timed out. By default, Amazon Connect waits 5 seconds for each digit. 
  + Minimum value: 1 second
  + Maximum value: 20 seconds
+ **Encrypt entry**: Encrypt the customer's entry, such as their credit card information. 
+ **Specify terminating keypress**: Define a custom terminating keypress that is used when your contacts complete their DTMF inputs. The terminating keypress can be up to five digits long, with \$1, \$1 and 0-9 characters, instead of just \$1. 
**Note**  
To use a star (\$1) as part of the terminating keypress, you must also choose **Disable cancel key**.
+ **Disable cancel key**: By default, when a customer enters \$1 as input, it deletes all of the DTMF input that came before it. However, if you choose **Disable cancel key**, Amazon Connect treats the **\$1** as any other key.

  If you send the DMTF input to an [AWS Lambda function](invoke-lambda-function-block.md) block, the **Disable cancel key** property affects the input, as follows: 
  + When **Disable cancel key** is selected, all the characters entered—including any \$1—are sent to the **AWS Lambda function** block. 
  + When **Disable cancel key** is not selected, only the \$1 is sent to the **AWS Lambda function** block. 

  For example, let's say you chose **Disable cancel key**, and a customer entered *1\$12\$13\$14\$1\$1\$1*, where *\$1\$1* is the terminating keypress. The **AWS Lambda function** block then receives the entire *1\$12\$13\$14\$1* as input. You could program the Lambda function to ignore the character before the \$1 character. So, the customer input would be interpreted as *1\$12\$14\$1*.

## Problems with DTMF input?
<a name="store-customer-input-use-multiple-input-blocks"></a>

Let's say you have the following scenario with two contacts flows, each one capturing DTMF input from customers: 

1. One flow uses the **Get customer input** block to request DTMF input from customers.

1. After the DTMF input is entered, it uses the **Transfer to flow** block to move the contact to the next contact flow.

1. In the next flow, there's a **Store customer input** block to get more DTMF input from the customer.

There's setup time between the first and second flows. This means if the customer enters DTMF input very quickly for the second flow, some of the DTMF digits might be dropped.

For example, the customer needs to press 5, then wait for a prompt from the second flow, then type 123. In this case, 123 is captured without problem. However, if they don't wait for the prompt and enter 5123 very quickly, the **Store customer input** block may capture only 23 or 3.

To guarantee the **Store customer input** block in second contact flow captures all of the digits, the customer needs to wait for the prompt to be played, and then enter their type DTMF input.

## Configured block
<a name="store-customer-input-configured"></a>

The following image shows an example of what this block looks like when it is configured. It has the following branches: **Success**, **Error**, and **Invalid number**. 

![\[A configured Store customer input block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/store-customer-input-configured.png)


1. **Invalid number**: What to do if the customer enters an invalid number.

## Sample flows
<a name="store-customer-input-samples"></a>

Amazon Connect includes a set of sample flows. For instructions that explain how to access the sample flows in the flow designer, see [Sample flows in Amazon Connect](contact-flow-samples.md). Following are topics that describe the sample flows which include this block.
+ [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 queue configurations flow in Amazon Connect](sample-queue-configurations.md) 
+ [Sample queued callback flow in Amazon Connect](sample-queued-callback.md) 

# Flow block in Amazon Connect: Transfer to agent (beta)
<a name="transfer-to-agent-block"></a>

## Description
<a name="transfer-to-agent-block-description"></a>
+ Ends the current flow and transfers the customer to an agent. 
**Note**  
If the agent is already with someone else, the contact is disconnected.  
If the agent is in After Contact Work, they are automatically removed from ACW at the time of transfer.
+ The **Transfer to Agent** block is a beta feature and works only for voice interactions.
+ We recommend using the [Set working queue](set-working-queue.md) block for agent-to-agent transfers instead of using this block. The **Set working queue** block supports omnichannel transfers such as voice and chat. For instructions, see [Set up agent-to-agent transfers in Amazon Connect](setup-agent-to-agent-transfers.md). 

## Supported channels
<a name="transfer-to-agent-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | No - Error branch | 
| Task | No - Error branch | 
| Email | No - Error branch | 

To transfer chats and tasks to agents, use the [Set working queue](set-working-queue.md) block. Because [Set working queue](set-working-queue.md) works for all channels, we recommend using it for voice calls too, instead of using **Transfer to agents (beta)**. For instructions, see [Set up agent-to-agent transfers in Amazon Connect](setup-agent-to-agent-transfers.md).

## Flow types
<a name="transfer-to-agent-block-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Transfer to Agent flow
+ Transfer to Queue flow

## Properties
<a name="transfer-to-agent-block-properties"></a>

The following image shows the **Properties** page of the **Transfer to agent** block. It does not have any options on it.

![\[The properties page of the Transfer to agent block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/transfer-to-agent-properties.png)


## Configured block
<a name="transfer-to-agent-block-configured"></a>

The following image shows an example of what this block looks like when it is configured. It displays the status **Transferred**. It does not have any branches. 

![\[A configured Transfer to agent block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/transfer-to-agent-configured.png)


## Scenarios
<a name="transfer-to-agent-block-scenarios"></a>

See these topics for scenarios that use this block:
+ [Set up contact transfers in Amazon Connect](transfer.md)

# Flow block in Amazon Connect: Transfer to flow
<a name="transfer-to-flow"></a>

This topic defines the flow block for ending the current flow and transferring the customer to a different flow.

## Description
<a name="transfer-to-flow-description"></a>
+ Ends the current flow and transfers the customer to a different flow.

## Supported channels
<a name="transfer-to-flow-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | Yes | 
| Email | Yes | 

## Flow types
<a name="transfer-to-flow-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Inbound flow
+ Transfer to Agent flow
+ Transfer to Queue flow

## Properties
<a name="transfer-to-flow-properties"></a>

The following image shows the **Properties** page of the **Transfer to flow** block. You choose the flow from the dropdown box. 

![\[Transfer to flow dialog with options to set manually or dynamically, showing sample queue customer selection.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/transfer-to-flow-properties.png)


Only published flows appear in the dropdown list. 

## Configured block
<a name="transfer-to-flow-configured"></a>

The following image shows an example of what this block looks like when it is configured. It has the following branch: **Error**. 

![\[A configured Transfer to flow block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/transfer-to-flow-configured.png)


1. The contact is routed down the **Error** branch if the flow you have specified to transfer to isn't a valid flow, or it's not a valid flow type (Inbound, Transfer to Agent, or Transfer to Queue). 

## Sample flows
<a name="transfer-to-flow-samples"></a>

Amazon Connect includes a set of sample flows. For instructions that explain how to access the sample flows in the flow designer, see [Sample flows in Amazon Connect](contact-flow-samples.md). Following are topics that describe the sample flows which include this block.
+ [Sample flow in Amazon Connect for A/B contact distribution testing](sample-ab-test.md)

## Scenarios
<a name="transfer-to-flow-scenarios"></a>

See these topics for scenarios that use this block:
+ [Set up contact transfers in Amazon Connect](transfer.md)

# Flow block in Amazon Connect: Transfer to phone number
<a name="transfer-to-phone-number"></a>

This topic defines the flow block for transferring the customer to an external phone number outside of your Amazon Connect instance.

**Important**  
For a list of the telephony capabilities that Amazon Connect provides, such as whether Amazon Connect provides outbound calling within your country using a local Caller ID (CLID), see the [Amazon Connect Telecoms Country Coverage Guide](https://d1v2gagwb6hfe1.cloudfront.net/Amazon_Connect_Telecoms_Coverage.pdf). 

## Description
<a name="transfer-to-phone-number-description"></a>
+ Transfers the customer to a phone number external to your instance.

## Supported channels
<a name="transfer-to-phone-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | No - Error branch | 
| Task | No - Error branch | 
| Email | No - Error branch | 

## Flow types
<a name="transfer-to-phone-number-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Inbound flow
+ Customer Queue flow
+ Transfer to Agent flow
+ Transfer to Queue flow

## Properties
<a name="transfer-to-phone-number-properties"></a>

The following image shows the **Properties** page of the **Transfer to phone number** block. It shows the **Transfer via** section. The **Country code** is set to \$11 (US). **Set timeout** = 30 seconds.

![\[The properties page of the Transfer to phone number block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/transfer-to-phone-number-properties.png)


The following image shows the **Resume flow after disconnect** section is set to **Yes**. 

![\[The Resume flow after disconnect section, the Optional parameters section.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/transfer-to-phone-number-properties2.png)


Note the following properties:
+ **Resume flow after disconnect**: This works only if the external party disconnects, and the customer doesn't disconnect. (If the customer disconnects, the whole call disconnects.)
+ **Send DTMF**: This property is useful to bypass some of the DTMF of the external party. For example, if you know you'll need to press 1, 1, 362 to reach the external party, you can enter that here.

  If you specify a comma in **Send DTMF** it pauses for 750ms.
+ **Caller ID number**: You can choose a number from your instance to appear as the caller ID. This is useful in cases where you want to use a number that's different from the one the flow is actually using to make the call.
**Important**  
If you are using Amazon Connect outside of the United States, we recommend choosing **Caller ID number** and then selecting an Amazon Connect number. Otherwise, local regulations may cause telephony providers to block or redirect non-Amazon Connect phone numbers. This will result in service-related events, such as rejected calls, poor audio quality, delay, latency, and displaying the incorrect caller ID.   
**In Australia**: The caller ID must be an Amazon Connect provided DID (Direct Inward Dialing) phone number. If a toll free number or a number not provided by Amazon Connect is used in the caller ID, local telephony suppliers may reject outbound calls due to local anti-fraud requirements.  
**In the UK**: The caller ID must be a valid E164 phone number. If the phone number is not provided in the caller ID, local telephony suppliers may reject outbound calls due to local anti-fraud requirements.
+ **Caller ID name**: You can set a caller ID name, but there's no guarantee it will appear correctly to the customer. For more information, see [Outbound caller ID number](queues-callerid.md#using-call-number-block).
**Note**  
Per SIP protocol RFC3261, the following characters are reserved: **; / ? : @ & = \$1 \$1 ,**. Do not use these characters in the caller ID name. When these characters are included, outbound calls may fail or the caller ID name may display inaccurately. 
When [Transfer to phone number](#transfer-to-phone-number) block is used without specifying a custom caller ID, the caller ID of the caller is passed as the caller ID. For example, if you transfer to an external number and no custom caller ID is used to specify that the call is coming from your organization, then the contact's caller ID is displayed to the external party.

## Configuration tips
<a name="transfer-to-phone-number-tips"></a>
+ [Submit a service quota increase request](https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase&limitType=service-code-connect) requesting that your business be allowed to make outbound calls to the country you specified. If your business is not on the allowlist for making the call, it will fail. For more information, see [Countries that call centers using Amazon Connect can call by default](country-code-allow-list.md).
+ If the country you want to select is not listed, you can submit a request to add countries you want to transfer calls to using the [Amazon Connect service quotas increase form](https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase&limitType=service-code-connect).
+ You can choose to end the flow when the call is transferred, or choose to **Resume flow after disconnect**, which returns the caller to your instance and resumes the flow after the transferred call ends.

## Configured block
<a name="transfer-to-phone-number-configured"></a>

The following image shows an example of what this block looks like when it is configured. It shows the number you are transferring to. It has the following branches: **Success**, **Call Failed**, **Timeout**, **Error**. 

![\[A configured Transfer to phone number block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/transfer-to-phone-number-configured.png)


## Scenarios
<a name="transfer-to-phone-number-scenarios"></a>

See these topics for scenarios that use this block:
+ [Set up contact transfers in Amazon Connect](transfer.md)
+ [Set up outbound caller ID in Amazon Connect](queues-callerid.md)

# Flow block in Amazon Connect: Transfer to queue
<a name="transfer-to-queue"></a>

This topic defines the flow block for transferring a current contact to the destination queue.

## Description
<a name="transfer-to-queue-description"></a>

Use this block to transfer a current contact to the destination queue.

The functionality of this block depends on where it is used:
+ When used in a Customer Queue flow, this block transfers a contact already in a queue to another queue. 
+ When used in a callback scenario, Amazon Connect calls the agent first. After the agent accepts the call in the CCP, Amazon Connect calls the customer.
+ In all other cases, this block places the current contact in a queue and ends current flow.
+ This block cannot be used in a callback scenario when using the chat channel. If you attempt to do so, an error branch is followed. In addition, an error is created in the CloudWatch log.

## Use cases for this block
<a name="scenarios-transfer-to-queue"></a>

This block is designed to be used in the following scenarios:
+ Place the contact in a queue to be connected to an agent.
+ You want to move the current customer from a generic queue to a specialized queue. You may want to do this when customers have waited too long in the queue, for example, or you have other business requirements.
+ Offer callback options to the customer instead of having them wait to be connected to an agent.

## Contact types
<a name="transfer-to-queue-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Contact type | Supported? | 
| --- | --- | 
| Voice | Yes | 
| Chat | Yes | 
| Task | Yes | 
| Email | Yes | 

## Flow types
<a name="transfer-to-queue-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):


| Flow type | Supported? | 
| --- | --- | 
| Inbound flow | Yes | 
| Customer queue flow | Yes | 
| Customer hold flow | No | 
| Customer whisper flow | No | 
| Outbound whisper flow | No | 
| Agent hold flow | No | 
| Agent whisper flow | No | 
| Transfer to agent flow | Yes | 
| Transfer to queue flow | Yes | 

## How to configure this block
<a name="transfer-to-queue-properties"></a>

You can configure the **Transfer to queue** block using the Amazon Connect admin website. Or you can use the Amazon Connect Flow language. Depending on the use case you use one of the following actions: 
+ If the flow block is used in CustomerQueue flow type, it is represented as [DequeueContactAndTransferToQueue](https://docs.aws.amazon.com/connect/latest/APIReference/contact-actions-dequeuecontactandtransfertoqueue.html) action in the Flow Language.
+ If the flow block is used to configure callbacks, it is represented as [CreateCallbackContact](https://docs.aws.amazon.com/connect/latest/APIReference/interactions-createcallbackcontact.html) action.
+ If the flow block is used to configure callbacks, it is represented as [TransferContactToQueue ](https://docs.aws.amazon.com/connect/latest/APIReference/contact-actions-transfercontacttoqueue.html) action.

**Topics**
+ [

### Transfer to queue
](#transfer-to-queue-tab)
+ [

### Transfer to Callback (scheduling callbacks)
](#transfer-to-queue-callback)
+ [

### Flow block branches
](#transfer-to-queue-branches)
+ [

### Additional configuration tips
](#transfer-to-queue-tips)
+ [

### Data generated by the block
](#transfer-to-queue-data)

### Transfer to queue
<a name="transfer-to-queue-tab"></a>

Use this configuration tab to transfer the contact to a queue. There are two possible scenarios:
+ **Contacts are not in any queue yet**: If contacts are not in a queue yet, this configuration simply puts the contacts in the destination queue that you've specified. For contacts not in a queue yet, you must use a [Set working queue](set-working-queue.md) block before a **Transfer to queue** block. 

  The following image shows the **Transfer to queue** tab on the **Properties** page for transferring contacts to queue. You don't need to choose any options.  
![\[The properties page of the Transfer to queue block, the Transfer to queue tab.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/transfer-to-queue-properties.png)

  The following code sample shows how this same configuration would be represented by the [TransferContactToQueue ](https://docs.aws.amazon.com/connect/latest/APIReference/contact-actions-transfercontacttoqueue.html) action in the Flow language:

  ```
  {
           "Parameters": {},
           "Identifier": "a12c905c-84dd-45c1-8f53-4287d1752d59",
           "Type": "TransferContactToQueue",
           "Transitions": {
               "NextAction": "",
               "Errors": [
                   {
                       "NextAction": "0a1dc9a4-8657-4941-a980-772046b94f1e",
                       "ErrorType": "QueueAtCapacity"
                   },
                   {
                       "NextAction": "6e84a9b5-1ed0-40b1-815d-a3bdd4b2dc8a",
                       "ErrorType": "NoMatchingError"
                   }
               ]
           }
       }
  ```

  There are two possible outcomes in this case:
  + **At capacity**: If the destination queue cannot accept additional contacts when number of contacts currently in a queue exceeds the maximum contacts allowed for queue, then the contact is routed down the **At Capacity** branch.
  + **Error**: If transfer to queue fails for any other reason apart from capacity constraint (for example, the queue ARN that is specified for the transfer is not valid, the queue does not exist in the current instance, or queue is disabled for routing), then the contact is routed down the **Error** branch. 
+ **Contact already in a queue**: If contacts are already waiting in a queue, then running the **Transfer to queue** block would move contacts from one queue to another. The following image shows how to configure the block to transfer contacts to queue. In this case, the **BasicQueue** is set manually.  
![\[The properties page of the Transfer to queue block, the Transfer to callback queue tab.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/transfer-to-queue-properties1.png)

  The following code sample shows how this same configuration would be represented by the [DequeueContactAndTransferToQueue](https://docs.aws.amazon.com/connect/latest/APIReference/contact-actions-dequeuecontactandtransfertoqueue.html) action in the Flow language:

  ```
  {
           "Parameters": {
               "QueueId": "arn:aws:connect:us-west-2:1111111111:instance/aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee/queue/abcdef-abcd-abcd-abcd-abcdefghijkl"
           },
           "Identifier": "180c3ae1-3ae6-43ee-b293-546e5df0286a",
           "Type": "DequeueContactAndTransferToQueue",
           "Transitions": {
               "NextAction": "",
               "Errors": [
                   {
                       "NextAction": "0a1dc9a4-8657-4941-a980-772046b94f1e",
                       "ErrorType": "QueueAtCapacity"
                   },
                   {
                       "NextAction": "6e84a9b5-1ed0-40b1-815d-a3bdd4b2dc8a",
                       "ErrorType": "NoMatchingError"
                   }
               ]
           }
       }
  ```

  There are three possible outcomes in this case:
  + **Success**: Indicates the contact successfully transferred to the destination queue.
  + **At capacity**: If the destination queue cannot accept additional contacts when the number of contacts currently in a queue exceeds maximum contacts allowed for queue, then the contact is routed down the **At Capacity** branch. The contact remains in the current working queue.
  + **Error**: If transfer to queue fails for any other reason apart from capacity constraint (for example, the queue ARN that is specified for the transfer is not valid, the queue does not exist in the current instance, or queue is disabled for routing), then the contact is routed down the **Error** branch. The contact remains in the current working queue.

### Transfer to Callback (scheduling callbacks)
<a name="transfer-to-queue-callback"></a>

Use this configuration tab to schedule callbacks for contacts at later time. The following image shows a **Properties** page that is configured for scheduling callbacks. 

![\[The properties page of the Transfer to queue block, the Transfer to Callback tab.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/transfer-to-queue-properties-callback.png)


The following properties are available under the **Transfer to Callback** tab:
+ **Initial delay**: Specify how much time has to pass between a callback contact being initiated in the flow, and the customer is put in queue for the next available agent. 
+ **Maximum number of retries**: If this were set to 1, then Amazon Connect would try to callback the customer at most two times: the initial callback, and 1 retry.
**Tip**  
We strongly recommend that you double-check the number entered in **Maximum number of retries**. If you accidentally enter a high number, such as 20, it's going to result in unnecessary work for the agent and too many calls for the customer.
+ **Minimum time between attempts**: If the customer doesn't answer the phone, this is how long to wait until trying again.
+ **Set working queue**: You can transfer a callback queue to a different queue. This is useful if you set up a special queue just for callbacks. You can then view that queue to see how many customers are waiting for callbacks.
**Tip**  
If you want to specify the **Set working queue** property, you need to add a **Set customer callback number** block before this block.

  If you don't set a working queue, Amazon Connect uses the queue that was set previously in the flow.
+ **Set creation flow**: Use the dropdown menu to select the flow to be run when a callback contact is created. 

  The callback creation flow that you select must meet the following requirements: 
  + The flow type must be the default flow type, **Contact flow (inbound)**. For information about flow types, see [Choose a flow type](create-contact-flow.md#contact-flow-types). 
  + You need to configure a [Transfer to queue](#transfer-to-queue) block to queue the contact in the queue of your choice.

  Following are additional options for how you can configure your callback creation flow: 
  + You can evaluate contact attributes (including customer profiles) by using a [Check contact attributes](check-contact-attributes.md) block to see if the callback should be terminated because it is a duplicate or the customer issue has already been resolved.
  + You can add a [Set customer queue flow](set-customer-queue-flow.md) block and use it to specify the flow to run when a customer is transferred to a queue. This flow is called a customer queue flow.
    + In the customer queue flow, you can evaluate the contact's wait time in queue by using a combination of the [Get metrics](get-queue-metrics.md) block and [GetCurrentMetricData](https://docs.aws.amazon.com/connect/latest/APIReference/API_GetCurrentMetricData.html) to send an advance SMS to customers, notifying them to expect a callback in the near future from the specific contact center number.
+ **Caller ID number to display**: Specify the phone number that appears to customers when they receive the callback. You can choose **Set manually** to select from drop-down list of claimed phone numbers in your Amazon Connect instance, or **Set dynamically** based on contact attributes. The attribute value must be a valid phone number claimed in your Amazon Connect instance. This caller ID takes precedence over the outbound phone number configured on the queue.

### Flow block branches
<a name="transfer-to-queue-branches"></a>

 When this block is configured to **transfer to queue**, it looks similar to the following image. It has two branches: **At capacity** and **Error**. If a contact is routed down the **At capacity** branch, it remains in the current working queue.

![\[A configured transfer to queue block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/transfer-to-queue-configured.png)


When this block is configured to **transfer to callback queue**, it looks similar to the following image. It has two branches: **Success** and **Error**. If a contact is routed down the **Success** branch, it's transferred to the specified queue.

![\[A configured transfer to callback block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/transfer-to-queue-configured1.png)


### Additional configuration tips
<a name="transfer-to-queue-tips"></a>
+ When you use this block in a Customer Queue flow, you must add a **Loop prompts** block before this one.
+ To use this block in most flows, you must add a **Set working queue** block first. There are two exceptions: 
  + When this block is used in a Customer Queue flow.
  + When making an outbound campaign that points to a Contact (Inbound) flow. The **Set working queue** block isn't necessary because the queue is already set using the campaign configuration. It can simply transfer to the queue. 
+ Queue-to-queue transfers can be done only 11 times because there is a maximum limit of 12 contacts in a contact chain. Every transfer adds a new contact to the chain.

### Data generated by the block
<a name="transfer-to-queue-data"></a>

This block does not generate any data.

## Error scenarios
<a name="transfer-to-queue-errorscenarios"></a>

A contact is routed down the **Error** branch in the following situations:

When the Transfer to queue block runs, it checks the queue capacity to determine whether the queue is at capacity (full). This check for queue capacity compares the current number of contacts in the queue to the Maximum contacts in queue limit, if one is set for the queue. If no limit is set, the queue is limited to the number of concurrent contacts set in the service quota for the instance.

## Sample flows
<a name="transfer-to-queue-samples"></a>

Amazon Connect includes a set of sample flows. For instructions that explain how to access the sample flows in the flow designer, see [Sample flows in Amazon Connect](contact-flow-samples.md). Following are topics that describe the sample flows which include this block.
+ [Sample queue configurations flow in Amazon Connect](sample-queue-configurations.md)
+ [Sample customer queue priority flow in Amazon Connect](sample-customer-queue-priority.md)
+ [Sample queued callback flow in Amazon Connect](sample-queued-callback.md)

## More resources
<a name="transfer-to-queue-scenarios"></a>

See the following topics to learn more about the transferring contacts to a queue and queued callback.
+ [Set up a flow to manage contacts in a queue in Amazon Connect](queue-to-queue-transfer.md)
+ [Set up queued callback by creating flows, queues, and routing profiles in Amazon Connect](setup-queued-cb.md)
+ [Queued callbacks in real-time metrics in Amazon Connect](about-queued-callbacks.md)

# Flow block in Amazon Connect: Wait
<a name="wait"></a>

This topic defines the flow block for pausing the flow for the specified amount of time. 

## Description
<a name="wait-description"></a>

This block pauses the flow for the specified wait time or for the specified event. 

For example, if a contact stops responding to a chat, the block pauses the contact flow for the specified wait time (**Timeout** time), then branches accordingly, such as to disconnect.

## Supported channels
<a name="wait-channels"></a>

The following table lists how this block routes a contact who is using the specified channel. 


| Channel | Supported? | 
| --- | --- | 
| Voice | Yes - but only in Inbound flow when the **Keep running while waiting** option, or the **Set event-based wait** option is selected (see the image below). | 
| Chat | Yes | 
| Task | Yes - It always branches to **Time Expired** or **Error**. It never branches to **Bot participant disconnected** or **Participant not found**. The **Participant Type **setting does not affect this behavior.  | 
| Email | Yes | 

## Flow types
<a name="wait-types"></a>

You can use this block in the following [flow types](create-contact-flow.md#contact-flow-types):
+ Inbound flow
+ Customer Queue flow

## Properties
<a name="wait-properties"></a>

The following image shows the **Config** tab of the **Wait** block. It is configured pause the flow for 5 hours.

![\[The settings the Wait block, the Config tab.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/wait-properties.png)


It has the following properties: 
+ **Participant Type**: Runs the **Wait** block for the specified participant type.
  + **Default** - A customer contact.
  + **Bot** - A custom participant, such as a third-party bot. For more information about using this option, see [Customize chat flow experiences in Amazon Connect by integrating custom participants](chat-customize-flow.md). 
+ **Timeout**: Run this branch if the customer hasn't sent a message after a specified amount of time. Maximum is 7 days.
  + Manually set timeout: You can provide the **Number** and **Units**.
  + Dynamically set timeout: The unit of measurement is in seconds.
+ **Customer return**: Route the contact down this branch when the customer returns and sends a message. With this branch you can route the customer to the previous (same) agent, previous (same) queue, or override and set a new working queue or agent. This optional branch is available only when **Participant Type** = **Default**.
+ **Set Event based Wait**: Specify a Lambda to wait for its completion and route the contact down the Lambda Return branch when the execution of specified Lambda is completed. This optional branch is available only when **Participant Type** = **Default**.
+ **Keep running while waiting**: Temporarily route the contact down the **Continue** branch while waiting on the block. This optional branch is available only when **Participant Type** = **Default**.

## Configuration tips
<a name="wait-tips"></a>
+ You can configure the **Wait** block to wait for a Lambda that is invoked using the [AWS Lambda function](invoke-lambda-function-block.md) block in **Asynchronous** execution mode. To do this, select the **Set Event based Wait** option and provide the RequestId of the Lambda invocation. For more information, see [Load Lambda Result](invoke-lambda-function-block.md#properties-load-lamdba).
**Note**  
If the wrong Invocation ID is provided to the **Wait** block, it continues to wait until the **Set timeout**. 
+ You cannot have nested **Wait** blocks, such as a **Wait** block inside the **Continue** branch of another **Wait** block. 

  For example, you can't have the first **Wait** block configured with **Continue** and Lambda-returned branches to send messages with a specific delay (configured on the second Wait block in the Continue branch) while waiting for their asynchronous Lambda invocation to return. This configuration results in the following error on the second **Wait** block:
  + **Unsupported Action In Wait Action's Continue Branch**
+ You can configure the **Wait** block to run other blocks. For example, you may want to play an audio while waiting for a Lambda execution to complete. To do this, add a [Play prompt](play.md) block to the **Continue** branch.
+ You can add multiple **Wait** blocks to your flows. For example: 
  + If the customer comes back in 5 minutes, connect them to the same agent. This is because that agent has all of the context.
  + If the customer doesn't come back after 5 minutes, send a text saying "We missed you." 
  + If the customer comes back in 12 hours, connect to a flow that puts them in a priority queue. However, it doesn't route them to the same agent.

## Configured block
<a name="wait-configured"></a>

The following image shows an example of what this block looks like when it is configured with **Participant Type** = **Default**. It has the following branches: **Time Expired** and **Error**. 

![\[A configured Wait block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/wait-configured.png)


The following image shows an example of what this block looks like when it is configured with **Participant Type** = **Bot**. It has the following branches: **Bot participant disconnected**, **Participant not found**, **Time Expired**, and **Error**. 

![\[A configured Wait block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/wait-configured2.png)


1. **Bot participant disconnected**: The custom participant, such as a third-party bot, has successfully disconnected to the contact. 

1. **Participant not found**: No custom participant was found to be associated to the contact. 

1. **Time Expired**: The timeout specified has lapsed before the custom participant disconnected.

## Sample flows
<a name="wait-samples"></a>

Amazon Connect includes a set of sample flows. For instructions that explain how to access the sample flows in the flow designer, see [Sample flows in Amazon Connect](contact-flow-samples.md). Following are topics that describe the sample flows which include this block.
+ [Sample disconnect flow in Amazon Connect](sample-disconnect.md)

## Scenarios
<a name="wait-scenarios"></a>

See these topics for scenarios that use this block:
+ [Example chat scenario](web-and-mobile-chat.md#example-chat-scenario)

# Use the flow designer in Amazon Connect to create flows
<a name="create-contact-flow"></a>

The starting point for creating all flows is the flow designer. It's a drag-and-drop work surface that enables you to link together blocks of actions. For example, when a customer first enters your contact center, you can ask for some input and then play a prompt such as "Thank you."

For descriptions of the available flow blocks, see [Flow block definitions in the flow designer in Amazon Connect](contact-block-definitions.md).

**Topics**
+ [

## Before you begin: develop a naming convention
](#before-create-contact-flow)
+ [

## Choose a flow type
](#contact-flow-types)
+ [

## Create an inbound flow
](#create-inbound-contact-flow)
+ [

## Add tags to flows and flow modules
](#tag-flows-and-flow-modules)
+ [Use the mini-map to navigate a flow](flow-minimap.md)
+ [Customize the name of a block](set-custom-flow-block-name.md)
+ [Undo and redo history](undo-redo-history.md)
+ [Add notes to a block](add-notes-to-block.md)
+ [Copy and paste flows](copy-paste-contact-flows.md)
+ [Archive, delete, and restore flows](delete-contact-flow.md)
+ [Generate logs for published flows](logs.md)
+ [Roll back a flow](flow-version-control.md)
+ [Best practices for flows](bp-contact-flows.md)
+ [Contact initiation methods and flow types](contact-initiation-methods.md)

## Before you begin: develop a naming convention
<a name="before-create-contact-flow"></a>

Chances are you're going to create tens or hundreds of flows. To help you stay organized, it's important to develop a naming convention. After you start creating flows, we strongly recommend against renaming them.

## Choose a flow type
<a name="contact-flow-types"></a>

Amazon Connect includes a set of specific flow types. **Each type has only those blocks for a specific scenario.** For example, the flow type for transferring to a queue contains only the appropriate flow blocks for that type of flow. 

**Important**  
When you create a flow, you need to choose the right type for your scenario. Otherwise, the blocks you need may not be available. 
You can't import flows of different types. This means if you start with one type and need to switch to another to get the right blocks, you have to start over.

The following flow types are available. 


| Type | When to use | 
| --- | --- | 
|  **Inbound flow**  |  This is the generic flow type that's created when you choose the **Create flow** button, and don't select a type using the drop-down arrow. It creates an inbound flow.  This flow works with voice, chat, and tasks.   | 
|  **Campaign flow**  |  Use to manage what the customer experiences during an outbound campaign. This flow only works with outbound campaigns.  | 
|  **Customer queue flow**  |  Use to manage what the customer experiences while in queue, before being joined to an agent. Customer queue flows are interruptible and can include actions such as an audio clip apologizing for a delay and offering an option to receive a callback, leveraging the **Transfer to queue** block. This flow works with voice, chat, and tasks.   | 
|  **Customer hold flow**  |  Use to manage what the customer experiences while the customer is on hold. With this flow, one or more audio prompts can be played to a customer using the **Loop prompts** block while waiting on hold. This flow works with voice.   | 
|  **Customer whisper flow**  |  Use to manage what the customer experiences as part of an inbound call immediately before being joined with an agent. The agent and customer whispers are played to completion, then the two are joined. This flow works with voice and chat.   | 
|  **Outbound whisper flow**  |  Use to manage what the customer experiences as part of an outbound call before being connected with an agent. In this flow, the customer whisper is played to completion, then the two are joined. For example, this flow can be used to enable call recordings for outbound calls with the **Set recording behavior** block. This flow works with voice and chat.   | 
|  **Agent hold flow**  |  Use to manage what the agent experiences when on hold with a customer. With this flow, one or more audio prompts can be played to an agent using the **Loop prompts** block while the customer is on hold. This flow works with voice.   | 
| **Agent whisper flow** | Use to manage what the agent experiences as part of an inbound call immediately before being joined with a customer. The agent and customer whispers are played to completion, then the two are joined. This flow works with voice, chat, and tasks.   | 
| **Transfer to agent flow** | Use to manage what the agent experiences when transferring to another agent. This type of flow is associated with transfer to agent quick connects, and often plays messaging, then completes the transfer using the **Transfer to agent** block. This flow works with voice, chat, and tasks.   Do not place any sensitive information in this flow. When a cold transfer occurs, the transferring agent disconnects before transfer is completed, and this flow is run on the caller. This means information in the flow is played to the caller, not the agent.    | 
| **Transfer to queue flow** | Use to manage what the agent experiences when transferring to another queue. This type of flow is associated with transfer to queue quick connects, and often plays messaging, then completes the transfer using the **Transfer to queue** block. This flow works with voice, chat, and tasks.  | 

## Create an inbound flow
<a name="create-inbound-contact-flow"></a>

Use these steps to create an inbound flow. 

1. In the left navigation menu, choose **Routing**, **Flows**.   
![\[The Amazon Connect navigation menu.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/menu-contact-flows.png)

1. Choose **Create flow**. This opens the flow designer and creates an inbound flow (Type = Flow). 

1. Type a name and a description for your flow.

1. Search for a flow block using the **Search** bar, or expand the relevant group to locate the block. For descriptions of the flow blocks, see [Flow block definitions in the flow designer in Amazon Connect](contact-block-definitions.md).

1. Drag and drop contact blocks onto the canvas. You can add blocks in any order or sequence, as connections between elements aren't required to be strictly linear.
**Tip**  
You can move blocks around the canvas so the layout aligns to your preferences. To select multiple blocks at the same time, press the **Ctrl** key on your laptop (or the **Cmd** key on a Mac), choose the blocks you want, and then use your mouse to drag them as a group within the flow. You can also use the **Ctrl**/**Cmd** key to start at one point on the canvas and drag your pointer across the canvas to select all blocks included in the frame. 

1. Double-click the title of the block. In the configuration pane, configure settings for that block and then choose **Save** to close the pane.

1. Back on the canvas, click on the first (the originating) block.

1. Choose the circle for the action to perform, such as ****Success.

1. Drag the arrow to the connector of the group that performs the next action. For groups that support multiple branches, drag the connector to the appropriate action. 

1. Repeat the steps to create a flow that meets your requirements.

1. Choose **Save** to save a draft of the flow. Choose **Publish** to activate the flow immediately.

**Note**  
All connectors must be connected to a block in order to successfully publish your flow.

## Add tags to flows and flow modules
<a name="tag-flows-and-flow-modules"></a>

A *tag* is a custom metadata label that you can add to a resource to make it easier to identify, organize, and find in a search. Tags are comprised of two individual parts: A tag key and a tag value. This is referred to as a key:value pair.

A tag key typically represents a larger category, while a tag value represents a subset of that category. For example you could have tag key=Color and tag value=Blue, which would produce the key:value pair `Color:Blue`.

You can add resource tags to your flows and flow modules. Use the following steps to add a resource tag from the flow designer.

1. Open the tag section on flow designer page for a chosen flow or flow module.  
![\[The flow designer.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/tag-flows-and-flow-modules-1.png)

1. Enter a **Key** and **Value** combination to tag the resource.  
![\[Tags section in the flow designer.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/tag-flows-and-flow-modules-2.png)

1. Choose **Add**. Tags are not persisted until you save or publish the flow.

For more information, see [Apply tag-based access control in Amazon Connect](tag-based-access-control.md)

# Use the mini-map in Amazon Connect to navigate a flow
<a name="flow-minimap"></a>

In the lower left corner of the flow designer, there's a miniaturize view of the entire flow. Use this view to help you easily navigate the flow. The drag-to-move mini-map has visual highlights that enable you to quickly move to any point in the flow.

The following image shows the location of the mini-map in the flow designer. The arrow points to the toggle that you use to hide or show the mini-map.

![\[A flow with the mini-map.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/flow-minimap.png)


The following GIF shows an example of how you can use the mini-map to navigate a large flow. Click or tap the mini-map to move the view to the desired location on the flow designer. 

![\[A flow that shows the mini-map.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/flow-minimapgif.gif)


Note the following functionality:
+ It shows your current view in green outline.
+ It highlights selected blocks in blue, notes in yellow, search results in orange, and termination blocks in black.
+ It allows continuous movement of the view when you drag on the mini-map.
+ It returns the view to the **Entry** block and trims unused space when you choose **Reset**.

# Customize the name of a flow block in Amazon Connect
<a name="set-custom-flow-block-name"></a>

To help you distinguish blocks in a flow, you can customize the names of blocks. For example, when there are multiple **Play prompt** blocks, and you want to distinguish between them at a glance you can assign each block their own name. 

Custom flow block names appear in CloudWatch logs under the `Identifier` field. This makes it easier for you to review the logs to diagnose issues.

**Important**  
The following characters are not allowed in the block name or `Identifier` field: (% : ( \$1 / ) = \$1 , ; [ ] \$1 \$1)
The following strings are not allowed in the block name or `Identifier` field: \$1\$1proto\$1\$1, constructor, \$1\$1defineGetter\$1\$1, \$1\$1defineSetter\$1\$1, toString, hasOwnProperty, isPrototypeOf, propertyIsEnumerable, toLocaleString, and valueOf. 

There are two ways you can specify a custom block name:
+ On the block, choose **...**, and then choose **Add block name**, as shown in the following GIF.  
![\[A block with a custom name.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-custom-flow-block-name-1.gif)
+ You can also customize the name of the block on the **Property** page, as shown in the following GIF.  
![\[A block with a custom name.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-custom-flow-block-name-2.gif)

# Undo and redo actions in the flow designer in Amazon Connect
<a name="undo-redo-history"></a>

You can undo and redo actions in the flow designer. Choose the undo and redo items on the toolbar. Or, with your cursor on the flow designer canvas, use the shortcut keys: Ctrl\$1Z to undo, Ctrl\$1Y to redo. 

**Tip**  
On a Mac, Ctrl\$1Y opens the history page instead of performing a redo.

To access a history of your actions that you can undo, choose the **Undo** dropdown button on the toolbar, as shown in the following image.

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


## Limits
<a name="undo-redo-limits"></a>


| Action | Limit | 
| --- | --- | 
|  History limit  |  Up to 100 actions can be undone.  | 
|  Dragging unconnected connector  |  This action cannot be undone.  | 
|  Folding of notes  |  This action cannot be undone.  | 
|  Page reload  |  The undo history is not retained after a page is reloaded.  | 

# Add comments to a flow block in the flow designer in Amazon Connect
<a name="add-notes-to-block"></a>

To add notes to a block, on the toolbar choose **Annotation**. Or, with your cursor on the flow designer canvas, use the shortcut keys: Ctrl \$1 Alt \$1N. A yellow box opens for you to type up to 1000 characters. This enables you to leave comments that others can view.

The following image shows the flow designer toolbar, the annotation box, and an annotation that is attached to a block.

![\[A block with annotations.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/flow-annotations.png)


The following GIF shows how to move notes around the flow designer and attach them to a block.

![\[Notes on the flow designer.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/flow-annotationsGIF.gif)


The following image shows the dropdown menu that allows you to view a list of all the notes in a flow. Choose a note to navigate to it. Use the search box to search notes across the flow.

![\[The list note menu item.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/flow-annotations2.png)


Note the following functionality:
+ Unicode and emojis are supported.
+ You can copy and paste, undo, and redo into the note box.
+ You can search notes across the flow.
+ When a block is deleted, the notes are deleted. When a block is restored, the notes are restored.

## Limits
<a name="note-limits"></a>


| Item | Limit | 
| --- | --- | 
|  Character limit  |  1000 characters per note  | 
|  Attachment limit  |  5 notes per block  | 
|  Note limit  |  100 notes per flow  | 

# Copy and paste flows in Amazon Connect
<a name="copy-paste-contact-flows"></a>

You can select, cut, copy, and paste a complete flow or multiple blocks within or across flows. The following information is copied:
+ All configured settings in the selected flow blocks.
+ The layout arrangements.
+ The connections.

The following image shows the copy item on the flow designer toolbar.

![\[The copy item on the toolbar.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/flow-copytoolbar.png)


Or, if desired, use the shortcut keys. 

**Windows: CTRL\$1C to copy, CTRL\$1V to paste, and CTRL\$1X to cut**

1. To select multiple blocks at the same time, press the **Ctrl** key, and choose the blocks you want.

1. With your cursor on the flow designer canvas, press **Ctrl\$1C** to copy the blocks.

1. Press **CTRL\$1V** to paste the blocks.

**Mac: Cmd\$1C to copy, Cmd\$1V to paste, and Cmd\$1X to cut**

1. To select multiple blocks at the same time, press the **Cmd** key, and choose the blocks you want.

1. Press **Cmd\$1C** to copy the blocks.

1. Press **Cmd\$1V** to paste the blocks.

**Tip**  
Amazon Connect uses the clipboard for this feature. Paste won't work if you edit the JSON in your clipboard and introduce a typo or other error, or if you have multiple items saved to your clipboard. 

# Archive, delete, and restore flows in Amazon Connect
<a name="delete-contact-flow"></a>

Flows and modules must be archived before you can delete them from your Amazon Connect instance. Archived flows and modules can be restored.

**Warning**  
Deleted flows and modules cannot be restored. They are permanently deleted from your Amazon Connect instance.

## Important things to know
<a name="important-archive-flow"></a>
+ **Use caution when archiving flows or modules**. Amazon Connect does not validate whether the flow or module you are archiving is being used in other published flows. It does not warn you that the flow is in use. 
+ Default flows cannot be archived or deleted. If you attempt to archive a default flow, you'll get message similar to the following image.  
![\[The Archive option in the dropdown menu.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/flow-archive-error.png)
+ Flows and modules that are associated with queues, quick connects, or phone numbers cannot be archived. You need to disassociate the resources from the flows before you can archive them.
+ Archived flows and modules count towards your **Flows per instance** and **Modules per instance** service quotas. You must delete them to not have them counted. For more information about quotas, see [Amazon Connect service quotas](amazon-connect-service-limits.md).

## Archive a flow or module
<a name="archive-flow"></a>

There are two ways you can archive flows or modules.

**Option 1: Open the flow or module and then archive it**

1. Log in to Amazon Connect with a user account that has the **Numbers and flows** - **Flows** - **Edit** permission in its security profile. If you are archiving a flow module, you need **Flow modules** - **Edit** permission.

1. On the navigation menu, choose **Routing**, **Flows**.

1. Open the flow or module you want to archive.

1. On the flow designer page, choose the dropdown menu, and then choose **Archive**, as shown in the following image.  
![\[The Archive option in the dropdown menu.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/contact-flow-archive.png)

1. Confirm you want to archive the flow or module.

1. To locate the archived flow or module, choose **View archive**.

**Option 2: Search for flow or module and then archive it**
+ On the **Flows** page, search for the flow or module you want archive, and then choose **Archive** from the **...** menu, as shown in the following image.  
![\[The Archive option in the dropdown menu.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/flow-archive-option2.png)

## Restore an archived flow or module
<a name="restore-flow"></a>

There are two ways you can restore flows or modules.

**Option 1: View list of archived flows or modules, and choose Restore**

1. Log in to the Amazon Connect admin website with a user account that has the **Numbers and flows** - **Flows** - **Edit** permission in its security profile. If you are restoring a flow module, you need **Flow modules** - **Edit** permission.

1. On the navigation menu, choose **Routing**, **Flows**.

1. On the **Flows** page, choose **View archive**.

   1. To restore archived modules, on the **Flows** page, choose the **Modules** tab, and then choose **View archive**.

1. On the **Flows Archive** page, next to the flow or module you want to restore, under **Actions**, choose **...** and then choose **Restore**. This option is shown in the following image.  
![\[The Amazon Connect Flows Archive page showing the restore option in the Actions menu for an archived flow.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/flow-restorearchive1.png)

**Option 2: Restore the archived flow or module from the flow designer**

1. Open the archived flow or module in the flow designer.

1. From the dropdown menu, choose **Restore**, as shown in the following image.  
![\[The Amazon Connect flow designer dropdown menu showing the Restore option for an archived flow.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/flow-restorearchive.png)

## Delete an archived flow or module
<a name="delete-flow"></a>

You can delete archived flows and modules manually by using the Amazon Connect admin website, or programmatically by using the [DeleteContactFlow](https://docs.aws.amazon.com/connect/latest/APIReference/API_DeleteContactFlow.html) API. 

**Warning**  
Deleted flows and modules cannot be restored. They are permanently deleted from your Amazon Connect instance.

**Option 1: View list of archived flows or modules, and choose Delete**

1. Log in to the Amazon Connect admin website with a user account that has the **Numbers and flows** - **Flows** - **Remove** permission in its security profile. If you are deleting a flow module, you need **Flow modules** - **Remove** permission.

1. On the navigation menu, choose **Routing**, **Flows**.

1. On the **Flows** page, choose **View archive**.

   1. To delete modules, on the **Flows** page, choose the **Modules** tab, and then choose **View archive**.

1. On the **Flows Archive** page, next to the flow or module you want to delete, under **Actions**, choose **...** and then choose **Delete**. 

1. Confirm that you want to delete the flow or module.

**Option 2: Delete the archived flow or module from the flow designer**

1. Open the archived flow or module in the flow designer.

1. From the dropdown menu, choose **Delete**.

1. Confirm that you want to delete the flow or module.

# Generate logs for published flows in Amazon Connect
<a name="logs"></a>

After your flow is published live, you can use flow logs to help analyze flows and quickly find errors your customers encounter. If needed, you can roll back to a previous version of the flow. 

For more information about using flow logs, see [Use flow logs to track events in Amazon Connect flows](about-contact-flow-logs.md). 

# Flow version control: Roll back a flow
<a name="flow-version-control"></a>

## View a previous version of a flow
<a name="how-to-view-previous-flows"></a>

This procedure is especially useful if you want to research how a flow has been changed over time. 

1. In the flow designer, open the flow you want to view.

1. Choose the **Latest: Published** dropdown to view a list of previously published versions of the flow.

   For default flows that are provided with your Amazon Connect instance, the oldest flow in the list is the original version. The date matches when your Amazon Connect instance was created. For example, in the following image, the original default flow is dated 07/21/22.  
![\[The Latest published dropdown box listing the dates the default agent hold was published.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/default-agent-hold-versioning.png)
**Note**  
For users with tag-based access controls configured on their security profile, the dropdown will be restricted to **Latest: Published** and **Latest: Saved** versions. To learn more about tag-based access controls in Amazon Connect, see [Apply tag-based access control in Amazon Connect](tag-based-access-control.md).

1. Choose the version of the flow to open and view it. You can view all the blocks and how they are configured.

1. Next, you can do one of the following: 
   + To return to the most recently published version, choose it from the **Latest: Published** dropdown list. 
   + Make changes to the previous version and choose **Save as** from the dropdown to save it with a new name. Or choose **Save** from the dropdown to assign the same name.   
![\[The Save dropdown box, the Save as option.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/default-agent-hold-saveas.png)
   + Or, choose **Publish** to return the previous version to production. 

## Roll back a flow
<a name="rollback"></a>

1. In the flow designer, open the flow you want to roll back.

1. Use the drop-down to choose the version of the flow you want to roll back to. If you choose **Latest**, it reverts the flow to the most recent published version. If there isn't a published version, it reverts to the most recent saved version. 
**Note**  
To see a consolidated view of all changes across all flows, click the **View historical changes** link at the bottom of the **Flows** page. You can filter to a specific flow by date or user name.

1. Choose **Publish** to push that version into production. 

# Best practices for flows in Amazon Connect
<a name="bp-contact-flows"></a>

Use the list of recommended best practices in this topic when you are using and creating flows.
+ Use consistent attribute naming conventions across all AWS services. Use camel case for yourAttributeNames to avoid confusion when passing and referencing variables. 
+ Use standard naming conventions for attribute names. Don't use spaces or special characters that could impact downstream reporting processes such as AWS Glue crawlers. 
+ Create modular flows. Make the flows as small as possible, and then combine modular flows into an end-to-end contact experience. This helps to keep your flows manageable, and you won't require numerous regression testing cycles.
+ When you set **User Defined** or **External** values in dynamic attribute fields, use only alphanumeric characters (A-Z, 0–9) and periods. No other characters are allowed.
+ Ensure all error branches are routed to a block that effectively handles the error or terminates the contact.
+ Use a **Set logging behavior** block to enable or disable logging for segments of the flow where sensitive information is collected and can't be stored in CloudWatch.
+ Ensure that attributes used in the flow are set and referenced correctly. If there are periods prepended to the attribute names, you are likely using JSONPath (\$1.) format while also selecting a variable type from the pick list. For example, using:
  + **Save text as attribute** and value `$.External.variableName` works as expected.
  + `Set dynamically` and value `variableName` works as expected.
  + **Set dynamically** and `$.External.variableName` results in a prepended period. 
+ Before transferring a call to agent and putting that call in a queue, ensure that **Check hours of operation** and **Check staffing** blocks are used. They verify that the call is within working hours and that agents are staffed to service.
+ Ensure that callbacks are offered before and after queue transfer by using **Check queue status** blocks. Include a condition for **Queue capacity** that is greater than X, where X is a number representing your expected queue capacity.
  + If queue capacity exceeds the expected capacity, use a **Get Customer Input** block to offer a callback. This retains the caller's position in the queue and calls them back when an agent is available.
  + In the **Set callback number** block, choose the number to be used to call the customer back in the CCP. Use **System** and **Customer Number** or a new number, collected by a **Store Customer Input** block, using **System** and **Stored customer input**.
  + Finally, add a **Transfer to queue** block. Configure it to **Transfer to callback queue** and configure the callback options to fit your specific use case.
+ Use a **Loop prompts** block in your Customer queue flow to interrupt with a queued callback and external transfer option at regular intervals. 
+ Ensure that all countries referenced in external transfers or used for outbound dialing are added to the service quota for your account/instance.
+ Ensure that all numbers referenced in external transfers are in E.164 format. Drop the national trunk prefix that you use when calling locally. This prefix would be the leading 0 for most of Europe, 1 for the US. The prefix is replaced by the country code. For example, the UK mobile number **07911 123456** in E.164 format is **\$144 7911 123456 (tel:\$1447911123456)**.
+ Ensure that there are no infinite loops in the flow logic. Also ensure that for each call, the flow connects the caller to an agent, bot, or transferred externally for further assistance.

# Contact initiation methods and flow types in your Amazon Connect contact center
<a name="contact-initiation-methods"></a>

Every contact in your Amazon Connect contact center is initiated by one of the following methods: 
+ INBOUND
+ OUTBOUND
+ TRANSFER
+ CALLBACK
+ API
+ QUEUE\$1TRANSFER
+ DISCONNECT
+ WEBRTC\$1API
+ EXTERNAL\$1OUTBOUND
+ MONITOR
+ AGENT\$1REPLY
+ FLOW
+ CAMPAIGN\$1PREVIEW

The initiation method is stored in the `InitiationMethod` field of the contact record. 

You can create flows appropriate for a given initiation method when you know which [types of flows ](create-contact-flow.md#contact-flow-types) the initiation method uses.

For each initiation method, this topic explains which types of flows are run.

## INBOUND
<a name="inbound-initiation-method"></a>

The customer initiated a voice (phone) contact with your contact center.
+ When the contact successfully connects with the phone number of your contact center, an [Inbound flow](create-contact-flow.md#contact-flow-types) is presented to caller.
+ During the transition in the **Inbound flow**, if the customer is put in a queue, a [Customer queue flow](create-contact-flow.md#contact-flow-types) is played to customer.
+ After the agent becomes available to handle the caller and accept the contact, a [Agent whisper flow](create-contact-flow.md#contact-flow-types) is played to the agent.
+ After a [Agent whisper flow](create-contact-flow.md#contact-flow-types) completes, a [Customer whisper flow](create-contact-flow.md#contact-flow-types) is played to customer.
+ After the both whisper flows are played successfully to the agent and the customer respectively, the caller gets connected to agent for interaction.

To summarize, for a simple inbound call, the following flow types are played before caller is connected to agent: 

1. **Inbound flow**

1. **Customer queue flow**

1. **Agent whisper flow**

1. **Customer whisper flow**

## OUTBOUND
<a name="outbound-initiation-method"></a>

An agent initiated voice (phone) contact to an external number, by using their CCP to make the call. 
+ As soon as the destination party picks the call, they are presented with an [Outbound whisper flow](create-contact-flow.md#contact-flow-types).
+ After an **Outbound whisper flow** successfully completes, the agent and the contact are connected for interaction.

Before the call is made, all the blocks before the first **Play prompt** are run. After the customer picks up, the first **Play prompt** and all the blocks after it are run. 

To summarize, an **Outbound flow** type is the only one involved in an outbound call initiated from Amazon Connect.

## TRANSFER
<a name="transfer-initiation-method"></a>

The contact was transferred by an agent to another agent or to a queue, using quick connects in the CCP. This results in a new contact record being created.

Before the agent transfers the contact to another agent or queue, all the flows involved in an INBOUND contact are run.
+ Agent to Agent transfer using Agent Quick Connect
  + After the agent transfers the inbound contact to another agent:
    + A [Agent transfer flow](create-contact-flow.md#contact-flow-types) is played to the source agent.
    + After the destination agent accepts the call, a [Agent whisper flow](create-contact-flow.md#contact-flow-types) is played to destination agent, and then a [Customer whisper flow](create-contact-flow.md#contact-flow-types) is played to source agent.
    + After all three flows are successfully run, the interaction begins between the source and destination agents.
    + During this whole process, the inbound caller is on hold and a [Customer hold flow](create-contact-flow.md#contact-flow-types) is played to the inbound caller during hold time.

    After the source agent is connected with destination agent, the source agent can do one of the following actions:
    + Choose **Join**. This joins all parties on the call: source agent, destination agent, and the customer are joined in a conference call.
    + Choose **Hold all**. This puts the destination agent and the customer on hold. 
    + Put destination agent on hold, so only the source agent can talk to the customer.
    + Choose **End call**. The source agent leaves the call but the destination agent and the customer are directly connected and continue talking.

  To summarize for an agent to agent transfer call, the following flow types are run:

  1. **Agent transfer flow**

  1. **Agent whisper flow** (played to the destination agent) 

  1. **Customer whisper flow** (played to the source agent) during whole this process

  1. **Customer hold flow** played to the original caller
+ Agent to Queue transfer using Queue Quick Connect
  + After the agent transfers the inbound call to another queue:
    + A [Queue transfer flow](create-contact-flow.md#contact-flow-types) is played to source agent.
    + After the agent from the transferred queue accepts the call, an [Agent whisper flow](create-contact-flow.md#contact-flow-types) is played to destination agent, and then a [Customer whisper flow](create-contact-flow.md#contact-flow-types) is played to source agent.
    + After these flows run, the source and destination agent interaction begins.
    + During this whole process, the inbound caller is on hold. A [Customer hold flow](create-contact-flow.md#contact-flow-types) is played to the inbound caller during the hold time.

    After the source agent is connected with destination agent, the source agent can do one of the following:
    + Choose **Join**. This joins all parties on the call: source agent, destination agent, and the customer are joined in a conference call.
    + Choose **Hold all**. This puts destination agent and the customer on hold.
    + Put destination agent on hold, so only the source agent can talk to the customer.
    + Choose **End call**. The source agent leaves the call but the destination agent and the customer are directly connected and continue talking.

  To summarize for agent to queue transfer call, the following flows are played: 

  1. **Queue transfer flow** 

  1. **Agent whisper flow** (played to the destination agent) 

  1. **Customer whisper flow** (played to the source agent) during whole this process

  1. **Customer hold flow** played to the original caller

## CALLBACK
<a name="callback-initiation-method"></a>

The customer is contacted as part of a callback flow. 
+ As soon as agent accepts the callback contact, an [Agent whisper flow](create-contact-flow.md#contact-flow-types) is played to the agent.
+ After the customer accepts the callback call, an [Outbound whisper flow](create-contact-flow.md#contact-flow-types) is played to customer.
+ After these two flows are played, the agent and customer are connected and can interact. 

To summarize, for callback contacts, the following flow types are played:
+ **Agent whisper flow**
+ **Outbound whisper flow**

## API
<a name="api-initiation-method"></a>

 The contact was initiated with Amazon Connect by API. This could be:

1. An outbound contact you created and queued to an agent using the [StartOutboundVoiceContact](https://docs.aws.amazon.com/connect/latest/APIReference/API_StartOutboundVoiceContact.html) API.

1. A live chat that was initiated by the customer with your contact center where you called the [StartChatContact](https://docs.aws.amazon.com/connect/latest/APIReference/API_StartChatContact.html) API.

1. A task that was initiated by calling the [StartTaskContact](https://docs.aws.amazon.com/connect/latest/APIReference/API_StartTaskContact.html) API.

Following is an example of an API initiated contact method:
+ After the outbound contact is successfully initiated using the [StartOutboundVoiceContact](https://docs.aws.amazon.com/connect/latest/APIReference/API_StartOutboundVoiceContact.html) API, an [Inbound flow](create-contact-flow.md#contact-flow-types) provided in the API request is played to the customer.
+ Depending on the configuration of the [Inbound flow](create-contact-flow.md#contact-flow-types), additional flows are played. For example, an [Inbound flow](create-contact-flow.md#contact-flow-types) transfers a customer to an agent for conversation. In this case, a [Customer queue flow](create-contact-flow.md#contact-flow-types) is played to customer while they waiting in queue for an agent.
+ When the available agent accepts the call, an [Agent whisper flow](create-contact-flow.md#contact-flow-types) is played to agent.
+ A [Customer whisper flow](create-contact-flow.md#contact-flow-types) is played to customer.
+ After both whisper flows are played successfully to the agent and customer respectively, the caller is connected to agent for interaction.

To summarize API initiation methods, the following flows are played before the customer is connected to agent:
+ **Inbound flow**
+ **Customer queue flow**
+ **Agent whisper flow**
+ **Customer whisper flow**

## QUEUE\$1TRANSFER
<a name="queue-transfer-initiation-method"></a>

While the customer was in one queue (listening to a [Customer queue flow](create-contact-flow.md#contact-flow-types)), they were transferred into another queue using a flow block.
+ The customer who is waiting in the queue for an agent is presented only with a [Customer queue flow](create-contact-flow.md#contact-flow-types). No additional flows are involved.

## DISCONNECT
<a name="disconnect-initiation-method"></a>

When a [Set disconnect flow](set-disconnect-flow.md) block runs, it specifies which flow to run after a disconnect event during a contact.
+ You can specify only an [Inbound flow](create-contact-flow.md#contact-flow-types) in this block. Since it occurs after the disconnect event, no additional flow is presented to customer.

## WEBRTC\$1API
<a name="webrtc-api-initiation-method"></a>

The contact used the communication widget to make an in-app voice/video call to an agent. This initiation method is created by the same flow types as the Inbound initiation method:

1. **Inbound flow**

1. **Customer queue flow**

1. **Agent whisper flow**

1. **Customer whisper flow**

## EXTERNAL\$1OUTBOUND
<a name="external-outbound-initiation-method"></a>

An agent initiated a voice (phone) contact with an external participant by using either a quick connect in the CCP or a flow block. No flow type is associated with this initiation method.

## MONITOR
<a name="monitor-initiation-method"></a>

A supervisor initiated the monitor feature on a contact connected to an agent. The supervisor can silently monitor the agent and customer, or barge the conversation. No flow type is associated with this initiation method.

## AGENT\$1REPLY
<a name="agent-reply-initiation-method"></a>

An agent has replied to an inbound email contact to create an outbound email reply. For this initiation method the **Outbound whisper flow** type is played. 

## FLOW
<a name="flow-initiation-method"></a>

An email was initiated by the [Send message](send-message.md) block. For this initiation method the **Outbound whisper flow** type is played. 

## CAMPAIGN\$1PREVIEW
<a name="campaign-preview-initiation-method"></a>

The contact was initiated by an outbound campaign using preview dialing mode. The agent previews customer information before the call is placed.

## Override the default contact flows
<a name="override-default-contact-flows"></a>

For all of the initiation methods discussed in this topic, if you don't specify flows for **Agent whisper flow**, **Customer whisper flow**, **Customer queue flow**, or **Outbound whisper flow**, then the default flow of that type runs instead. For a list of default flows, see [Default flows in Amazon Connect for your contact center](contact-flow-default.md).

To override the defaults and use your own flows, use the following blocks:
+ [Set customer queue flow](set-customer-queue-flow.md)
+ [Set hold flow](set-hold-flow.md)
+ [Set whisper flow](set-whisper-flow.md)

For more information, see [Default flows in Amazon Connect for your contact center](contact-flow-default.md). 

# Configure Amazon Nova Sonic Speech-to-Speech
<a name="nova-sonic-speech-to-speech"></a>

You can configure Amazon Nova Sonic as a Speech-to-Speech (S2S) model for a Conversational AI bot locale in Amazon Connect. With Speech-to-Speech, the bot converts customer speech directly into natural, expressive speech responses using Nova Sonic. Amazon Connect continues to manage orchestration, intents, and flows.

## Part 1: Configure Speech-to-Speech for a Bot Locale
<a name="configure-speech-to-speech-bot-locale"></a>

### Prerequisites
<a name="nova-sonic-prerequisites"></a>
+ A Conversational AI bot exists in Amazon Connect.
+ The locale you want to use with Nova Sonic is already created.
+ You have permissions to edit the bot configuration and build the language.

### Step 1: Open the Speech model configuration
<a name="open-speech-model-configuration"></a>

1. Sign in to the Amazon Connect admin website.

1. Choose **Bots**, then select the **Configuration** tab.

1. Select the locale you want to configure.

1. In the Speech model section, choose **Edit**.

![\[Amazon Nova Sonic Speech-to-Speech overview\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/nova-sonic-overview.jpg)


### Step 2: Select Speech-to-Speech
<a name="select-speech-to-speech"></a>

In the Speech model modal, open the Model type dropdown and choose **Speech-to-Speech**.

![\[Model type dropdown showing Speech-to-Speech option\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/nova-sonic-model-type.png)


### Step 3: Choose Amazon Nova Sonic
<a name="choose-amazon-nova-sonic"></a>

After selecting Speech-to-Speech, open Voice provider and select **Amazon Nova Sonic**. Then choose **Confirm**.

![\[Model type dropdown showing Speech-to-Speech option\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/nova-sonic-speech-to-speech.png)


### Step 4: Review Speech model status
<a name="review-speech-model-status"></a>

The Speech model card now shows Speech-to-Speech: Amazon Nova Sonic and displays a warning to select a Nova Sonic compatible voice in your Set voice block.

![\[Speech model modal with Amazon Nova Sonic selected\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/nova-sonic-provider-selection.png)


### Step 5: Build and activate the locale
<a name="build-activate-locale"></a>

If the locale shows **Unbuilt changes**, choose **Build language**. The new STT settings become active after a successful build.

## Part 2: Configure a Nova Sonic Compatible Voice in a Flow
<a name="configure-nova-sonic-voice-flow"></a>

After enabling Nova Sonic at the bot level, you must configure a matching Nova Sonic–compatible expressive voice in your flow using the Set voice block.

### Supported Nova Sonic Voices (Launch Set)
<a name="supported-nova-sonic-voices"></a>
+ Matthew (en-US, Masculine)
+ Amy (en-GB, Feminine)
+ Olivia (en-AU, Feminine)
+ Lupe (es-US, Feminine)

### Step 1: Add or open a Set voice block
<a name="add-set-voice-block"></a>

1. Open the target flow in the Flow designer.

1. Search for Set voice in the block library.

1. Drag a Set voice block onto the canvas or open an existing one.

![\[Speech model card showing Nova Sonic configuration\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/nova-sonic-speech-model-card.jpg)


### Step 2: Select Override and Generative speaking style
<a name="select-override-generative"></a>

In Other settings, choose **Override speaking style** and select **Generative** to enable Nova Sonic expressive output.

![\[Set voice block configuration\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/nova-sonic-set-voice-block.png)


### Step 3: Select a Nova Sonic compatible voice
<a name="select-nova-sonic-voice"></a>

1. Set Voice provider to **Amazon**.

1. Under Language, select the locale that corresponds to the voice you want.

1. Under Voice, select one of the Nova Sonic–compatible voices.

![\[Override speaking style set to Generative\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/nova-sonic-generative-style.png)


### Step 4: Review selected voice
<a name="review-selected-voice"></a>

The Set voice block now shows the selected voice and style, such as Voice: Matthew (Generative).

![\[Set necessary fields for Sonic\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/nova-sonic-voice-selection.png)


### Step 5: Save and publish the flow
<a name="save-publish-flow"></a>

Choose **Save**, then **Publish** to activate the configuration.

## Part 3: Configure Nova Sonic–Only and Beta Voices Using Session Attributes
<a name="configure-nova-sonic-beta-voices"></a>

You can configure Nova Sonic–only voices and beta voices for your Amazon Connect Conversational AI bot. These voices are supported by Nova Sonic Speech-to-Speech (S2S) but are not available as Amazon Polly TTS voices. Because they are not surfaced in the Set voice block, you must configure them using session attributes in the Get Customer Input (GCI) block.

When you use a Nova Sonic–only or beta voice, Amazon Connect will generate Nova Sonic expressive audio for that segment. However, any prompts rendered using Amazon Polly in the same flow may sound inconsistent, because Polly does not support these voices. Choose this option only if you are comfortable with this variability.

### Step 1: Add a GCI block to your flow
<a name="add-gci-block"></a>

Open the flow that interacts with your Nova Sonic bot. In the block library, search for **GCI** and drag the block into the designer.

![\[GCI block in flow designer\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/nova-sonic-beta-gci-block.png)


### Step 2: Select Amazon Lex in the GCI block configuration
<a name="select-amazon-lex-gci"></a>

In the GCI block configuration panel, select **Amazon Lex**.

![\[Amazon Lex selected in GCI configuration\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/nova-sonic-beta-select-lex.png)


### Step 3: Set the bot and alias
<a name="set-bot-alias"></a>

Choose the bot and alias that is configured to use Speech-to-Speech: Amazon Nova Sonic.

![\[Bot and alias configuration\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/nova-sonic-beta-bot-alias.png)


### Step 4: Add a session attribute override
<a name="add-session-attribute"></a>

In the Lex Configuration, scroll to **Session attributes** and choose **Add an attribute**.

![\[Session attributes configuration\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/nova-sonic-beta-session-attributes.png)


### Step 5: Set the override key and beta voice name
<a name="set-override-key-voice"></a>

Use the following key to override the default S2S voice: **x-amz-lex:audio:speaker-model-voice-override**

For the value, enter the Nova Sonic–only or beta voice ID. The value must match the exact case expected by the model. For example, the following sets the voice to **tiffany**.

After adding the key and value, choose **Confirm**.

![\[Override key and voice value configured\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/nova-sonic-beta-override-key.png)


### Runtime behavior
<a name="runtime-behavior"></a>
+ Nova Sonic uses the Nova Sonic–only or beta voice for the duration of the session.
+ If the session later reaches a Set voice block using Amazon Polly, the audio may switch back to the Polly voice.

### Troubleshooting
<a name="troubleshooting-nova-sonic"></a>
+ **Voice not applied:** Confirm that the voice ID is typed exactly as required (case sensitive).
+ **Unexpected voice switching:** Ensure no downstream Set voice block uses a Polly voice.
+ **No S2S response:** Verify that the locale is configured for Speech-to-Speech: Amazon Nova Sonic.

# Attach a claimed or ported phone number to a flow in Amazon Connect
<a name="associate-claimed-ported-phone-number-to-flow"></a>

After you publish a flow, you can attach a [claimed](get-connect-number.md) or [ported](port-phone-number.md) phone number to it. When a contact calls the phone number that you associate with a flow, they are connected to that flow.

**To associate a claimed or ported phone number with a published flow**

1. Log in to your Amazon Connect instance (https://*instance name*.my.connect.aws/) with an Admin account or a user account that has **Phone number - Edit** permissions in it's [security profile](connect-security-profiles.md). (To find the name of your instance, see [Find your Amazon Connect instance ID or ARN](find-instance-arn.md).)

1. On the navigation menu, choose **Channels**, **Phone numbers**.

1. Locate the phone number to associate with the flow in the list. Click the phone number to open the **Edit Phone number** page. The following image shows a sample phone number that you would click.  
![\[A sample phone number on the Phone number page.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/click-on-phone-number.png)

1. On the **Edit Phone number** page, do the following:

   1. (Optional) Edit the description for the phone number.

   1. For **Flow / IVR**, select the flow. Note that only published flows are included in this list.

   1. Choose **Save**.

# Flow modules for reusable functions in Amazon Connect
<a name="contact-flow-modules"></a>

Flow modules are reusable sections of a flow. You can create them to extract repeatable logic across your flows, and create common functions. For example:

1. You can create a module that sends SMS text messages to customers.

1. You can invoke the module in flows that handle situations where customers want to reset their passwords, check their bank balances, or receive a one-time password.

Following are the benefits of using modules:
+ Simplify managing common functionality across flows. For example, an SMS module could validate the format of phone number, confirm SMS opt-in preferences, and integrate with an SMS service, such as Amazon Pinpoint.
+ Makes it more efficient to maintain flows. For example, you can quickly propagate changes across all flows that invoke a flow module.
+ Helps separate flow designer responsibilities. For example, you can have both technical module designers and non-technical flow designers.
+ Support for more reusable and dynamic experiences with flow modules. For example, you can define a module with custom input/output objects and branches to be reused across different contact flow use cases.
+ Easier flow module management. You can create multiple immutable versions of your modules to track and test changes effectively. Additionally, you can create aliases that point to specific versions, allowing you to update aliases as needed to implement changes across all contact flows that reference them.

## Where you can use modules
<a name="where-to-use-modules"></a>

You can use modules in any flow that is [type](create-contact-flow.md#contact-flow-types) **Inbound flow**. 

The following types of flows do not support modules: **Customer queue**, **Customer hold**, **Customer whisper**, **Outbound whisper**, **Agent hold**, **Agent whisper**, **Transfer to agent**, ** Transfer to queue**. 

## Limitations
<a name="modules-limits"></a>
+ Modules do not allow overriding flow local data of the invoking flow. This means you can't use the following with modules:
  + External attributes
  + Amazon Lex attributes
  + Customer Profiles attributes
  + Connect AI agents attributes
  + Queue metrics
  + Stored customer input
+ Modules do not allow invoking another module.

To pass any data to a module, or to get any data from a module, you need to pass and retrieve attributes.

For example, you want data that is written from Lambda (an External attribute) and pass it to the module so you can make a decision. Your Lambda identifies whether the customer is a VIP member. You need that information inside the module because if they are a VIP member, you want to play a prompt thanking them for their membership. Since default Lambda is not available inside a module, you use attributes to pass and retrieve data. 

## Security profile permissions for modules
<a name="module-permissions"></a>

Before you can add modules to Inbound flows, you must have permissions in your security profile. By default, the **Admin** and **CallCenterManager** security profiles have these permissions.

## Create basic module
<a name="use-modules"></a>

For information about the number of modules that you can create for each Amazon Connect instance, see [Amazon Connect service quotas](amazon-connect-service-limits.md).

1. Log in to the Amazon Connect console with an account assigned to a security profile that has permissions to create modules.

1. On the navigation menu, choose **Routing**, **Contact flows**.

1. Choose **Modules**, **Create flow module**. 

1. (optional) In the **Details** tab, you can enter description and add up 50 tags for the module.

1. In the **Designer** tab, add the blocks that you want to your module. When finished, choose **Publish**. This makes the module available to use in other modules and flows.

## Add a module to a flow
<a name="add-modules"></a>

1. Log in to the Amazon Connect console with an account assigned to a security profile that has permissions to create flows. You don't need permissions to create modules.

1. On the navigation menu, choose **Routing**, **Contact flows**.

1. Choose **Create flow** and select any flow type. 

1. To add a module, go to the **Integrate** section, and choose **Invoke flow module**. 

1. When you're finished creating your flow, choose **Publish**. 

## Example module
<a name="example-module"></a>

This module shows how to get a random fun fact by invoking a Lambda function. The module uses a contact attribute (`$.Attributes.FunFact`) to retrieve the fun fact. Flows that invoke this module can play a FunFact to customers, depending on their incoming contact type. 

The inbound flows in your instance can invoke this common module and get the fun fact.

Following is an image of the FunFact module:

![\[The funfact module in the flow designer.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/module-example1.png)


Following is an image of the FunFactSampleFlow that invokes the module:

![\[The funfactsampleflow in the flow designer.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/module-example2.png)


## Module versioning and aliasing
<a name="module-versioning-aliasing"></a>

To improve maintenance efficiency and reduce deployment risks, versioning and aliasing are supported for modules. Module versions are Immutable snapshots to ensure each module version remains unchanged, providing consistency and reliability. Module aliases allows you to assign descriptive names to versions for easier identification and management. Latest revision tracking automatically updates to the newest version when you invoke a module and select \$1.LATEST as the alias.

### Create version for modules
<a name="create-module-version"></a>

You can create versions of your modules to track changes and maintain different iterations.

![\[Creating a version for a module in the console.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/module-version-create.png)


### Create alias for modules
<a name="create-module-alias"></a>

You can create aliases that point to specific module versions for easier management.

![\[Creating an alias for a module in the console.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/module-alias-create.png)


### View specific version or alias of modules
<a name="view-module-version-alias"></a>

You can view specific versions or aliases of your modules in read-only mode.

![\[Viewing module versions in the console.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/module-version-view1.png)


![\[Viewing module aliases in the console.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/module-version-view2.png)


Click on the specific version or alias to view the modules in read-only mode:

![\[Read-only view of a specific module version.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/module-readonly-view.png)


### Use module versions and alias in flows
<a name="use-module-versions-alias"></a>

You can reference specific module versions or aliases when invoking modules in your flows.

![\[Using module versions and aliases in flows.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/module-use-in-flows.png)


## Create custom block module
<a name="create-custom-block-module"></a>

You can begin creating a custom block module by navigating to the Settings tab of your new or existing flow module. Here, you can configure input and output data types for your module. While the input/output schemas default to Object type, you have flexibility to define other data types for properties within the root input and output schemas, the following data types are supported: String, Number, Integer, Boolean, Object, Array, and Null.

### Configure custom block module
<a name="configure-custom-block-module"></a>

You can start creating custom block module by navigating the **Settings** tab of your new or existing flow module, you can configure any data type of input and output for your module, however, the input/output schema are Object type by default. For properties under the root input and output schema, data types supported are String, Number, Integer, Boolean, Object, Array, and Null.

You can use **Designer** mode to create input and output model structure or you can use **JSON schema** to define them.

![\[Designer mode for custom block module configuration.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/module-custom-designer.png)


![\[JSON schema mode for custom block module configuration.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/module-custom-json.png)


You can define up to 8 custom branches for your module.

![\[Custom branches configuration for modules.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/module-custom-branches.png)


### Accessing module related attributes
<a name="accessing-module-attributes"></a>

As part of custom blocks module enhancement, a new namespace Module is introduced for you to access module inputs within a module, output and results from flows or modules that were calling the module. You can store these attributes using [Flow block in Amazon Connect: Set contact attributes](set-contact-attributes.md) block or directly use these attributes via JSONPath reference. See [List of available contact attributes in Amazon Connect and their JSONPath references](connect-attrib-list.md) documentation on details of module attributes.

### Example custom block module
<a name="example-custom-block-module"></a>

This module shows how to get customers authenticated based on their provided phone number and PIN by invoking Lambda functions. The module takes an input as phone number and outputs the customerId, customerName, and customerEmail. The module also supports 2 custom branch which are authenticated and unauthenticated. Flows that invoke this module can simply pass in a phone number to authenticate customers and get basic customer information for further actions.

Following is an image of the Authentication module with settings:

![\[Authentication module settings - input configuration.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/module-auth-settings1.png)


![\[Authentication module settings - output configuration.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/module-auth-settings2.png)


![\[Authentication module settings - branches configuration.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/module-auth-settings3.png)


![\[Authentication module settings - summary view.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/module-auth-settings4.png)


Following is an image of a sample customer support flow that invokes the module to authenticate the customer using a phone number:

![\[Sample customer support flow using the authentication module.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/module-auth-flow-example.png)


## Create module as tools
<a name="create-module-as-tools"></a>

To enable Flow Modules to be invoked outside of a Flow by various systems as independent execution units, expanding their utility and supporting powerful use cases with established automation tools such as Q in Connect, where AI Agents can use modules as tools to fulfill actions identified during customer service interactions, such as executing payment workflows and automated task workflows. This approach allows you to define business logic once as modules and execute it across multiple channels and contexts, ensuring consistency while reducing development overhead.

### Create new module as tool
<a name="create-new-module-as-tool"></a>

![\[Create new module as tool interface\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/module-as-tool-create-new.png)


### Create module as tool from existing module
<a name="create-module-tool-from-existing"></a>

![\[Create module as tool from existing module interface\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/module-as-tool-from-existing.png)


### Module as tool supported blocks
<a name="module-tool-supported-blocks"></a>

When you are creating a new tool module, you will only see supported list of blocks from the block library to build your module. For converting your existing module as tool, you will see which are your existing blocks that are not supported in a tool module. The following list of blocks are supported for module as tool.


| Blocks | 
| --- | 
| Cases | 
| ChangeRoutingPriority | 
| CheckCallProgress | 
| CheckContactAttributes | 
| CheckHoursOfOperation | 
| CheckQueueStatus | 
| CheckStaffing | 
| CheckVoiceId | 
| CreatePersistentContactAssociation | 
| CreateTask | 
| CustomerProfiles | 
| DataTable | 
| DistributeByPercentage | 
| GetQueueMetrics | 
| InvokeFlowModule | 
| InvokeLambdaFunction | 
| InvokeThirdPartyAction | 
| Loop | 
| Resume | 
| ResumeContact | 
| Return | 
| SendMessage | 
| SetAttributes | 
| SetCallbackNumber | 
| SetCustomerQueueFlow | 
| SetDisconnectFlow | 
| SetEventHook | 
| SetHoldFlow | 
| SetLoggingBehavior | 
| SetQueue | 
| SetRecordingAndAnalyticsBehavior | 
| SetRoutingCriteria | 
| SetRoutingProficiency | 
| SetVoice | 
| SetVoiceId | 
| SetWhisperFlow | 
| SetWisdomAssistant | 
| TagContact | 

# Enable agent-initated flows during active chat sessions
<a name="agent-initiated-flows"></a>

Agent-initiated workflows are interactive workflows that agents can trigger during active chat sessions with customers. This feature enables agents to send forms for data collection, process payments, update customer profiles, and initiate automated processes while maintaining direct interaction with customers within the chat experience.

## Benefits
<a name="agent-initiated-flows-benefits"></a>

Agent-initiated flows provides the following benefits:
+ Simplify customer task completion by keeping interactions within the chat interface
+ Enable agents to provide real-time assistance during form completion
+ Support sensitive data collection through Show View blocks with [sensitive data configuration options](https://aws.amazon.com/about-aws/whats-new/2024/12/amazon-connect-collect-sensitive-customer-data-chats/)

## Where you can use agent-initiated flows
<a name="agent-initiated-flows-channels"></a>

You can use agent-initiated flows in chat channels, including:
+ Web chat
+ SMS
+ WhatsApp Business
+ Apple Messages for Business

Voice and other channels are not currently supported.

## Limitations
<a name="agent-initiated-flows-limitations"></a>
+ The supported Quick Connect "FLOW" type only work for chat channels (web chat, SMS, WhatsApp Business, Apple Messages for Business).
+ Only [Inbound Flows](https://docs.aws.amazon.com/connect/latest/adminguide/sample-inbound-flow.html) are supported
+ Transfers and adding new participants will not work during an ongoing agent-initiated workflow. The workflow needs to be either completed or cancelled before adding a new agent or contact.
+ Only one agent-initiated flow can execute at a time per contact
+ The following flow blocks are not supported: [https://docs.aws.amazon.com/connect/latest/adminguide/connect-assistant-block.html](https://docs.aws.amazon.com/connect/latest/adminguide/connect-assistant-block.html), [https://docs.aws.amazon.com/connect/latest/adminguide/authenticate-customer.html](https://docs.aws.amazon.com/connect/latest/adminguide/authenticate-customer.html), [https://docs.aws.amazon.com/connect/latest/adminguide/create-persistent-contact-association-block.html](https://docs.aws.amazon.com/connect/latest/adminguide/create-persistent-contact-association-block.html), [https://docs.aws.amazon.com/connect/latest/adminguide/get-customer-input.html](https://docs.aws.amazon.com/connect/latest/adminguide/get-customer-input.html)
+ Limited to 10 Agent-initiated flows per Chat

## Security profile permissions for agent-initiated flows
<a name="agent-initiated-flows-permissions"></a>

Before you can create agent-initiated flows, you must have permissions in your security profile.

The required permissions are:
+ **Channels and flows - Views**
+ **Routing - Quick Connects**

![\[Security profile permissions for agent-initiated flows\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/agent-initiated-flows-security-profile.png)


## Create Quick Connect for agent-initiated flow
<a name="agent-initiated-flows-create-quick-connect"></a>

1. On the navigation menu, choose **Routing**, **Quick connects**.

1. Choose **Add new**.

1. For **Type**, select **Flow**.

1. Select a specific **Inbound Flow** for agents to send.

1. Choose **Save**.

![\[Create Quick Connect for agent-initiated flow\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/agent-initiated-flows-quick-connect-config.png)


## Associate Quick Connect with queue
<a name="agent-initiated-flows-associate-queue"></a>

1. On the navigation menu, choose **Routing**, **Queues**.

1. Select the queue where agents will use this flow.

1. In the **Quick connects** section, add your Quick Connect.

1. Choose **Save**.

![\[Associate Quick Connect with queue\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/agent-initiated-flows-add-quick-connect.png)


For additional details on quick connects, see [Create quick connects in Amazon Connect](quick-connects.md).

## Send Form to Customer
<a name="agent-initiated-flows-send-form"></a>

1. On **agent control panel**, select the **Quick connect** button at the action bar

1. On the selection menu, choose the appropriate form

1. Select **Add to chat**

![\[Agent control panel Quick connect button\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/agent-initiated-flows-agent-example-1.png)


![\[Select form and Add to chat\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/agent-initiated-flows-agent-example-2.png)


When the form is active, the agent may cancel the workflow. Agents will see events for the status of the workflow.

![\[Active workflow status\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/agent-initiated-flows-agent-example-3.png)


![\[Workflow events for agent\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/agent-initiated-flows-agent-example-4.png)


## Receive Form from Agent
<a name="agent-initiated-flows-receive-form"></a>
+ Customer will receive the respective form to fill out
+ Customers and agents continue ongoing conversation during the active form
+ Upon submission, the agent will be notified through new events

![\[Customer receives form\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/agent-initiated-flows-customer-example-1.png)


![\[Form submission notification\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/agent-initiated-flows-customer-example-2.png)


# Create prompts in Amazon Connect
<a name="prompts"></a>

Prompts are audio files played in call flows. For example, hold music is a prompt. Amazon Connect comes with a set of prompts that you can add to your flows. Or, you can add your own recordings. 

We recommend that you align your prompts and routing policies with each other to ensure a smooth call flow for customers.

You can create and manage prompts by using the Amazon Connect admin site as described in the topics in this section. Or you can use the [Prompt actions](https://docs.aws.amazon.com/connect/latest/APIReference/prompts-api.html) documented in the *Amazon Connect API Reference Guide*. 

**Topics**
+ [How to create prompts](#howto-prompts)
+ [

## Supported file types
](#supported-file-types-for-prompts)
+ [

## Maximum length for prompts
](#max-length-for-prompts)
+ [

## Bulk upload of prompts not supported in UI, API, or CLI
](#bulk-upload-prompts)
+ [

# Add text-to-speech to prompts in flow blocks in Amazon Polly
](text-to-speech.md)
+ [Create dynamic text strings in Play prompt blocks](create-dynamic-text-strings.md)
+ [

# Dynamically select which prompts to play in Amazon Connect
](dynamically-select-prompts.md)
+ [

# Set up prompts to play from an S3 bucket in Amazon Connect
](setup-prompts-s3.md)
+ [

# Choose the text-to-speech voice and language for audio prompts in Amazon Connect
](voice-for-audio-prompts.md)
+ [

# Use SSML tags to personalize text-to-speech in Amazon Polly
](ssml-prompt.md)
+ [

# SSML tags in an Amazon Connect chat conversation
](chat-and-ssml-tags.md)
+ [

# SSML tags supported by Amazon Connect
](supported-ssml-tags.md)

## How to create prompts
<a name="howto-prompts"></a>

This topic explains how to use the Amazon Connect admin website to create prompts. To create prompts programmatically, see [CreatePrompt](https://docs.aws.amazon.com/connect/latest/APIReference/API_CreatePrompt.html) in the *Amazon Connect API Reference Guide*. 

1. Log in to Amazon Connect using an account that has the following security profile permission:
   + **Numbers and flows**, **Prompts - Create**

1. On the navigation menu, choose **Routing**, **Prompts**.

1. On the **Prompts** page, choose **Add prompt**.

1. On the **Add Prompt** page, enter a name for the prompt. 

1. In the **Description** box, describe the message. We recommend using this box to provide a detailed description of the prompt. It is helpful for accessibility.

1. Choose the following actions:
   + **Upload**—Select **Choose File** to upload a .wav file that you have legal permission to use. 
   + **Record**—Choose **Start recording** and speak into your microphone to record a message. Choose **Stop recording** when you're finished. You can choose **Crop** to cut sections of the recorded prompt or choose **Clear recording** to record a new prompt.

1. In the **Prompt Settings** section, enter any tags you want to use to manage the prompt. 

   For example, you may have a department that manages prompts for greetings. You can tag those prompts so users can focus on only those recordings that pertain to them. 

1. Optionally, add tags to identify, organize, search for, filter, and control who can access this prompt. For more information, see [Add tags to resources in Amazon Connect](tagging.md).

Use the filters on the **Prompts** page to filter the list of prompts by **Name**, **Description**, and **Tags**. To copy the full Amazon Resource Name (ARN) of a prompt with just one click, choose the **Copy** icon. When you [set up dynamic prompts in a flow](dynamically-select-prompts.md), you'll need to enter the full ARN of the prompt. 

![\[The prompts page, the filter options, the copy ARN option.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/prompts-filter.png)


## Supported file types
<a name="supported-file-types-for-prompts"></a>

You can upload a pre-recorded .wav file to use for your prompt, or record one in the web application.

We recommend using 8 KHz .wav files that are less than 50 MB and less than 5 minutes long. If you use higher rated audio libraries, such as 16 KHz files, Amazon Connect has to down sample them into 8 KHz samples because of PSTN limitations. This may result in low quality audio. For more information, see the following Wikipedia article: [G.711](https://en.wikipedia.org/wiki/G.711). 

## Maximum length for prompts
<a name="max-length-for-prompts"></a>

Amazon Connect supports prompts that are less than 50 MB and less than 5 minutes long. 

## Bulk upload of prompts not supported in UI, API, or CLI
<a name="bulk-upload-prompts"></a>

Currently, bulk uploading of prompts is not supported through the Amazon Connect console or programmatically using the API or CLI.

# Add text-to-speech to prompts in flow blocks in Amazon Polly
<a name="text-to-speech"></a>

You can enter text-to-speech prompts in the following flow blocks: 
+ [Get customer input](get-customer-input.md) 
+ [Loop prompts](loop-prompts.md)
+ [Play prompt](play.md)
+ [Store customer input](store-customer-input.md)

## Amazon Polly converts text-to-speech
<a name="amazon-polly-default-voice-free"></a>

To convert text-to-speech, Amazon Connect uses Amazon Polly, a service that converts text into lifelike speech using SSML. 
+ Amazon Polly default voices such as Amazon Polly Neural and Standard voices are **free**. 
+ You will be charged for using the Amazon Polly Generative voices. For more details on pricing, see the [Amazon Polly Pricing Details](https://aws.amazon.com/polly/pricing/)
+ If you are onboarded to [Next Gen Amazon Connect](https://docs.aws.amazon.com/connect/latest/adminguide/enable-nextgeneration-amazonconnect.html), the Generative voices are included as part of the Next Gen Amazon Connect pricing.
+ You are also charged for using custom voices such as unique [ Brand Voices](https://aws.amazon.com/blogs/machine-learning/build-a-unique-brand-voice-with-amazon-polly/) that are associated with your account.

## Amazon Polly best sounding voice
<a name="amazon-polly-best-sounding-voice"></a>

Amazon Polly periodically releases improved voices and speaking styles. You can choose to automatically resolve your text-to-speech to the most lifelike and natural sounding variant of a voice. For example, if your flows use Joanna, Amazon Connect automatically resolves to Joanna's conversational speaking style. 

**Note**  
If no Neural version is available, Amazon Connect defaults to the standard voice. 

**To automatically use the best sounding voice**

1. Open the Amazon Connect console at [https://console.aws.amazon.com/connect/](https://console.aws.amazon.com/connect/).

1. If prompted to login, enter your AWS account credentials.

1. Choose the name of the instance from the **Instance alias** column.  
![\[The Amazon Connect virtual contact center instances page, the instance alias.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/instance.png)

1. In the navigation pane, choose **Flows**.

1. In the Amazon Polly section, choose **Use the best available voice**.

## How to add text-to-speech
<a name="add-tts"></a>

1. In a flow, add the block that will play the prompt. For example, add a [Play prompt](play.md) block. 

1. In the **Properties**, choose **Text-to-speech**. 

1. Enter plain text. For example, the following image shows *Thank you for calling*.   
![\[A message in the text-to-speech box.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/play-prompt-sample-tts.png)

   Or enter SSML, as shown in the following image:  
![\[A message formatted with SSML in the text-to-speech box.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/play-prompt-sample-ssml.png)

SSML-enhanced input text gives you more control over how Amazon Connect generates speech from the text you provide. You can customize and control aspects of speech such as pronunciation, volume, and speed.

For a list of SSML tags you can use with Amazon Connect, see [SSML tags supported by Amazon Connect](supported-ssml-tags.md). 

For more information about Amazon Polly, see [Using SSML](https://docs.aws.amazon.com/polly/latest/dg/ssml.html) in the Amazon Polly Developer Guide.

# Create dynamic text strings in Play prompt blocks in Amazon Connect
<a name="create-dynamic-text-strings"></a>

Use a [Play prompt](play.md) block to use an audio file to play as a greeting or message to callers. You can also use contact attributes to specify the greeting or message delivered to callers. To use the values of a contact attribute to personalize a message for a customer, include references to stored or external contact attributes in the text-to-speech message. 

For example, if you retrieved the customer’s name from a Lambda function, and it returns values from your customer database for FirstName and LastName, you could use these attributes to say the customer’s name in the text-to-speech block by including text similar to the following:
+ Hello \$1.External.FirstName \$1.External.LastName, thank you for calling.

This message is shown in the following image of the text-to-speech box of the [Play prompt](play.md) block.

![\[A message that contains attributes in the text-to-speech box.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/play-prompt-attribute.png)


Alternatively, you could store the attributes returned from the Lambda function using a **Set contact attributes** block, and then reference the user-defined attribute created in the text-to-speech string.

If you are referencing a user-defined attribute that was previously set as a contact attribute in the flow using the API, you can reference the attribute using the \$1.Attributes.nameOfAttribute syntax. 

For example, if the contact in question has attributes "FirstName" and "LastName" set previously, reference them as follows:
+ Hello \$1.Attributes.FirstName \$1.Attributes.LastName, thank you for calling.

## Resolution using backticks
<a name="w2aac18c29c21c23"></a>

You can also use backticks (`) to resolve keys dynamically. For example, suppose you retrieve a customer's name from a Lambda function that returns FirstName and LastName values from your customer database. If the customer's preference for which name to use is stored in \$1.Attributes.NameToPlay, you can dynamically select the appropriate name by enclosing the dynamic key in backticks (`). 
+ Hello \$1.External.['`\$1.Attributes.NameToPlay`'], thank you for calling.

# Dynamically select which prompts to play in Amazon Connect
<a name="dynamically-select-prompts"></a>

You can dynamically select which prompt to play by using an attribute.

1. Add [Set contact attributes](set-contact-attributes.md) blocks to your flow. Configure each one to play the appropriate audio prompt. For example, the first one might play the .wav file when your contact center is open. The second one might play the .wav file for when it's closed.

   The following image shows how you might configure a [Set contact attributes](set-contact-attributes.md) block. In this example, the user-defined attribute is named **CompanyWelcomeMessage**. You can name your attribute anything you want.  
![\[The properties page of the set contact attributes block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/play-prompt-properties-2-a-new.png)

1. In the [Play prompt](play.md) block, choose **User Defined**, and then enter the name of the attribute that you created in step 1, as shown in the following image.  
![\[The properties page of the Play prompt block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/play-prompt-properties2.png)

1. Connect the [Set contact attributes](set-contact-attributes.md) blocks to the **Play prompt** block. The following example shows how it might look if you added one of each block to test how this works.   
![\[A flow with the set contact attributes block connected to the play prompt.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/play-prompt-properties-2-b.png)

# Set up prompts to play from an S3 bucket in Amazon Connect
<a name="setup-prompts-s3"></a>

When you configure prompts on the [Get customer input](get-customer-input.md), [Loop prompts](loop-prompts.md), [Play prompt](play.md), or [Store customer input](store-customer-input.md) blocks, you can choose an S3 bucket as the source location. You can store as many voice prompts as needed in an S3 bucket and access them in real time by using contact attributes. For examples, see the [Play prompt](play.md) block. 

## Requirements
<a name="format-prompts-s3"></a>
+ **Supported formats**: Amazon Connect supports .wav files to use for your prompt. You must use .wav files that are 8KHz, and mono channel audio with U-Law encoding. Otherwise, the prompt won't play correctly. You can use publicly available third-party tools to convert your .wav files to U-Law encoding. After converting the files, upload them to Amazon Connect.
+ **Size**: Amazon Connect supports prompts that are less than 50MB and less than five minutes long.
+ **For Regions that are disabled by default** (also called [opt-in](https://docs.aws.amazon.com/general/latest/gr/rande-manage.html) Regions) such as Africa (Cape Town), your bucket must be in the same Region.

## Update the S3 bucket policy
<a name="bucket-policy-prompts-s3"></a>

To allow Amazon Connect to play prompts from an S3 bucket, when you set up your S3 bucket, you must update the bucket policy to grant `connect.amazonaws.com` (the Amazon Connect service principal) permission to call `s3:ListBucket` and `s3:GetObject`. 

**To update the S3 bucket policy:**

1. Go to the Amazon S3 admin console. 

1. Choose the bucket that has your prompts.

1. Choose the **Permissions** tab.

1. In the **Bucket policy** box, choose **Edit**, and paste the following policy as your template. Replace the bucket name, Region, AWS account ID, and [instance ID](find-instance-arn.md) with your own information, and then choose **Save changes**. 

------
#### [ JSON ]

****  

   ```
   {
       "Version":"2012-10-17",		 	 	 
       "Statement": [
           {
               "Sid": "statement1",
               "Effect": "Allow",
               "Principal": {
                   "Service": "connect.amazonaws.com"
               },
               "Action": [
                   "s3:ListBucket",
                   "s3:GetObject"
               ],
               "Resource": [
                   "arn:aws:s3:::amzn-s3-demo-bucket1",
                   "arn:aws:s3:::amzn-s3-demo-bucket1/*"
               ],
               "Condition": {
                   "StringEquals": {
                       "aws:SourceAccount": "123456789012",
                       "aws:SourceArn": "arn:aws:connect:region:123456789012:instance/instance-id"
                   }
               }
           }
       ]
   }
   ```

------

1. Encryption: Amazon Connect cannot download and play prompts from an S3 bucket if an AWS managed key is enabled on that S3 bucket. However, you can use a customer managed key to allow the Amazon Connect service principal ("connect.amazonaws.com") that enables your Amazon Connect instance to access the S3 bucket. See the following code snippet:

   ```
   {
               "Sid": "Enable Amazon Connect",
               "Effect": "Allow",
               "Principal": {
                   "Service": "connect.amazonaws.com"
               },
               "Action": "kms:decrypt",
               "Resource": [
               	"arn:aws:kms:region:account-ID:key/key-ID"
               ]
   }
   ```

   The following image shows where you place the code on the **Key policy** tab on the AWS Key Management Service console.  
![\[The KMS page where you add the key policy.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/contact-flow-prompts-s3.png)

   For information on how to find the key ID, see [Finding the key ID and key ARN](https://docs.aws.amazon.com/kms/latest/developerguide/find-cmk-id-arn.html) in the *AWS Key Management Service Developer Guide*. 

After you set up your S3 bucket with the required bucket policy, configure [Get customer input](get-customer-input.md), [Loop prompts](loop-prompts.md), [Play prompt](play.md), or [Store customer input](store-customer-input.md) to play a prompt from the bucket.

**Tip**  
For more information about S3 buckets, including examples and limitations, see the [Play prompt](play.md) block.

# Choose the text-to-speech voice and language for audio prompts in Amazon Connect
<a name="voice-for-audio-prompts"></a>

You select the text-to-speech voice and language in the [Set voice](set-voice.md) block. 

You can also use SSML in Amazon Lex bots to modify the voice used by a chat bot when interacting with your customers. For more information about using SSML in Amazon Lex bots, see [Managing Messages](https://docs.aws.amazon.com/lex/latest/dg/howitworks-manage-prompts.html#msg-prompts-response) and [Managing Conversation Context](https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#special-response) in the Amazon Lex Developer Guide.

**Tip**  
If you enter text that isn't supported for the Amazon Polly voice you are using, it won't be played. However, any other supported text in the prompt will be played. For a list of supported languages, see [Languages Supported by Amazon Polly](https://docs.aws.amazon.com/polly/latest/dg/SupportedLanguage.html).

# Use SSML tags to personalize text-to-speech in Amazon Polly
<a name="ssml-prompt"></a>

When you add a prompt to a flow, you can use SSML tags to provide a more personalized experience for your customers. SSML tags are a way to control how Amazon Polly generates speech from the text you provide.

The default setting in a flow block for interpreting text-to-speech is **Text**. To use SSML for text to speech in your flow blocks, set the **Interpret as** field to **SSML** as shown in the following image.

![\[Image of the settings for a flow block showing the Text to speech Interpret as field set to SSML.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/connect-interpret-as-ssml.png)


# SSML tags in an Amazon Connect chat conversation
<a name="chat-and-ssml-tags"></a>

If you create text-to-speech text and apply SSML tags, they won't be interpreted in a chat conversation. For example, in the following image both the text **and tags** will be printed in the chat conversation. 

![\[SSML tags in a text to speech box.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/ssml-tags-in-prompt.png)


# SSML tags supported by Amazon Connect
<a name="supported-ssml-tags"></a>

Amazon Connect supports the following SSML tags. 

**Tip**  
If you use an unsupported tag in your input text, it's automatically ignored when it's processed. 


| Tag | Use to... | 
| --- | --- | 
|  speak  |  All SSML-enhanced text must be enclosed within a pair of speak tags.  | 
|  break  |  Add a pause to your text. The maximum duration for a pause is 10 seconds.  | 
|  lang  |  Specify another language for specific words.  | 
|  mark  |  Put a custom tag within the text.  | 
|  p  |  Add a pause between paragraphs in your text.   | 
| phoneme | Make a phonetic pronunciation for specific text. | 
| prosody | Control the volume, rate, or pitch of your selected voice. | 
| s | Add a pause between lines or sentences in your text. | 
| say-as | Combine with the interpret-as attribute to tell Amazon Polly how to say certain characters, words, and numbers. | 
| sub | Combine with the alias attribute to substitute a different word (or pronunciation) for selected text such as an acronym or abbreviation. | 
| w | Customize the pronunciation of words by specifying the word’s part of speech or alternate meaning. | 
| amazon:effect name="whispered"  | Indicate that the input text should be spoken in a whispered voice rather than as normal speech. | 

If you use an unsupported tag in your input text it is automatically ignored when it is processed. 

To learn more about the SSML tags, see [Supported SSML Tags](https://docs.aws.amazon.com/polly/latest/dg/supportedtags.html) in the Amazon Polly Developer Guide.

## Neural and Conversational Speaking Styles
<a name="neural-and-conversational-tts"></a>

For the **Joanna** and **Matthew** neural voices, in American English (en-US), you can also specify a [Newscaster speaking style](https://docs.aws.amazon.com/polly/latest/dg/ntts-speakingstyles.html).

# Set up contact transfers in Amazon Connect
<a name="transfer"></a>

Amazon Connect enables you to set up different kinds of transfers:
+ [Agent-to-agent transfers](setup-agent-to-agent-transfers.md): For example, if you want agents to be able to transfer calls or tasks to other agents. 
+ [Transfers to a specific agent](transfer-to-agent.md): For example, if you want to route contacts to the last agent the customer interacted with, or route contacts to agents who have specific responsibilities.
+ [Transfers to queues](quick-connects.md): For example, if you want to transfer the contact to a sales, support, or escalation queue. To do this, create a [queue quick connect](how-quick-connects-work.md#queue-quick-connects). This works with voice, chat, and task contacts.
+ [Transfers to phone numbers](quick-connects.md): For example, if you want to transfer the contact to a phone number, such as an on-call pager. To do this, create an phone number quick connect.

## Overview of steps
<a name="transfer-overview"></a>

**To set up call transfers and quick connects**

1. Choose a flow type based on what you want to do: Transfer to agent or Transfer to queue. Phone number transfers do not require a specific type of contact flow.

1. Create and publish the flow. 

1. Create a quick connect for the type of transfer to enable: **Agent**, **Queue**, or **Phone number**.

   When you create the **Agent** or **Queue** quick connect, select a flow that matches the type of transfer to enable. **Phone number** quick connects require only a phone number, and do not allow you to set a queue or flow.

1. Add the quick connect that you created to any queue used in a flow for which to enable contact transfer, such as the queue used in the flow for incoming contacts.

1. Make sure the queue is in a routing profile assigned to the agents who transfers contacts. 

# Create quick connects in Amazon Connect
<a name="quick-connects"></a>

Quick connects are a way for you to create a list of destinations for common transfers. For example, you might create a quick connect for Tier 2 support. If agents in Tier 1 support can't solve the issue, they will transfer the contact to Tier 2. 

**How many quick connects can I create?** To view your quota of **Quick connects per instance**, open the Service Quotas console at [https://console.aws.amazon.com/servicequotas/](https://console.aws.amazon.com/servicequotas/).

## Types of quick connects
<a name="quick-connect-types"></a>

The type of a quick connect specifies the destination. You can specify one of the following destinations.

### Phone number quick connect
<a name="external-quick-connect-type"></a>

Contacts are transferred to a phone number (such as an on-call pager). 

### User quick connect
<a name="agent-quick-connect-type"></a>

Contacts are transferred to a specific user, such as an agent, as part of a flow.

**Important**  
User and Queue quick connects only appear in the CCP when an agent goes to transfer a contact. 

### Queue quick connect
<a name="queue-quick-connect-type"></a>

Contacts are transferred to a queue as part of a flow.

**Important**  
User and Queue quick connects only appear in the CCP when an agent goes to transfer a contact. 

### Flow quick connect
<a name="flow-quick-connect-type"></a>

Agent initiated contacts to provide interactive workflows during an active chat session. For more information, see [Agent-initiated flows](https://docs.aws.amazon.com/connect/latest/adminguide/agent-initiated-flows.html).

**Important**  
Flow quick connects are only supported for chat contacts.

## Step 1: Create quick connects
<a name="step1-create-quick-connects"></a>

 Following are the instructions to add quick connects manually using the Amazon Connect console. To add quick connects programmatically, use the [CreateQuickConnect](https://docs.aws.amazon.com/connect/latest/APIReference/API_CreateQuickConnect.html) API.

**To add quick connects**

1. Log in to the Amazon Connect admin website at https://*instance name*.my.connect.aws/. To find the name of your instance, see [Find your Amazon Connect instance ID or ARN](find-instance-arn.md).

1. On the navigation menu, choose **Routing**, **Quick connects**.

1. For each quick connect, do the following:

   1. Choose **Add new**.

   1. Enter a unique name. If desired, also enter a description.

   1. Choose a type.

   1. Enter the destination (for example, a phone number, the name of an agent, or the name of a queue).

   1. Enter a flow, if applicable.

   1. Enter a description.

1. When you're finished adding quick connects, choose **Save**.

## Step 2: Enable agents to see quick connects
<a name="step2-enable-agents-to-see-quick-connects"></a>

**To enable your agents to see the quick connects in the CCP when they transfer a contact**

1. After you create the quick connect, go to **Routing**, **Queues** and then choose the appropriate queue for the contact to be routed to.

1. On the Edit queue page, in the Quick connect box, search for the quick connect you created.

1. Select the quick connect and then choose **Save**.

**Tip**  
Agents see the quick connects of the queues in their routing profile, including the Default outbound queue. 

## Example: Create a phone number quick connect to a mobile phone
<a name="example-create-external-quick-connect"></a>

In this example, you create a phone number quick connect to a person's mobile phone. This might be for a supervisor, for example, so agents can call them if needed.

**Create a quick connect for a person's mobile phone number**

1. On the navigation menu, choose **Routing**, **Quick connects**, **Add quick connect**.

1. On the **Add quick connect** page, enter a name for the quick connect, for example, **John Doe's cell phone**.

1. For **Type**, select **Phone number**.

1. For **Phone number**, enter the mobile phone number, starting with the country code. In the US, the country code is 1, as shown in the following image.  
![\[The phone number on the Add quick connect page.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/quick-connect-johndoe.png)

1. Choose **Save**.

**Add the quick connect to a queue. Agents working this queue will see the quick connect in their CCP.**

1. Go to **Routing**, **Queues**, and choose the queue you want to edit.

1. On the **Edit queue** page, in **Outbound caller ID number**, choose a number claimed for your contact center. This is required to make outbound calls.

1. At the bottom of the page, in the **Quick connect** box, search for the quick connect you created, for example, **John Doe's cell phone**.

1. Select the quick connect. In the following image of the **Edit queue** page, a phone number has been selected for the **Outbound caller ID number**, and **John Doe's cell phone** has been selected as the quick connect.  
![\[The Edit queue page, the quick connect for John Doe's cell phone number.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/quick-connect-johndoe-queue.png)

1. Choose **Save**.

**Test the quick connect**

1. Open the Contact Control Panel.

1. Choose **Quick connects**.

1. Select the quick connect you created, and then choose **Call**.  
![\[The quick connects page in the CCP, an entry for John Doe's cell phone.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/quick-connect-johndoe-call.png)

## More examples
<a name="quick-connect-types"></a>

Configured Agent and Queue quick connects only appear in the CCP (Contact Control Panel) when an agent is on an active call. External quick connects appear in the CCP at all times.

### Agent quick connects
<a name="agent-quick-connect"></a>

Let's say Agent A is on inbound call and during the conversation he would like to transfer the call to another agent B.

1. Agent A initiates the agent quick connect by choosing **Transfer** on the CCP and selecting Agent B quick connect. As soon as agent A chooses Agent B quick connect, the CCP status of Agent A changes to "Connected."

   Even though status of transferred call (internal transfer) shows connected status the call is not connected to agent B.

1. The Agent transfer flow that is associated with agent quick connect gets invoked.

   The call is still not connected to Agent B.

1. Agent B gets notification in his/her CCP window to either accept or reject the calls.

1. Agent B accepts the incoming call and the status in CCP changes to "Connecting."

1. Agent whisper flow is played at agent A end who transferred the call to agent B.

1. Customer whisper flow is played at agent B end.

Finally after 6th step, Agent A and B gets connected for conversation and the status in CCP for agent B changes to "Connected."

### Queue quick connects
<a name="queue-quick-connect"></a>

Let's say Agent A is on inbound call and during the conversation he would like to transfer the call to another queue.

1. Agent A initiates the queue quick connect by choosing **Transfer** on the CCP and then selecting "XYZ" queue transfer. As soon as agent A clicks on queue quick connect, CCP status of Agent A changes to "Connected."

   Even though status of transferred call (internal transfer) shows connected the call is not transferred to queue.

1. The Queue transfer flow that is associated with queue quick connect gets invoked. In this flow the Transfer to queue block is placed to transfer the contact to required queue, in this case the "XYZ" queue. At the end of step 2, the call is in the "XYZ" queue. Let's say Agent B is assigned to work on contact in "XYZ" queue and agent B is in "Available" status.

1. Agent B gets notification in the CCP to either accept or reject the calls.

1. Agent B accepts the incoming call and the status in CCP changes to "Connecting."

1. Agent whisper flow is played at agent A end who transferred the call to "XYZ" queue.

1. Customer whisper flow is played at agent B end.

Finally after 6th step, Agent A and B gets connected for conversation and the status in CCP for agent B changes to "Connected."

### External quick connects
<a name="external-quick-connect"></a>

No flows are involved in external quick connects. When agent A uses external quick connect the call is directly connected the destination parties (without invoking any flows).

Because no flow is involved in external quick connects you cannot set the outbound caller id. Caller ID is used from the queue configuration.

During invocation of Agent/Queue/External quick connects the caller of the inbound call which Agent A was working on will hear the Customer hold flow.

# Delete quick connects in the Amazon Connect admin website
<a name="quick-connects-delete"></a>

There are two ways you can delete a quick connect:
+ Use the Amazon Connect admin website. This topic provides instructions.
+ Use the [DeleteQuickConnect](https://docs.aws.amazon.com/connect/latest/APIReference/API_DeleteQuickConnect.html) API.

**To delete a quick connect**

1. Log in to your Amazon Connect instance (https://*instance name*.my.connect.aws/) with an Admin account or a user account that has **Quick connects - Delete** permissions in its [security profile](connect-security-profiles.md). (To find the name of your instance, see [Find your Amazon Connect instance ID or ARN](find-instance-arn.md).)

1. On the navigation menu, choose **Routing**, **Quick connects**.

1. Select the quick connect, and then choose the **Delete** icon. 

   If you don't see the delete option, check the following:
   + You are using the latest Amazon Connect user interface. The following image shows a banner at the top of the **Quick connects** page. Choose **Try it now** to use the latest Amazon Connect user interface.  
![\[A banner at the top of the quick connects page, the try it now button.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/quick-connect-newinterface.png)
   + You have **Quick connects - Delete** permission in your security profile.

# Quick connect scenarios for transferring contacts
<a name="how-quick-connects-work"></a>

This article explains how each type of quick connect works: agent, queue, and phone number quick connects. It explains which flows are used, and what appears on the agent's Contact Control Panel (CCP).

**Tip**  
For all three types of quick connects, when the quick connect is invoked, the contact that the agent is working on hears the [Default customer hold](default-customer-hold.md) flow unless you specify a different customer hold flow. 

## User quick connects
<a name="agent-quick-connects"></a>

Let's say an agent named John is talking to a customer. During the conversation he needs to transfer the call to an agent named Maria. This is a user quick connect.

Here's what John and Maria do, and what flow blocks are triggered: 

1. John chooses the **Quick Connect** button on his CCP. (On the earlier CCP, the button is named **Transfer**). He selects **Maria** from the list of quick connects. 

   When John does this, his CCP banner changes to **Connected**. However, the call isn't actually connected to Maria yet. 

1. In our example scenario, Amazon Connect triggers an agent transfer flow that looks like the following image. It has the following blocks connected by **Success** branches: a **Play prompt**, a **Set whisper flow**, another **Set whisper flow**, and then a **Transfer to agent** block.  
![\[An agent transfer flow in the flow designer.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/contact-flow-transfer-agent-transfer-flow.png)

   The call is not yet connected to Maria.

1. John hears the first **Play prompt**, "Transferring to agent."

1. Maria receives a notification in her CCP to either accept or reject the call.

1. Maria accepts the incoming call. The banner in her CCP changes to **Connecting**.

1. The first [Set whisper flow](set-whisper-flow.md) block is triggered. This block sets the custom agent whisper flow. It plays the Custom\$1Agent\$1Whisper to Maria, for example, "This is an internal call transferred from another agent."
**Note**  
If you don't create and then select a custom agent whisper flow, Amazon Connect plays the [default agent whisper flow](default-agent-whisper.md), which says the queue name. 

1. The next [Set whisper flow](set-whisper-flow.md) block is triggered. It plays the Custom\$1Customer\$1Whisper to John, for example, "Your call is now connecting to an agent." 
**Note**  
If you don't create and then select a custom customer whisper flow, Amazon Connect plays the [default customer whisper flow](default-customer-whisper.md), which plays a beep. 

1. Maria's CCP banner shows she's **Connected**. John and Maria are connected and can start talking.

1. Now John can do one of the following on his CCP:
   + Choose **Join**. This joins all parties on the call. John, Maria, and the customer have a conference call.
   + Choose **Hold all**. This puts Maria and the customer on hold.
   + Put Maria on hold, so he only talks to the customer.
   + Choose **End call**. He leaves the call but Maria and the customer are directly connected and continue talking.

## Queue quick connects
<a name="queue-quick-connects"></a>

Let’s say John is talking to a customer. The customer needs help resetting his password, so John needs to transfer him to the PasswordReset queue. This is a queue quick connect.

Another agent, Maria, is assigned to handle contacts in the PasswordReset queue. Her status in the CCP is **Available**. 

Here's what John and Maria do, and what flow blocks are triggered:

1. John chooses the **Quick Connect** button on his CCP. (On the earlier CCP, the button is named **Transfer**). He chooses to transfer the contact to the PasswordReset queue. As soon as John chooses the PasswordReset quick connect, his CCP banner shows **Connecting**. 
**Important**  
Even though the status of the transferred call (internal-transfer) shows on John's CCP banner as **Connecting**, the contact is not yet transferred to the PasswordReset queue.  
![\[The CCP, the status banner says Internal transfer Connecting.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/contact-flow-transfer-transfer-connecting.png)

1. Amazon Connect invokes the queue transfer flow that's associated with the PasswordReset quick connect. In this flow, the [Transfer to queue](transfer-to-queue.md) block transfers the contact to the PasswordReset queue since it's specified in the block. The contact is now in the PasswordReset queue.

1. Maria is notified in her CCP to accept or reject the incoming call. 

1. Maria accepts the incoming call and her CCP banner changes to **Connecting**.

1. The [Agent whisper flow](create-contact-flow.md#contact-flow-types) is played to Maria. It says "Connecting you to PasswordReset queue."

1. The [Customer whisper flow](create-contact-flow.md#contact-flow-types) is played to John. It says "Connecting you to PasswordReset queue."

1. Maria's CCP banner changes to **Connected**. John and Maria are connected and can start talking. 

1. Now John can do one of the following from his CCP:
   + Choose **Join**. This joins all parties on the call. John, Maria, and the customer have a conference call.
   + Choose **Hold all**. This puts Maria and the customer on hold.
   + Put Maria on hold, so he only talks to the customer.
   + Choose **End call**. He leaves the call but Maria and the customer are directly connected and continue talking.

## Phone number quick connects
<a name="external-quick-connects"></a>

There are no flows involved in a phone number quick connect. When an agent invokes a phone number quick connect, the call is directly connected to the destination without invoking any flows.

Because no flow is involved in phone number quick connects, you can't set the outbound caller ID. Instead, the caller ID that you specified when you [created the queue](create-queue.md) is used. 

# Set up agent-to-agent transfers in Amazon Connect
<a name="setup-agent-to-agent-transfers"></a>

We recommend using these instructions to set up agent-to-agent voice, chat, and task transfers. You use a [Set working queue](set-working-queue.md) block to transfer the contact to the agent's queue. The **Set working queue **block supports an omnichannel experience, whereas the [Transfer to agent (beta)](transfer-to-agent-block.md) block does not.

## Step 1: Create the quick connect
<a name="step1-create-quick-connect"></a>

 Following are the instructions to add quick connects manually using the Amazon Connect admin website. To add quick connects programmatically, use the [CreateQuickConnect](https://docs.aws.amazon.com/connect/latest/APIReference/API_CreateQuickConnect.html) API.

**Create a quick connect**

1. On the navigation menu, choose **Routing**, **Quick connects**, **Add a new destination**.

1. Enter a name for the connect. Choose the type, and then specify the destination (such as a phone number or the name of an agent), flow (if applicable), and description.
**Important**  
A description is required when you create a quick connect. If you don't add one, you'll get an error when you try to save the quick connect. 

1. To add more quick connects, choose **Add new**.

1. Choose **Save**.

1. Go to the next procedure to enable your agents to see the quick connects in the Contact Control Panel (CCP).

**Enable your agents to see the quick connects in the CCP when they transfer a contact**

1. After you create the quick connect, go to **Routing**, **Queues** and then choose the appropriate queue for the contact to be routed to.

1. On the **Edit queue** page, in the **Quick connect** box, search for the quick connect you created.

1. Select the quick connect and then choose **Save**.

**Tip**  
Agents see all of the quick connects for the queues in their routing profile.

## Step 2: Set up the "Transfer to agent" flow
<a name="setup-agent-voice-transfers"></a>

In this step, you create a flow that's type **Transfer to agent** and use a [Set working queue](set-working-queue.md) block to transfer the contact to the agent. 

1. On the navigation menu, choose **Routing**, **Flows**.

1. Use the drop-down to choose **Create transfer to agent flow**. 

1. Type a name and a description for your flow.

1. In the left navigation menu, expand **Set**, and then drag the **Set working queue** block to the canvas.

1. Configure the **Set working queue** block as shown in the following image. Choose **By agent**, **Set dynamically**, **Namespace** = **Agent**, **Value** = **User name**.  
![\[The properties page for the Set working queue block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-working-queue-properties-agent-to-agent-transfer.png)

   1. Choose **By agent**.

   1. Choose **Set dynamically**.

   1. For **Namespace**, use the dropdown box to select **Agent**.

   1. For **Value**, use the dropdown box to select **User name**.

1. Add a [Transfer to queue](transfer-to-queue.md) block. You don't need to configure this block. The following image shows the **Success** branch of the **Set working queue** block connecting to the **Transfer to queue** block.   
![\[The transfer to queue block on the flow designer.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/agent-to-agent-transfer.png)

1. Save and publish this flow.

1. To show your agents how to transfer chats to another agent, see [Transfer a chat to an agent's queue, with all context preserved](transfer-chats.md). 

   To show your agents how to transfer tasks to another agent, see [Transfer a task to another agent or queue in the Amazon Connect Contact Control Panel (CCP)](transfer-task.md). 

# Set up a flow in Amazon Connect to resume a call with a customer after a transfer
<a name="contact-flow-resume"></a>

Let's say you need to transfer a contact to an external department that's not using Amazon Connect. For example, maybe you need to transfer the caller to a shipping provider to check the status of their delivery. After the contact is disconnected from the phone number, you want them to be returned to your agent, for example, when the delivery company couldn't resolve their issue. 
+ For advanced creation, send tracking information as DTMF digits when the call is transferred, so that the shipment information is retrieved with the transferred call before the customer is connected.

**To set up a flow for this scenario**

1. Add a **Transfer to phone number** block to your contact flow.

1. In the **Transfer to phone number** block, enter the following settings:
   + **Transfer to**
     + **Phone number**—Sets the phone number to transfer the call to.
     + **Set dynamically**—Specify a contact attribute (choose a namespace and then a value) to set the phone number to transfer the call to.
   + **Set timeout**
     + **Timeout (in seconds)**—The number of seconds to wait for the recipient to answer the transferred call.
   + **Set dynamically**—Specify a contact attribute (choose a namespace and then a value) to use to set the **Timeout** duration.
   + **Resume flow after disconnect**—When you select this option, after the call is transferred, the caller is returned to the flow only if the transfer is unsuccessful. Additional branches for **Success**, **Call failed**, and **Timeout** are added to the block when you select this option so that you can appropriately route contacts when there is an issue with the transfer.
   + **Optional parameters**
     + **Send DTMF**—Select **Send DTMF** to include up to 50 Dual-Tone Multi-frequency (DTMF) characters with the transferred call. You can enter the characters to include, or use an attribute. Use the DTMF characters to navigate an automated IVR system that answers the call.
     + **Caller ID number**—Specify the caller ID number used for transferred call. You can select a number from your instance, or use an attribute to set the number.
     + **Caller ID name**—Specify the caller ID name used for the transferred call. You can enter a name, or use an attribute to set the name.

       In some cases, the caller ID information is provided by the carrier of the party you are calling. The information may not be up-to-date with that carrier, or the number may get passed differently between systems because of hardware or configuration differences. If that is the case, the person you call may not see the phone number, or may see the name of a previously registered owner of the number, instead of the name you specify in the block.

1. Connect **Transfer to phone number** to the rest of your flow.

When the block executes: 

1. The call is transferred to the phone number.

1. Optionally, when the conversation with the external party ends, the contact is returned to the flow.

1. The contact then follows the **Success** branch from the block to continue the flow.

1. If the call is not successfully transferred, one of the other branches is followed: **Call failed**, **Timeout**, or **Error**, depending on the reason the caller did not return to the flow.

# Set up a flow to manage contacts in a queue in Amazon Connect
<a name="queue-to-queue-transfer"></a>

For inbound contacts, you can define advanced routing decisions to minimize queue wait times, or route contacts to specific queues, using blocks in your flow. For example: 
+ Use a **Check queue status** block to check staffing or agent availability for a queue before sending a contact to that queue.
+ Or, use a **Get queue metrics** block to retrieve queue metrics.
+ Then use a **Check contact attributes** block to check specific queue metric attributes, and define conditions to determine which queue to route the contact to based on attribute values. For more information about using queue metrics, see [Use attributes in Amazon Connect to route based on number of contacts in a queue](attrib-system-metrics.md).

After determining which queue to transfer the contact to, use a **Transfer to queue** block in a flow to transfer the contact to that queue. When the **Transfer to queue** block runs, it checks the queue capacity to determine whether or not the queue is at capacity (full). This check for queue capacity compares the current number of contacts in the queue to the [Maximum contacts in queue](set-maximum-queue-limit.md) limit, if one is set for the queue. If no limit is set, the queue is limited to the number of concurrent contacts set in the [service quota](amazon-connect-service-limits.md) for the instance.

After the contact is placed in a queue, the contact remains there until an agent takes the contact, or until the contact is handled based on the routing decisions in your customer queue flow. 

To change the queue associated with the call after it is already placed in a queue, use a **Loop prompts** block with a **Transfer to queue** block in a customer queue flow. In the block choose which queue to transfer the call to, or use an attribute to set the queue.

**To manage contacts in a queue using a Transfer to queue block**

1. In Amazon Connect, on the navigation menu choose **Routing**, **Flows**.

1. Choose the down arrow next to **Create flow**, then choose **Create customer queue flow**.

1. Under **Interact**, add a **Loop prompts** block to provide a message to the caller when the call is transferred, then every X seconds or minutes while the call is in the queue.

1. Select the **Loop prompts** block to display the settings for the block.

1. Choose **Add another prompt to the loop**.

1. Under **Prompts**, do one of the following:
   + Choose **Audio recording** in the drop-down menu, then select the audio recording to use as the prompt.
   + Choose **Text to Speech** in the drop-down menu, then enter text to use for the prompt in the **Enter text to be spoken** field.

1. To set an interrupt, choose **Interrupt every**, enter a value for the interrupt interval, and then choose a unit, either **Minutes** or **Seconds**. We recommend that you use an interval greater than 20 seconds to ensure that queued contacts that are being connected to an agent are not interrupted.

1. Choose **Save**.

1. Connect the block to the **Entry point** block in the contact flow.

1. Under **Terminate/Transfer**, drag a **Transfer to queue** block onto the designer.

1. Select the title of the block to display the settings for the block, then choose the **Transfer to queue** tab.

1. Under **Queue to check**, choose **Select a queue**, then select the queue to transfer calls to.

   Alternatively, choose **Set dynamically**, then reference an attribute to specify the queue. If you use an attribute to set the queue, the value must be the queue ARN.

1. Choose **Save**.

1. Connect the **Loop prompt** block to the **Transfer to queue** block.

1. Add additional blocks to complete the flow that you require, such as the blocks to check queue status or metrics, then choose **Save**.

   The flow is not active until you publish it.

**Important**  
To successfully complete the call transfer to another queue, you must include a block after the **Transfer to queue** block and connect the **Success** branch to it. For example, use an **End flow / Resume** block to end the flow. The flow does not end until the call is picked up by an agent.

# Transfer contacts to a specific agent in Amazon Connect
<a name="transfer-to-agent"></a>

There are two ways to route contacts directly to an agent:
+ **Use routing criteria to prefer an agent**. This method is better when: 
  + You want the ability to target multiple agents simultaneously. For example, a four-person support team that is primarily supporting a customer.
  + You want the option to fallback to a broader pool of agents in the queue if the preferred agent(s) are not available.
  + You want the contact to be reported within the standard queue's metrics.

  For this option, use the [Set routing criteria](set-routing-criteria.md) block instead of the procedure in this topic. 
+ **Use the agent's queue**. This method is usually better when: 
  + The contact is intended for **only** that specific agent and no one else.
  + You don't want the contact to be reported under a standard queue. For information about standard queues and agent queues, see [Queues: standard and agent](concepts-queues-standard-and-agent.md). 

  This topic explains how to route contacts for this second scenario.

Agent queues enable you to route contacts directly to a specific agent. Following are a couple of scenarios where you might want to do this: 
+ Route contacts to the last agent the customer interacted with. This provides a consistent customer experience.
+ Route contacts to agents who have specific responsibilities. For example, you might route all billing questions to Jane.

**Note**  
A queue is created for all users in your Amazon Connect instance, but only users who are assigned permissions to use the Contact Control Panel (CCP) can use it to receive contacts. The Agent and Admin security profiles are the only default security profiles that include permissions to use the CCP. If you route a contact to someone who doesn't have these permissions, the contact can never be handled.

**To route a contact directly to a specific agent**

1. In Amazon Connect, choose **Routing**, **Contact flows**.

1. In the flow designer, open an existing flow, or create a new one.

1. Add a block in which you can select a queue to transfer a contact to, such as a **Set working queue** block.

1. Select the title of the block to open the block settings.

1. Select **By agent**.

1. Under **Select an agent**, enter the user name of the agent, or select the agent's user name from the drop-down list.

1. Choose **Save**.

1. Connect the **Success** branch to the next block in your flow.

You can also choose to use an attribute to select the queue created for the agent user account. To do so, after you choose **By agent**, choose **Use attribute**.

## Use contact attributes to route contacts to a specific agent
<a name="use-attribs-agent-queue"></a>

When you use contact attributes in a flow to route calls to an agent, the attribute value must be either the agent's user name, or the agent's user ID.

To determine the user ID for an agent so that you can use the value as an attribute, use one of these options: 
+ Use the **Network** tab of the browser debugger to retrieve the agent ID. For example:

  1. In a Chrome browser, press F12 and go to the **Network** tab. 

  1. In Amazon Connect, in the navigation menu, choose **Users**, **User management**, and then select an agent. Monitor the content of the **Network** tab. In the **Name** list, choose the GUID. 

  1. Choose the **Preview** tab. The agent ID is displayed next to the `Id` field. The following image shows the location of the agent ID in the **Preview** tab.  
![\[The preview tab, the agent ID.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/find-agent-id.png)
+ Use the [ListUsers](https://docs.aws.amazon.com/connect/latest/APIReference/API_ListUsers.html) operation to retrieve the users from your instance. The agent's user ID is returned with the results from the operation as the value of the `Id` in the [UserSummary](https://docs.aws.amazon.com/connect/latest/APIReference/API_UserSummary.html) object.
+ Find the user ID for an agent by using [Amazon Connect agent event streams](agent-event-streams.md). The agent events, which are included in the agent event data stream, include the agent ARN. The user ID is included in the agent ARN after **`agent/`**. 

In the following agent event data, the agent ID is **87654321-4321-4321-4321-123456789012**.

```
{
    "AWSAccountId": "123456789012",
    "AgentARN": "arn:aws:connect:us-west-2:123456789012:instance/12345678-1234-1234-1234-123456789012/agent/87654321-4321-4321-4321-123456789012",
    "CurrentAgentSnapshot": {
        "AgentStatus": {
            "ARN": "arn:aws:connect:us-west-2:123456789012:instance/12345678-1234-1234-1234-123456789012/agent-state/76543210-7654-6543-8765-765432109876",
            "Name": "Available",
            "StartTimestamp": "2019-01-02T19:16:11.011Z"
        },
        "Configuration": {
            "AgentHierarchyGroups": null,
            "FirstName": "IAM",
            "LastName": "IAM",
            "RoutingProfile": {
                "ARN": "arn:aws:connect:us-west-2:123456789012:instance/12345678-1234-1234-1234-123456789012/routing-profile/aaaaaaaa-bbbb-cccc-dddd-111111111111",
                "DefaultOutboundQueue": {
                    "ARN": "arn:aws:connect:us-west-2:123456789012:instance/12345678-1234-1234-1234-123456789012/queue/aaaaaaaa-bbbb-cccc-dddd-222222222222",
                    "Name": "BasicQueue"
                },
                "InboundQueues": [{
                    "ARN": "arn:aws:connect:us-west-2:123456789012:instance/12345678-1234-1234-1234-123456789012/queue/aaaaaaaa-bbbb-cccc-dddd-222222222222",
                    "Name": "BasicQueue"
                }],
                "Name": "Basic Routing Profile"
            },
            "Username": "agentUserName"
        },
        "Contacts": []
},
```

# Set up queued callback by creating flows, queues, and routing profiles in Amazon Connect
<a name="setup-queued-cb"></a>

You can allow your customers to maintain their position in queue without requiring them to stay on the call during high wait times, and get a callback from an available agent when it's their turn.

**Topics**
+ [

## How callbacks keep their place in queue
](#callback-how-it-works)
+ [

## Steps to set up queued callbacks
](#setup-queued-callback-overview)
+ [

## The routing process
](#cb-routing)
+ [

## How queued callbacks affect queue limits
](#queued-callback-limits)
+ [

## Create a flow for queued callbacks
](#queued-callback-contact-flow)
+ [

## Callbacks from a chat, task, or email contact
](#queued-callback-chat-task)
+ [

## Learn more about queued callbacks
](#queued-callback-no-agents-available)

## How callbacks keep their place in queue
<a name="callback-how-it-works"></a>

You can configure callbacks to remain in the same queue as the original inbound call or to be placed in a separate dedicated queue that you create. This separate queue enables you to get a clearer delineation between active inbound calls and callbacks in real time reports.

You can ensure that the callback maintains its position in queue even when you place it in a dedicated queue by configuring it at the same priority as the original inbound queue in the routing profile. This configuration ensures that Amazon Connect continues to look at the original start time of the inbound call to maintain order, regardless of whether the customer opted for a callback or to stay on the call for the next available agent.

Amazon Connect evaluates the routing profiles first so if the two queues have the same priority, the oldest call is pushed first across all queues with the same priorities. For example, if your original call arrived at 10:00 and left a callback request at 10:05, Amazon Connect looks for the call start time of 10:00, not 10:05.

## Steps to set up queued callbacks
<a name="setup-queued-callback-overview"></a>

Use the steps provided in the following overview to set up queued callback. 
+ [Set up a queue](create-queue.md) specifically for callbacks. In your real-time metrics reports, you can look at that queue and see how many customers are waiting for callbacks.
+ [Set up caller ID](queues-callerid.md). When setting your callback queue, specify the caller ID name and phone number that appears to customers when you call back. 
+ [Add the callback queue to a routing profile](routing-profiles.md). Set this up so that contacts waiting for a call are routed to agents. 
+ [Create a flow for queued callbacks](#queued-callback-contact-flow). Set this up to offer the option for a callback to the customer. 
+ [Associate a phone number with the inbound flow](associate-claimed-ported-phone-number-to-flow.md). 
+ (Optional) Create a callback creation flow. When a callback is created, this flow is run. The contact is enqueued only when there is a [Transfer to queue](transfer-to-queue.md) set on this flow. You can use the callback creation flow to [Check contact attributes](check-contact-attributes.md) to see if the callback is a duplicate or if the customer issue is resolved before queuing the contact for an agent. This flow also allows you to set a customer queue flow by adding a [Set customer queue flow](set-customer-queue-flow.md) block. 
+ (Optional) Create a customer queue flow for callback. This flow is run if you choose a [Set customer queue flow](set-customer-queue-flow.md) block for the **Set creation flow** option. You can use a [Set customer queue flow](set-customer-queue-flow.md) block to add logic to transfer a contact from one queue to another. Or, you can manually remove a callback from the queue by using the [StopContact](https://docs.aws.amazon.com/connect/latest/APIReference/API_StopContact.html) API. 
+ (Optional) Create an outbound whisper flow. When a queued call is placed, the customer hears this message after they pick up and before they connect to the agent. For example, "Hello, this is your scheduled callback..."
+ (Optional) Create an agent whisper flow. This is what the agent hears right after they accept the contact, before they are joined to the customer. For example, "You're about to be connected to Customer John, who requested a refund for..."
+ (Optional) Provide a caller ID. This is what the customer sees when dialed. Must be a valid phone number claimed in your Amazon Connect instance. This field is reflected as the system endpoint in contact records. The number set here takes precedence over the outbound phone number set on the queue.
+ Choose a dial mode between agent first and customer first.
**Important**  
This option is available only when Next Generation Amazon Connect is [enabled](enable-nextgeneration-amazonconnect.md) for your Amazon Connect instance. 
If you disable Next Generation Amazon Connect after you've already activated and started using customer first callback, customer first callback is also disabled. It is not available in the pay-per-feature pricing model.

## The routing process
<a name="cb-routing"></a>

1. When a customer leaves their number it's put in a queue and then routed to the next available agent.

1. After an agent accepts the callback in the CCP, Amazon Connect calls the customer.

   If no agents are available to work on callbacks, the callbacks can stay in queue for up to 7 days after they are created before Amazon Connect automatically removes them.
**Tip**  
To manually remove a callback from the queue, use the [StopContact](https://docs.aws.amazon.com/connect/latest/APIReference/API_StopContact.html) API.

1. If there is no answer when the Amazon Connect calls the customer, it retries based on the number of times you've specified. 

1. If the call goes to **voicemail**, it's considered connected.

1. If the customer calls again while in the callback queue, it's treated as a new call and will be handled as usual. To avoid duplicate callback requests in a callback queue, see this blog: [Preventing duplicate callback requests in Amazon Connect](https://aws.amazon.com/blogs/contact-center/preventing-duplicate-callback-requests-in-amazon-connect/).

## How queued callbacks affect queue limits
<a name="queued-callback-limits"></a>
+ Queued callbacks count towards the queue size limit, but they are routed to the error branch. For example, if you have a queue that handles callbacks and incoming calls, and that queue reaches the size limit:
  + The next callback is routed to the error branch.
  + The next incoming call gets a reorder tone (also known as a fast busy tone), which indicates no transmission path to the called number is available.
+ Consider setting up your queued callbacks to be lower priority than your queue for incoming calls. This way, your agents only work on queued callbacks when the incoming call volume is low.

## Create a flow for queued callbacks
<a name="queued-callback-contact-flow"></a>

To see what a flow looks like with queued callback, in new Amazon Connect instances see [Sample queue configurations flow in Amazon Connect](sample-queue-configurations.md). In previous instances, see [Sample queued callback flow in Amazon Connect](sample-queued-callback.md).

The following procedure shows how to:
+ Request a callback number from a customer.
+ Store the callback number in an attribute.
+ Reference the attribute in a **Set callback number** block to set the number to dial the customer.
+ Transfer the customer to the callback queue.

At the basic level, here's what this queued callback flow looks like, without any of the alternative branches or error handling configured. The following image shows a flow with the following blocks: **Get customer input**, **Store customer input**, **Set callback number**, **Play prompt**, **Transfer to queue**, and **Disconnect/hang up**.

![\[A queued callback flow in the flow designer.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/queued-callback-flow.png)


Following are the steps to create this flow.

**To create a flow for queued callbacks**

1. In Amazon Connect, choose **Routing**, **Contact flows**.

1. Select an existing flow, or choose **Create flow** to create a new one.
**Tip**  
You can create this flow using different flow types: Customer queue flow, Transfer to agent, Transfer to queue. 

1. Add a [Get customer input](get-customer-input.md) block.

1. Configure the block to prompt the customer for a callback. The following image shows a message in the **Text-to-speech** box: **Press 1 to receive a callback. Press 2 to stay in queue**.   
![\[The properties page of the Get customer input block, configured for text-to-speech or chat text.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/get-customer-input-callback.png)

1. At the bottom of the block, choose **Add another condition**, and add options 1 and 2, as shown in the following image.   
![\[Option 1 and option 2.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/options-1-and-2.png)

1. Add a [Store customer input](store-customer-input.md) block.

1. Configure the block to prompt customers for their callback number, such as "Please enter your phone number." The following image shows the **Properties** page of the **Store customer input **block.  
![\[The text to speech box, contains the message Please enter your phone number.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/store-customer-input.png)

1. In the **Customer input** section, select **Phone number**, and then choose one of the following: 
   + **Local format**: Your customers are calling from phone numbers that are in the same country as the AWS Region where you created your Amazon Connect instance.
   + **International format/Enforce E.164**: Your customers are calling from phone numbers in countries or regions other than the one where you created your instance.

1. Add a [Set callback number](set-callback-number.md) block to your flow.

1. Configure the block to set **Type** to **System**, as shown in the following image. For **Attribute**, choose **Store customer input**. This attribute stores the customer's phone number.   
![\[The Properties page of the set callback number block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/set-callback-number2.png)

1. Add a [Transfer to queue](transfer-to-queue.md) block. 

1. In the **Transfer to queue** block, configure the **Transfer to callback queue** tab as shown in the following image. Set **Initial delay** to 99. Set **Max number of retries** to 2. Set **Minimum time between attempts** to 10 minutes.   
![\[The Transfer to callback queue tab on the Properties page of the Transfer to queue block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/transfer-to-callback-queue-tab.png)

   The following properties are available:
   + **Initial delay**: Specify how much time has to pass between a callback contact being initiated in the flow, and the customer is put in queue for the next available agent. In the previous example, the time is 99 seconds.
   + **Maximum number of retries**: If this is set to 2, then Amazon Connect tries to call back the customer a maximum of three times: the initial callback, and two retries. 

     A retry only happens if it rings but there's no answer. If the callback goes to voicemail, it's considered connected and Amazon Connect does not retry again.
**Tip**  
We strongly recommend that you double-check the number entered in **Maximum number of retries**. If you accidentally enter a high number, such as 20, it's going to result in unnecessary work for the agent and too many calls for the customer.
   + **Minimum time between attempts**: If the customer doesn't answer the phone, this is how long to wait until trying again. In the previous example, we wait 10 minutes between attempts.

1. In the **Optional parameters** section, choose **Set working queue** if you want to transfer the contact to a queue that you set up specifically for callbacks. This option is shown in the following image.  
![\[The optional parameters, set a queue set to callback queue.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/transfer-to-callback-queue-tab-set-working-queue.png)

   Creating a queue just for callbacks lets you view in your real-time metrics reports how many customers are waiting for callbacks.

   If you don't set a working queue, Amazon Connect uses the queue that was set previously in the flow.

1. You can optionally specify the caller ID that customers see when they receive the callback by configuring the **Caller ID number to display** option in the [Transfer to queue](transfer-to-queue.md) block, as shown in the following image.  
![\[The optional parameters section showing Caller ID number to display options.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/transfer-to-callback-caller-id-display.png)

1. The callback contact is a new contact separate from the inbound voice contact. You can optionally control the experience of this callback contact when it is created by configuring the **Set creation flow** option in the [Transfer to queue](transfer-to-queue.md) block, as shown in the following image.   
![\[The properties page of the Transfer to queue block, the Transfer to Callback tab.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/transfer-to-queue-properties1a.png)
   + If Next Generation Amazon Connect is enabled for your Amazon Connect instance (learn how to [check whether it's enabled](enable-nextgeneration-amazonconnect.md#how-to-enable-ac)), you can choose either agent first callback mode (the default) or customer first callback mode. For more information about these options, see [Use customer first callback mode](customer-first-cb.md).  
![\[Choose the dial mode, either agent first callback (the default) or customer first callback mode.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/first-callbacks-choose-dial-mode-agent-and-customer.png)
   + (Optional) Create a callback creation flow. Use the **Set creation flow** dropdown menu to select the flow to be run when a callback contact is created. 

     The callback creation flow that you select must meet the following requirements: 
     + The flow type must be the default flow type, **Contact flow (inbound)**. For information about flow types, see [Choose a flow type](create-contact-flow.md#contact-flow-types). 
     + You need to configure a [Transfer to queue](transfer-to-queue.md) block to queue the contact in the queue of your choice.

     Following are additional options for how you can configure your callback creation flow: 
     + You can evaluate contact attributes (including customer profiles) by using a [Check contact attributes](check-contact-attributes.md) block to see if the callback should be terminated because it is a duplicate or the customer issue has already been resolved.
     + You can add a [Set customer queue flow](set-customer-queue-flow.md) block and use it to specify the flow to run when a customer is transferred to a queue. This flow is called a customer queue flow.
       + In the customer queue flow, you can evaluate the contact's wait time in queue by using a combination of the [Get metrics](get-queue-metrics.md) block and [GetCurrentMetricData](https://docs.aws.amazon.com/connect/latest/APIReference/API_GetCurrentMetricData.html) to send an advance SMS to customers, notifying them to expect a callback in the near future from the specific contact center number.

1. To save and test this flow, configure the other branches and add error handling. To see an example of how this is done, see [Sample queue configurations flow in Amazon Connect](sample-queue-configurations.md). For previous instances, see [Sample queued callback flow in Amazon Connect](sample-queued-callback.md). 

1. For information about how callbacks appear in real-time metrics reports and contact records, see [Queued callbacks in real-time metrics in Amazon Connect](about-queued-callbacks.md). 

## Callbacks from a chat, task, or email contact
<a name="queued-callback-chat-task"></a>

You can also configure the **Transfer to Callback** option in the [Transfer to queue](transfer-to-queue.md) block to support callbacks when a customer contacts you from a chat, task, or email contact. For example, if a customer reaches out after hours when no agent is available, they can request a voice callback by sending a chat message or completing a webform request (which uses tasks).

The following video shows how to use Contact Lens to allow customers who contact you through Amazon Connect chat to request a callback. This creates a more personalized customer experience. It shows how to configure this capability that allows customers to request callbacks from any channel, not just voice calls.




## Learn more about queued callbacks
<a name="queued-callback-no-agents-available"></a>

See the following topics to learn more about queued callbacks:
+ [Queued callbacks in real-time metrics in Amazon Connect](about-queued-callbacks.md)
+ [How Initial delay affects Scheduled and In queue metrics in Amazon Connect](scheduled-vs-inqueue.md)
+ [Failed callback attempts in Amazon Connect](failed-callback-attempt.md)
+ [Amazon Connect real-time metrics example for a queued callback flow](queued-callback-example.md)

# Use customer first callback mode in Amazon Connect
<a name="customer-first-cb"></a>

When you set up queued callbacks, you have the additional choice of whether to use agent first callback mode or customer first callback mode.
+ **Agent first callback mode** is the default. The callback is offered to an agent to accept or reject before the call is dialed to a customer.
+ **Customer first callback mode** is available only when Next Generation Amazon Connect is [enabled](enable-nextgeneration-amazonconnect.md) for your Amazon Connect instance. In this mode, Amazon Connect dials the customer first and only offers the callback to an agent if the customer answers the callback that they've received.

**Important**  
Customer first callback mode is not available in the pay-per-feature pricing model. 
If you disable Next Generation Amazon Connect after you've already activated and started using customer first callback, customer first callback mode is also disabled.

**Topics**
+ [The lifecycle of a customer first callback](#queued-callback-customer-first-callback-contact-lifecycle)
+ [Retries](#customer-first-callback-retries)
+ [Metrics for customer first callbacks](#customer-first-callback-metrics)
+ [Example contact records](#customer-first-callback-contact-lifecycle-contact-model)
+ [Sample flows](#customer-first-callback-contact-lifecycle-sample-flows)

## The lifecycle of a customer first callback
<a name="queued-callback-customer-first-callback-contact-lifecycle"></a>

The lifecycle for customer first callbacks is spread across three different contacts, as shown in the following diagram. 

![\[The lifecycle for customer first callbacks, spread across three different contacts.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/queued-callback-customer-first-callback-contact-lifecycle-1.png)


Following is a description of each contact.

1. **Inbound customer contact (C1)** is an inbound voice contact. It looks like every other inbound customer contact.

1. **Queued callback contact (C2)** is the queued leg of the customer first callback. It has a new initiation method of CALLBACK\$1CUSTOMER\$1FIRST\$1QUEUED.
   + C2 triggers the creation flow, if you selected **Set creation flow** in the [Transfer to queue](transfer-to-queue.md) block. It does this before it is queued in the working queue, and after the **Initial delay**, if that is specified in the [Transfer to queue](transfer-to-queue.md) block. 
   + C2 does not support the **Maximum number of retries** and **Minimum time between attempts** settings in the [Transfer to queue](transfer-to-queue.md) block. That functionality is only available for agent first callbacks.

1. **Dialed callback contact (C3)** is the dialed leg of the customer first callback. It has a new initiation method of CALLBACK\$1CUSTOMER\$1FIRST\$1DIALED.
   + C3 triggers the required outbound callback flow that you specified in the [Transfer to queue](transfer-to-queue.md) flow block. You only specify an outbound callback flow for customer first callback mode, not for agent first callback mode.
   + For customer first callbacks, you configure retries and time between attempts in the outbound flow specified for C3, based on the output of the [Check call progress](check-call-progress.md) flow block. The purpose of this is to determine whether a contact has been answered by a voicemail or human voice.
   + After the customer's presence is confirmed, the flow for C3 should have a [Transfer to queue](transfer-to-queue.md) flow block configured to place the contact in its queue to find the next available agent.
   + You can customize the routing priority of this contact within the flow by using the [Set routing criteria](set-routing-criteria.md) or [Change routing priority / age](change-routing-priority.md) blocks.

**Note**  
You must set the final working queue at least once before C2 is created.   
You can do this in the C1 inbound flow by using the [Set working queue](set-working-queue.md). Or, while configuring C2 you can specify the queue in the [Transfer to queue](transfer-to-queue.md) block.
You can modify the final working queue by using **Set creation flow** for C2, or by using the outbound flow that you specify for C3.
When you set the final working queue for the callback at any point in the contact's lifecycle (step C1, C2, or C3), the following stages inherit it. 

## Retries for customer first callbacks
<a name="customer-first-callback-retries"></a>

Retry behavior for customer first callbacks differs significantly from agent first callbacks. Retries are configured on the dialed callback contact (C3), not on the queued callback contact (C2).

### How retries work
<a name="customer-first-callback-retries-how-they-work"></a>
+ C2 does not support retries. The **Maximum number of retries** and **Minimum time between attempts** settings in the [Transfer to queue](transfer-to-queue.md) block are only available for agent first callbacks.
+ For customer first callbacks, retries are configured in the outbound callback flow specified for C3.
+ When a retry is needed (for example, voicemail is detected), a new dialed callback contact – C4 – is created. C4 inherits the user-defined attributes set on C3.

### Configure retries with Check Call Progress
<a name="customer-first-callback-retries-check-call-progress"></a>

Use the [Check call progress](check-call-progress.md) block in the C3 outbound flow to detect whether a human or voicemail answered the call. Based on the output, configure the flow as follows:
+ **Voicemail detected** (`VOICEMAIL_BEEP`, `VOICEMAIL_NO_BEEP`) – Set a `retry` attribute on C3, then recreate the callback contact (C4).
+ **Human detected** (`HUMAN_ANSWERED`) – Transfer to queue so an agent can join the call.
+ **Other or unresolved states** – Configure fallback handling as needed.

The `AnsweringMachineDetectionStatus` field on the C3 contact record captures the full answering machine detection result. Possible values include:

`HUMAN_ANSWERED` \$1 `VOICEMAIL_BEEP` \$1 `VOICEMAIL_NO_BEEP` \$1 `AMD_UNANSWERED` \$1 `AMD_UNRESOLVED` \$1 `AMD_NOT_APPLICABLE` \$1 `SIT_TONE_BUSY` \$1 `SIT_TONE_INVALID_NUMBER` \$1 `SIT_TONE_DETECTED` \$1 `FAX_MACHINE_DETECTED` \$1 `AMD_ERROR`

### Adjust priority for retry contacts
<a name="customer-first-callback-retries-adjust-priority"></a>

To ensure retry contacts are routed appropriately, use the callback creation flow that runs when the C4 contact is created. The recommended approach is:

1. **Set a retry attribute on C3** – Before recreating the callback contact, use a **Set contact attributes** block in the C3 outbound flow to add a user-defined attribute (for example, `retry = true`).

1. **C4 inherits C3's user-defined attributes** – When the C4 contact is created, it automatically inherits all user-defined attributes from C3, including the `retry` attribute.

1. **Check for the retry attribute in C4's callback creation flow** – In the callback creation flow configured for C4, use a **Check contact attributes** block to evaluate whether the `retry` attribute is present.

1. **Adjust routing priority if retrying** – If the `retry` attribute is present, use a [Set routing criteria](set-routing-criteria.md) or [Change routing priority / age](change-routing-priority.md) block to enqueue the contact with an adjusted priority before it enters the working queue.

This approach allows you to differentiate first-attempt callbacks from retries and apply custom prioritization logic without relying on external state.

**Note**  
Retry contacts (C4) are placed at the back of the queue – they do not retain their original position. You can compensate for this by adjusting routing priority or routing age in C4's callback creation flow as described above.

**Note**  
The [Set routing criteria](set-routing-criteria.md) block can be used in the outbound flow to dynamically increase priority across retry attempts (for example, priority 5 to 3 to 1 using a retry counter attribute). Priority changes take effect at the point the contact re-enters the queue.

### Control retry timing
<a name="customer-first-callback-retries-timing"></a>

By default, retry timing is not system-controlled for customer first callbacks – you have full control over when a retry is initiated.

To introduce a delay between retry attempts, use the **Initial delay** parameter in the [Transfer to queue](transfer-to-queue.md) block when recreating the callback contact (C4) in the C3 outbound flow. This is the recommended approach because it:
+ Allows the flow to disconnect from the customer's voicemail once a retry decision has been made, avoiding long silent voicemails or the voicemail disconnecting the call and ending the flow prematurely.
+ Allows you to track scheduled retries under the `CONTACTS_SCHEDULED` metric.

A typical retry flow with timing control looks like:

1. [Check call progress](check-call-progress.md) – voicemail detected.

1. **Set contact attributes** – set `retry = true` (and optionally increment a retry counter).

1. **Create callback** – recreate the contact as C4 using the [Transfer to queue](transfer-to-queue.md) block with the **Initial delay** set to the desired interval (for example, 5 minutes).

## Metrics for customer first callbacks
<a name="customer-first-callback-metrics"></a>

You can access the following metrics in either the Queue performance dashboard or by using the [GetMetricDataV2](https://docs.aws.amazon.com/connect/latest/APIReference/API_GetMetricDataV2.html) API.
+ [Average queue abandon time - customer first callback](metrics-definitions.md#average-queue-abandon-time-customer-first-callback)
+ [Average queue answer time - customer first callback](metrics-definitions.md#average-queue-answer-time-customer-first-callback)
+ [Average speed of answer - customer first callback dialed](metrics-definitions.md#average-speed-of-answer-customer-first-callback-dialed)
+ [Average wait time after customer connection - customer first callback](metrics-definitions.md#average-wait-time-after-customer-connection-customer-first-callback)
+ [Callback attempts - customer first callback](metrics-definitions.md#callback-attempts-customer-first-callback)
+ [Contact volume - agent first callback](metrics-definitions.md#contact-volume-agent-first-callback)
+ [Contact volume - customer first callback](metrics-definitions.md#contact-volume-customer-first-callback)
+ [Contacts abandoned - customer first callback](metrics-definitions.md#contacts-abandoned-customer-first-callback)
+ [Contacts handled - customer first callback](metrics-definitions.md#contacts-handled-customer-first-callback)

## Example contact records for customer first callbacks
<a name="customer-first-callback-contact-lifecycle-contact-model"></a>

Following are example contact records to show what information is stored for the C2 and C3 legs of a customer first callback.

### Example C2 queued customer first callback contact record
<a name="customer-first-callback-contact-lifecycle-contact-model-c2"></a>

```
InitialContactId : C1 (Inbound contact)
ContactId : C2 (this contact)
PreviousContactId : C1 (Inbound contact)
NextContactId : C3 (Dialed customer first callback contact)
Channel : VOICE,
InitiationMethod : CALLBACK_CUSTOMER_FIRST_QUEUED, 

ConnectedToSystemTimeStamp : time // Timestamp when callback creation flow got started

CustomerEndpoint : customer phone number endpoint

DisconnectTimestamp : time // Timestamp indicating contact is disconnected and customer will be dialed

DisconnectReason : // Disconnect reason code 

InitiationTimeStamp : time // Timestamp indicating customer first callback has been created in connect systems

QueueInfo : {
    Arn : arn // Queue arn representing customer first callback queue
    EnqueueTimeStamp : time // Timestamp indicating customer first callback has been put in queue and waiting out to dial.
    DequeueTimeStamp : time // Timestamp indicating customer first callback has been taken out from queue to dial out end customer.
    Duration : time // total time it took connect systems to dial out end customer. 
}
```

### Example C3 dialed customer first callback contact
<a name="customer-first-callback-contact-lifecycle-contact-model-c3"></a>

```
InitialContactId : C1 (Inbound contact)
ContactId : C3 (this contact)
PreviousContactId : C2 (Queued customer first callback contact)
Channel : VOICE,
InitiationMethod : CALLBACK_CUSTOMER_FIRST_DIALED,

ConnectedToSystemTimeStamp : time // Timestamp when the outbound call associated with callback was connected with customer.

CustomerEndpoint : customer phone number endpoint

SystemEndpoint : Outbound caller id assigned to the outbound queue

Agent : {
    // All agent information associated with the outbound call. 
    // Like Agent Arn, ConnectToAgentTimestamp, ACW duration etc. 
}

AgentConnectionAttempts : number

DisconnectTimestamp : time // Timestamp indicating outbound call for the callback is disconnected

DisconnectReason : // Disconnect reason code

SegmentAttributes : { 
    'connect:TrafficType' : 'CUSTOMER_FIRST_CALLBACK'
}, 

AnsweringMachineDetectionStatus : HUMAN_ANSWERED|VOICEMAIL_BEEP|VOICEMAIL_NO_BEEP|AMD_UNANSWERED|AMD_UNRESOLVED|AMD_NOT_APPLICABLE|SIT_TONE_BUSY|SIT_TONE_INVALID_NUMBER|SIT_TONE_DETECTED|FAX_MACHINE_DETECTED|AMD_ERROR|AMD_UNRESOLVED_SILENCE(WIP)

CustomerVoiceActivity : {
    GreetingStartTimestamp : timestamp
    GreetingEndTimestamp : timestamp
}

InitiationTimeStamp : time // Timestamp indicating start of outbound call to customer
 
QueueInfo : {
    Arn : arn // Queue arn representing customer first callback queue
    EnqueueTimeStamp : time // Timestamp indicating customer first callback has been put in queue to join with agent.
    DequeueTimeStamp : time // Timestamp indicating customer first callback has been taken out from queue to join with agent.
    Duration : time // total time it took connect systems to join dialed end customer with agent.
    CallbackTotalQueueDuration : time // total time the customer first callback spent in queue (Includes the total queued time for C2 and C3.)
}
```

## Sample flows for customer first callbacks
<a name="customer-first-callback-contact-lifecycle-sample-flows"></a>

The following sample flows show how you can configure a flow for customer first callbacks.

### Sample Inbound call flow
<a name="customer-first-callback-contact-lifecycle-sample-flows-inbound"></a>

The following image shows a [Transfer to queue](transfer-to-queue.md) block in a flow.

![\[A Transfer to queue block in a customer first callback flow.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-first-callback-contact-lifecycle-sample-flows-inbound-1.png)


In this flow, the [Transfer to queue](transfer-to-queue.md) has **Set creation flow** configured and an outbound dial flow is specified.

![\[A Transfer to queue block, where Set creation flow is configured and the outbound dial flow is specified.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-first-callback-contact-lifecycle-sample-flows-inbound-2.png)


### Sample callback creation flow configuration
<a name="customer-first-callback-contact-lifecycle-sample-flows-creation"></a>

The following image shows a sample callback creation flow. The [Set customer queue flow](set-customer-queue-flow.md) block is configured so a customer queue flow runs while the callback contact is in queue waiting for agent availability to dial out to customers.

![\[A sample callback creation flow with a Set customer queue block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-first-callback-contact-lifecycle-sample-flows-creation-1.png)


### Example outbound dial flow for callbacks
<a name="customer-first-callback-contact-lifecycle-sample-flows-outbound"></a>

In the outbound dial flow shown in the following image, Amazon Connect evaluates the presence of the customer by using a [Check call progress](check-call-progress.md) block. If voicemail is detected, a callback contact is recreated. If a customer is detected on other end of the call, the call is transferred to queue for the agent to be joined to the customer.

![\[An outbound dial flow with a Check call progress block\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-first-callback-contact-lifecycle-sample-flows-outbound-1.png)


# Import and export flows between flow designers in Amazon Connect
<a name="contact-flow-import-export"></a>

Use the procedures described in this topic to import/export a flows from the previous flow designer to the new one, from one instance to another, or from one Region to another as you expand your customer service organization.

**Important**  
**Deprecation of Legacy Flow Import Support**  
Support for importing legacy flows into the flow designer will end on **03/31/2026**. To ensure continued functionality of importing offline flow configuration into flow designer, follow these update steps:  
Legacy flows must be manually imported using the updated flow designer to convert them into the new flow language format. It's important to note that copy and paste functionality in the updated flow designer only works with flows that use the new flow language.
This update process is relevant for users who maintain and store flow configurations in offline JSON such as for configuration control. To continue using any portion of these stored flows in the updated flow designer, you must first import them to convert them to the new flow language. After they are converted, you can freely copy and paste flow components within the updated flow designer.
If you rely on an offline data store for your flow configuration as your source of truth, please ensure you update your flows configuration to the new format before the **03/31/2026** deadline.

To migrate tens or hundreds of flows, use the APIs described in [Migrate flows to an instance, Region, or environment in Amazon Connect](migrate-contact-flows.md). 

The flow import/export feature is currently in Beta status. Updates and improvements that we make could result in issues in future releases importing flows that are exported during the beta phase.

## Export limitations
<a name="contact-flow-export-limitations"></a>

You can export flows that meet the following requirements:
+ The flow has fewer than 200 blocks.
+ The total size of the flow is less than 1MB.

We recommend dividing large flows in to smaller ones to meet these requirements.

## Block counter
<a name="contact-flow-block-counter"></a>

Use the block counter to track how many blocks are in a flow. The block counter also helps you meet the limit of 200 blocks for import and export operations.

The following image shows an example flow with the block counter. It displays a warning that 201 blocks are used.

![\[The block counter, a warning that 201 blocks are used.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/block-counter.png)


## Flows are exported to JSON files
<a name="contact-flow-export-json"></a>

A flow is exported to a JSON file. It has the following characteristics:
+ The JSON includes a section for each block in the flow.
+ The name used for a specific block, parameter, or other element of the flow may be different than the label used for it in the flow designer.

By default, flow export files are created without a file name extension, and saved to the default location set for your browser. We suggest saving your exported flows to folder that contains only exported flows.

## How to import/export flows
<a name="how-to-import-export-contact-flows"></a>

**To export a flow**

1. Log in to your Amazon Connect instance using an account that is assigned a security profile that includes view permissions for flows.

1. Choose **Routing**, **Contact flows**.

1. Open the flow to export.

1. Choose **Save**, **Export flow**.

1. Provide a name for the exported file, and choose **Export**.

**To import a flow**

1. Log in to your Amazon Connect instance. The account must be assigned a security profile that includes edit permissions for flows.

1. On the navigation menu, choose **Routing**, **Contact flows**.

1. Do one of the following:
   + To replace an existing flow with the one you are importing, open the flow to replace.
   + Create a new flow of the same type as the one you are importing.

1. Choose **Save**, **Import flow**.

1. Select the file to import, and choose **Import**. When the flow is imported into an existing flow, the name of the existing flow is updated, too.

1. Review and update any resolved or unresolved references as necessary.

1. To save the imported flow, choose **Save**. To publish, choose **Save and Publish**.

## Resolve resources in imported flows
<a name="contact-flow-export-resources"></a>

When you create a flow, the resources you include in the flow, such as queues and voice prompts, are referenced within the flow using the name of the resource and the Amazon Resource Name (ARN). The ARN is a unique identifier for a resource that is specific to the service and Region in which the resource is created. When you export a flow, the name and ARN for each resource referenced in the flow is included in the exported flow.

When you import a flow, Amazon Connect attempts to resolve the references to the Amazon Connect resources used in the flow, such as queues, by using the ARN for the resource. 
+ When you import a flow into the same Amazon Connect instance that you exported it from, the resources used in the flow will resolve to the existing resources in that instance.
+ If you delete a resource, or change the permissions for a resource, Amazon Connect may not be able to resolve the resource when you import the flow.
+ When a resource cannot be found using the ARN, Amazon Connect attempts to resolve the resource by finding a resource with the same name as the one used in the flow. If no resource with the same name is found, a warning is displayed on the block that contains a reference to the unresolved resource.
+ If you import a flow into a different Amazon Connect instance than the one it was exported from, the ARNs for the resources used are different.
+ If you create resources in the instance with the same name as the resource in the instance where the flow was exported from, the resources can be resolved by name. 

  You can also open the blocks that contain unresolved resources, or resources that were resolved by name, and change the resource to another one in the Amazon Connect instance.

You can save a flow with unresolved or missing resources. You can publish a flow with unresolved or missing resources only for optional parameters. If any required parameter has an unresolved resource, you cannot publish the flow until the resources are resolved.

# Create conversational AI bots in Amazon Connect
<a name="connect-conversational-ai-bots"></a>

You can use the Amazon Connect admin website to create, edit, and continuously improve conversational AI bots for interactive voice response (IVR) and chatbot self-service experiences. The bots are powered by Amazon Lex.

By using the Amazon Connect admin website, you can deliver dynamic, conversational AI experiences to understand your customer's intent, ask follow-on questions, and automate the resolution of their issues. The topics in this section explain how to enable the bot building experience in Amazon Connect admin website, and how to build your bot.

**Topics**
+ [Enable bot and analytics in Amazon Connect](enable-bot-building.md)
+ [Create a bot](work-bot-building-experience.md)
+ [Create a flow and add your conversational AI bot](create-bot-flow.md)
+ [Configure third-party speech providers](configure-third-party-speech-providers.md)
+ [Create an Connect AI agents intent](create-qic-intent-connect.md)
+ [Create bot versions and aliases](create-bot-version.md)
+ [Evaluate the performance of your conversational AI bot](lex-bot-analytics.md)
+ [Bot metrics and analytics](bot-metrics.md)
+ [Bot Advanced configuration](bot-advanced-config.md)
+ [Add an Amazon Lex bot](amazon-lex.md)

# Enable bot building and analytics in Amazon Connect
<a name="enable-bot-building"></a>

Complete the following steps to enable users to create Amazon Lex bots in the Amazon Connect admin website and view metrics about bot performance.

Users can not edit LEX V1 bots or cross-regional bots from within Amazon Connect.

1. Open the [Amazon Connect console.](https://console.aws.amazon.com/connect/)

1. Select the Amazon Connect instance that you want to integrate with your Amazon Lex bot.  
![\[The Amazon Connect virtual contact center instances page, the instance alias.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/instance.png)

1. On the navigation menu, choose **Flows**.

1. Choose **Enable Lex Bot Management in Amazon Connect** and **Enable Bot Analytics and Transcripts in Amazon Connect**, and then **Save**.  
![\[The Amazon Lex bots page, the options to enable Lex bot management and analytics Amazon Connect.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lex-bot-service-linked-role.png)

   
**Note**  
If you already have existing Service Control Policies (SCP) in place that block access to Lex, Amazon Connect respects those policies and does not enable the Bot Management and Analytics feature. However, if you put those SCP policies in place after you've already enabled this feature, they won't be respected. In that case, you'll need to disable this feature.

   Amazon Connect displays the service role and service linked role name it uses. uses Amazon Lex resource-based policies to make calls to your Amazon Lex bot. When you associate an Amazon Lex bot with your Amazon Connect instance, the resource-based policy on the bot is updated to give Amazon Connect permission to invoke the bot. 

   For more information about Amazon Lex resource-based policies, see [Resource-based policies within Amazon Lex V2](https://docs.aws.amazon.com/lexv2/latest/dg/security_iam_service-with-iam.html#security_iam_service-with-iam-resource-based-policies) in the *Amazon Lex V2 Developer Guide*.

1. Assign the following security profile permissions to users who need to create and manage bots and bot analytics: 
   + **Channels and Flows** - **Bots** - **View**, **Edit**, **Create** permissions
   + **Analytics and Optimization** - **Historical metrics** - **Access** permission

# Create a bot by using the Amazon Connect admin website
<a name="work-bot-building-experience"></a>

You can build complete Lex bots in the Amazon Connect admin website without ever leaving the Amazon Connect interface. There is no charge for building or editing bots in Amazon Connect. Instead, you are billed by Amazon Lex for usage. For pricing information, see the [Amazon Lex pricing](https://aws.amazon.com/lex/pricing/) page.

**To create a bot**

1. Log in to the Amazon Connect admin website at https://*instance name*.my.connect.aws/. Use an Admin account or an account that has **Channels and Flows** - **Bots** - **Create** permission in its security profile.

1. In the left navigation menu, choose **Routing**, **Flows**.

1. On the **Flows** page, choose **Bots**, **Create bot**.   
![\[The Flows page, the Bots tab, the Create bot button.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/flows-bots-tab.png)

1. In the **Details** dialog box, provide the following information: 
   + **Bot name**: Enter a unique name for the bot.
   + **Bot description**: - (Optional) Provide additional information about the purpose of the bot.
   + **Child Online Privacy Protection Act (COPPA)**: Choose whether the bot is subject to the Child Online Privacy Protection Act.

   The following image shows the **Details** dialog box and these options.  
![\[Bot creation details page with name, description, and COPPA settings.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/bot-create.png)

1. Choose **Create**. After the bot is successfully created, you are directed to the bot configuration page. The following image shows an example page for a newly created bot named **HotelBookingBot**.  
![\[A sample configuration page for an unconfigured bot.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/hotelbookingbot.png)

1. On the bot configuration page, choose **Add language**. Choose the primary language for your bot and your preferred way to create this language.   
![\[A sample Define your bot page, the Add language dropdown box.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/bot-language-create.png)

1. After you choose your language, you are directed to the **Define your bot** section. An example section is shown in the following image. This section is where you'll add intents.  
![\[A sample Define bot section.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/define-bot-page.png)

## Add intents to your bot
<a name="define-bot"></a>

In the **Define your bot** section, you add intents. Intents are the goals that your users want to accomplish, such as ordering flowers or booking a hotel.

Your bot must have at least one intent. There are two types of intents:
+ Custom intents: Create intents that represent the actions or requests your bot should handle. This topic explains how to create custom intents. 
+ Build-in intents: By default, all bots contain a single built-in intent, the fallback intent. This intent is used when the bot does not recognize any other intent. For example, if a user says "I want to order flowers" to a hotel booking intent, the fallback intent is triggered. The following image shows an example of a built-in intent.  
![\[The Use built-in intent dialog box, a built-in intent names AMAZON.HelpIntent.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/built-in-intent.png)

**To create a custom intent**

1. Choose **Add intent**, and then choose **Add empty intent**. 

1. In the **Add intent** dialog box, enter a name for your intent and a description that's meaningful to you. Choose **Add**.

1. Enter the following information to configure your intent:
   + Add sample **Utterances**: Choose **Add** and then provide phrases or questions that users might use to express that intent. Choose **Save**. 
   + Configure **Slots**: Choose **Add** and then define the slots, or parameters, required to fulfill the intent. Each slot has a type that defines the values that can be entered in the slot. Choose **Add** to add the slot. When you're done adding slots, choose **Save**.
   + Create **Prompts**: Choose **Edit** and then you can enter prompts that the bot will use to ask for information or clarify user inputs. Choose **Save** when finished.
     + **Initial response message**: The initial message sent to the user after the intent is invoked. You can provide responses, initialize values, and define the next step that the bot takes to respond to the user at the beginning of the intent.
     + **Confirmation prompt and responses**: These are used to confirm or decline fulfillment of the intent. The confirmation prompt asks the user to review slot values. For example, "I've booked a hotel room for Friday. Is this correct?" The declination response is sent to the user when they decline the confirmation. 
     + **Closing response message**: This is the response sent to the user after the intent is fulfilled and all other messages are played. For example, "Thank you for booking a hotel room." 

For more information about intents for Amazon Lex bots intents and advanced configurations, see [Adding intents](https://docs.aws.amazon.com/lexv2/latest/dg/add-intents.html) in the *Amazon Lex V2 Developer Guide*.

# Create a flow and add your conversational AI bot
<a name="create-bot-flow"></a>

This topic explains how to add a previously created conversational AI bot to a flow. 

1. On the navigation menu in Amazon Connect, choose **Routing**, **Flows**, **Create flow**, and type a name for the flow.

1. Under **Interact**, drag a [Get customer input](get-customer-input.md) block onto the designer, and connect it to the **Entry ** point block.

1. Choose the [Get customer input](get-customer-input.md) block to open it.

1. On the Amazon Lex tab, use the dropdown menus to select the bot you created earlier and the alias, as shown in the following image.  
![\[The Get customer input block properties, the Amazon Lex tab.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/get-customer-input-lextab.png)

1. Under **Customer prompt or bot initialization**, choose **Text-to-speech or chat text**.

1. Type a message that provides callers with information about what they can do. For example, use a message that matches the intents used in the bot, such as *To check your account balance, press or say 1. To speak to an agent, press or say 2*. The following image shows this message on the properties page of the [Get customer input](get-customer-input.md) block.  
![\[The customer prompt or bot initialization section of the Get customer input block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-prompt-bot-initialization.png)

1. Under **Intents**, choose **Add an intent**, and then enter or search for the customer intents that should trigger the bot.   
![\[The Intents section, the Add an intent button, search button.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/add-intent.png)

   When you search for intents, you can filter by the locale. The locale is only used for filtering, it is not tied to the locale when the bot is triggered. For example, you might find the BookHotel intent by using the English (US) locale, but the intent can be successfully returned in both English (US) and English (GB).

   For more information on finding intents, see [How to find intents](#find-notlisted-intents). 

   The following image shows the dialog box to filter intents by locale.  
![\[The search option, the Filter using locale to add intent dialog box.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/filter-intents.png)

1. Choose **Save**.

**Important**  
If you're using an Amazon Lex V2 bot, your language attribute in Amazon Connect must match the language model used to build your Lex bot. This is different than Amazon Lex (Classic). Use a [Set voice](set-voice.md#set-voice-lexv2bot) block to indicate the Amazon Connect language model, or use a [Set contact attributes](set-contact-attributes.md) block.

## How to find intents for Amazon Lex V1 bots, cross-Region bots, or dynamically set bots
<a name="find-notlisted-intents"></a>

The **Intents** dropdown box does not list intents for Amazon Lex V1 bots, cross region bots, or if the bot ARN is dynamically set. For these intents, try the following options to find them.
+ Check whether the **AmazonConnectEnabled** tag is set to true:

  1. Open the Amazon Lex console, choose **Bots**, select the bot, then choose **Tags**.

  1.  If the **AmazonConnectEnabled** tag is not present, add **AmazonConnectEnabled = true**.

  1.  Return to the Amazon Connect admin website. Refresh the flow designer to see the selections in **Get customer input** block.
+ Check if the version is associated with the alias: 

  1. In Amazon Connect admin website, choose **Routing**, **Flows**, the bot, **Aliases**. Verify that **Use in flow and flow modules** is enabled, as shown in the following image.  
![\[The Aliases tab, the Use in flow and flow modules toggle.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/bot-alias-enabled.png)

  1. Refresh the flow designer to see the selections in **Get customer input** block.

# Configure third-party speech providers in Amazon Connect
<a name="configure-third-party-speech-providers"></a>

You can configure third-party speech-to-text (STT) and text-to-speech (TTS) providers in Amazon Connect to expand language coverage, improve recognition accuracy, and deliver more expressive synthesized speech. This section describes how to configure third-party STT providers for bots and third-party TTS providers for use in contact flows.

**Topics**
+ [

# Configure third-party speech-to-text (STT) providers
](configure-third-party-stt.md)
+ [

# Configure third-party text-to-speech (TTS) providers
](configure-third-party-tts.md)
+ [

# Endpoints and Regions for third-party STT providers
](endpoints-regions-third-party-stt.md)
+ [

# Managing secrets and resource policies
](managing-secrets-resource-policies.md)

# Configure third-party speech-to-text (STT) providers
<a name="configure-third-party-stt"></a>

Use the following instructions to configure a third-party speech-to-text (STT) provider.

## Prerequisites
<a name="stt-prerequisites"></a>
+ A bot with an existing locale.
+ A third-party STT provider API key stored in AWS Secrets Manager. For more information about storing API keys as secrets in Secrets Manager, see [Create an AWS Secrets Manager secret](https://docs.aws.amazon.com/secretsmanager/latest/userguide/create_secret.html).
+ An Secrets Manager resource policy allowing Amazon Connect to retrieve the secret. For more information, see [Managing secrets and resource policies](managing-secrets-resource-policies.md).
+ AWS KMS key permissions allowing decryption. For more information, see [Managing secrets and resource policies](managing-secrets-resource-policies.md).
+ A provider model ID and Secrets Manager ARN.

## Step 1: Open the speech model configuration panel
<a name="stt-step1"></a>

1. Sign in to the Amazon Connect admin website.

1. Choose **Bots**, then choose the bot.

1. Choose the locale.

1. In the **Speech model** section, choose **Edit** to open the configuration modal.  
![\[The configuration page for your conversational AI bot.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/Lex/01-airlinesbot.png)

## Step 2: Choose the model type
<a name="stt-step2"></a>

In the **Model type** dropdown, choose **Speech-to-Text (STT)**. This ensures the locale is configured for transcription rather than speech-to-speech.

![\[The speech model dialog box.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/Lex/02-speech-model.png)


## Step 3: Review the default speech model settings
<a name="stt-step3"></a>

By default, Amazon is selected as the speech-to-text provider. Review the current settings before switching to a third-party provider.

![\[The speech model dialog box with Amazon selected as the voice provider.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/Lex/03-speech-model-amazon.png)


## Step 4: Choose a third-party STT provider
<a name="stt-step4"></a>

Open the **Voice provider** dropdown and choose a supported third-party speech-to-text provider.

![\[The speech model dialog box with Deepgram selected as the voice provider.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/Lex/04-speech-model-deepgram.png)


## Step 5: Enter the model ID and Secrets Manager ARN
<a name="stt-step5"></a>

1. In **Model ID**, enter the provider's model name.
   + Some providers require a minimum or maximum length.
   + Model IDs are case-sensitive and must match provider documentation.

1. In **Secrets Manager ARN**, enter the ARN of the secret that contains the provider API key.
   + The secret must be in the same Region as your Amazon Connect instance.
   + Secrets Manager and KMS key policies must permit Amazon Connect to access and decrypt the key. For more information, see [Managing secrets and resource policies](managing-secrets-resource-policies.md).

1. Choose **Continue** to save your changes.

## Build and activate the locale
<a name="stt-build-activate"></a>

If the locale shows **Unbuilt changes**, choose **Build language**. The new STT settings become active after a successful build.

## Runtime behavior (STT)
<a name="stt-runtime-behavior"></a>
+ Amazon Connect routes audio to the chosen third-party speech-to-text provider.
+ No changes to flows or Lambda functions are required.
+ Errors such as invalid credentials or invalid model IDs appear in logs.
+ Metrics and analytics continue to function normally.

## Troubleshooting (STT)
<a name="stt-troubleshooting"></a>
+ **Invalid model ID**: Confirm the value with provider documentation.
+ **Access denied**: Verify Secrets Manager and KMS permissions.
+ **Locale build fails**: Ensure required fields are valid.
+ **High latency**: Validate the provider region configuration.

# Configure third-party text-to-speech (TTS) providers
<a name="configure-third-party-tts"></a>

Use the following instructions to configure a third-party text-to-speech (TTS) provider.

## Prerequisites
<a name="tts-prerequisites"></a>
+ A contact flow exists (or you have permission to create one).
+ A third-party TTS provider API key stored in AWS Secrets Manager. For more information about storing API keys as secrets in Secrets Manager, see [Create an AWS Secrets Manager secret](https://docs.aws.amazon.com/secretsmanager/latest/userguide/create_secret.html).
+ An Secrets Manager resource policy allowing Amazon Connect to retrieve the key. For more information, see [Managing secrets and resource policies](managing-secrets-resource-policies.md).
+ AWS KMS key permissions allowing decryption. For more information, see [Managing secrets and resource policies](managing-secrets-resource-policies.md).
+ Provider-specific model and voice values.

## Step 1: Open the contact flow
<a name="tts-step1"></a>

1. Sign in to the Amazon Connect admin website.

1. Choose **Flows**.

1. Choose an existing flow or create a new one.

## Step 2: Add or choose a Set voice block
<a name="tts-step2"></a>

1. In the Flow designer, search for **Set voice**.

1. Drag the block onto the canvas or choose an existing one.

1. Choose the block to open its configuration panel.

## Step 3: Choose a third-party TTS provider
<a name="tts-step3"></a>

In the **Voice provider** dropdown, choose the third-party text-to-speech provider you want to use.

![\[The 'Set voice' configuration pane showing a drop-down list of voice providers.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/Lex/08-set-voice-amazon.png)


## Step 4: Specify model, voice, Secrets Manager ARN, and language
<a name="tts-step4"></a>

1. Under **Model**, choose **Set manually** and enter the provider model.

1. Under **Voice**, choose **Set manually** and enter the provider voice.

1. Under **Secrets Manager ARN**, choose **Set manually** and enter the ARN of the provider secret.
   + The secret must be in the same AWS Region.
   + AWS Secrets Manager and KMS policies must permit retrieval and decryption. For more information, see [Managing secrets and resource policies](managing-secrets-resource-policies.md).

1. Under **Language**, choose **Set manually** and choose a language that is supported by the provider voice.  
![\[The 'Voice provider' configuration pane showing the ElevenLabs third-party voice provider.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/Lex/09-voice-provider-elevenlabs.png)

## Step 5: Save and publish the flow
<a name="tts-step5"></a>

1. Choose **Save** in the Flow designer.

1. Choose **Publish** to activate the updated flow settings.

## Runtime behavior (TTS)
<a name="tts-runtime-behavior"></a>
+ Amazon Connect sends text to the TTS provider for synthesis.
+ Returned audio is played to the customer.
+ Execution logs include provider errors such as invalid credentials or model values.

## Troubleshooting (TTS)
<a name="tts-troubleshooting"></a>
+ **No audio output**: Validate model and voice values.
+ **Authentication errors**: Verify Secrets Manager and KMS permissions.
+ **Dynamic attributes**: Ensure runtime values resolve to valid provider parameters.
+ **High latency**: Validate provider region alignment.

# Endpoints and Regions for third-party STT providers
<a name="endpoints-regions-third-party-stt"></a>

By default, Amazon Connect communicates with the following endpoints:

**Deepgram**: [https://api.deepgram.com](https://api.deepgram.com)

**ElevenLabs**: [https://api.elevenlabs.io](https://api.elevenlabs.io)

You can specify a different provider Region alongside your API key as part of the JSON object:

```
{
  "apiToken": "XXXXX",
  "apiTokenRegion": "xx"
}
```

The following regions are supported:


| **Provider** | **apiTokenRegion** | **Endpoint** | 
| --- | --- | --- | 
| Deepgram | eu | [https://api.eu.deepgram.com](https://api.eu.deepgram.com) (only supported for speech-to-text) | 
| Deepgram | \$1SHORT\$1UID\$1.\$1REGION\$1SUBDOMAIN\$1 | https://\$1SHORT\$1UID\$1.\$1REGION\$1SUBDOMAIN\$1.api.deepgram.com (Deepgram Dedicated endpoints) | 
| ElevenLabs | us | [https://api.us.elevenlabs.io](https://api.us.elevenlabs.io) | 
| ElevenLabs | eu | [https://api.eu.residency.elevenlabs.io](https://api.eu.residency.elevenlabs.io) | 
| ElevenLabs | in | [https://api.in.residency.elevenlabs.io](https://api.in.residency.elevenlabs.io) | 

# Managing secrets and resource policies
<a name="managing-secrets-resource-policies"></a>

When you [configure a third-party speech provider](configure-third-party-speech-providers.md), you will need to create a secret in Secrets Manager that contains the speech provider's API key. Creating the secret is a two step process:
+ Create the secret containing the API key. For instructions, see [Create an AWS Secrets Manager secret](https://docs.aws.amazon.com/secretsmanager/latest/userguide/create_secret.html).
+ Configure the necessary permissions:
  + Attach a resource-based policy to the secret.
  + Attach a resource-based policy to the KMS key (not the API key) associated with the secret. The KMS key protects the API key in the secret.

  These policies allow Amazon Connect to access to the API key within the secret. Note that you cannot use the default `aws/secretsmanager` KMS key; you will have to create a new key or use an existing customer-managed key. For more information about how KMS keys secure secrets, see [Secret encryption and decryption in Secrets Manager](https://docs.aws.amazon.com/secretsmanager/latest/userguide/security-encryption.html).

Make sure that the resource-based policy for the secret includes the `aws:SourceAccount` and `aws:SourceArn` confused deputy conditions (see [The confused deputy problem](https://docs.aws.amazon.com/IAM/latest/UserGuide/confused-deputy.html)) and that the resource-based policy for the KMS key includes the `kms:EncryptionContext:SecretARN` condition. This will ensure that Amazon Connect can only access your API key secret in context of a single specific instance, and can only access your KMS key in context of both that instance and the specific secret.

## Example of a resource-based policy for Secrets Manager secrets
<a name="example-resource-policy-secrets-manager"></a>

The following is an example of a resource-based policy that you can attach to your secret.

```
{
  "Version":"2012-10-17",		 	 	                    
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Service": [
          "connect.amazonaws.com"
        ]
      },
      "Action": "secretsmanager:GetSecretValue",
      "Resource": "*",
      "Condition": {
        "ArnLike": {
          "aws:sourceArn": "///the ARN of your Amazon Connect instance///"
        },
        "StringEquals": {
          "aws:sourceAccount": "///Your account ID///"
        }
      }
    }
  ]
}
```

## Example of a resource-based policy for AWS KMS keys
<a name="example-resource-policy-kms-keys"></a>

The following is an example of a resource-based policy that you can attach to your KMS key.

```
{
  "Version":"2012-10-17",		 	 	                    
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Service": [
          "connect.amazonaws.com"
        ]
      },
      "Action": "kms:Decrypt",
      "Resource": "*",
      "Condition": {
        "ArnLike": {
          "aws:sourceArn": "///the ARN of your Amazon Connect instance///"
        },
        "StringEquals": {
          "aws:sourceAccount": "///Your account ID///",
          "kms:EncryptionContext:SecretARN": "///the ARN of your secrets manager secret///"
        }
      }
    }
  ]
}
```

## Attaching a resource-based policy to your Secrets Manager secret
<a name="attaching-resource-policy-secrets-manager"></a>

To attach a resource-based policy to your secret, go to the Secrets Manager console within the AWS Management Console, navigate to your secret, choose **Edit Permissions** or **Resource Permissions** and then add or modify the resource policy directly on the page so that it looks similar to the [example](#example-resource-policy-secrets-manager). You can also attach the resource policy through the AWS CLI's `put-resource-policy` command, or programmatically using the [PutResourcePolicy](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_PutResourcePolicy.html) API operation.

## Attaching a resource-based policy to your KMS key
<a name="attaching-resource-policy-kms-key"></a>

To attach a resource-based policy to your KMS key, go to the AWS Key Management Service console within the AWS Management Console, navigate to your KMS key and edit your key policy to look like the [example](#example-resource-policy-kms-keys). You can also update the key through the AWS CLI's `put-key-policy` command, or programmatically using the [PutKeyPolicy](https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html) API operation.

## Rotating API keys
<a name="rotating-api-keys"></a>

We recommend rotating API keys at least every 90 days to minimize the risk of compromise, and to maintain a well-practiced key rotation process for emergency situations.

To rotate an API key, you must rotate the secret in which it is contained. See [Rotate Secrets Manager secrets](https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotating-secrets.html) in the *Secrets Manager User Guide* for more information on how to rotate secrets. When you rotate an API key, it is recommended that you wait for the previous key's usage to drop to zero before revoking the old API key to ensure that ongoing requests are not impacted.

# Create an Connect AI agents intent from an Amazon Connect instance
<a name="create-qic-intent-connect"></a>

You can use the generative AI capabilities powered by Connect AI agents for your bot by enabling the [AMAZON.QinConnectIntent](https://docs.aws.amazon.com/lexv2/latest/dg/built-in-intent-qinconnect.html) in your bot. This is an Amazon Lex built-in intent. 

Complete the following steps to enable Connect AI agents.

1. Open the bot for which you want to add the **AMAZON.QinConnectIntent** intent.

1. Navigate to the **Configuration** tab in the bot builder interface.

1. Enable the **AMAZON.QinConnectIntent** intent by setting the toggle to on. The following image shows the location of the toggle.  
![\[A sample configuration page for an unconfigured bot.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/enable-qic-bot.png)

   The **Connect AI agents intent** toggle is only supported for bots created directly within the Amazon Connect admin website. To add Amazon Q capabilities to intents for bots created outside of Amazon Connect admin website, use the Amazon Lex console to update the configuration.

1. In the **Enable Connect AI agents intent **dialog box, use the dropdown menu to choose the Amazon Resource Name (ARN) of the Connect AI agents intent.  
![\[A Enable Connect AI agents intent dialog box.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/qic-intent-dropdownbox.png)

1. Choose **Confirm** to add **AMAZON.QinConnectIntent** intent support.
**Important**  
You cannot use **AMAZON.QInConnectIntent** along with intents without specific utterances such as **AMAZON.QnAIntent**, **AMAZON.BedrockAgentIntent** in the same bot locale. For more information, see [AMAZON.QinConnectIntent](https://docs.aws.amazon.com/lexv2/latest/dg/built-in-intent-qinconnect.html) in the *Amazon Lex V2 Developer Guide*. 

# Create bot versions and aliases in Amazon Connect
<a name="create-bot-version"></a>

To control which bot implementation your client uses, you create versions and aliases. 
+ A version acts as a numbered snapshot of your work.
+ You can point an alias to the version of your bot that you want to be available to your customers.

In between creating versions, you can continue to update the Draft version of your bot without affecting your customer's experience. This process is crucial for deploying bots in a production environment. 

## Create a version
<a name="create-bot-version1"></a>

Creating a new version preserves the current state of your bot configuration. Complete the following steps to create a new version of your Amazon Lex bot in Amazon Connect.

1. Open the bot for which you want to create a new version.

1. Choose the **Versions** tab, and then choose **Create version**.  
![\[The Versions tab, the Create version button.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/bot-versionstab.png)

1. In the **Create version** dialog box:

   1. Enter a version description (optional, but recommended for tracking changes)

   1. Choose **Create**. The following image shows an example **Create version** dialog box.  
![\[A Create version dialog box.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/create-version-bot.png)

After the version is created, you can associate it with aliases or you can use it to revert to a previous state of your bot.

## Create an alias
<a name="create-bot-alias-association"></a>

An alias is a pointer to a specific version of a bot. With an alias, you can easily update the version that your client applications are using. For example, you can point an alias to version 1 of your bot. When you are ready to update the bot, you create version 2 and change the alias to point to the new version. Because your applications use the alias instead of a specific version, all of your clients get the new functionality without needing to be updated. This allows for controlled rollouts and easy version management. 

**Important**  
If you want to use the bot in a flow, be sure to choose **Enable for use in flow and flow modules** when you create an alias.

Complete the following steps to create an alias for your Amazon Lex bot.

1. Open the bot for which you want to add the alias.

1. Choose the **Aliases** tab, and then choose **Create aliases**.  
![\[The Alias tab, the Create aliases button.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/bot-aliases-button.png)

1. In the **Create Alias** dialog box:

   1. Enter a unique name for the alias.

   1. Provide a description for the alias (optional, but recommended).

   1. Select the bot version you want to associate with this alias.

   1. (Recommended) Choose **Enable for use in flow and flow modules**. This is required if you want to use the bot in a flow.

   1. Choose **Create**. The following image shows an example **Create alias** dialog box.  
![\[A Create Alias dialog box.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/bot-create-alias.png)

For more information about versioning and aliasing in Amazon Lex V2, see [Versioning and aliases with your Lex V2 bot](https://docs.aws.amazon.com/lexv2/latest/dg/versions-aliases.html) in the *Amazon Lex V2 Developer Guide*. 

# Evaluate the performance of your conversational AI bot in Amazon Connect
<a name="lex-bot-analytics"></a>

You can use the comprehensive analytics tools in Amazon Connect to help you evaluate and optimize your conversational AI bot performance. These insights enable you to identify successful interactions, pinpoint failure points, and visualize conversation patterns to continuously improve customer experience.

The analytics dashboard includes key metrics such as Utterance recognition rate and Conversation performance. These metrics help you understand both the success and failure rates of your bot's interactions with customers.

**Note**  
The Bot Analytics page shows data for conversations triggered only from flows. You can trigger bots externally using Lex APIs or custom integrations, but data for those conversations are not reflects on this page.

**To view analytics for your bot**

1. Log in to the Amazon Connect admin website at https://*instance name*.my.connect.aws/. Use an Admin account or an account that has the following permissions in its security profile:
   + **Channels and Flows** - **Bots** - **View**
   + **Channels and Flows** - **Bots** - **Edit**
   + **Analytics and Optimization** - **Historical metrics** - **Access**

1. In the left navigation menu, choose **Routing**, **Flows**.

1. On the **Flows** page, choose **Bots**, choose the bot whose performance you want to evaluate, and then choose **Analytics**.  
![\[The Flows page, the Analytics tab.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/bot-analytics1.png)

 The following image shows sample analytics data.

![\[The Analytics tab with sample analytics data for a bot.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/bot-analytics.png)


Use these analytics to identify improvement opportunities, refine your bot's responses, and enhance the overall customer experience.

For additional metrics and advanced analysis techniques specific to Amazon Lex, see [Monitoring bot performance in Lex V2](https://docs.aws.amazon.com/lexv2/latest/dg/monitoring-bot-performance.html).

# Amazon Connect bot metrics and analytics
<a name="bot-metrics"></a>

The following flow driven metrics are available on the [Flows and conversational bot performance dashboard](flows-performance-dashboard.md) and the [GetMetricDataV2](https://docs.aws.amazon.com/connect/latest/APIReference/API_GetMetricDataV2.html).

## Average bot conversation time
<a name="average-bot-conversation-time-metric"></a>

This metric measures the average duration of completed conversations for which the invoking resource (flow or flow module) started between the specified start and end time. 

**Metric type**: String (*hh:mm:ss*)

**Metric category**: Flow driven metric

**How to access using the Amazon Connect API**: 
+ [GetMetricDataV2](https://docs.aws.amazon.com/connect/latest/APIReference/API_GetMetricDataV2.html) API metric identifier: `AVG_BOT_CONVERSATION_TIME`

   It can be filtered on specific conversation outcomes with `BOT_CONVERSATION_OUTCOME_TYPE` metric level filter.

**Calculation logic**:
+ Sum(Conversation Start Time - Conversation End Time of all filtered conversations) / (Count of all filtered conversations)

**Notes**:
+ Data for this metric is available starting from December 2, 2024 00:00:00 GMT.

## Average bot conversation turns
<a name="average-bot-conversation-turns-metric"></a>

This metric provides the average number of turns for completed conversations for which the invoking resource (flow or flow module) started between the specified start and end time. 

A single turn is a request from the client application and a response from the bot.

**Metric type**: Double

**Metric category**: Flow driven metric

**How to access using the Amazon Connect API**: 
+ [GetMetricDataV2](https://docs.aws.amazon.com/connect/latest/APIReference/API_GetMetricDataV2.html) API metric identifier: `AVG_BOT_CONVERSATION_TURNS`

   It can be filtered on specific conversation outcomes with `BOT_CONVERSATION_OUTCOME_TYPE` metric level filter.

**Calculation logic**:
+ Sum(Conversation Turn of all filtered conversations) / (Count of all filtered conversations)

**Notes**:
+ Data for this metric is available starting from December 2, 2024 00:00:00 GMT.

## Bot conversations completed
<a name="bot-conversations-completed-metric"></a>

This metric provides the count of completed conversations for which the invoking resource (flow or flow module) started between the specified start and end time. The conversation end time can be beyond the specified end time. 

For example, if you request this metric with start time at 9 AM and end time at 10 AM, the result includes conversations where the invoking resource (flow or flow module):
+ started at 9:15 AM and ended at 9:40 AM
+ started at 9:50 AM and ended at 10:10 AM

but will exclude conversations for which the invoking resource (flow or flow module):
+ started at 8:50 AM and ended at 9:10 AM

**Metric type**: Integer

**Metric category**: Flow driven metric

**How to access using the Amazon Connect API**: 
+ [GetMetricDataV2](https://docs.aws.amazon.com/connect/latest/APIReference/API_GetMetricDataV2.html) API metric identifier: `BOT_CONVERSATIONS_COMPLETED`

  It can be filtered on the following conversation outcomes using metric level filter `BOT_CONVERSATION_OUTCOME_TYPE`.
  + SUCCESS: The final intent in the conversation is categorized as *success*.
  + FAILED: The final intent in the conversation is failed. The conversation is also failed if Amazon Lex V2 defaults to the `AMAZON.FallbackIntent`.
  + DROPPED: The customer does not respond before the conversation is categorized as *success* or *failed*.

**Calculation logic**:
+ Total count of conversations.

**Notes**:
+ Data for this metric is available starting from December 2, 2024 00:00:00 GMT.

## Bot intents completed
<a name="bot-intents-completed-metric"></a>

This metric provides the count of completed intents. It includes intents for completed conversations where the invoking resource (flow or flow module) started between the specified start and end time.

**Metric type**: Integer

**Metric category**: Flow driven metric

**How to access using the Amazon Connect API**: 
+ [GetMetricDataV2](https://docs.aws.amazon.com/connect/latest/APIReference/API_GetMetricDataV2.html) API metric identifier: `BOT_INTENTS_COMPLETED`

  It can be filtered on the following conversation outcomes using metric level filter `BOT_CONVERSATION_OUTCOME_TYPE`.

  It can be filtered on the following intent outcomes using metric level filter `BOT_INTENTS_OUTCOME_TYPE`.
  + SUCCESS: The bot successfully fulfilled the intent. One of the following situations is true:
    + The intent *state* is *ReadyForFulfillment* and the type of *dialogAction* is *Close*.
    + The intent `state` is `Fulfilled` and the type of `dialogAction` is `Close`.
  + FAILED: The bot failed to fulfill the intent. The intent state. One of the following situations is true:
    + The intent `state` is `Failed` and the `type` of `dialogAction` is `Close` (for example, the user declined the confirmation prompt).
    + The bot switches to the `AMAZON.FallbackIntent` before the intent is completed.
  + SWITCHED: The bot recognizes a different intent and switches to that intent instead, before the original intent is categorized as a *success* or *failed*.
  + DROPPED: The customer does not respond before the intent is categorized as *success* or *failed*.

**Calculation logic**:
+ Total count of intents.

**Notes**:
+ Data for this metric is available starting from December 2, 2024 00:00:00 GMT.

## Percent bot conversations outcome
<a name="percent-bot-conversations-outcome-metric"></a>

This metric provides the percentage of total conversations that ended in the specific outcome type specified in the metric level filter (`BOT_CONVERSATION_OUTCOME_TYPE`). It only includes completed conversations for which the invoking resource (flow or flow module) started between the specified start and end time. 

**Metric type**: Percent

**Metric category**: Flow driven metric

**How to access using the Amazon Connect API**: 
+ [GetMetricDataV2](https://docs.aws.amazon.com/connect/latest/APIReference/API_GetMetricDataV2.html) API metric identifier: `PERCENT_BOT_CONVERSATIONS_OUTCOME`

**How to access using the Amazon Connect admin website**: 

**Calculation logic**:
+ (Count of conversations with BOT\$1CONVERSATION\$1OUTCOME\$1TYPE)/(Total count of conversations) \$1 100

**Notes**:
+ Data for this metric is available starting from December 2, 2024 00:00:00 GMT.

## Percent bot intents outcome
<a name="percent-bot-intents-outcome-metric"></a>

This metric provides the percentage of intents that ended in the specific outcome type specified in the metric level filter (`BOT_INTENT_OUTCOME_TYPE`). It includes intents in completed conversations where the invoking resource (flow or flow module) started between the specified start and end time.

**Metric type**: Percent

**Metric category**: Flow driven metric

**How to access using the Amazon Connect API**: 
+ [GetMetricDataV2](https://docs.aws.amazon.com/connect/latest/APIReference/API_GetMetricDataV2.html) API metric identifier: `PERCENT_BOT_INTENTS_OUTCOME`

**How to access using the Amazon Connect admin website**: 

**Calculation logic**:
+ (Count of intents with BOT\$1INTENT\$1OUTCOME\$1TYPE)/(Total count of intents) \$1 100

# Bot Advanced configuration support from Amazon Connect
<a name="bot-advanced-config"></a>

The advanced configuration feature enables you to make detailed customizations to your bot without going to the Amazon Lex console.

1. On the Amazon Connect admin website, in the left navigation, choose **Flows**. Choose the **Bots** tab, and then choose the bot you want to work with.

1. Choose the **Advanced configurations** button, as shown in the following image.  
![\[The Advanced configurations button on a bot details page.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/bot-advanced-config.png)

   This action will switch the view to a more detailed interface where you can access more features to customize your bot. 

1. To switch back to the simple bot user interface, choose **Configuration summary**, as shown in the following image.  
![\[An Advanced configuration page, the Configuration summary button.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/bot-adv-config2.png)

# Add an Amazon Lex bot to Amazon Connect
<a name="amazon-lex"></a>

**Important**  
**End of support notice**: On September 15, 2025, AWS will discontinue support for Amazon Lex V1. After September 15, 2025, you will no longer be able to access the Amazon Lex V1 console or Amazon Lex V1 resources. To learn about migrating to Amazon Lex V2, see [Migrating a bot](https://docs.aws.amazon.com/lex/latest/dg/migrate.html).

In this article we guide you through the steps to add an Amazon Lex bot to Amazon Connect. 

With Amazon Lex, you can build conversational interactions (bots) that feel natural to your customers. Amazon Connect with Amazon Lex bots can also capture customer input as digits that customers enter on their numeric keypad when used in an Amazon Connect flow. This way customers can choose how they want to enter sensitive information such as account numbers. 

To follow along with this walkthrough, you need the following: 
+ An active AWS account. 
+ An Amazon Connect instance. 

**Tip**  
You can also use Amazon Lex to power interactive messages for Amazon Connect chat. Interactive messages are rich messages that present a prompt and pre-configured display options that a customer can select from. These messages are powered by Amazon Lex and configured through Amazon Lex using a Lambda. For more information, see [Add Amazon Lex interactive messages for customers in chat](interactive-messages.md).

## Create an Amazon Lex bot
<a name="lex-bot-create"></a>

In this step you'll create a custom bot to demonstrate the Press or Say integration with Amazon Connect. The bot prompts callers to press or say a number that matches the menu option for the task to complete. In this case, the input is checking their account balance.

------
#### [ Amazon Lex ]

1. Open the [Amazon Lex console.](https://console.aws.amazon.com/lexv2/home)

1. Choose **Create bot**.

1. On the **Configure bot settings** page, choose **Create - Create a blank bot** and provide the following information:
   + **Bot name** — For this walkthrough, name the bot **AccountBalance**.
   + **IAM permissions** — Select a role if you have one created. Otherwise, choose **Create a role with basic Amazon Lex permissions**.
   + **COPPA** — Choose whether the bot is subject to the Child Online Privacy Protection Act.
   + **Session timeout** — Choose how long the bot should wait to get input from a caller before ending the session.

1. Choose **Next**.

1. Provide language and voice specific information:
   + **Language** — Select language and locale from the list of [Languages and locales supported by Amazon Lex](https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html). 
   + **Voice interaction** — Select the voice for your bot to use when speaking to callers. The default voice for Amazon Connect is Joanna.

1. Choose **Done**. The AccountBalance bot is created, and the **Intent** page is displayed.

------
#### [ Amazon Lex (Classic) ]

1. Open the [Amazon Lex console.](https://console.aws.amazon.com/lex/)

1. If you are creating your first bot, choose **Get Started**. Otherwise, choose **Bots, Create**.

1. On the **Create your bot** page, choose **Custom bot** and provide the following information:
   + **Bot name** — For this walkthrough, name the bot **AccountBalance**.
   + **Output voice** — Select the voice for your bot to use when speaking to callers. The default voice for Amazon Connect is Joanna.
   + **Session timeout** — Choose how long the bot should wait to get input from a caller before ending the session.
   + **COPPA** — Choose whether the bot is subject to the Child Online Privacy Protection Act.

1. Choose **Create**.

------

## Configure the Amazon Lex bot
<a name="lex-bot-configure"></a>

In this step you'll determine how the bot responds to customers by providing intents, sample utterances, slots for input, and error handling.

For this example, you'll configure the bot with two intents: one to look up account information, and another to speak with an agent.

### Create AccountLookup intent
<a name="lex-bot-create-account-lookup-intent"></a>

------
#### [ Amazon Lex ]

1. After you created the bot, you are on the **Intents** page the Amazon Lex console. If you're not there, you can get there by choosing **Bots**, **AccountBalance**, **Bot versions**, **Draft version**, **Intents**. Choose **Add intent**, **Add empty intent**.

1. In the **Intent name** box, enter **AccountLookup**.

1. Scroll down the page to **Sample utterances**. In this step you enter utterances that allow the customer to elicit the AccountLookup intent. Enter the following utterances, and choose **Add utterance** after each one. 
   + **Check my account balance**
   + **One**: This assigns the utterance of "one" or key press of "1" to the **AccountLookup** intent.

   The following image shows where to add the utterance in the **Sample utterances** section.  
![\[The sample utterances section of the Intents page.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lexv2-enter-utterances.png)

1. Scroll to the **Slots** section, and choose **Add slot**. Complete the box as follows:

   1. **Required for this intent** = selected.

   1. **Name** = **AccountNumber**. 

   1. **Slot type** = **AMAZON.Number**. 

   1. **Prompts** = the text to be spoken when the call is answered. For example, ask callers to enter their account number using their keypad: **Using your touch-tone keypad, please enter your account number**. Choose **Add**.

   The following image shows a completed **Add slot** section.  
![\[The add slot section of the Intents page.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lexv2-add-slots.png)

1. Scroll to the **Closing responses** section. Add a message for the bot to say to customers. For example, **Your account balance is \$11,234.56**. (For this walkthrough, we aren't going to actually get the data, which is what you would do in reality.)

   The following image shows a completed **Closing responses** section.  
![\[The closing responses section of the Intents page.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lexv2-response1.png)

1. Choose **Save intent**.

------
#### [ Amazon Lex (Classic) ]

1. In the Amazon Lex console choose the **\$1** icon next to **Intents**, and choose **Create new intent**.

1. Name the intent **AccountLookup**.

1. Add a sample utterance, such as *Check my account balance*, and choose the **\$1** icon.

1. Add a second utterance, such as *One* and choose the **\$1** icon. This assigns the utterance of "one" or key press of "1" to the **AccountLookup** intent.
**Tip**  
You must add an utterance of "one" in the bot, and not the number "1". This is because Amazon Lex doesn't support numeric input directly. To get around this, later in this walkthrough you'll use numeric input to interact with a Lex bot invoked from a flow. 

1. Under **Slots**, add a slot named **AccountNumber**.

   The following image shows the location of the **Slots** section on the page.  
![\[The slot section on the Intents page.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lex-slots.png)

1. For **Slot type**, use the drop-down to choose **AMAZON.NUMBER**.

1. For **Prompt**, add the text to be spoken when the call is answered. For example, ask callers to enter their account number using their keypad: *Using your touch-tone keypad, please enter your account number*.

1. Choose the \$1 icon.

1. Make sure that the **Required **check box is selected.

1. In the **Response** section, add a message for the bot to say to customers. For example, **Your account balance is \$11,234.56**. 

1. Choose **Save Intent**.

------

### Create SpeakToAgent intent
<a name="lex-bot-create-speaktoagent-intent"></a>

------
#### [ Amazon Lex ]

1. Navigate to the **Intents** page: choose **Back to intents list**. 

1. Choose **Add intent**, **Add empty intent**. 

1. In the **Intent name** box, enter **SpeakToAgent**, and then choose **Add**. 

1. Scroll down to **Sample utterances** section. Enter the following utterances, which allow the customer to elicit the SpeakToAgent intent:
   + **Speak to an agent**
   + **Two**

1. Scroll down to the **Closing responses** section. Add a message for the bot to say to customers. For example, **Okay, an agent will be with you shortly**.

1. Choose **Save intent**.

------
#### [ Amazon Lex (Classic) ]

1. In the Amazon Lex console choose the **\$1** icon next to **Intents**, and choose **Create new intent**.

1. Name the intent **SpeakToAgent**.

1. Select **SpeakToAgent**.

1. Add a sample utterance, such as *Speak to an agent*, and choose **\$1**.

1. Add a second utterance, such as *Two*, and choose **\$1**.

1. Add a message that lets callers know that their call is being connected to an agent. For example, "Okay, an agent will be with you shortly."

1. Choose **Save Intent**.

------

## Build and test the Amazon Lex bot
<a name="lex-bot-build"></a>

After you create your bot, make sure it works as intended.

------
#### [ Amazon Lex ]

1. At the bottom of the page, choose **Build**. It may take a minute or two. The following image shows where the **Build** button is located.  
![\[The location of the Build button on the page.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lexv2-build-test-intent.png)

1. When it's finished building, choose **Test**.

1. Let's test the **AccountLookup** intent: In the **Test Draft version** pane, in the **Type a message** box, type **1** and press Enter. Then type a fictitious account number and press Enter. The following image shows where you enter intent.  
![\[The box where you type the intent to test.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lexv2-test1.png)

   1. Clear the test box.

   1. Type the intents you want to test.

1. To confirm that the **SpeakToAgent** intent is working, clear the test box, and then type **2** and press Enter. The following image shows what the test looks like after you clear it and then enter 2.  
![\[The test box.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lexv2-test2.png)

1. Close the **Test Draft version** pane.

------
#### [ Amazon Lex (Classic) ]

1. Choose **Build**. It may take a minute or two.

1. When it's finished building, choose **Test Chatbot**, as shown in the following image.  
![\[The test chatbot button, on the right side of the page.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lex-test-chatbot.png)

1. Let's test the **AccountLookup** intent: In the **Test Chatbot** pane, in the **Chat with your bot** box, type **1**. Then type a fictitious account number. In the following image, the arrow points to the box where you type 1.  
![\[The test bot, the box for typing your message.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lex-test-run.png)

1. Choose **Clear chat history**. 

1. To confirm that the **SpeakToAgent** intent is working, type **2**.

------

## Create a bot version (Optional)
<a name="lex-bot-create-bot-version"></a>

In this step you create a new bot version to use in an alias. It's how you create an alias that can be used in a production environment. Test aliases are subject to lower throttling limits. Although this is a test walkthrough, creating a version is a best practice.

------
#### [ Amazon Lex ]

1. If you're on the **Intents** page, choose **Back to intents list**.

1. On the left menu, choose **Bot versions**.

1. Choose **Create version**.

1. Review the details of the **AccountBalance** bot, and then choose **Create**.

   This creates a version of your bot (Version 1). You can switch versions on an non-test alias without having to track which version is getting published.  
![\[The Versions page with Version 1 listed.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lexv2-version1.png)

------

## Create an alias for the bot
<a name="lex-bot-create-alias"></a>

------
#### [ Amazon Lex ]

1. In the left menu, choose **Aliases**.

1. On the **Aliases** page, choose **Create alias**.

1. In the **Alias name** box, enter a name, such as **Test**. Later in this walkthrough you'll use this alias to specify this version of the bot in your flow. 
**Important**  
In a production environment, always use a different alias than **TestBotAlias** for Amazon Lex and **\$1LATEST** for Amazon Lex classic. **TestBotAlias** and **\$1LATEST** support a limited number of concurrent calls to an Amazon Lex bot. For more information, see [Runtime quotas](https://docs.aws.amazon.com/lexv2/latest/dg/quotas.html#quotas-service).

1. For **Associated version**, choose the version you just created, such as **Version 1**. 

1. Choose **Create**.

------
#### [ Amazon Lex (Classic) ]

1. Choose **Publish**.

1. Provide an alias for your bot. Use the alias to specify this version of the bot in the flow, for example, **Test**.
**Important**  
In a production environment, always use a different alias than **TestBotAlias** for Amazon Lex and **\$1LATEST** for Amazon Lex classic. **TestBotAlias** and **\$1LATEST** support a limited number of concurrent calls to an Amazon Lex bot. For more information, see [Runtime Service Quotas](https://docs.aws.amazon.com/lex/latest/dg/gl-limits.html#gl-limits-runtime).

1. Choose **Publish**.

------

## Add the Amazon Lex bot to your Amazon Connect instance
<a name="lex-bot-add-to-connect"></a>

------
#### [ Amazon Lex ]

1. Open the [Amazon Connect console.](https://console.aws.amazon.com/connect/)

1. Select the Amazon Connect instance that you want to integrate with your Amazon Lex bot.  
![\[The Amazon Connect virtual contact center instances page, the instance alias.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/instance.png)

1. On the navigation menu, choose **Flows**.

1. Under **Amazon Lex**, use the dropdown to select the Region of your Amazon Lex bot, and then select your Amazon Lex bot, **AccountBalance**. 

1. Select the Amazon Lex bot alias name from the dropdown (**Test**), and then choose **\$1 Add Lex Bot**. The following image shows Amazon Lex section after it has been configured.  
![\[The Amazon Lex section of the flows page.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lexv2-region-bot.png)

**Note**  
Amazon Connect uses Amazon Lex resource-based policies to make calls to your Amazon Lex bot. When you associate an Amazon Lex bot with your Amazon Connect instance, the resource-based policy on the bot is updated to give Amazon Connect permission to invoke the bot. For more information on Amazon Lex resource-based policies, see [How Amazon Lex works with IAM](https://docs.aws.amazon.com/lexv2/latest/dg/security_iam_service-with-iam.html#security_iam_service-with-iam-resource-based-policies).

------
#### [ Amazon Lex (Classic) ]

1. Open the [Amazon Connect console.](https://console.aws.amazon.com/connect/)

1. Select the Amazon Connect instance that you want to integrate with your Amazon Lex bot.

1. On the navigation menu, choose **Contact flows**.

1. Under **Amazon Lex**, select the Region of your Amazon Lex classic bot from the dropdown, and then select your Amazon Lex classic bot. It’s name will have the suffix "(Classic)". Then choose **Add Lex Bot**.

------

## Create a flow and add your Amazon Lex bot
<a name="lex-bot-create-flow-add-bot"></a>

**Important**  
If you're using an Amazon Lex V2 bot, your language attribute in Amazon Connect must match the language model used to build your Lex bot. This is different than Amazon Lex (Classic). Use a [Set voice](set-voice.md#set-voice-lexv2bot) block to indicate the Amazon Connect language model, or use a [Set contact attributes](set-contact-attributes.md) block.

Next, create a new flow that uses your Amazon Lex bot. When you create the flow, you configure the message played to callers.

1. Log in to your Amazon Connect instance with an account that has permissions for contact flows and Amazon Lex bots.

1. On the navigation menu, choose **Routing, Flows, Create Flow**, and type a name for the flow.

1. Under **Interact**, drag a [Get customer input](get-customer-input.md) block onto the designer, and connect it to the **Entry point block**.

1. Choose the **Get customer input** block to open it. Choose **Text to speech or chat text, Enter text**.

1. Type a message that provides callers with information about what they can do. For example, use a message that matches the intents used in the bot, such as "To check your account balance, press or say 1. To speak to an agent, press or say 2." The following image shows this message on the Properties page of the **Get customer input** block.  
![\[The Properties page of the Get customer input block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lex-get-customer-input.png)

1. Select the **Amazon Lex** tab, as shown in the following image.  
![\[The Amazon Lex tab on the Properties page of the Get customer input block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lexv2-get-customer-input2.png)

1. In the **Name** dropdown, select the **AccountBalance** bot you created earlier. 

   1. If you selected an Amazon Lex bot, under **Alias** use the dropdown menu to select the bot alias, **Test**. from 

   1. Amazon Lex Classic bots have the suffix "(Classic)" appended to their names. If you have selected a Classic bot, enter the alias you want to use in the **Alias** field.

   1. For Amazon Lex V2 bots, you also have the option of manually setting a bot alias ARN. Choose **Set manually**, then either type the ARN of the bot alias you want to use or set the ARN using a dynamic attribute.

1. Under **Intents**, choose **Add an intent**.

1. Type **AccountLookup** and choose **Add another intent**. The following image shows the **Intents** section configured with this information.  
![\[The Intents section of Amazon Lex tab.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lex-get-customer-input3.png)

1. Type **SpeakToAgent** and choose **Save**.

### Finish the flow
<a name="lex-bot-finish-flow"></a>

In this step you finish adding parts to the flow that run after the caller interacts with the bot:

1. If the caller presses 1 to get their account balance, use a **Prompt** block to play a message and disconnect the call.

1. If the caller presses 2 to speak to an agent, use a **Set queue** block to set the queue and transfer the caller to the queue, which ends the flow.

Here are the steps to create the flow:

1. Under **Interact**, drag a **Play prompt block** to the designer, and connect the **AccountLookup** node of the **Get customer input** block to it. After the customer gets their account balance from the Amazon Lex bot, the message in the **Play prompt** block plays.

1. Under **Terminate/Transfer**, drag a **Disconnect** block to the designer, and connect the **Play prompt** block to it. After the prompt message plays, the call is disconnected.

To complete the **SpeakToAgent** intent:

1. Add a **Set working queue** block and connect it to the **SpeakToAgent** node of the **Get customer input** block.

1. Add a **Transfer to queue** block. 

1. Connect the Success node of the **Set customer queue flow** block to the **Transfer queue**.

1. Choose **Save**, then **Publish**.

Your finished flow will look something like the following image. The flow starts with the **Get customer input** block. That block branches to **Play prompt** or **Set customer queue**.

![\[The finished flow in the flow designer.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lex-contactflow-designer.png)


**Tip**  
If your business uses multiple locales in a single bot, add a [Set contact attributes](set-contact-attributes.md) block to the beginning of your flow. Configure this block to use the [\$1.LanguageCode](connect-attrib-list.md#attribs-system-table) system attribute. 

## Assign the flow to a phone number
<a name="lex-bot-assign-number"></a>

When customers call in to your contact center, the flow to which they are sent is the one assigned to the telephone number that they called. To make the new flow active, assign it to a phone number for your instance.

1. Open the Amazon Connect console.

1. Choose **Routing, Phone numbers**.

1. On the **Manage Phone numbers** page, select the phone number to assign to the flow.

1. Add a description.

1. In the **Flow/IVR** menu, choose the flow that you just created.

1. Choose **Save**.

## Try it\$1
<a name="lex-bot-try-it"></a>

To try the bot and flow, call the number you assigned to the flow. Follow the prompts. 

# Best practices for using the chat channel and Amazon Lex
<a name="bp-lex-bot-chat"></a>

Following are some recommended best practices for using the chat channel and Amazon Lex together.
+ You can use the same bot for both the voice and chat channels. However, you may want the bot to respond differently based on the channel. For example, you want to return SSML for voice so a number is read as a phone number, but you want to return normal text to chat. You can do this by passing the **Channel** attribute. For instructions, see [How to use the same Amazon Lex bot for voice and chat](one-bot-voice-chat.md). 
+ For voice, some words are best spelled phonetically to get the correct pronunciation, such as last names. If this is the case with your scenario, include it in the design of your bot. Or, you can keep the voice and chat bots separate. 
+ Tell agents about the bot. When a contact is connected to the agent, the agent sees the entire transcript in their window. The transcript includes text from both the customer and the bot.

# Add Amazon Lex interactive messages for customers in chat
<a name="interactive-messages"></a>

Interactive messages are rich messages that present a prompt and pre-configured display options for a customer to choose. These messages are powered by Amazon Lex and configured through Amazon Lex using an AWS Lambda function. 

**Tip**  
If you have integrated with Apple Messages for Business, see [Interactive Message Types](https://register.apple.com/resources/messages/msp-rest-api/type-interactive) on the Apple website.

## Validation limits
<a name="validation-limits"></a>

The string field limits (for example, title, subtitle, etc.) are expected to be enforced by the client (that is, a custom built interface or the hosted communications widget). The [SendMessage](https://docs.aws.amazon.com/connect-participant/latest/APIReference/API_SendMessage.html) API checks only that the total size of the string is less than 20KB.
+ When you use the hosted communications widget without customizing it, if the string exceeds field limits, it is truncated on the user interface and an ellipsis (...) is appended. You can determine how to enforce field limits by customizing the widget. 
+ If you are integrating with other platforms (such as Apple Messages for Business), review the limits in this topic for Amazon Connect, and review the limits in the documentation for the other platform. For example, quick replies are not supported on older versions of iOS. 

All other field limits must be followed for the message to be successfully sent.

## Message display templates
<a name="message-display-templates"></a>

Amazon Connect provides the following message display templates. Use them to render information to customers in a chat:
+  [List picker](#list-picker)
+ [Time picker](#time-picker)
+ [Panel](#panel)
+ [Quick reply](#quick-reply-template)
+ [Carousel](#carousel-template)
+ [Apple form template](#apple-form-template)
+ [Apple pay template](#apple-pay-template)
+ [iMessage app template](#imessage-app-template)
+ [WhatsApp list](#whatsapp-list)
+ [WhatsApp reply button](#whatsapp-reply-button)
+ [Rich formatting in titles and subtitles](#rich-link-formatting)

These templates define how the information renders, and what information is surfaced in the chat interface. When interactive messages are sent through chat, flows validate that the message format follows one of these templates.

## List picker template
<a name="list-picker"></a>

Use the list picker template to present the customer with a list of up to six choices. Each choice can have its own image. 

The following images show two examples of how the list picker template renders information in a chat. 
+ One image shows three buttons, each one with the name of a fruit in text: apple, orange, banana.
+ The second image shows a picture of a store and then under it, three buttons, each one with the name, image, and price of the fruit.

![\[The list picker template rendering information in a chat.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/interactive-messages-listpicker-images2.png)


The following code is the list picker template that you can use in your Lambda. Note the following:
+ **Bold text** indicates a mandatory parameter.
+ In some cases, if the parent element isn't mandatory, but the fields in the parent element are, then the fields are mandatory. For example, see the `data.replyMessage` structure in the following template. If the structure exists, `title` is mandatory. Otherwise a complete `replyMessage` is optional. 

```
{
   "templateType":"ListPicker",                       
   "version":"1.0",                                   
   "data":{                                           
      "replyMessage":{                             
         "title":"Thanks for selecting!",             
         "subtitle":"Produce selected",
         "imageType":"URL",                                
         "imageData":"https://interactive-msg.s3-us-west-2.amazonaws.com/fruit_34.3kb.jpg",                          
         "imageDescription":"Select a produce to buy"
      },
      "content":{                                       
         "title":"What produce would you like to buy?",
         "subtitle":"Tap to select option",
         "imageType":"URL",                       
         "imageData":"https://interactive-msg.s3-us-west-2.amazonaws.com/fruit_34.3kb.jpg",                  
         "imageDescription":"Select a produce to buy",
         "elements":[                                   
            {
               "title":"Apple",                          
               "subtitle":"$1.00",
               "imageType":"URL",
               "imageData":"https://interactive-message-testing.s3-us-west-2.amazonaws.com/apple_4.2kb.jpg"
            },
            {
               "title":"Orange",                         
               "subtitle":"$1.50",
               "imageType":"URL",                  
               "imageData":"https://interactive-message-testing.s3-us-west-2.amazonaws.com/orange_17.7kb.jpg",           
            },
             {
               "title":"Banana",                         
               "subtitle":"$10.00",
               "imageType":"URL",                  
               "imageData":"https://interactive-message-testing.s3-us-west-2.amazonaws.com/banana_7.9kb.jpg",            
               "imageDescription":"Banana"
            }
         ]
      }
```

### List picker limits
<a name="list-picker-limits"></a>

The following table lists the limits for each of the list picker elements, should you choose to build your own Lambda from scratch. The mandatory parameters are in bold.

To send unlimited options, implement action buttons in your application. For more information, see [Implementation of action buttons in interactive message list picker/panel](https://github.com/amazon-connect/amazon-connect-chat-interface/blob/master/.github/docs/InteractiveMessageActionButtonImplementation.md). 


****  
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/connect/latest/adminguide/interactive-messages.html)

**Note**  
If you are using the `targetForLinks` field and Amazon Connect communications widget, in order to open links in the same browser tab, you must add the following attribute to the widget code snippet to allow the current iframe to open and navigate links within the same tab:  

```
amazon_connect('updateSandboxAttributes', 'allow-scripts allow-same-origin allow-popups allow-downloads allow-top-navigation-by-user-activation')                                       
```

## Time picker template
<a name="time-picker"></a>

The time picker template is useful for enabling customers to schedule appointments. You can provide up to 40 timeslots to the customer in a chat. 

The following images show two examples of how the time picker template renders information in a chat.
+ One image shows one date, and under it, one time slot.
+ The second image shows one date, and under it, two time slots.

![\[The time picker template rendering information in a chat.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/interactive-messages-timepicker.png)


The following image shows the time picker with an image

**Note**  
If you are using this message template with the [Apple Messages for Business](apple-messages-for-business.md) channel and do not add an image, Amazon Connect will add a default image in both the reply and response message.

![\[The time picker with an image.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/interactive-messages-timepicker-with-image.png)


The following code is the time picker template that you can use in your Lambda. Note the following:
+ **Bold text** indicates a mandatory parameter.
+ In some cases, if the parent element isn't mandatory, but the fields the parent element are, then the fields are mandatory. For example, see the `data.replyMessage` structure in the following template. If the structure exists, `title` is mandatory. Otherwise a complete `replyMessage` is optional. 

```
{
   "templateType":"TimePicker",                                 
   "version":"1.0",                                             
   "data":{                                                    
      "replyMessage":{
         "title":"Thanks for selecting",                        
         "subtitle":"Appointment selected",
         "imageType":"URL",                                       
         "imageData":"https://interactive-msg.s3-us-west-2.amazonaws.com/booked.jpg",
         "imageDescription":"Appointment booked"
      },
      "content":{                                               
         "title":"Schedule appointment",                       
         "subtitle":"Tap to select option",
         "imageType":"URL",                                       
         "imageData":"https://interactive-msg.s3-us-west-2.amazonaws.com/calendar.jpg",
         "imageDescription":"Appointment booked",
         "timeZoneOffset":-450,
         "location":{
            "latitude":47.616299,                               
            "longitude":-122.4311,                              
            "title":"Oscar",                                    
            "radius":1,
         },
         "timeslots":[                                          
               {
                  "date" : "2020-10-31T17:00+00:00",             
                  "duration": 60,                               
               },
               {
                  "date" : "2020-11-15T13:00+00:00",            
                  "duration": 60,                              
               },
               {
                  "date" : "2020-11-15T16:00+00:00",            
                  "duration": 60,                              
               }
            ],           
         }
      }
   }
}
```

### Time picker limits
<a name="time-picker-limits"></a>

The following table lists the limits for each of the time picker elements. Use this information if you choose to build your own Lambda from scratch. The mandatory parameters are in bold.


****  
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/connect/latest/adminguide/interactive-messages.html)

## Panel template
<a name="panel"></a>

By using the panel template, you can present the customer with up to 10 choices under one question. However, you can include only one image, rather than an image with each choice. 

The follow image shows an example of how the panel template renders information in a chat. It shows an image at the top of the message, and under the image it shows a prompt that asks *How can I help? Tap to select option*. Under the prompt three options are displayed to the customer: **Check self-service options**, **Talk to an agent**, **End chat**. 

![\[The panel template rendering information in a chat.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/interactive-messages-panel1.png)


The following code is the panel template that you can use in your Lambda. Note the following:
+ **Bold text** indicates a mandatory parameter.
+ In some cases, if the parent element isn't mandatory, but the fields in the parent element are, then the fields are mandatory. For example, see the `data.replyMessage` structure in the following template. If the structure exists, a `title` is mandatory. Otherwise, a complete `replyMessage` is optional.

```
{
   "templateType":"Panel",                            
   "version":"1.0",                                   
   "data":{                                          
      "replyMessage":{                             
         "title":"Thanks for selecting!",             
         "subtitle":"Option selected",
      },
      "content":{                                      
         "title":"How can I help you?",                
         "subtitle":"Tap to select option",
         "imageType":"URL",                       
         "imageData":"https://interactive-msg.s3-us-west-2.amazonaws.com/company.jpg",                  
         "imageDescription":"Select an option",
         "elements":[                                 
            {
               "title":"Check self-service options",   
            },
            {
               "title":"Talk to an agent",                     
            },
            {
               "title":"End chat",                    
            }
         ]
      }
   }
}
```

### Panel limits
<a name="panel-limits"></a>

The following table lists the limits for each of the panel elements, should you choose to build your own Lambda from scratch. The mandatory parameters are in bold.

To send unlimited options, implement action buttons in your application. For more information, see [Implementation of action buttons in interactive message list picker/panel](https://github.com/amazon-connect/amazon-connect-chat-interface/blob/master/.github/docs/InteractiveMessageActionButtonImplementation.md). 


****  
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/connect/latest/adminguide/interactive-messages.html)

## Quick reply template
<a name="quick-reply-template"></a>

Use quick reply messages to get simple responses from customers, and then to customers in an in-line list. Images are not supported for quick replies.

The following image shows an example of how the quick reply template renders information in a chat.

![\[The panel template rendering information in a chat.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/quick-reply-template.png)


The following code is the quick reply template that you can use in your Lambda.

```
{
    "templateType": "QuickReply",
    "version": "1.0",
    "data": {
        "replyMessage": {
            "title": "Thanks for selecting!"
        },
        "content": {
            "title": "Which department would you like?",
            "elements": [{
                    "title": "Billing"
                },
                {
                    "title": "Cancellation"
                },
                {
                    "title": "New Service"
                }
            ]
        }
    }
}
```

### Quick reply limits
<a name="quickreply-limits"></a>

The following table lists the limits for each of the quick reply elements. Use this information if you choose to build your own Lambda from scratch. The mandatory parameters are in bold.


****  
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/connect/latest/adminguide/interactive-messages.html)

## Carousel template
<a name="carousel-template"></a>

Use carousels to display up to 5 list pickers or panels to customers in a single message. Similar to the list picker and time picker, you can add more options to the carousel by using the SHOW\$1MORE feature.

The following GIF shows an example of how the carousel template renders information in a chat. Customers scroll through the carousel of images by using the left and right arrows. 

![\[A carousel in a customer's chat experience.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/carousel-interactive.gif)


The following image shows two **Learn More** hyperlinks, which are examples of carousel picker hyperlink elements.

![\[A carousel picker with hyperlinks.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/carousel-interactive1.png)


The following code is the carousel template that you can use in your Lambda. 

```
{
  "templateType": "Carousel",            
  "version": "1.0",                      
  "data": {                              
      "content": {                           
        "title": "View our popular destinations",   
        "elements": [                               
        {
          "templateIdentifier": "template0",        
          "templateType": "Panel",
          "version": "1.0",
          "data": {
            "content": {
              "title": "California",
              "subtitle": "Tap to select option",
              "elements": [
                {
                  "title": "Book flights"
                },
                {
                  "title": "Book hotels"
                },
                {
                  "title": "Talk to agent"
                }
              ]
            }
          }
        },
        {
          "templateIdentifier": "template1",   
          "templateType": "Panel",
          "version": "1.0",
          "data": {
            "content": {
              "title": "New York",
              "subtitle": "Tap to select option",
              "elements": [
                {
                  "title": "Book flights"
                },
                {
                  "title": "Book hotels"
                },
                {
                  "title": "Talk to agent"
                }
              ]
            }
          }
        }
      ]
    }
  }
}
```

For hosted communications widget users:
+ The selections on the carousel template result in a JSON string response structured like the following example, to be sent back to Lambda (other interactive message types return regular string response with only `selectionText` value):

  ```
  {
      templateIdentifier: "template0",
      listTitle: "California",
      selectionText: "Book hotels"
  }
  ```
+ In carousels, you can provide hyperlinks in the list picker/panel elements. To create a hyperlink instead of a button, include the following additional fields for the element that should be a hyperlink:

  ```
  {
      title: "Book flights",
      ...
      type: "hyperlink",
      url: "https://www.example.com/Flights"
  }
  ```

### Carousel limits
<a name="carousel-limits"></a>

The following table lists the limits for each of the carousel elements. Use this information if you choose to build your own Lambda from scratch. The mandatory parameters are in bold.


****  
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/connect/latest/adminguide/interactive-messages.html)

## Apple form template
<a name="apple-form-template"></a>

**Note**  
 This template is applicable only for Apple Messages for Business contact flows. 

A business can send a form interactive message to their end customers through a single message, containing multiple pages of requested inputs. When the message is received on an end-customer's Apple device, they can open the form and navigate through the pages, providing a response for each page, before submitting all responses at the end of the form.

For example, businesses can use Apple forms for various purposes, including triaging flows, customer surveys, and account creation / sign-ups.

**Warning**  
Interactive message content and end customer responses are stored in contact record transcript and are viewable by other chat participants and contact analysts with access to transcripts. To prevent PII from appearing in your contact record transcript **after the contact has ended**, you will want to use the [Set recording and analytics behavior block](set-recording-behavior.md) in your step-by-step guide flow, [enable Contact Lens](sensitive-data-redaction.md), and enable the redaction of sensitive date. For full details on how to enable PII redaction, see [Enable redaction of sensitive data](enable-analytics.md#enable-redaction).

 The types of pages supported are:
+ **ListPicker**: a list of options that the user must select from with image support.
+ **WheelPicker**: similar to ListPicker but selection is made through scrollable wheel of options.
+ **DatePicker**: a calendar view where user can pick a date.
+ **Input**: a text field that the user must fill in.

The following code is an example of an Apple forms template you can use in your Lambda.

**Note**  
 **Bold text** is a mandatory parameter. 
 In some cases, if the parent element exists in the request and it isn't mandatory/bold, but the fields in it are, then the fields are mandatory. 

 Simple survey form example: 

```
{
  "templateType": "AppleForm",
  "version": "1.0",
  "data": {
    "content": {
      "title": "Survey",
      "pages": [
        {
          "pageType": "DatePicker",
          "title": "Date you visited",
          "subtitle": "When did you last visit?",
          "minDate": "2024-01-02"
        },
        {
          "pageType": "ListPicker",
          "title": "Rating",
          "subtitle": "How do you rate the experience?",
          "items": [
            {
              "title": "Good",
              "imageType": "URL",
              "imageData": "https://mybucket.s3.us-west-2.amazonaws.com/good.jpg"
            },
            {
              "title": "Okay",
              "imageType": "URL",
              "imageData": "https://mybucket.s3.us-west-2.amazonaws.com/okay.jpg"
            },
            {
              "title": "Poor",
              "imageType": "URL",
              "imageData": "https://mybucket.s3.us-west-2.amazonaws.com/poor.jpg"
            }
          ]
        },
        {
          "pageType": "ListPicker",
          "title": "Dine type",
          "subtitle": "Select all dine types that apply",
          "multiSelect": true,
          "items": [
            {
              "title": "Pickup"
            },
            {
              "title": "Dine-in"
            },
            {
              "title": "Delivery"
            }
          ]
        },
        {
          "pageType": "WheelPicker",
          "title": "Visits",
          "subtitle": "How often do you visit?",
          "items": [
            {
              "title": "Often"
            }
            {
              "title": "Sometimes"
            },
            {
              "title": "Rarely"
            }
          ]
        },
        {
          "pageType": "Input",
          "title": "Additional notes",
          "subtitle": "Anything else you'd like to mention about your visit?",
          "multiLine": true
        }
      ]
    }
  }
}
```

### Apple form limits
<a name="apple-forms-limits"></a>

#### InteractiveMessage
<a name="apple-forms-limits-interactivemessage"></a>


| Field  | Type  | Required  | Description / Notes  | 
| --- | --- | --- | --- | 
| version  | string  | Yes  | Version number. Allowed value: "1.0"  | 
| templateType  | TemplateType  | Yes  | Interactive message template type. Allowed values: ["ListPicker", "TimePicker", "Panel", "QuickReply", "Carousel", "ViewResource", "AppleForm"]  | 
| data  | InteractiveMessageData  | Yes  | Interactive message data  | 

#### InteractiveMessageData
<a name="apple-forms-limits-interactivemessagedata"></a>


| Field  | Type  | Required  | Description / Notes  | 
| --- | --- | --- | --- | 
| content  | InteractiveMessageContent  | Yes  | Main interactive message content  | 
| replyMessage  | ReplyMessage  | No  | Message display configuration for after response to interactive message is sent  | 

#### AppleFormContent
<a name="apple-forms-limits-appleformcontent"></a>


| Field  | Type  | Required  | Description / Notes  | 
| --- | --- | --- | --- | 
| title  | String  | Yes  | Top-level title of the form. Displayed in Apple receive message bubble and transcript rendering  | 
| subtitle  | String  | No  | Used as subtitle in ReceivedMessage  | 
| imageType  | String  | No  | Valid values: "URL" Used for image in ReceivedMessage  | 
| imageData  | String  | No  | S3 image url Used for image in ReceivedMessage  | 
| pages  | AppleFormPage[]  | Yes  | List of form pages  | 
| showSummary  | Boolean  | No  | Whether to display a summary page of responses to review before submission Default: False (no confirmation/summary page)  | 
| splashPage  | AppleFormSplashPage  | No  | Initial splash page to display before actual pages Default: No splash page  | 

#### AppleFormSplashPage
<a name="apple-forms-limits-appleformsplashpage"></a>


| Field  | Type  | Required  | Description / Notes  | 
| --- | --- | --- | --- | 
| title  | String  | Yes  | Title of splash page  | 
| subtitle  | String  | No  | Subtitle / body of splash page  | 
| imageType  | ImageType  | No  | Present when displaying image within splash page Allowed value: "URL" Default: No image displayed  | 
| imageData  | String  | No  | For imageType="URL", this is the URL value Default: No image displayed  | 
| buttonTitle  | String  | Yes  | Text of Continue button. Required by Apple, default text with localization not supported  | 

#### AppleFormPage
<a name="apple-forms-limits-appleformpage"></a>
+  Base model for form pages. Specific page types extend from this model 


| Field  | Type  | Required  | Description / Notes  | 
| --- | --- | --- | --- | 
| pageType  | ApplePageType  | Yes  | Enum for page type. Allowed values: ["Input", "DatePicker", "WheelPicker", "ListPicker"]  | 
| title  | String  | Yes  | Page title  | 
| subtitle  | String  | Yes  | Page subtitle. Used in confirmation page  | 

#### AppleFormDatePickerPage
<a name="apple-forms-limits-appleformdatapickerpage"></a>

 **AppleFormDatePickerPage **extends [AppleFormPage](#apple-forms-limits-appleformpage) 


| Field  | Type  | Required  | Description / Notes  | 
| --- | --- | --- | --- | 
| pageType  | ApplePageType  | Yes  | Value: "DatePicker"  | 
| labelText  | String  | No  | Text displayed next to the date input. See example screenshots in Appendix  | 
| helperText  | String  | No  | Helper text displayed under the date input. See example screenshots in Appendix Default: No helper text  | 
| dateFormat  | String  | No  | ISO 8601 date format. Default: MM/dd/yyyy  | 
| startDate  | String  | No  | Initial / default selected date in valid date format Default: Current date for end user when message is sent  | 
| minDate  | String  | No  | Min date allowed to be selected in valid date format Default: No min  | 
| maxDate  | String  | No  | Max date allowed to be selected in valid date format Default: Current date for end user when message is sent  | 

#### AppleFormListPickerPage
<a name="apple-forms-limits-appleformlistpickerpage"></a>

 **AppleFormListPickerPage** extends [AppleFormPage](#apple-forms-limits-appleformpage) 


| Field  | Type  | Required  | Description / Notes  | 
| --- | --- | --- | --- | 
| pageType  | ApplePageType  | Yes  | Value: "ListPicker"  | 
| multiSelect  | Boolean  | No  | Enables selecting multiple items Default: false (single selection)  | 
| items  | AppleFormListPickerPageItem[]  | Yes  | List of list page items  | 

#### AppleFormListPickerPageItem
<a name="apple-forms-limits-appleformlistpickerpageitem"></a>

 **AppleFormListPickerPageItem** extends [AppleFormPage](#apple-forms-limits-appleformpage) 


| Field  | Type  | Required  | Description / Notes  | 
| --- | --- | --- | --- | 
| title  | String  | Yes  | Display text of item  | 
| imageType  | ImageType  | No  | Present when displaying image within item Allowed value: "URL" Default: No image displayed  | 
| imageData  | String  | No  | For imageType="URL", this is the URL value Default: No image displayed  | 

**Note**  
Similar image model to existing interactive message models (ListPicker), except `imageDescription` is not included, which is used for image alt text in chat widget / web chats and ignored for Apple interactive messages.

#### AppleFormWheelPickerPage
<a name="apple-forms-limits-appleformwheelpickerpage"></a>

 **AppleFormWheelPickerPage** extends [AppleFormPage](#apple-forms-limits-appleformpage) 


| Field  | Type  | Required  | Description / Notes  | 
| --- | --- | --- | --- | 
| pageType  | ApplePageType  | Yes  | Value: "WheelPicker"  | 
| items  | AppleFormWheelPickerPageItem[]  | Yes  | List of wheel picker items  | 
| labelText  | String  | No  | Text displayed next to the input. See example screenshots in Appendix  | 

#### AppleFormWheelPickerPageItem
<a name="apple-forms-limits-appleformwheelpickerpageitem"></a>

 **AppleFormWheelPickerPageItem** extends [AppleFormPage](#apple-forms-limits-appleformpage) 


| Field  | Type  | Required  | Description / Notes  | 
| --- | --- | --- | --- | 
| title  | String  | Yes  | Display text of picker item  | 

#### AppleFormInputPage
<a name="apple-forms-limits-appleforminputpage"></a>

 **AppleFormInputPage** extends [AppleFormPage](#apple-forms-limits-appleformpage) 


| Field  | Type  | Required  | Description / Notes  | 
| --- | --- | --- | --- | 
| pageType  | ApplePageType  | Yes  | Value: "Input"  | 
| labelText  | String  | No  | Text displayed next to the input box. See example screenshots in Appendix  | 
| helperText  | String  | No  | Additional text displayed under input box Default: No helper text  | 
| placeholderText  | String  | No  | Placeholder text to display initially when there's no input Default: "(Optional)" or "(Required)" placeholder text  | 
| prefixText  | String  | No  | Prefix text to display next to input. Ex: '\$1' when input is monetary value Default: No prefix text  | 
| required  | Boolean  | No  | Whether end user is required to provide input Default: false  | 
| multiLine  | Boolean  | No  | Whether multi-line input can be provided Default: false (single line)  | 
| maxCharCount  | Number  | No  | Max char count of input. Enforced on Apple client Default: No limit  | 
| regex  | String  | No  | Regex string to place constraints on input provided Default: No regex constraints  | 
| keyboardType  | String  | No  | Determines what type of keyboard is displayed when end user is providing input Allowed values: Same as Apple. See [docs](https://register.apple.com/resources/messages/msp-rest-api/type-interactive#form-message). Some of the allowed values: numberPad, phonePad, emailAddress  | 
| textContentType  | String  | No  | Helps with auto-fill suggestions on Apple device.  Allowed values: Same as Apple. See [docs](https://register.apple.com/resources/messages/msp-rest-api/type-interactive#form-message). Some of the allowed values: telephoneNumber, fullStreetAddress, familyName  | 

## Apple Pay template
<a name="apple-pay-template"></a>

**Note**  
This template is applicable only for Apple Messages for Business contact flows.

 Use the Apple Pay template to provide an easy and secure way for customers to buy goods and services through Apple Messages for Business with Apple Pay.

 The following code is the Apple Pay template that you can use in your Lambda:

**Note**  
 **Bold text** is a mandatory parameter. 
 In some cases, if the parent element exists in the request and it isn't mandatory/bold, but the fields in it are, then the fields are mandatory. 

```
{
  "templateType":"ApplePay",
  "version":"1.0",
  "data":{
    "content":{
      "title":"Halibut",
      "subtitle":"$63.99 at Sam's Fish",
      "imageType":"URL",
      "imageData":"https://interactive-msg.s3-us-west-2.amazonaws.com/fish.jpg",
      "payment": {
        "endpoints": {
          "orderTrackingUrl": "https://sams.example.com/orderTrackingUrl/",
          "paymentGatewayUrl": "https://sams.example.com/paymentGateway/",
          "paymentMethodUpdateUrl": "https://sams.example.com/paymentMethodUpdate/",
          "shippingContactUpdateUrl": "https://sams.example.com/shippingContactUpdate/",
          "shippingMethodUpdateUrl": "https://sams.example.com/shippingMethodUpdate/",
          "fallbackUrl": "https://sams.example.com/paymentGateway/"
        },
        "merchantSession": {
          "epochTimestamp": 1525730094057,
          "expiresAt": 1525730094057,
          "merchantSessionIdentifier": "PSH40080EF4D6.........9NOE9FD",
          "nonce": "fe72cd0f",
          "merchantIdentifier": "merchant.com.sams.fish",
          "displayName": "Sam's Fish",
          "signature": "308006092a8.......09F0W8EGH00",
          "initiative": "messaging",
          "initiativeContext": "https://sams.example.com/paymentGateway/",
          "signedFields": [
            "merchantIdentifier",
            "merchantSessionIdentifier",
            "initiative",
            "initiativeContext",
            "displayName",
            "nonce"
          ],
        },
        "paymentRequest": {
          "applePay": {
            "merchantCapabilities": [
              "supports3DS",
              "supportsDebit",
              "supportsCredit"
            ],
            "merchantIdentifier": "merchant.com.sams.fish",
            "supportedNetworks": [
              "amex",
              "visa",
              "discover",
              "masterCard"
            ]
          },
          "countryCode": "US",
          "currencyCode": "USD",
          "lineItems": [
            {
              "amount": "59.00",
              "label": "Halibut",
              "type": "final"
            },
            {
              "amount": "4.99",
              "label": "Shipping",
              "type": "final"
            }
          ],
          "requiredBillingContactFields": [
            "postalAddress"
          ],
          "requiredShippingContactFields": [
            "postalAddress",
            "phone",
            "email",
            "name"
          ],
          "shippingMethods": [
            {
              "amount": "0.00",
              "detail": "Available within an hour",
              "identifier": "in_store_pickup",
              "label": "In-Store Pickup"
            },
            {
              "amount": "4.99",
              "detail": "5-8 Business Days",
              "identifier": "flat_rate_shipping_id_2",
              "label": "UPS Ground"
            },
            {
              "amount": "29.99",
              "detail": "1-3 Business Days",
              "identifier": "flat_rate_shipping_id_1",
              "label": "FedEx Priority Mail"
            }
          ],
          "total": {
            "amount": "63.99",
            "label": "Sam's Fish",
            "type": "final"
          },
          "supportedCountries" : [
            "US",
            "CA",
            "UK",
            "JP",
            "CN"
          ]
        }
      },
      "requestIdentifier" : "6b2ca008-1388-4261-a9df-fe04cd1c23a9"
    }
  }
}
```

### Apple Pay limits
<a name="apple-pay-limits"></a>


| Parent field  | Field  | Required  | Minimum characters  | Maximum characters  | Other requirement  | 
| --- | --- | --- | --- | --- | --- | 
|  | templateType  | Yes  |  |  | Valid template type  | 
|  | data  | Yes  |  |  |  | 
|  | version  | Yes  |  |  | Must be "1.0"  | 
| data  | content  | Yes  |  |  |  | 
| content  | title  | Yes  | 1  | 512  | The title of the received message bubble  | 
|  | subtitle  | No  | 0  | 512  | Subtitle to be displayed under title of the received message bubble  | 
|  | imageData  | No  | 0  | 200  | Must be a valid publicly accessible URL  | 
|  | imageType  | No  | 0  | 50  | Must be "URL"  | 
|  | payment  | Yes  |  |  | A dictionary containing fields giving the specifics of an Apple Pay request.  | 
|  | requestIdentifier  | No  |  |  | String, An identifier for the ApplePay request. If not specified, an UUID will be generated and used.  | 
| payment  | endpoints  | Yes  |  |  | A dictionary containing the endpoints for payment processing, contact updates, and order tracking.  | 
|  | merchantSession  | Yes  |  |  | A dictionary containing the payment session provided by Apple Pay after requesting a new payment session.  | 
|  | paymentRequest  | Yes  |  |  | A dictionary with information about the payment request  | 
| endpoints  | paymentGatewayUrl  | Yes  |  |  | String. Called by Apple Pay to process the payment through the payment provider. The URL should match the URL in the initiativeContext field of the merchant session  | 
|  | fallbackUrl  | No  |  |  | A URL that opens in a web browser so the customer can complete the purchase if their device is unable to make payments using Apple Pay. If specified, fallbackUrl need to match paymentGatewayUrl.  | 
|  | orderTrackingUrl  | No  |  |  | Called by Messages for Business after completing the order; provides you with an opportunity to update the order information in your system.  | 
|  | paymentMethodUpdateUrl  | No  |  |  | Called by Apple Pay when the customer changes the payment method. If you don’t implement this endpoint and you include this key in the dictionary, the customer sees an error message.  | 
|  | shippingContactUpdateUrl  | No  |  |  | Called by Apple Pay when the customer changes their shipping address information. If you don’t implement this endpoint and you include this key in the dictionary, the customer sees an error message  | 
|  | shippingMethodUpdateUrl  | No  |  |  | Called by Apple Pay when the customer changes the shipping method. If you don’t implement this endpoint and you include this key in the dictionary, the customer sees an error message.  | 
| merchantSession  | displayName  | Yes  | 1  | 64  | String. The canonical name for your store, suitable for display. Do not localize the name.  | 
|  | initiative  | Yes  |  |  | String. Must be “messaging”  | 
|  | initiativeContext  | Yes  |  |  | String. Pass your payment gateway URL.  | 
|  | merchantIdentifier  | Yes  |  |  | String. A unique identifier that represents a merchant for Apple Pay.  | 
|  | merchantSessionIdentifier  | Yes  |  |  | String. A unique identifier that represents a merchant's session for Apple Pay.  | 
|  | epochTimestamp  | Yes  |  |  | String.The time representation in number of seconds that have elapsed since 00:00:00 UTC, Thursday, January 1, 1970.  | 
|  | expiresAt  | Yes  |  |  | String. The expiration time representation in number of seconds that have elapsed since 00:00:00 UTC, Thursday, January 1, 1970.  | 
|  | nonce  | No  |  |  | Binary. A single-use string that checks the integrity of the interaction.  | 
|  | signature  | No  |  |  | Binary. A hash of the public key used to sign the interactions.  | 
|  | signedFields  | No  |  |  | List of strings contains the signed properties.  | 
| paymentRequest  | applePay  | Yes  |  |  | A dictionary that describes the Apple Pay configuration.  | 
|  | countryCode  | Yes  |  |  | String. The merchant’s two-letter ISO 3166 country code.  | 
|  | currencyCode  | Yes  |  |  | String. The three-letter ISO 4217 currency code for the payment.  | 
|  | lineItems  | No  |  |  | An array of line items explaining payments and additional charges. Line items are not required. However, the array cannot be empty if the lineItems key is present.  | 
|  | total  | Yes  |  |  | A dictionary containing the total. The total amount must be greater than zero to pass validation.  | 
|  | requiredBillingContactFields  | No  |  |  | The list of the customer's required billing information needed to process the transaction. For the list of possible strings, see [requiredBillingContactFields](https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentrequest/2216120-requiredbillingcontactfields). Require only the contact fields needed to process the payment. Requesting unnecessary fields adds complexity to the transaction, which can increase the chances of the customer canceling the payment request.  | 
|  | requiredShippingContactFields  | No  |  |  | The list of shipping or contact information required from the customer to fulfill the order. For example, if you need the customer's email or phone number, then include this key. For the list of possible strings, see [requiredShippingContactFields](https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentrequest/2216121-requiredshippingcontactfields).  | 
|  | shippingMethods  | No  |  |  | An array that lists the available shipping methods. The Apple Pay payment sheet displays the first shipping method from the array as the default shipping method.  | 
|  | supportedCountries  | No  |  |  | An array of countries to support. List each country with their ISO 3166 country code.  | 
| applePay  | merchantIdentifier  | Yes  |  |  | A unique identifier that represents a merchant for Apple Pay.  | 
|  | merchantCapabilities  | Yes  |  |  | An array of payment capabilities supported by the merchant. The array must include supports3DS, and may optionally include supportsCredit, supportsDebit, and supportsEMV.  | 
|  | supportedNetworks  | Yes  |  |  | An array of payment networks supported by the merchant. The array must include one or more of the following values: amex, discover, jcb, masterCard, privateLabel, or visa  | 
| lineItem  | amount  | Yes  |  |  | The monetary amount of the line item.  | 
|  | label  | Yes  |  |  | A short, localized description of the line item.  | 
|  | type  | No  |  |  | A value that indicates whether the line item is final or pending.  | 
| total  | amount  | Yes  |  |  | The total amount of the payment.  | 
|  | label  | Yes  |  |  | A short, localized description of the payment.  | 
|  | type  | No  |  |  | A value that indicates whether the payment is final or pending.  | 
| shippingMethods  | amount  | Yes  |  |  | String. The non-negative cost associated with this shipping method.  | 
|  | detail  | Yes  |  |  | String. Additional description of the shipping method.  | 
|  | label  | Yes  |  |  | String. A short description of the shipping method.  | 
|  | identifier  | Yes  |  |  | String. A client-defined value used to identify this shipping method.  | 

## iMessage App template
<a name="imessage-app-template"></a>

**Note**  
This template is applicable only for Apple Messages for Business contact flows. 

 Use the iMessage Apps template to present the customer with your custom built iMessage App. 

 The following code is an example iMessage App template that you can use in your Lambda function.  

```
{
   templateType: AppleCustomInteractiveMessage,
   version: "1.0",
   data: {
       content: {
           appIconUrl: "https://interactive-message-testing.s3-us-west-2.amazonaws.com/apple_4.2kb.jpg",
           appId: "123456789",
           appName: "Package Delivery",
           title: "Bubble Title CIM",
           bid: "com.apple.messages.MSMessageExtensionBalloonPlugin:{team-id}:{ext-bundle-id}",
           dataUrl: "?deliveryDate=26-01-2024&destinationName=Home&street=1infiniteloop&state=CA&city=Cupertino&country=USA&postalCode=12345&latitude=37.331686&longitude=-122.030656&isMyLocation=false&isFinalDestination=true",
           subtitle: "Bubble package",
       },
       replyMessage: {
           title: "Custom reply message title",
           subtitle: "Custom reply message subtitle",
           imageType: "URL",
           imageData: "https://interactive-msg.s3-us-west-2.amazonaws.com/fruit_34.3kb.jpg",
       }
   }
}
```

### iMessage App limits
<a name="imessage-apps-limits"></a>


|  **Parent Field**  |  **Field**  |  **Required**  |  **Type**  |  **Other Notes**  | 
| --- | --- | --- | --- | --- | 
|  |  templateType  | Yes  | TemplateType  | Valid template type, "AppleCustomInteractiveMessage"  | 
|  |  data  | Yes  | InteractiveMessageData  | Contains content and receivedMessage dictionaries  | 
|  |  version  | Yes  | string  | Must be "1.0"  | 
|  data  |  content  | Yes  | InteractiveMessageContent  | Interactive Content of the iMessage App  | 
|  |  replyMessage  | Yes  | ReplyMessage  | Message display configuration for after response to interactive message is sent  | 
|  content  |  appIconUrl  | Yes  | string  | AWS S3 URL  | 
|  |  appId  | Yes  | string  | Business IMessage App Id  | 
|  |  appName  | Yes  | string  | Business IMessage App name  | 
|  |  bid  | Yes  | string  | Business IMessage App Bid. Pattern:  com.apple.messages.MSMessageExtensionBalloonPlugin:\$1team-id\$1:\$1ext-bundle-id\$1  | 
|  |  dataUrl  | Yes  | string  | Data that is passed into the iMessage App  | 
|  |  useLiveLayout  | No  | boolean  | Default True  | 
|  |  title  | Yes  | string  | title of the Imessage App bubble  | 
|  |  subtitle  | No  | string  | subtitle of the Imessage App bubble  | 
|  replyMessage  |  title  | No  | string  |  | 
|  |  subtitle  | No  | string  |  | 
|  |  imageType  | No  | string  | Must be a valid publicly accessible URL  | 
|  |  imageData  | No  | string  | Cannot exist without an image  | 

## WhatsApp list
<a name="whatsapp-list"></a>

**Note**  
You only use this template for WhatsApp messaging flows. For more information about integrating WhatsApp with Amazon Connect, see [Set up WhatsApp Business messaging](whatsapp-integration.md), earlier in this guide.

You use the WhatsApp list template in WhatsApp chats to provide customers with a list of options.

The following example shows a list of options for a banking service.

```
{
  "templateType": "WhatsAppInteractiveList",
  "version": "1.0",
  "data": {
    "content": {
      "title": "Which account do you need help with?",
      "body": {
        "text": "Which account do you need help with?"
      },
      "action": {
        "button": "Options",
        "sections": [
          {
            "title": "Your accounts",
            "rows": [
              {
                "id": "11111111",
                "title": "11111111",
                "description": "PERSONAL CHECKING"
              },
              {
                "id": "22223333",
                "title": "22223333",
                "description": "PERSONAL SAVINGS"
              }
            ]
          },
          {
            "title": "Other",
            "rows": [
              {
                "id": "other",
                "title": "I can't find my account"
              }
            ]
          }
        ]
      }
    }
  }
}
```

The following image shows a typical screen before and after a customer opens a list.

![\[Image showing a list of options.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/whatsapp-options-results.png)


### WhatsApp options limits
<a name="whatsapp-options-limits"></a>


| Parent field | Field | Required | Minimum length  | Maximum length  | Other Requirement | 
| --- | --- | --- | --- | --- | --- | 
|  | templateType | Yes |  |  | Must be "WhatsAppInteractiveList" | 
|  | data | Yes |  |  |  | 
|  | version | Yes |  |  | Must be "1.0" | 
| data | content | Yes |  |  |  | 
| content | title | Yes |  |  |  | 
|  | header | No |  |  |  | 
|  | body | Yes  |  |  |  | 
|  | footer | No |  |  |  | 
|  | action | Yes |  |  |  | 
| header  |  type  | Yes  |  |  |  Must be "text"  | 
|  |  text  | Yes  | 1  |  60  |  | 
| body |  text  | Yes  | 1 |  4096  |  | 
|  footer  |  text  | Yes  | 1 |  60  |  | 
|  action  |  sections  | Yes  | 1 |  10  |  | 
|  |  button  | Yes  | 1 |  20  |  | 
|  section  |  title  | Yes  | 1 |  24  |  | 
|  |  rows  | Yes  | 1 |  10  |  Maximum 10 rows across all sections  | 
|  row  |  id  | Yes | 1 | 200 | Must be unique across rows | 
|  |  title  | Yes  | 1 | 24 |  | 
|  | description  | No  | 1 |  72  |  | 

## WhatsApp reply button
<a name="whatsapp-reply-button"></a>

**Note**  
You only use this template for WhatsApp messaging flows.

You can use the WhatsApp reply button template to present an in-line list of options for customers.

```
{
  "templateType": "WhatsAppInteractiveReplyButton",
  "version": "1.0",
  "data": {
    "content": {
      "title": "What would you like to do?",
      "body": {
        "text": "What would you like to do?"
      },
      "action": {
        "buttons": [
          {
            "type": "reply",
            "reply": {
              "id": "agent",
              "title": "Continue to agent"
            }
          },
          {
            "type": "reply",
            "reply": {
              "id": "end_chat",
              "title": "End chat"
            }
          }
        ]
      }
    }
  }
}
```

The following image shows a typical user experience.

![\[Image of a reply in a chat session.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/whatsapp-reply-template.png)


### WhatsApp reply button limits
<a name="whatsapp-reply-limits"></a>

The WhatsApp reply template has the following limits.


| Parent Field | Field | Required | Minimum length | Maximum length  | Other Requirement | 
| --- | --- | --- | --- | --- | --- | 
|  | templateType  | Yes |  |  | Must be "WhatsAppInteractiveReplyButton"  | 
|  | data  | Yes |  |  |  | 
|  | version  | Yes |  |  | Must be "1.0"  | 
|  data  | content | Yes |  |  |  | 
|  content  | title  | Yes |  |  |  | 
|  | header  | No |  |  |  | 
|  | body | Yes |  |  |  | 
|  | footer  | No |  |  |  | 
|  | action  | Yes |  |  |  | 
| header  | type  | Yes |  |  | Valid values: "text", "document", "image", "video"  | 
|  | text  | No | 1 | 60  |  | 
|  | image  | No |  |  |  | 
|  | video  | No |  |  |  | 
|  | document  | No |  |  |  | 
| image  | link  | Yes |  |  | Must be publicly accessible media URL starting with https/http  | 
| video  | link  | Yes |  |  | Must be publicly accessible media URL starting with https/http  | 
| document  | link  | Yes |  |  | Must be publicly accessible media URL starting with https/http  | 
| body  | text  | Yes | 1 | 1024  |  | 
| footer  | text  | Yes | 1 | 60  |  | 
| action  | buttons  | Yes | 1 | 3  |  | 
| button  | type  | Yes |  |  | Must be "reply"  | 
|  | reply.id | Yes | 1 | 256  | Must be unique across buttons  | 
|  | reply.title  | Yes | 1 | 20  |  | 

## Rich formatting in titles and subtitles
<a name="rich-link-formatting"></a>

You can add rich formatting to the titles and subtitles of your chat messages. For example, you can add links, italics, bold, numbered lists, and bulleted lists. You use [markdown]( https://commonmark.org/help/) to format your text. 

The following image of a chat box shows an example list picker with rich formatting in the title and subtitle.
+ The title **How can we help? aws.amazon.com** is bold and contains a link.
+ The subtitle contains italics and bold text, a bulleted list, and a numbered list. It also shows a plain link, text link, and sample code.
+ The bottom of the chat box shows three list picker elements.

![\[A chat box, a title with a link, a subtitle with lists and links.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/rich-link-formatting-example1a.png)


### How to format text with markdown
<a name="markdown-formatting-text"></a>

You can write title and subtitle strings in a multi-line format, or in a single line with ``\r\n`` line break characters.
+ **Multi-line format**: The following code sample shows how to author lists in markdown in a multi-line format.

  ```
  const MultiLinePickerSubtitle = `This is some *emphasized text* and some **strongly emphasized text**
  
  This is a bulleted list (multiline):
  * item 1
  * item 2
  * item 3
  
  This is a numbered list:
  1. item 1
  2. item 2
  3. item 3
  
  Questions? Visit https://plainlink.com/faq
  
  [This is a link](https://aws.amazon.com)
  
  This is \`\`
  `
  
  const PickerTemplate = {
      templateType: "ListPicker|Panel",
      version: "1.0",
      data: {
          content: {
              title: "How can we help?",
              subtitle: MultiLinePickerSubtitle,
              elements: [ /* ... */ ]
          }
      }
  }
  ```
+ **Single line format**: The following example shows how to author a subtitle in a single line by using ``\r\n`` line break characters. 

  ```
  const SingleLinePickerSubtitle = "This is some *emphasized text* and some **strongly emphasized text**\r\nThis is a bulleted list:\n* item 1\n* item 2\n* item 3\n\nThis is a numbered list:\n1. item 1\n2. item 2\n3. item 3\n\nQuestions? Visit https://plainlink.com/faq\r\n[This is a link](https://aws.amazon.com)\r\nThis is `<code/>`";
  
  const PickerTemplate = {
      templateType: "ListPicker|Panel",
      version: "1.0",
      data: {
          content: {
              title: "How can we help?",
              subtitle: SingleLinePickerSubtitle,
              elements: [ /* ... */ ]
          }
      }
  }
  ```

The following example shows how format italics and bold text with markdown:

`This is some *emphasized text* and some **strongly emphasized text**`

The following example shows how to format text as code with markdown:

`This is `<code />``

### How to format links with markdown
<a name="markdown-formatting-links"></a>

To create a link, use the following syntax:

 `[aws](https://aws.amazon.com)`

The following examples show two ways you can add links with markdown:

`Questions? Visit https://plainlink.com/faq `

`[This is a link](https://aws.amazon.com)`

**Note**  
For list pickers, the `targetForLinks` field can be added as a child field to `content` if you want to have granular control over where links are opened. The communications widget will open links in a new browser tab by default. For more information, see [List picker template](#list-picker).

# Grant Amazon Connect access to your AWS Lambda functions
<a name="connect-lambda-functions"></a>

Amazon Connect can interact with your own systems and take different paths in flows dynamically. To achieve this, invoke AWS Lambda functions in a flow, fetch the results, and call your own services or interact with other AWS data stores or services. For more information, see the [AWS Lambda Developer Guide](https://docs.aws.amazon.com/lambda/latest/dg/).

To invoke a Lambda function from a flow, complete the following tasks.

**Topics**
+ [

## Create a Lambda function
](#create-lambda-function)
+ [

## Add a Lambda function to your Amazon Connect instance
](#add-lambda-function)
+ [

## Invoke a Lambda function from a flow
](#function-contact-flow)
+ [

## Best practice for invoking multiple Lambda functions
](#invoke-multiple-functions)
+ [

## Configure your Lambda function to parse the event
](#function-parsing)
+ [

## Verify the function response
](#verify-function)
+ [

## Consume the Lambda function response
](#process-function-response)
+ [

## Tutorial: Create a Lambda function and invoke in a flow
](#tutorial-invokelambda)

## Create a Lambda function
<a name="create-lambda-function"></a>

Create a Lambda function, using any runtime, and configure it. For more information, see [Get started with Lambda](https://docs.aws.amazon.com/lambda/latest/dg/get-started.html) in the *AWS Lambda Developer Guide*.

If you create the Lambda function in the same Region as your contact center, you can use the Amazon Connect console to add the Lambda function to your instance as described in the next task, [Add a Lambda function to your Amazon Connect instance](#add-lambda-function). This automatically adds resource permissions that allow Amazon Connect to invoke the Lambda function. Otherwise, if the Lambda function is in a different Region, you can add it to your flow using the flow designer and add the resource permissions using the [add-permission](https://docs.aws.amazon.com/cli/latest/reference/lambda/add-permission.html) command, with a principal of `connect.amazonaws.com` and the ARN of your Amazon Connect instance. For more information, see [Using Resource-Based Policies for AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html) in the *AWS Lambda Developer Guide*.

## Add a Lambda function to your Amazon Connect instance
<a name="add-lambda-function"></a>

Before you can use an Lambda function in a flow, you need to add it to your Amazon Connect instance.

**Add a Lambda function to your instance**

1. Open the Amazon Connect console at [https://console.aws.amazon.com/connect/](https://console.aws.amazon.com/connect/).

1. On the instances page, choose your instance name in the **Instance Alias** column. This instance name appears in the URL you use to access Amazon Connect.   
![\[The Amazon Connect virtual contact center instances page, the instance alias.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/instance.png)

1. In the navigation pane, choose **Flows**.

1. In the **AWS Lambda** section, use the **Function** drop-down box to select the function to add to your instance.
**Tip**  
The drop-down lists only those functions in the same Region as your instance. If no functions are listed, choose **Create a new Lambda function**, which opens the AWS Lambda console.  
To use a Lambda in a different Region or account, in the [AWS Lambda function](invoke-lambda-function-block.md), under **Select a function**, you can enter the ARN of a Lambda. Then set up the corresponding resource-based policy on that Lambda to allow the flow to call it.   
To call `lambda:AddPermission`, you need to:  
Set the principal to **connect.amazonaws.com**
Set the source account to be the account your instance is in.
Set the source ARN to the ARN of your instance.
For more information, see [Granting function access to other accounts](https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html#permissions-resource-xaccountinvoke).

1. Choose **Add Lambda Function**. Confirm that the ARN of the function is added under **Lambda Functions**.

Now you can refer to that Lambda function in your flows.

## Invoke a Lambda function from a flow
<a name="function-contact-flow"></a>

1. Open or create a flow.

1. Add an [AWS Lambda function](invoke-lambda-function-block.md) block (in the **Integrate** group) to the grid. Connect the branches to and from the block.

1. Choose the title of the [AWS Lambda function](invoke-lambda-function-block.md) block to open its properties page.

1. Under **Select a function**, choose from the list of functions you've added to your instance.

1. (Optional) Under **Function input parameters**, choose **Add a parameter**. You can specify key-value pairs that are sent to the Lambda function when it is invoked. You can also specify a **Timeout** value for the function.

1. In **Timeout (max 8 seconds)**, specify how long to wait for Lambda to time out. After this time, the contact routes down the Error branch.

For every Lambda function invocation from a flow, you pass a default set of information related to ongoing contact, as well as any additional attributes defined in the **Function input parameters** section for the **Invoke AWS Lambda function** block added.

The following is an example JSON request to a Lambda function:

```
{
    "Details": {
        "ContactData": {
            "Attributes": {
               "exampleAttributeKey1": "exampleAttributeValue1"
              },
            "Channel": "VOICE",
            "ContactId": "4a573372-1f28-4e26-b97b-XXXXXXXXXXX",
            "CustomerEndpoint": {
                "Address": "+1234567890",
                "Type": "TELEPHONE_NUMBER"
            },
            "CustomerId": "someCustomerId",
            "Description": "someDescription",
            "InitialContactId": "4a573372-1f28-4e26-b97b-XXXXXXXXXXX",
            "InitiationMethod": "INBOUND | OUTBOUND | TRANSFER | CALLBACK",
            "InstanceARN": "arn:aws:connect:aws-region:1234567890:instance/c8c0e68d-2200-4265-82c0-XXXXXXXXXX",
            "LanguageCode": "en-US",
            "MediaStreams": {
                "Customer": {
                    "Audio": {
                        "StreamARN": "arn:aws:kinesisvideo::eu-west-2:111111111111:stream/instance-alias-contact-ddddddd-bbbb-dddd-eeee-ffffffffffff/9999999999999",
                        "StartTimestamp": "1571360125131", // Epoch time value
                        "StopTimestamp": "1571360126131",
                        "StartFragmentNumber": "100" // Numberic value for fragment number 
                    }
                }
            },
            "Name": "ContactFlowEvent",
            "PreviousContactId": "4a573372-1f28-4e26-b97b-XXXXXXXXXXX",
            "Queue": {
                   "ARN": "arn:aws:connect:eu-west-2:111111111111:instance/cccccccc-bbbb-dddd-eeee-ffffffffffff/queue/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
                 "Name": "PasswordReset"
                "OutboundCallerId": {
                    "Address": "+12345678903",
                    "Type": "TELEPHONE_NUMBER"
                }
            },
            "References": {
                "key1": {
                    "Type": "url",
                    "Value": "urlvalue"
                }
            },
            "SystemEndpoint": {
                "Address": "+1234567890",
                "Type": "TELEPHONE_NUMBER"
            }
        },
        "Parameters": {"exampleParameterKey1": "exampleParameterValue1",
               "exampleParameterKey2": "exampleParameterValue2"
        }
    },
    "Name": "ContactFlowEvent"
}
```

The request is divided into two parts:
+ Contact data—This is always passed by Amazon Connect for every contact. Some parameters are optional.

  This section may include attributes that have been previously associated with a contact, such as when using a **Set contact attributes** block in a flow. This map may be empty if there aren't any saved attributes.

  The following image shows where these attributes would appear in the properties page of a **Set contact attributes**.  
![\[The properties page of the Set contact attributes block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lambda-setAttribute.png)
+ Parameters—These are parameters specific to this call that were defined when you created the Lambda function. The following image shows where these parameters would appear in the properties page of the **Invoke AWS Lambda function** block.   
![\[The function input parameters in the Invoke AWS Lambda function block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lambda-setParameter.png)

The [AWS Lambda function](invoke-lambda-function-block.md) block can receive input parameters in JSON format, accommodating both primitive data types and nested JSON. The following is an example of a JSON input that can be used in the [AWS Lambda function](invoke-lambda-function-block.md) block.

```
{ 
  "Name": "Jane", 
  "Age":10, 
  "isEnrolledInSchool": true, 
  "hobbies": {
    "books":["book1", "book2"], 
    "art":["art1", "art2"]
  } 
}
```

### Invocation retry policy
<a name="retry"></a>

If your Lambda invocation in a flow gets throttled, the request will be retried. It will also be retried if a general service failure (500 error) happens. 

When a synchronous invocation returns an error, Amazon Connect retries up to 3 times, for a maximum of 8 seconds. At that point, the flow will progress down the Error branch. 

To learn more about how Lambda retries, see [Error Handling and Automatic Retries in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/retries-on-errors.html). 

## Best practice for invoking multiple Lambda functions
<a name="invoke-multiple-functions"></a>

Amazon Connect limits the duration of a sequence of Lambda functions to 20 seconds. It times out with an error message when the total execution time exceeds this threshold. Because customers hear silence while a Lambda function runs, we recommend adding a **Play prompt** block between functions to keep them engaged during the long interaction. 

By breaking up a chain of Lambda functions with the **Play prompt** block, you can invoke multiple functions that last longer than the 20 second threshold.

## Configure your Lambda function to parse the event
<a name="function-parsing"></a>

To successfully pass attributes and parameters between your Lambda function and Amazon Connect, configure your function to correctly parse the JSON request sent from the **Invoke AWS Lambda function** block or **Set contact attributes**, and define any business logic that should be applied. How the JSON is parsed depends on the runtime you use for your function. 

For example, the following code shows how to access `exampleParameterKey1` from **Invoke AWS Lambda function** block and `exampleAttributeKey1` from **Set contact attributes** block using Node.JS:

```
exports.handler = function(event, context, callback) {
// Example: access value from parameter (Invoke AWS Lambda function)
let parameter1 = event['Details']['Parameters']['exampleParameterKey1'];
  		  
// Example: access value from attribute (Set contact attributes block)
let attribute1 = event['Details']['ContactData']['Attributes']['exampleAttributeKey1'];
  		  
// Example: access customer's phone number from default data
let phone = event['Details']['ContactData']['CustomerEndpoint']['Address'];
  		  
// Apply your business logic with the values
// ...
}
```

## Verify the function response
<a name="verify-function"></a>

**Tip**  
Referencing an array is not supported in a flow. Arrays can be used only in another Lambda function.

The Lambda function response could be either a STRING\$1MAP or JSON and has to be set while configuring the **Invoke AWS Lambda function** block in the flow. If response validation is set to STRING\$1MAP, then the Lambda function should return a flat object of key/value pairs of the string type. Otherwise, if response validation is set to JSON, the Lambda function can return any valid JSON including nested JSON.

![\[The invoke AWS Lambda function flow block that highlights the use of either string map or json.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/verify-function-lambda-response-validation.png)


The Lambda response can be up to 32kb. If you fail to reach Lambda, the function throws an exception, the response is not understood, or the Lambda function takes more time than the limit, the flow jumps to the `Error` label.

Test the output returned from your Lambda function to confirm that it will be correctly consumed when returned to Amazon Connect. The following example shows a sample response in Node.JS:

```
exports.handler = function(event, context, callback) {
// Extract data from the event object	     
let phone = event['Details']['ContactData']['CustomerEndpoint']['Address'];    
	   
// Get information from your APIs

let customerAccountId = getAccountIdByPhone(phone);
let customerBalance = getBalanceByAccountId(customerAccountId);
  		  
    let resultMap = {
        AccountId: customerAccountId,
        Balance: '$' + customerBalance,
}

callback(null, resultMap);
}
```

This example shows an example response using Python:

```
def lambda_handler(event, context):
// Extract data from the event object
  phone = event['Details']['ContactData']['CustomerEndpoint']['Address']
  		  
// Get information from your APIs
  customerAccountId = getAccountIdByPhone(phone)
  customerBalance = getBalanceByAccountId(customerAccountId)
  		  
  	resultMap = {
  		"AccountId": customerAccountId,
  		"Balance": '$%s' % customerBalance
  		}
        
 return resultMap
```

The output returned from the function must be a flat object of key/value pairs, with values that include only alphanumeric, dash, and underscore characters. The size of the returned data must be less than 32 KB of UTF-8 data.

The following example shows the JSON output from these Lambda functions:

```
{
"AccountId": "a12345689",
"Balance": "$1000"
}
```

If response validation is set to JSON, then Lambda function can return even a nested JSON, for example:

```
{
  "Name": {
      "First": "John",
      "Last": "Doe"
  },
  "AccountId": "a12345689",
  "OrderIds": ["x123", "y123"]
}
```

You may return any result as long as they are simple key-value pairs.

## Consume the Lambda function response
<a name="process-function-response"></a>

There are two ways to use the function response in your flow. You can either directly reference the variables returned from Lambda, or store the values returned from the function as contact attributes and then reference the stored attributes. When you use an external reference to a response from a Lambda function, the reference will always receive the response from the most recently invoked function. To use the response from a function before a subsequent function is invoked, the response must be saved as a contact attribute, or passed as a parameter to the next function.

### 1. Access variables directly
<a name="access-variables"></a>

 If you access the variables directly, you can use them in flow blocks, but they are not included in contact records. To access these variables directly in a flow block, add the block after the **Invoke AWS Lambda function** block, and then reference the attributes as shown in the following example: 

```
Name - $.External.Name
Address - $.External.Address
CallerType - $.External.CallerType
```

The following image shows the properties page of the **Play prompt** block. The variables are specified in the text-to-speech block.

![\[The properties page of the Play prompt block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lambda-useExternal.png)


Make sure that the name specified for the source attribute matches the key name returned from Lambda.

### 2. Store variables as contact attributes
<a name="store-variables"></a>

If you store the variables as contact attributes, you can use them throughout your flow, and they are included in contact records.

To store the values returned as contact attributes and then reference them, use a **Set contact attributes** block in your flow after the **Invoke AWS Lambda function** block. Choose **Use attribute**, **External** for the **Type**. Following the example we're using, set **Destination Attribute** to `MyAccountId`, and set the **attribute** to `AccountId`, and do the same for `MyBalance` and **Balance**. This configuration is shown in the following image.

![\[The properties page of the Set contact attributes block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lambda-useInSetAttributes.png)


Add Address as a **Source attribute** and use `returnedContactAddress` as the **Destination key**. Then add `CallerType` as a **Source attribute** and use `returnedContactType` for the **Destination key**, as shown in the following image.

![\[The properties page of the Play prompt block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lambda-useAttributeInPlayPrompt.png)


Make sure that the name specified for the source external attribute matches the key name returned from Lambda.

## Tutorial: Create a Lambda function and invoke in a flow
<a name="tutorial-invokelambda"></a>

### Step 1: Create the Lambda example
<a name="tutorial-invokelambda-step1"></a>

1. Sign in to the AWS Management Console and open the AWS Lambda console at [https://console.aws.amazon.com/lambda/](https://console.aws.amazon.com/lambda/).

1. In AWS Lambda, choose **Create function**.

1. Choose **Author from scratch**, if it's not selected already. Under **Basic information**, for **Function name**, enter **MyFirstConnectLambda**. For all other options, accept the defaults. These options are shown in the following image of the AWS Lambda console.  
![\[The AWS Lambda console.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lambdafunctions-tutorial-create-function-name.png)

1. Choose **Create function**.

1. In the **Code source** box, in the **index.js** tab, delete the template code from the code editor.

1. Copy and paste the following code into the code editor as shown in the following image:  
![\[The Code source section, the deploy button.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lambdafunctions-tutorial-code-source.png)

   ```
   exports.handler = async (event, context, callback) => {
   // Extract information
           const customerNumber = event.Details.ContactData.CustomerEndpoint.Address;
           const companyName = event.Details.Parameters.companyName;
   // Fetch data
           const balance = await fetchBalance(customerNumber, companyName);
           const support = await fetchSupportUrl(companyName);
   // Prepare result
           const resultMap = {
           customerBalance: balance,
           websiteUrl: support
           }
           callback(null, resultMap);
           }
           
           async function fetchBalance(customerPhoneNumber, companyName) {
   // Get data from your API Gateway or Database like DynamoDB
           return Math.floor(Math.random() * 1000);
           }
           
           async function fetchSupportUrl(companyName) {
   // Get data from your API Gateway or Database like DynamoDB
           return 'www.GGG.com/support';
           }
   ```

   This code is going to generate a random result for the customerBalance.

1. Choose **Deploy**.

1. After you choose **Deploy**, choose **Test** to launch the test editor.

1. In the **Configure test event** dialog box, select **Create new event**. For **Event name**, enter **ConnectMock** as the test name.

1. In the **Event JSON** box, delete the sample code and enter the following code instead. 

   ```
   {
   "Details": {
   "ContactData": {
       "Attributes": {},
       "Channel": "VOICE",
       "ContactId": "4a573372-1f28-4e26-b97b-XXXXXXXXXXX",
       "CustomerEndpoint": {
       "Address": "+1234567890",
       "Type": "TELEPHONE_NUMBER"
       },
   "InitialContactId": "4a573372-1f28-4e26-b97b-XXXXXXXXXXX",
   "InitiationMethod": "INBOUND | OUTBOUND | TRANSFER | CALLBACK",
   "InstanceARN": "arn:aws:connect:aws-region:1234567890:instance/c8c0e68d-2200-4265-82c0-XXXXXXXXXX",
   "PreviousContactId": "4a573372-1f28-4e26-b97b-XXXXXXXXXXX",
   "Queue": {
       "ARN": "arn:aws:connect:eu-west-2:111111111111:instance/cccccccc-bbbb-dddd-eeee-ffffffffffff/queue/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
       "Name": "PasswordReset"
     },
   "SystemEndpoint": {
       "Address": "+1234567890",
       "Type": "TELEPHONE_NUMBER"
       } 
   },
   "Parameters": {
       "companyName": "GGG"
       }
   },
   "Name": "ContactFlowEvent"
   }
   ```

1. Choose **Save**.

1. Choose **Test**. You should see the following something similar to the following image:  
![\[The Code source section, the test button.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lambdafunctions-tutorial-code-source-response.png)

   Your balance will be different. The code generates a random number.

### Step 2: Add your Lambda to Amazon Connect
<a name="tutorial-invokelambda-step2"></a>

1. Go to the Amazon Connect console, at [https://console.aws.amazon.com/connect/](https://console.aws.amazon.com/connect/). 

1. Choose your Amazon Connect instance alias.  
![\[The Amazon Connect virtual contact center instances page, the instance alias.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/instance.png)

1. On the navigation menu, choose **Flows**.

1. In the AWS Lambda section, use the **Lambda Functions** dropdown box to select **MyFirstConnectLambda**.  
![\[The flows page, the AWS Lambda section.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lambda-add-myfirstconnectlambda.png)

1. Choose **Add Lambda Function**.

### Step 3: Create the contact flow
<a name="tutorial-invokelambda-step3"></a>

The following image is an example of the flow you are going to build using the steps in this procedure. It contains the following blocks: **Set contact attributes**, **Play prompt**, **Invoke AWS Lambda function**, another **Set contact attributes** block, another **Play prompt** block, and finally a **Disconnect** block.

![\[A flow that calls the Invoke AWS Lambda function block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lambda-exampleFlow.png)


1. Log in to the Amazon Connect admin website at https://*instance name*.my.connect.aws/.

1. On the navigation menu, go to **Routing**, **Flows**, **Create a contact flow**.

1. Drag a [Set contact attributes](set-contact-attributes.md) block onto the grid, and configure its properties page shown in the following image:   
![\[A Set contact attributes block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lambda-exampleFlow-set-contact-attribute-1.png)

   1. **Namespace** = **User defined**.

   1. **Attribute** = **companyName**.

   1. Choose **Set manually**. **Value** = **GGG**.

   1. Choose **Save**.

1. Drag a [Play prompt](play.md) block onto the grid, and configure its properties page as shown in the following image:   
![\[A play prompt block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lambda-exampleFlow-play-prompt-1.png)

   1. Choose **Text-to-speech or chat text**, **Set manually**, and set **Interpret as** to **SSML**. Enter the following text in the box for the text to be spoken:

      `Hello, thank you for calling $.Attributes.companyName inc.`

   1. Choose **Save**.

1. Drag another [Play prompt](play.md) block onto the grid, and configure its properties page as shown in the following image:   
![\[A play prompt block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lambda-exampleFlow-play-prompt-2.png)

   1. Choose **Text-to-speech or chat text**, **Set manually**, and set **Interpret as** to **Text**. Enter the following text in the box for the text to be spoken:

      `Please try again later.`

   1. Choose **Save**.

1. Drag a [AWS Lambda function](invoke-lambda-function-block.md) block onto the grid, and configure its properties page as shown in the following image:   
![\[An Invoke AWS Lambda function block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lambda-exampleFlow-invoke-lambda.png)

   1. Choose **Select manually**, and then choose **MyFirstConnectLambda** from the dropdown.

   1. In the **Destination Key** box, enter **companyName**. (This is sent to Lambda.)

   1. Choose **Set dynamically** box

   1. For **Namespace**, select **User Defined**.

   1. For **Attribute**, enter **companyName**.

   1. Choose **Save**.

1. Drag a [Set contact attributes](set-contact-attributes.md) block onto the grid, choose **Add another attribute**, and configure its properties page as shown in the following image:   
![\[A set contact attributes block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lambda-exampleFlow-set-contact-attribute-2.png)

   1. **Namespace** = **User Defined**. **Attribute** = **MyBalance**.

   1. Choose **Set dynamically**. 

   1. **Namespace** = **External**.

   1. **Attribute** = **customerBalance**. This is the result from Lambda.

   1. Choose **Add another attribute**.

   1. **Namespace** = **User-defined**.

   1. **Attribute** = **MyURL**.

   1. Select **Set dynamically**. **Namespace** =**External**. 

   1. **Attribute** = **websiteUrl**. This is the result from Lambda.

   1. Choose **Save**.

1. Drag a [Play prompt](play.md) block onto the grid, and configure its properties page as shown in the following image:   
![\[A play prompt block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/lambda-exampleFlow-play-prompt-3.png)

   1. Choose **Text-to-speech or chat text**, and set **Interpret as** to **SSML**. Enter the following text in the box:

      `Your remaining balance is <say-as interpret-as="characters">$.Attributes.MyBalance</say-as>.`

      `Thank you for calling $.Attributes.companyName.`

      `Visit $.Attributes.MyURL for more information.`

   1. Choose **Save**.

1. Drag a [Disconnect / hang up](disconnect-hang-up.md) block onto the grid. 

1. Connect the all blocks so your flow looks like the image shown at the top of this procedure.

1. Enter **MyFirstConnectFlow** as the name, and then choose **Publish**.

1. On the navigation menu, go to **Channels**, **Phone numbers**. 

1. Select your phone number.

1. Select **MyFirstConnectFlow** and choose **Save**.

Now try it out. Call the number. You should hear a greeting message, your balance, and the website to visit.

# Set up live media streaming of customer audio in Amazon Connect
<a name="customer-voice-streams"></a>

In Amazon Connect, you can capture customer audio during an interaction with your contact center by sending the audio to a Kinesis video stream. Depending on your settings, audio can be captured for the entire interaction—until the interaction with the agent is complete—or only one direction: 
+ What the customer hears, including what the agent says and system prompts.
+ What the customer says, including when they are on hold.

The customer audio streams also include interactions with an Amazon Lex bot, if you're using one in your flow. 

**Topics**
+ [Plan for live media streaming](plan-live-media-streams.md)
+ [Enable live media streaming](enable-live-media-streams.md)
+ [Access Kinesis Video Streams Data](access-media-stream-data.md)
+ [Test live media streaming](use-media-streams-blocks.md)
+ [Contact attributes for live media streaming](media-streaming-attributes.md)

# Plan for live media streaming from Amazon Connect to Kinesis Video Streams
<a name="plan-live-media-streams"></a>

**Important**  
If you want to use the audio streaming feature, you need to retain the streams that are created by Amazon Connect. Don't delete them, unless you're going to stop using the streaming feature.

You can send all audio to and from the customer to Kinesis Video Streams. Media streaming leverages Kinesis Video Streams multi-track support so that what the customer says is on a separate track from what the customer hears. 

Audio sent to Kinesis uses a sampling rate of 8 kHz.

## Do you need to increase your service quotas?
<a name="create-streams-service-limit"></a>

When you enable media streaming in Amazon Connect, one Kinesis video stream is used per active call. We create new KVS streams as needed to handle concurrent streaming requests. We automatically create additional streams as needed to keep pace with active calls, unless your account reaches the [Kinesis Video Streams service quota](https://docs.aws.amazon.com/streams/latest/dev/service-sizes-and-limits.html).

Contact Support to request an increase to **Number of Streams**.

To request an increase to your service quota, in the AWS Support Center, choose **Create Case** and then choose **Service Quota Increase**.

**Tip**  
We make sure that **PutMedia** requests always stay within the 5 TPS quota. You don't need to request an increase.

## How long do you need to store audio?
<a name="storing-audio-streams"></a>

Customer audio is stored in Kinesis for the time defined by your retention settings in an Amazon Connect instance. For instructions for setting this value, see [Enable live media streaming in your Amazon Connect instance](enable-live-media-streams.md).

## Do you need to change the audio streams?
<a name="changing-audio-streams"></a>

We recommend that you refrain from modifying the streams. Doing so can cause unexpected behavior.

## Who requires IAM permissions to retrieve data?
<a name="perms-audio-streams"></a>

If your business is using IAM permissions, your AWS admin will need to grant permissions to IAM roles which need to retrieve data from Kinesis Video Streams. They will need to grant them full access permissions for Kinesis Video Streams and AWS Key Management Service. 

# Enable live media streaming in your Amazon Connect instance
<a name="enable-live-media-streams"></a>

Live media streaming (customer audio streams) is not enabled by default. You can enable customer audio streams from the settings page for your instance.

**To enable live media streaming**

1. Open the Amazon Connect console at [https://console.aws.amazon.com/connect/](https://console.aws.amazon.com/connect/).

1. On the instances page, choose the instance alias. The instance alias is also your **instance name**, which appears in your Amazon Connect URL. The following image shows the **Amazon Connect virtual contact center instances** page, with a box around the instance alias.

1. In the navigation pane, choose **Data storage**.

1. Under **Live media streaming**, choose **Edit**. Choose **Enable live media streaming**.

1. Enter a prefix for the Kinesis Video Streams created for your customer audio. This prefix makes it easier for you to identify the stream with the data.

1. Data is encrypted before it's written to the Kinesis Video Streams stream storage layer, and it's decrypted after it's retrieved from storage. As a result, your data is always encrypted at rest within the Kinesis Video Streams service. Choose the KMS key used to encrypt the data within Kinesis Video Streams as shown in the following image.  
![\[The Encryption section where you choose the KMS key.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/streaming-encryption.png)

   When you choose to enter your own key, make note of the following restrictions:

   1. The KMS key must be in the same Region as the instance.

   1. The KMS key should be either: 
      + A customer managed key

      OR
      +  The AWS managed key for Kinesis Video Streams (aws/kinesisvideo). 

      It should not be any of the AWS managed keys automatically created for other services (for example, aws/connect, aws/lambda, aws/kinesis).

   1. The grant provisioned for the key by Amazon Connect shouldn't be revoked. These grants would have `GranteePrincipal` of the format:

      ```
      arn:aws:iam::customer-account-id:role/aws-service-role/connect.amazonaws.com/AWSServiceRoleForAmazonConnect_hash_suffix
      ```

1. Specify a number and unit for the **Data retention period**.
**Important**  
If you select **No data retention**, data is not retained and is available to be consumed for only 5 minutes. This is the default minimum time that Kinesis retains data.  
Because Amazon Connect uses Kinesis for streaming, [Kinesis Video Streams quotas](https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/limits.html) apply.

1. Choose **Save** under **Live media streaming**, and then choose **Save** at the bottom of the page.

After you enable live media streaming, add **Start media streaming** and **Stop media streaming** blocks to your flow. Configure those blocks to specify what audio you want to capture. For instructions and an example, see [Example flow for testing live media streaming in Amazon Connect](use-media-streams-blocks.md).

# Develop live media streaming in Amazon Connect
<a name="access-media-stream-data"></a>

To help you get started with development using live media streaming, Amazon Connect includes the following Kinesis Video Streams repository that contains a basic example of how to consume audio data from your Kinesis Video Streams: [https://github.com/amazon-connect/connect-kvs-consumer-demo](https://github.com/amazon-connect/connect-kvs-consumer-demo) 

This demo builds upon the high level abstractions provided by the Kinesis Video Streams Parser Library to read the `AUDIO_TO_CUSTOMER` and `AUDIO_FROM_CUSTOMER` tracks published by Amazon Connect. It stores this data as a raw PCM file. This file can be transformed, transcoded, or played back.

# Example flow for testing live media streaming in Amazon Connect
<a name="use-media-streams-blocks"></a>

Here's how you can set up a flow to test live media streaming: 

1. Add a **Start media streaming** block at the point where you want to enable customer audio streaming.

1. Connect the **Success** branch to the rest of your flow.

1. Add a **Stop media streaming** block to where you want to stop streaming. 

1. Configure both blocks to specify what you want to stream: **From the customer** and/or **To the customer**.  
![\[A Start media streaming block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/start-media-streaming.png)

Customer audio is captured until a **Stop media streaming** block is invoked, even if the contact is passed to another flow.

Use the contact attributes for media streaming in your flow so that the contact record includes the attributes. You can then view the contact record to determine the media streaming data associated with a specific contact. You can also pass the attributes to an AWS Lambda function.

The following example flow shows how you might use media streaming with attributes for testing purposes. This flow includes a **Start media streaming** block but it is missing the **Stop media streaming** block.

![\[A sample flow with a start media streaming block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/media-streaming-flow.png)


After the audio is successfully streamed to Kinesis Video Streams, the contact attributes are populated from the **Invoke AWS Lambda function** block. You can use the attributes to identify the location in the stream where the customer audio starts. For instructions, see [Contact attributes for live media streaming in Kinesis Video Streams](media-streaming-attributes.md).

# Contact attributes for live media streaming in Kinesis Video Streams
<a name="media-streaming-attributes"></a>

The attributes are displayed when you select **Media streams** for the **Type** in a flow block that supports attributes, such as the **Start media streaming** block. They include the following:

Customer audio stream ARN  
The ARN of the Kinesis video stream that includes the customer data to reference.  
**JSONPath format: **\$1.MediaStreams.Customer.Audio.StreamARN

Customer audio start timestamp  
The time at which the customer audio stream started.  
**JSONPath format: **\$1.MediaStreams.Customer.Audio.StartTimestamp

Customer audio stop timestamp  
The time at which the customer audio stream stopped.  
**JSONPath format: **\$1.MediaStreams.Customer.Audio.StopTimestamp

Customer audio start fragment number  
The number that identifies the Kinesis Video Streams fragment in which the customer audio stream started.  
**JSONPath format: **\$1.MediaStreams.Customer.Audio.StartFragmentNumber

For more information about Amazon Kinesis Video Streams fragments, see [Fragment](https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_reader_Fragment.html) in the * Amazon Kinesis Video Streams Developer Guide*.

# Encrypt sensitive customer input in Amazon Connect
<a name="encrypt-data"></a>

You can encrypt sensitive data that is collected by flows. To do this, you need to use public-key cryptography. 

When configuring Amazon Connect, you first provide the public key. This is the key used when encrypting data. Later, you provide the X.509 certificate, which includes a signature that proves you possess the private key. 

In a flow that collects data, you provide an X.509 certificate to encrypt data that's captured using the **Stored customer input** system attribute. You must upload the key in `.pem` format to use this feature. The encryption key is used to verify the signature of the certificate used within the flow. 

**Note**  
You can have up to two encryption keys active at one time to facilitate rotation.

To decrypt the data in the **Stored customer input** attribute, use the AWS Encryption SDK. For more information, see the [AWS Encryption SDK Developer Guide](https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/).

## How to decrypt data encrypted by Amazon Connect
<a name="sample-decryption"></a>

The following code sample shows how to decrypt data using the AWS Encryption SDK. 

```
package com.amazonaws;
 
import com.amazonaws.encryptionsdk.AwsCrypto;
import com.amazonaws.encryptionsdk.CryptoResult;
import com.amazonaws.encryptionsdk.jce.JceMasterKey;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
 
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.GeneralSecurityException;
import java.security.KeyFactory;
import java.security.Security;
import java.security.interfaces.RSAPrivateKey;
import java.security.spec.PKCS8EncodedKeySpec;
import java.util.Base64;
 
public class AmazonConnectDecryptionSample {
 
    // The Provider 'AmazonConnect' is used during encryption, this must be used during decryption for key
    // to be found
    private static final String PROVIDER = "AmazonConnect";
 
    // The wrapping algorithm used during encryption
    private static final String WRAPPING_ALGORITHM = "RSA/ECB/OAEPWithSHA-512AndMGF1Padding";
 
    /**
     * This sample show how to decrypt data encrypted by Amazon Connect.
     * To use, provide the following command line arguments: [path-to-private-key] [key-id] [cyphertext]
     * Where:
     *  path-to-private-key is a file containing the PEM encoded private key to use for decryption
     *  key-id is the key-id specified during encryption in your flow
     *  cyphertext is the result of the encryption operation from Amazon Connect
     */
    public static void main(String[] args) throws IOException, GeneralSecurityException {
        String privateKeyFile = args[0]; // path to PEM encoded private key to use for decryption
        String keyId = args[1]; // this is the id used for key in your flow
        String cypherText = args[2]; // the result from flow
 
        Security.addProvider(new BouncyCastleProvider());
 
        // read the private key from file
        String privateKeyPem = new String(Files.readAllBytes(Paths.get(privateKeyFile)), Charset.forName("UTF-8"));
        RSAPrivateKey privateKey =  getPrivateKey(privateKeyPem);
 
        AwsCrypto awsCrypto = new AwsCrypto();
        JceMasterKey decMasterKey =
                JceMasterKey.getInstance(null,privateKey, PROVIDER, keyId, WRAPPING_ALGORITHM);
        CryptoResult<String, JceMasterKey> result = awsCrypto.decryptString(decMasterKey, cypherText);
 
        System.out.println("Decrypted: " + result.getResult());
    }
 
    public static RSAPrivateKey getPrivateKey(String privateKeyPem) throws IOException, GeneralSecurityException {
        String privateKeyBase64 = privateKeyPem
                .replace("-----BEGIN RSA PRIVATE KEY-----\n", "")
                .replace("-----END RSA PRIVATE KEY-----", "")
                .replaceAll("\n", "");
        byte[] decoded = Base64.getDecoder().decode(privateKeyBase64);
        KeyFactory kf = KeyFactory.getInstance("RSA");
        PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(decoded);
        RSAPrivateKey privKey = (RSAPrivateKey) kf.generatePrivate(keySpec);
        return privKey;
    }
}
```

# Monitor flow performance with metrics in flow designer analytics mode
<a name="monitor-flow-performance"></a>

You can view near real-time and historical performance data directly in the flow designer to identify bottlenecks and optimize your published flows and modules. You can see aggregate traffic through each completed and in-progress blocks in the flow. This allows you to identify behavioral patterns of your customers or pinpoint where errors are being encountered.

Following are a couple example use cases for this functionality:
+ In an IVR experience, you can determine how often customers select specific options from a menu, where a menu configuration may be causing an error, or identify at which point in the flow customers are abandoning the experience.
+ For step-by-step guides, you can track which guides customers and agents use most frequently and optimize their navigation paths.

**Topics**
+ [

## Requirements
](#flow-performance-requirements)
+ [

## How flow designer analytics mode works
](#how-it-works)
+ [

## Display metrics for a flow
](#show-metrics-for-a-flow)
+ [

## View metrics in the flow designer
](#metrics-display)
+ [

## Block Metrics table
](#block-metrics-table)
+ [

## Metrics with flow versions
](#metrics-with-flow-versions)

## Requirements
<a name="flow-performance-requirements"></a>

To use flow designer analytics mode: 
+ You must enable [Next Generation Amazon Connect](enable-nextgeneration-amazonconnect.md) for your instance.
+ Your flows and modules must be published so metrics can be collected.
+ You must have the following permissions in your security profile: **Analytics and Optimization** - **Access metrics** - **Access**.

## How flow designer analytics mode works
<a name="how-it-works"></a>

Flows designer analytics displays metrics in three places:
+ At the entry point of each block.
+ On the block's branches (for example, Success: 94%, Error: 4%).
+ A floating metrics table on the flows designer provides detailed performance data for all blocks. You can move the table as needed.

The following GIF shows how analytics mode works:

![\[Analytics mode in the flow designer.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/metrics-button.gif)


## Display metrics for a flow
<a name="show-metrics-for-a-flow"></a>

Complete the following steps to display metrics for a flow.

1. On the Amazon Connect admin website, on the left navigation menu, choose **Routing**, **Flows**.

1. Choose a flow to open the flows designer.

1. On the toolbar, choose **Show Metrics**.

1. Choose the **Show Metrics** dropdown arrow to open the **Metric Controls** panel. The following image shows an example panel.  
![\[The Metric Controls panel with sample settings.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/metric-controls.png)

1. In the **Metric Controls** panel, you can configure the following settings:
   + **Date range**: You can set the following types of date ranges:
     + **Relative range**: Displays flow metrics that are captured X hours, minutes, weeks, or months from the current time.
     + **Absolute range**: Displays flow metrics that are captured between a date range.
**Important**  
Historical data is retained and available for the last 30 days from the current date.  
![\[The options for choosing relative or absolute range.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/flow-metrics-date-range.png)
   + **Visual options**
     + **Highlight incompletes**: Displays **Incomplete: X%** on the affected blocks.
     + **Highlight errors**: Adds amber color highlight (1-4% errors) or red color highlight (≥5% errors) indicators to density of error branches.
     + **Highlight traffic**: Highlights the relative traffic volume with thickness of the block connecting line.
   + **Data presentation**
     + **Show as a percentage of all traffic**: Change the metric to use percentage (%) to represent each block traffic as percentage of total flow traffic.
     + **Show as a percentage of incoming block(s)**: Change the metric to use percentage (%) to represent each block traffic as percentage relative to the previous connecting block's traffic.
     + **Show interaction count**: Change the metric to show absolute number of traffic going through the flow.

## View metrics in the flow designer
<a name="metrics-display"></a>

Flows metrics appear directly on block branches and at the entry point of each block. Choose any entry point metric to toggle all flow metrics between the visual option **Show percentage of traffic** and **Show interaction count**.

The following GIF shows an example of choosing the entry point and the metrics displaying.

![\[Metrics for blocks on the flow designer.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/metrics-click-badge.gif)


## Block Metrics table
<a name="block-metrics-table"></a>

When you enable metrics, a floating block metrics palette appears that you can drag anywhere on the canvas. To open the **Block Metrics** table, choose the arrow on the right side as shown in the following image.

![\[The Block Metrics table on the flow designer.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/block-metrics.png)


The following image shows an example of metrics on the **Block Metrics** table:

![\[An example Block Metrics table for a flow.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/block-metrics-table.png)


The following information is displayed on the table:
+ **Block name**: Shows the block name. Choose the name to navigate to that block in the canvas.
+ **Type**: The block type.
+ **Status**: An alert indicator for issues.
+ **Ingress**: The contact traffic that has entered the block.
+ **Success**: The contact traffic that has successfully completed the block.
+ **Incomplete**: The contact traffic that entered but did not exit through any block branch. This occurs when customers are disconnected, timeouts expired, transfers failed, or error handling is missing.

  The following image shows an example of an **Incomplete** metric on the **Play prompt** block.  
![\[An example Incomplete metric.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/incomplete-metrics.png)

To work with the palette, you can:
+ Drag it using the handle (⋮⋮) in the header.
+ Resize the **Block Metrics** table after it is opened. Use the right bottom corner to resize it.
+ Expand and collapse the **Block Metrics** table by choosing the right side of the arrow icon.

## Metrics with flow versions
<a name="metrics-with-flow-versions"></a>

When viewing metrics for previous flow versions:
+ Metrics are version-specific: Each published flow generates its own data while active.
+ Publishing a replacement version closes the previous data and opens a new one.
+ Only published versions collect metrics. Drafts are excluded from analytics.

# Use flow logs to track events in Amazon Connect flows
<a name="about-contact-flow-logs"></a>

Amazon Connect flow logs provide you with real-time details about events in your flows as customers interact with them. You can also use flow logs to help debug your flows as you are creating them. If needed, you can always [roll back](flow-version-control.md#rollback) to a previous version of a flow.

Following is an overview of logging for flows and bot interactions. 
+ **Flow logs stored in an CloudWatch group**. Use these logs for identifying bottlenecks in flow design, debugging flow issues in real-time, and analyzing customer journey patterns.

  Flow logs help you track customers between different flows by including the ID of the contact in each log entry. You can query the logs for the contact ID to trace the customer interaction through each flow.

  The CloudWatch group log is created automatically when [Enable flow logging](contact-flow-logs.md#enable-contact-flow-logs) is selected for your instance on the Amazon Connect console. However, to enable logging, you also need to add a **Set logging behavior** block to your flow. For instructions, see [Enable Amazon Connect flow logs in an Amazon CloudWatch log group](contact-flow-logs.md).
+ **Automated interaction logs**. Use these logs to analyze the quality of conversations between customers and bots, understand common customer queries, and improve bot responses.

  These logs are saved in an S3 bucket that is created when you [select](monitor-automated-interaction-logs.md) the following options for your instance on the Amazon Connect console:
  + **Enable call recording** and create or select your S3 bucket on the **Data storage** page. The automated interaction log is stored in the same S3 location as that of your call recording.
  + **Enable Automated Interaction Logs** on the **Flows** page. This option enables the logging of key interaction points such as flows, prompts, menus, and keypad selections. This automated log is available in your S3 storage and in the **Contact details** page on the Amazon Connect admin website.
  + **Enable Bot Analytics and Transcripts** in Amazon Connect on the **Flows** page. This option ensures the log includes the Amazon Lex bot transcript.

**Topics**
+ [Storage for flow logs](contact-flow-logs-stored-in-cloudwatch.md)
+ [Enable flow logs](contact-flow-logs.md)
+ [Search flow logs](search-contact-flow-logs.md)
+ [Data in flow logs](contact-flow-log-data.md)
+ [

# Track customers between multiple flows in your contact center
](contact-flow-log-multiple-flows.md)
+ [Create alerts for events in your flow logs](contact-flow-log-alerts.md)
+ [Monitor automated interactions (IVR)](monitor-automated-interaction-logs.md)

# Flow logs stored in an Amazon CloudWatch log group
<a name="contact-flow-logs-stored-in-cloudwatch"></a>

Flow logs are stored in an Amazon CloudWatch log group, in the same AWS Region as your Amazon Connect instance. This log group is created automatically when [Enable flow logging](contact-flow-logs.md#enable-contact-flow-logs) is turned on for your instance.

For example, the following image shows the CloudWatch log groups for two test instances.

![\[The Amazon CloudWatch console, log groups, /aws/connect/mytest88 and mytest89.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/cloudwatch-log-group.png)


 A log entry added as each block in your flow is triggered. You can configure CloudWatch to send alerts when unexpected events occur during active flows. 

**What happens if my log group is deleted?** You need to manually re-create the CloudWatch log group. Otherwise, Amazon Connect won't publish more logs. 

## Pricing for flow logging
<a name="pricing-contact-flow-logs"></a>

You are not charged for generating flow logs, but you are charged for using CloudWatch for generating and storing the logs. Free tier customers are charged only for usage that exceeds service quotas. For details about Amazon CloudWatch pricing, see [Amazon CloudWatch Pricing](https://aws.amazon.com/cloudwatch/pricing/).

# Enable Amazon Connect flow logs in an Amazon CloudWatch log group
<a name="contact-flow-logs"></a>

By default when you create a new Amazon Connect instance, an Amazon CloudWatch log group is created automatically to store the logs for your instance.

**Tip**  
Amazon Connect delivers flow logs at least once. They may be delivered again for multiple reasons. For example, a service retry due to an unavoidable failure.

## Step 1: Enable logging for your instance
<a name="enable-contact-flow-logs"></a>

Use the following procedure to check that logging is enabled for your instance.

1. Open the Amazon Connect console at [https://console.aws.amazon.com/connect/](https://console.aws.amazon.com/connect/).

1. On the instances page, choose the instance alias. The instance alias is also your **instance name**, which appears in your Amazon Connect URL. The following image shows the **Amazon Connect virtual contact center instances** page, with a box around the instance alias.  
![\[The Amazon Connect virtual contact center instances page, the instance alias.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/instance.png)

1. In the navigation pane, choose **Flows**.

1. Select **Enable Flow logs** and choose **Save**.

## Step 2: Add the Set logging behavior block
<a name="use-set-logging-behavior-block"></a>

Logs are generated only for flows that include a [Set logging behavior](set-logging-behavior.md) block with logging set to enabled. 

You control which flows, or parts of flows, logs are generated for by including multiple **Set logging behavior** blocks and configuring them as needed.

When you use a **Set logging behavior** block to enable or disable logging for a flow, logging is also enabled or disabled for any subsequent flow that a contact is transferred to, even if the flow does not include a **Set logging behavior** block. To avoid logging that persists between flows, enable or disable a **Set logging behavior** block as needed for that specific flow.

**To enable or disable flow logs for a flow**

1. In the flow designer, add a [Set logging behavior](set-logging-behavior.md) block and connect it to another block in the flow.

1. Open the properties for the block. Choose **Enable** or **Disable**.

1. Choose **Save**.

1. If you add a **Set logging behavior** block to a flow that is already published, you must publish it again to start generating logs for it.

# Search flow logs stored in an Amazon CloudWatch log group
<a name="search-contact-flow-logs"></a>

Before you can search flow logs, you must first [enable flow logging](contact-flow-logs.md). 

Logs will be created for conversations that occur after logging is enabled.

**To search flow logs**

1. Open Amazon CloudWatch console, go to **Logs**, **Log groups**. The following image shows a sample log group named **mytest88**.  
![\[The Amazon CloudWatch console, log groups section.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/cloudwatch-log-group.png)

1. Choose the log group for your instance.

   A list of log streams will be displayed.

1. To search all the log streams in the instance, choose **Search log group**, as shown in the following image.  
![\[The search log group button on the /aws/connect/mytest88 page.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/contact-flow-logs-choose-search.png)

1. In the search box, enter the string you want to search for, for example, all or a portion of the contact ID. 

1. After a couple of moments (longer depending on how big your log is), Amazon CloudWatch returns results. The following image shows a sample contact ID **fb3304c2**, and the result.  
![\[The log events listed for mytest88.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/contact-flow-logs-search-results.png)

1. You can open each event to see what happened. The following image shows the event for when a **Play prompt** block runs in a flow.  
![\[The event for a Play prompt block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/contact-flow-logs-example-event.png)

# Data in flow logs stored in an Amazon CloudWatch log group
<a name="contact-flow-log-data"></a>

Log entries for flows include details about the block associated with the log entry, the contact ID, and the action taken after the steps in the block were completed. Any contact interaction that occurs outside of the flow is not logged, such as time spent in a queue or interactions with an agent. 

You can set the properties of the block to disable logging during the parts of your flow that interact with or capture sensitive data or customers’ personal information.

If you use Amazon Lex or AWS Lambda in your flows, the logs show the entry and exit of the flow going to them, and include any information about the interaction that is sent or received during entry or exit.

Because the logs also include the flow ID, and the flow ID stays the same when you change a flow, you can use the logs to compare the interactions with different versions of the flow.

The following example log entry shows a **Set working queue** block of an inbound flow.

```
{
    "ContactId": "11111111-2222-3333-4444-555555555555",
    "ContactFlowId": "arn:aws:connect:us-west-2:0123456789012:instance/nnnnnnnnnnn-3333-4444-5555-111111111111/contact-flow/123456789000-aaaa-bbbbbbbbb-cccccccccccc",
    "ContactFlowModuleType": "SetQueue",
    "Timestamp": "2021-04-13T00:14:31.581Z",
    "Parameters": {
        "Queue": "arn:aws:connect:us-west-2:0123456789012:instance/nnnnnnnnnnn-3333-4444-5555-111111111111/queue/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
    }
}
```

# Track customers between multiple flows in your contact center
<a name="contact-flow-log-multiple-flows"></a>

In many cases, customers interact with multiple flows in your contact center, being passed from one flow to another to appropriately assist them with their specific issue. Flow logs help you track customers between different flows, by including the ID of the contact in each log entry. 

When a customer is transferred to a different flow, the ID for the contact associated with their interaction is included with the log for the new flow. You can query the logs for the contact ID to trace the customer interaction through each flow. 

In larger, high-volume contact centers, there can be multiple streams for flow logs. If a contact is transferred to a different flow, the log may be in a different stream. To make sure that you are finding all of the log data for a specific contact, you should search for the contact ID in the entire CloudWatch log group instead of in a specific log stream.

For a diagram that shows when a new contact record is created, see [Events in the contact record](about-contact-states.md#ctr-events).

# Create alerts for events in your flow logs stored in an Amazon CloudWatch log group
<a name="contact-flow-log-alerts"></a>

You can configure CloudWatch to define a filter pattern that looks for specific events in your flow logs and then creates an alert when an entry for that event is added to the log. 

For example, you can set an alert for when a flow block goes down an error path as a customer interacts with the flow. Log entries are typically available in CloudWatch within a short time, giving you near real-time notification of events in flows.

# Monitor automated interactions (IVR) in Amazon Connect
<a name="monitor-automated-interaction-logs"></a>

You can use automated interaction logs to review the automated portion of your customers' Amazon Connect experience . The interaction logs appear on the **Contact details** page. They include the following information:
+ Key interaction points, that is, flows, prompts, menus, keypad selections.
+ A full bot transcript.

 You can use the logs to monitor and improve your automated customer interactions, and maintain audio and system execution records of the interaction for compliance purposes.

## Enable automated interaction logs
<a name="enable-automated-interaction-logs"></a>

Complete the following steps to check that automated interaction logs are enabled for your Amazon Connect instance.

**Note**  
Currently, Amazon Connect doesn’t support S3 buckets with [Object Lock](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html) enabled. 

1. Open the Amazon Connect console at [https://console.aws.amazon.com/connect/](https://console.aws.amazon.com/connect/).

1. Automated interactions logs are saved to the **S3 bucket you configured for call recordings**. If the call recordings feature is not yet enabled for your instance, enable it now. 

   1. On the navigation pane, choose **Data storage**, **Call recordings**, **Edit**, **Enable call recording**, and create or select your S3 bucket. 

1. In the navigation pane, choose **Flows**.

1. Select **Enable Bot Analytics and Transcripts in Amazon Connect**. Choose this option to log a full transcript of the Amazon Lex portion of the customer's experience. The transcript is then available for you to read on the **Contact details** page.

1. Select **Enable automated interaction logs**. Choose this option to log key interaction points such as flows, prompts, menus, and keypad selections. The can view the interaction log, and a listen to the audio recording if available, on the **Contact details** page.

## Permissions for automated interaction logs
<a name="permissions-automated-interaction-logs"></a>

To keep customer data secure, you can set up permissions to have granular control over who can access automated interaction logs. Access to automated interaction logs are gated by the following security profile permissions:
+ **Flows** and **Flow modules – View** permissions: These permissions are required to see flow and module specific data on the automated interaction logs.
+ **Analytics and Optimization** - **Automated interaction voice (IVR) transcripts (unredacted)** permissions: These permissions are required to access logs of the IVR interaction such as keypad inputs in response to IVR prompts, transcripts of Lex interactions, and more.

## Navigate automated interactions logs and audio recording
<a name="navigate-automated-interaction-logs"></a>

The following image shows an example of an automated interaction log on the **Contact details** page on the Amazon Connect admin website.

![\[An example of an automated interaction log.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/automated-interaction-log.png)


**To navigate the log**

1. Use tabs to toggle between the automated interaction and agent interaction to see the end-to-end interaction of your customer.

1. Choose **Show flow details** to hide system details about the flows and flow blocks.

1. Choose the flow and block hyperlinks to open the flow designer in a new tab, enabling you to quickly follow along with your flow.

1. Choose **Play** to play the specific prompt within your audio recording file. 
**Note**  
If no audio recording is available, there is no option to play the prompt.

1. Quickly see where errors have occurred including customer timeouts or Lambda function errors.

1. See where bot intents are detected and resolved.

# Use Amazon Connect contact attributes
<a name="connect-contact-attributes"></a>

One way to make your customers feel cared for is to create personalized experiences for them in your contact center. For example, you can deliver one welcome message for customers who are using a phone and another for customers using chat. To do this, you need a way to store information about the contact and then make a decision based on the value.

**Topics**
+ [

# How contact attributes work in Amazon Connect
](what-is-a-contact-attribute.md)
+ [

# List of available contact attributes in Amazon Connect and their JSONPath references
](connect-attrib-list.md)
+ [

# How to reference contact attributes in Amazon Connect
](how-to-reference-attributes.md)
+ [

# Display contact information to the agent in the Contact Control Panel (CCP)
](use-attribs-ccp.md)
+ [

# Use attributes in Amazon Connect to route based on number of contacts in a queue
](attrib-system-metrics.md)
+ [

# Personalize a contact's experience based on how they contact your contact center
](use-channel-contact-attribute.md)
+ [

# Use Amazon Lex and attribute values
](attribs-cust-input-lex-bot.md)
+ [

# Store a value from a Lambda functions as a contact attribute in Amazon Connect
](attribs-with-lambda.md)

# How contact attributes work in Amazon Connect
<a name="what-is-a-contact-attribute"></a>

Amazon Connect treats each interaction with a customer as a **contact**. The interaction can be a phone call (voice), a chat, or an automated interaction with an Amazon Lex bot.

Each contact can have some data that is specific to a particular interaction. This data can be accessed as a contact attribute. For example:
+ The name of the customer
+ The name of the agent
+ The channel used for the contact, such as phone or chat

A contact attribute represents this data as a key-value pair. You might think of it as a field name together with the data entered into that field.

For example, here are a couple of key-value pairs for the customer name:


| Key | Value | 
| --- | --- | 
| firstname  | Jane  | 
| lastname  | Doe  | 

The advantage of contact attributes is that they enable you to store temporary information about the contact so you can use it in the flow.

For example, in your welcome messages, you can say their name or thank them for being a member. To do this, you need a way of retrieving data about that specific customer and using it in a flow.

## Common use cases
<a name="contact-attribute-scenarios"></a>

Here are some common use cases for where contact attributes are used:
+ Use the customer phone number to schedule a queued callback.
+ Identify which agent is interacting with a customer so that a post call survey can be associated with a contact.
+ Identify the number of contacts in a queue to decide if the contact should be routed to a different queue.
+ Get the corresponding media streaming ARN to store in a database.
+ Use the customer phone number to identify the status of a customer (for example, are they a member), or the status of their order (shipped, delayed, etc.) to route them to the appropriate queue.
+ Based on a customer interaction with a bot, identify the slot (for example, the type of flowers to order) to be used in a flow.

## Types of contact attributes
<a name="types-of-contact-attributes"></a>

To make it faster for you to find and choose the attributes you want to use, attributes are grouped into **types**. For each flow block, we only surface those types of attributes that work with it. 

Another way to think about types of contact attributes is to categorize them based on where the value comes from. The values for contact attributes have the following sources: 
+ Amazon Connect provides the value, such as the agent's name, during the contact interaction. This is known as providing the value at runtime. 
+ An external process, such as Amazon Lex or AWS Lambda, provides the value. 
+ [User-defined](connect-attrib-list.md#user-defined-attributes). 
  + Contact attributes: In the flow, you can specify the value for an attribute under User defined namespace. 
  + Contact segment attributes: In the flow, you can specify value for a attribute under Segment attributes namespace. You must also predefine the attribute first before assigning it as a contact segment attribute. For instructions, see [Use contact segment attributes](use-contact-segment-attributes.md).

  [Flow attributes](connect-attrib-list.md#flow-attributes) are similar to user-defined attributes. However, unlike user-defined attributes, flow attributes are restricted to the flow in which they are configured.

The following illustration lists the types of available contact attributes, and maps them to the three sources for the values: Amazon Connect, external process such as Amazon Lex, and user-defined.

![\[The types of available contact attributes, the sources for their values.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/contact-attributes-types.png)


## Contact attributes in the contact record
<a name="attributes-in-ctr"></a>

In contact records, contact attributes are shared across all contacts with the same InitialContactId.

For example, while carrying out transfers, a contact attribute updated in the transfer flow updates the attribute's value in the contact attributes of both contact records (that is, the Inbound and Transfer contact attributes). 

## Contact segment attributes in the contact record
<a name="segmentattributes-in-ctr"></a>

In contact records, the values of a contact segment attribute are specific to the individual contactID. The values are not shared across all contacts with the same InitialContactId. 

For example, while carrying out transfers, a contact segment attribute that is updated in the transfer flow updates the attribute's value on the new contact record (that is, it updates the Transfer contact segment attributes). 

## "\$1" is a special character
<a name="dollar-sign-special"></a>

Amazon Connect treats the "\$1" character as a special character. You can't use it in a key when setting an attribute. 

 For example, let's say you're creating an interact block with text-to-speech. You set an attribute like this: 

 ` {"$one":"please read this text"} ` 

When Amazon Connect reads this text, it reads "dollar sign one" to the contact instead of "please read this text." Also, if you were to include \$1 in a key and try to reference the value later using Amazon Connect, it wouldn't retrieve the value. 

Amazon Connect does log and pass the full key:value pair `({"_$one":"please read this text"})` to integrations such as Lambda. 

## What happens if an attribute doesn't exist
<a name="attribute-error"></a>

Be sure to implement logic to handle if the attribute doesn't exist and the contact is routed down the error branch.

Let's say you add an attribute to the Store customer input block. The **Namespace** is **Agent** and the **Key** is **User name**, as shown in the following example. 

![\[Store customer input block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/contact-attributes-errorbranch.png)


If the flow runs and the agent user name is not available, then the contact is routed down the error branch. 

# List of available contact attributes in Amazon Connect and their JSONPath references
<a name="connect-attrib-list"></a>

The following tables describe the contact attributes available in Amazon Connect.

The JSONPath reference for each attribute is provided so you can [create dynamic text strings](create-dynamic-text-strings.md). 

**Topics**
+ [

## System attributes
](#attribs-system-table)
+ [

## Segment attributes
](#attribs-segment-attributes)
+ [

## Views attributes
](#attribs-views)
+ [

## Capabilities attributes
](#attribs-capabilities)
+ [

## Agent attributes
](#attribs-agent)
+ [

## Queue attributes
](#attribs-system-metrics-table)
+ [

## Contact Metric attributes
](#attribs-contact-metrics-table)
+ [

## Telephony call metadata attributes (call attributes)
](#telephony-call-metadata-attributes)
+ [

## Chat initial message attributes
](#chat-initial-message-attributes)
+ [

## Email attributes
](#email-attribs)
+ [

## Media streams attributes
](#media-stream-attribs)
+ [

## Amazon Lex contact attributes
](#attribs-lex-table)
+ [

## Case contact attributes
](#attribs-case-table)
+ [

## Lambda contact attributes
](#attribs-lambda-table)
+ [

## User-defined attributes
](#user-defined-attributes)
+ [

## Flow attributes
](#flow-attributes)
+ [

## Loop Attributes
](#w2aac18c52b9c41)
+ [

## Flow modules attributes
](#flow-modules-attributes)
+ [

## Data Table attributes
](#data-table-attributes)
+ [

## Apple Messages for Business attributes
](#apple-messages-for-business-attributes)
+ [

## Customer Profiles attributes
](#customer-profiles-attributes)
+ [

## Outbound campaign attributes
](#campaign-attributes)
+ [

## Connect AI agents attribute
](#qic-attributes)

## System attributes
<a name="attribs-system-table"></a>

These are predefined attributes in Amazon Connect. You can reference system attributes, but you cannot create them. 

Not all blocks in a flow support using System attributes. For example, you cannot use a System attribute to store customer input. Instead, use a [ user-defined attribute](#user-defined-attributes) to store the data input by a customer.


| Attribute | Description | Type | JSONPath Reference | 
| --- | --- | --- | --- | 
| AWS Region | When used, this returns the AWS Region where the contact is being handled. For example, us-west-2, us-east-1, and so on. | System | \$1.AwsRegion or \$1['AwsRegion'] | 
| Customer address or number | The customer's phone number, or email address if using the EMAIL channel. Supported in voice calls, SMS, WhatsApp business messaging, and email. When used in an outbound whisper flow, this is the number that the agents dialed to reach the customer. When used in inbound flows, this is the number from which the customer placed the call. This attribute is included in contact records. When used in a Lambda function, it's included in the input object under CustomerEndpoint.  | System | \$1.CustomerEndpoint.Address | 
| Customer ID | The customer's identification number. For example, the CustomerId may be a customer number from your CRM. You can create a Lambda function to pull the unique customer ID of the caller from your CRM system. Voice ID uses this attribute as the `CustomerSpeakerId` for the caller.  | System | \$1.CustomerId | 
| System address or number | Supported in voice calls, SMS, email, and WhatsApp business messaging. The number the customer dialed to call your contact center or the email address that the contact sent the email to if using the EMAIL channel. This attribute is included in contact records. When used in a Lambda function, it's included in the input object under SystemEndpoint. | System | \$1.SystemEndpoint.Address | 
| Customer display name | The customer's name on the email that they sent to your contact center. | System | \$1.CustomerEndpoint.DisplayName | 
| System display name | The display name of the email address that the customer sent. | System | \$1.SystemEndpoint.DisplayName | 
| CC Email Address List | The full list of cc'd email addresses on the inbound email sent to your contact center. | System | \$1.AdditionalEmailRecipients.CcList | 
| To Email Address List | The full list of To email addresses on the inbound email sent to your contact center. | System | \$1.AdditionalEmailRecipients.ToList | 
| Customer callback number | The number that Amazon Connect uses to call back the customer. This number can be the one used for a queued callback, or when an agent is dialing from the CCP. Transfer to callback queue functionality, or for an agent dialing from the CCP. The default value is the number that the customer used to call your contact center. However, it can be overwritten with the [Set callback number](set-callback-number.md) block.  This attribute is not included in contact records, and it's not accessible in Lambda input. However, you can copy the attribute to a user-defined attribute with the [Set contact attributes](set-contact-attributes.md) block, which is included in contact records. You can also pass this attribute as a Lambda input parameter in an [AWS Lambda function](invoke-lambda-function-block.md) block, which is not included in contact records.  | System | not applicable | 
| Stored customer input | An attribute created from the most recent invocation of a [Store customer input](store-customer-input.md) block. The attribute values created from the most recent[Store customer input](store-customer-input.md) block invocation. This attribute is not included in contact records, and is not accessible in Lambda input. You can copy the attribute to a user-defined attribute with the [Set contact attributes](set-contact-attributes.md) block, which is included in contact records. You can also pass this attribute as a Lambda input parameter in an [AWS Lambda function](invoke-lambda-function-block.md) block.  | System | \$1.StoredCustomerInput | 
| Queue name | The name of the queue. | System | \$1.Queue.Name | 
| Queue ARN | The ARN for the queue. | System | \$1.Queue.ARN | 
| Queue outbound number | The Outbound caller ID number for the selected queue. This attribute is only available in outbound whisper flows. | System |  | 
| Text to speech voice | The name of the Amazon Polly voice to use for text-to-speech in a contact flow. | System | \$1.TextToSpeechVoiceId | 
| Contact id | The unique identifier of the contact. | System | \$1.ContactId | 
| Initial Contact id | The unique identifier for the contact associated with the first interaction between the customer and your contact center. Use the initial contact ID to track contacts between flows.  | System | \$1.InitialContactId | 
| Task Contact id | The unique identifier for the task contact. Use the task contact ID to track tasks between flows.  | System | \$1.Task.ContactId | 
| Previous Contact id | The unique identifier for the contact before it was transferred. Use the previous contact ID to trace contacts between flows. | System | \$1.PreviousContactId | 
| Channel | The method used to contact your contact center: VOICE, CHAT, TASK, EMAIL.  | System | \$1.Channel | 
| Instance ARN | The ARN for your Amazon Connect instance. | System | \$1.InstanceARN | 
| Initiation method | How the contact was initiated. Valid values include: INBOUND, OUTBOUND, TRANSFER, CALLBACK, QUEUE\$1TRANSFER, EXTERNAL\$1OUTBOUND, MONITOR, DISCONNECT, WEBRTC\$1API, and API.   | System | \$1.InitiationMethod | 
| Name | The name of the task. | System | \$1.Name | 
| Description | A description of the task. | System | \$1.Description | 
| References | Links to other documents that are related to a contact. | System | \$1.References.*ReferenceKey*.Value and \$1.References.*ReferenceKey*.Type where *ReferenceKey* is the user-defined Reference name. | 
| Language | The language of content. Use the standard java.util.Locale. For example, en-US for United States English, ja-JP for Japanese, etc. | System | \$1.LanguageCode | 
| System Endpoint Type | The type of the system endpoint. Valid value is TELEPHONE\$1NUMBER. | System | \$1.SystemEndpoint.Type | 
| Customer Endpoint type | The type of the customer endpoint. Valid value is TELEPHONE\$1NUMBER. | System | \$1.CustomerEndpoint.Type | 
| Queue Outbound Caller ID number | The outbound caller ID number defined for the queue. This can be useful for reverting the caller ID after setting a custom caller ID. | System | \$1.Queue.OutboundCallerId.Address | 
| Queue Outbound Caller ID number type | The type of the outbound caller ID number. Valid value is TELEPHONE\$1NUMBER. | System | \$1.Queue.OutboundCallerId.Type | 
| Tags | The tags used to organize, track, or control access for this resource. For more information about tags, see [Add tags to resources in Amazon Connect](tagging.md) and [Set up granular billing for a detailed view of your Amazon Connect usage](granular-billing.md).  | System | \$1.Tags | 

## Segment attributes
<a name="attribs-segment-attributes"></a>

Segment attributes are a set of system defined key-value pairs stored on individual contact segments using an attribute map. However, it's possible to create user-defined segment attributes, as described in the following table..


| Attribute | Description | Allowed values | Type | JSONPath Reference | 
| --- | --- | --- | --- | --- | 
| connect:Subtype | Represents the subtype of the channel used for the contact. |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/connect/latest/adminguide/connect-attrib-list.html)  | ValueString | \$1.SegmentAttributes['connect:Subtype'] | 
| connect:Direction | Represents the direction of the contact. For example, inbound or outbound. |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/connect/latest/adminguide/connect-attrib-list.html)  | ValueString | \$1.SegmentAttributes['connect:Direction'] | 
| connect:CreatedByUser | Represents the user's ARN who created the task. |  | ValueString | \$1.SegmentAttributes['connect:CreatedByUser'] | 
| connect:AssignmentType | Represents how a task is assigned. | "SELF" | ValueString | \$1.SegmentAttributes['connect:AssignmentType'] | 
| connect:EmailSubject | Represents the subject of an email contact. |  | ValueString | \$1.SegmentAttributes['connect:EmailSubject'] | 
| connect:ScreenSharingDetails |  The `ScreenSharingDetails` section holds information about the screensharing activity performed on the contact. The `ScreenSharingActivated` key indicates whether or not the screen sharing session is activated for the contact or not.  | `"connect:ScreenSharingDetails": { "ScreensharingActivated" : "TRUE" // Allowed Values "TRUE" and "FALSE" }` | ValueString | \$1.SegmentAttributes['connect:ScreenSharingDetails'] | 
| connect:ContactExpiry | Contains the details of contact expiry such as `ExpiryDuration` and `ExpiryTimeStamp` for Task and Email contacts. |  | valueMap | \$1.SegmentAttributes['connect:ContactExpiry'] | 
| connect:CustomerAuthentication | The chat contact's authentication details. | `"connect:CustomerAuthentication": { "valueMap": { "IdentityProvider": { "ValueString": ""}, "ClientId": { "ValueString": ""}, "Status": { "ValueString": *AUTHENTICATED \| FAILED \| TIMEOUT*}, "AssociatedCustomerId": { "ValueString": ""} "AuthenticationMethod": { "ValueString": "*CONNECT" \| "CUSTOM*" } } }` | ValueMap | \$1.SegmentAttributes['connect:CustomerAuthentication'] | 
| connect:ValidationTestType |  Represents the testing and simulation type. This field remains empty for non-simulated contacts. You can use this attribute in the analytics dashboard to filter out actual customer contacts or to identify whether a contact is simulated within your contact record object.  | "EXPERIENCE\$1VALIDATION" | ValueString | \$1.Segment.Attributes['connect:ValidationTestType'] | 
| Client Id | The Amazon Cognito app client identifier. |  | ValueString | \$1.SegmentAttributes['connect:CustomerAuthentication']['ClientId'] | 
| Identify Provider | The identity provider used to authenticate the customer. |  | ValueString | \$1.SegmentAttributes['connect:CustomerAuthentication']['IdentityProvider'] | 
| Status | The status of the authentication process. | `AUTHENTICATED` \$1 `FAILED` \$1 `TIMEOUT` | ValueString | \$1.SegmentAttributes['connect:CustomerAuthentication']['Status'] | 
| Associated Customer Id | The customer's identifier number. This is either a custom identifier or a Customer Profile identifier.  |  | ValueString | \$1.SegmentAttributes['connect:CustomerAuthentication']['AssociatedCustomerId'] | 
| Authentication Method | An Amazon Connect-managed authentication workflow or customer-managed authentication workflow. | `CONNECT` \$1 `CUSTOM` | ValueString | \$1.SegmentAttributes['connect:CustomerAuthentication']['AuthenticationMethod'] | 
| Email Subject | The email subject in the email that the customer sent to your contact center. This useful in case you want to look at the email subject for certain keywords. |  | Segment attribute | \$1.SegmentAttributes['connect:EmailSubject'] | 
| Amazon SES Spam Verdict | When the email comes into your contact center, Amazon SES scans it for spam. You can check for the FAILED condition and then either drop the email or put it in a special queue for supervisors to review it.  |  | Segment attribute | \$1.SegmentAttributes['connect:X-SES-SPAM-VERDICT'] | 
| Amazon SES Virus Verdict | When the email comes into your contact center, Amazon SES scans it for viruses. You can check for the FAILED condition and then either drop the email or put it in a special queue for supervisors to review it.  |  | Segment attribute | \$1.SegmentAttributes['connect:X-SES-VIRUS-VERDICT'] | 
| User-defined attributes | You can choose any user-defined attribute and store it on the contact under segment attributes. The attribute must be predefined before it can be used to store values on contact. See [Use contact segment attributes](use-contact-segment-attributes.md). | If no values are predefined, Amazon Connect allows all string values. This is also the case when the [Enforce valid values](use-contact-segment-attributes.md) option on the **Add predefined attributes** page is not selected. When the **Enforce valid values** option is selected and values are predefined, the contact stores only valid and predefined values for the predefined attribute key. (If using the API, see the [EnableValueValidationOnAssociation](https://docs.aws.amazon.com/connect/latest/APIReference/API_InputPredefinedAttributeConfiguration.html) parameter.) | String | \$1.SegmentAttributes['Attribute\$1key\$1name'] | 

## Views attributes
<a name="attribs-views"></a>

The following table lists the Views attributes available in Amazon Connect.


| Attribute | Description | Type | JSONPath Reference | 
| --- | --- | --- | --- | 
| Action | The action taken by the user interacting with the view. Actions appear as flow branches from the [Show view](show-view-block.md) block | Views |  \$1.Views.Action | 
| View result data | The output data from the user's interaction with the view based on the component they took an action on. | Views |  \$1.Views.ViewResultData | 

## Capabilities attributes
<a name="attribs-capabilities"></a>

The following table lists the Capabilities attributes available in Amazon Connect. These attributes support the screen and video sharing capabilities. For more information, see [Set up in-app, web, video calling, and screen sharing capabilities](inapp-calling.md).


| Attribute | Description | Type | JSONPath Reference | 
| --- | --- | --- | --- | 
| Agent screen share capability | The screen sharing capability that is enabled for the participant. | Capabilities | \$1.Capabilities.Agent.ScreenShare | 
| Agent video capability | The video sharing capability that is enabled for the participant over the call.  | Capabilities | \$1.Capabilities.Agent.Video | 
| Customer screen share capability | The screen sharing capability that is enabled for the participant.  | Capabilities | \$1.Capabilities.Customer.ScreenShare | 
| Customer video capability | The video sharing capability that is enabled for the participant over the call.  | Capabilities | \$1.Capabilities.Customer.Video | 

## Agent attributes
<a name="attribs-agent"></a>

The following table lists the agent attributes available in Amazon Connect.


| Attribute | Description | Type | JSONPath Reference | 
| --- | --- | --- | --- | 
| Agent User name | The user name an agent uses to log in to Amazon Connect. | System | \$1.Agent.UserName | 
| Agent First name | The agent’s first name as entered in their Amazon Connect user account.  | System | \$1.Agent.FirstName | 
| Agent Last name | The agent’s last name as entered in their Amazon Connect user account. | System | \$1.Agent.LastName | 
| Agent ARN | The ARN of the agent. | System | \$1.Agent.ARN | 

**Note**  
When you use an agent contact attribute in a **Transfer to agent** flow, the agent attributes reflect the target agent, not the one who initiated the transfer.

Agent attributes are available only in the following types of flows:
+ Agent whisper
+ Customer whisper
+ Agent hold
+ Customer hold
+ Outbound whisper
+ Transfer to agent. In this case, the agent attributes reflect the target agent, not the one who initiated the transfer.

Agent attributes are not available in the following flow types:
+ Customer queue
+ Transfer to queue
+ Inbound flow

## Queue attributes
<a name="attribs-system-metrics-table"></a>

These system attributes are returned when you use a [Get metrics](get-queue-metrics.md) block in your flow.

If there is no current activity in your contact center, null values are returned for these attributes.


| Attribute | Description | Type | JSONPath Reference | 
| --- | --- | --- | --- | 
| Queue name | The name of the queue for which metrics were retrieved. | System | \$1.Metrics.Queue.Name | 
| Queue ARN | The ARN of the queue for which metrics were retrieved. | System | \$1.Metrics.Queue.ARN | 
| Contacts in queue | The number of contacts currently in the queue. | System | \$1.Metrics.Queue.Size | 
| Oldest contact in queue | For the contact that has been in the queue the longest, the length of time that the contact has been in the queue, in seconds. | System | \$1.Metrics.Queue.OldestContactAge | 
| Queue Estimated Wait Time | An estimate, in seconds, of how long a contact will wait in queue before being connected to an agent. | System | \$1.Metrics.Queue.EstimatedWaitTime | 
| Agents online | The number of agents currently online, which means logged in and in any state other than offline. | System | \$1.Metrics.Agents.Online.Count | 
| Agents available | The number of agents whose state is set to Available. | System | \$1.Metrics.Agents.Available.Count | 
| Agents staffed | The number of agents currently staffed, which is agents logged in and in Available, ACW, or Busy states. | System | \$1.Metrics.Agents.Staffed.Count | 
| Agents in After contact work | The number of agents currently in the ACW state. | System | \$1.Metrics.Agents.AfterContactWork.Count | 
| Agents busy | The number of agents currently active on a contact. | System | \$1.Metrics.Agents.Busy.Count | 
| Agents missed count | The number of agents in the Missed state, which is the state an agent enters after a missed contact. | System | \$1.Metrics.Agents.Missed.Count | 
| Agents in non-productive state | The number of agents in a non-productive (NPT) state. | System | \$1.Metrics.Agents.NonProductive.Count | 

## Contact Metric attributes
<a name="attribs-contact-metrics-table"></a>

These system attributes are returned when you use a [Get metrics](get-queue-metrics.md) block in your flow.

If there is no current activity in your contact center, null values are returned for these attributes.


| Attribute | Description | Type | JSONPath Reference | 
| --- | --- | --- | --- | 
| Estimated Wait Time | An estimate, in seconds, of how long the current contact will wait in queue before being connected to an agent. | System | \$1.Metrics.Contact.EstimatedWaitTime | 
| Position in Queue | The position of the contact in a queue while accounting for the channel (voice, chat, task, or email) and whether a routing step is used. | System | \$1.Metrics.Contact.PositionInQueue | 

## Telephony call metadata attributes (call attributes)
<a name="telephony-call-metadata-attributes"></a>

Telephony metadata provides additional information related to call origination from telephony carriers. 


| Attribute | Description | Type | JSONPath Reference | 
| --- | --- | --- | --- | 
| P-Charge-Info | The party responsible for the charges associated with the call. | System | \$1.Media.Sip.Headers.P-Charge-Info | 
| From | The identity of the end user associated with the request. | System | \$1.Media.Sip.Headers.From | 
| To | Information about the called party or the recipient of the request.  | System | \$1.Media.Sip.Headers.To | 
| ISUP-OLI | Originating Line Indicator (OLI). Shows the type of line placing call (for example, PSTN, 800 service call, wireless/cellular PCS, payphone). | System | \$1.Media.Sip.Headers.ISUP-OLI | 
| JIP | Jurisdiction Indication Parameter (JIP). Indicates geographic location of caller/switch.  Example value: 212555 | System | \$1.Media.Sip.Headers.JIP | 
| Hop-Counter | Hop Counter.  Example value: 0  | System | \$1.Media.Sip.Headers.Hop-Counter | 
| Originating-Switch | Originating Switch.  Example value: 710   | System | \$1.Media.Sip.Headers.Originating-Switch | 
| Originating-Trunk | Originating Trunk. Example value: 0235 | System | \$1.Media.Sip.Headers.Originating-Trunk | 
| Call-Forwarding-Indicator | Call Forwarding Indicators (for example, Diversion header). Indicates domestic or international origin of call.  Example value: sip:\$115555555555@public-vip.us2.telphony-provider.com;reason=unconditional  | System | \$1.Media.Sip.Headers.Call-Forwarding-Indicator | 
| Calling-Party-Address | Calling Party Address (number). NPAC dip shows true line type and native geographic switch. Example value: 15555555555;noa=4  | System | \$1.Media.Sip.Headers.Calling-Party-Address | 
| Called-Party-Address | Called Party Address (number).  Example value: 15555555555;noa=4   | System | \$1.Media.Sip.Headers.Called-Party-Address | 
| SIPREC metadata |  SIPREC metadata XML received by Amazon Contact Lens connector  | System |  \$1.Media.Sip.SiprecMetadata | 

**Note**  
The availability of telephony metadata is not consistent across all telephony providers and may not be available in all cases. This may result in empty values. 

## Chat initial message attributes
<a name="chat-initial-message-attributes"></a>


| Attribute | Description | Type | JSONPath Reference | 
| --- | --- | --- | --- | 
| InitialMessage | The initial message supplied by the customer on a web chat or SMS.  | System | \$1.Media.InitialMessage | 

## Email attributes
<a name="email-attribs"></a>

The following table lists the email attributes available in Amazon Connect.


| Attribute | Description | Type | JSONPath Reference | 
| --- | --- | --- | --- | 
| Email message (Plain text) |  When using the [Get stored content](get-stored-content.md) flow block, this will store the plain text version of the email message from email contacts.  | System | \$1.Email.EmailMessage.Plaintext | 

## Media streams attributes
<a name="media-stream-attribs"></a>

The following table lists the attributes that you can use to identify the location in the live media stream where the customer audio starts and stops.


| Attribute | Description | Type | JSONPath Reference | 
| --- | --- | --- | --- | 
| Customer audio stream ARN | The ARN of the Kinesis Video stream used for Live media streaming that includes the customer data to reference. | Media streams | \$1.MediaStreams.Customer.Audio.StreamARN | 
| Customer audio start timestamp in the Kinesis video stream used for Live media streaming. | When the customer audio stream started. | Media streams | \$1.MediaStreams.Customer.Audio.StartTimestamp | 
| Customer audio stop timestamp | When the customer audio stream stopped the Kinesis video stream used for Live media streaming. | Media streams | \$1.MediaStreams.Customer.Audio.StopTimestamp | 
| Customer audio start fragment number | The number that identifies the Kinesis Video Streams fragment, in the stream used for Live media streaming, in which the customer audio stream started. | Media streams | \$1.MediaStreams.Customer.Audio.StartFragmentNumber | 

## Amazon Lex contact attributes
<a name="attribs-lex-table"></a>

The following table lists the attributes that are returned from Amazon Lex bots. These are also know as *session attributes*.


| Attribute | Description | Type | JSONPath Reference | 
| --- | --- | --- | --- | 
| Alternate Intents | List of alternate intents available from Amazon Lex. Each intent has a corresponding confidence score and slots to fill. | Lex | \$1.Lex.AlternativeIntents.*x*.IntentName \$1.Lex.AlternativeIntents.*x*.IntentConfidence.Score  \$1.Lex.AlternativeIntents.*x*.Slots  \$1.Lex.AlternativeIntents.*y.*IntentName  \$1.Lex.AlternativeIntents.*y*.IntentConfidence.Score  \$1.Lex.AlternativeIntents.*y*.Slots   \$1.Lex.AlternativeIntents.*z*.IntentName  \$1.Lex.AlternativeIntents.*z*.IntentConfidence.Score \$1.Lex.AlternativeIntents.*z*.Slots  Where *x*, *y,* and *z* are the intent names in the Lex response  | 
| Intent Confidence Score | The intent confidence score returned by Amazon Lex. | Lex | \$1.Lex.IntentConfidence.Score | 
| Intent name | The user intent returned by Amazon Lex. | Lex | \$1.Lex.IntentName | 
| Sentiment Label |  The inferred sentiment that Amazon Comprehend has the highest confidence in.   | Lex | \$1.Lex.SentimentResponse.Label  | 
| Sentiment scores |  The likelihood that the sentiment was correctly inferred.   | Lex | \$1.Lex.SentimentResponse.Scores.Positive \$1.Lex.SentimentResponse.Scores.Negative \$1.Lex.SentimentResponse.Scores.Mixed \$1.Lex.SentimentResponse.Scores.Neutral | 
| Session attributes |  Map of key-value pairs representing the session-specific context information.   | Lex | \$1.Lex.SessionAttributes.attributeKey | 
| Slots | Map of intent slots (key/value pairs) Amazon Lex detected from the user input during the interaction.  | Lex | \$1.Lex.Slots.slotName | 
| Dialog state | The last dialog state returned from an Amazon Lex bot. The value is 'Fulfilled' if an intent was returned to the flow. | N/A (no type appears in the UI) | \$1.Lex.DialogState | 

## Case contact attributes
<a name="attribs-case-table"></a>

The following table lists the attributes that are used with Amazon Connect Cases.


| Attribute | Description | Type | JSONPath Reference | Where the data comes from | 
| --- | --- | --- | --- | --- | 
|  Case ID  | Unique Identifier of the case in UUID format (for example, 689b0bea-aa29-4340-896d-4ca3ce9b6226) | text |  \$1.Case.case\$1id  | Amazon Connect | 
|  Case Reason  | The reason for opening the case |  single-select  | \$1.Case.case\$1reason | Agent | 
|  Created By  | The identity of the user who created the case. |  user  | \$1.Case.created\$1by | Amazon Connect | 
|  Customer  | The API is a customer profile ID. On the Cases: Fields page, the customer's name is displayed. |  text  | \$1.Case.customer\$1id | Amazon Connect | 
|  Date/Time Closed  | The date and time the case was last closed. It does not guarantee that a case is closed. If a case is reopened, this field contains the date/time stamp of the last time the status was changed to closed. |  date-time  | \$1.Case.last\$1closed\$1datetime  | Amazon Connect | 
|  Date/Time Opened  | The date and time the case was opened. |  date-time  | \$1.Case.created\$1datetime | Amazon Connect | 
|  Date/Time Updated  | The date and time the case was last updated. |  date-time   | \$1.Case.last\$1updated\$1datetime | Amazon Connect | 
|  Reference number  | A friendly number for the case in 8-digit numeric format. Reference numbers (unlike the Case ID) are not guaranteed to be unique. We recommend that you identify the customer and then collect the reference number to correctly find the right case.  |  text  | \$1.Case.reference\$1number | Agent | 
|  Status  | Current status of the case  |  text  | \$1.Case.status | Agent | 
|  Summary  | Summary of the case  |  text  | \$1.Case.summary | Agent | 
|  Title  | Title of the case  |  text  | \$1.Case.title | Agent | 

## Lambda contact attributes
<a name="attribs-lambda-table"></a>

Lambda attributes are returned as key-value pairs from the most recent invocation of an [AWS Lambda function](invoke-lambda-function-block.md) block. Lambda invocation attributes are overwritten with each invocation of the Lambda function.

To reference attributes in JSONPath, use:
+ `$.LambdaInvocation.ResultData.attributeName`

where `AttributeName` is the attribute name, or the key of the key-value pair returned from the function. 

For example, if the function returns a contact ID, reference the attribute with `$.LambdaInvocation.ResultData.ContactId`. When referencing a contact ID returned from Amazon Connect, the JSONPath is `$.ContactId`. 

For more information about using attributes in Lambda functions, see [Grant Amazon Connect access to your AWS Lambda functions](connect-lambda-functions.md).

These attributes are not included in contact records, not passed to the next Lambda invocation, and not passed to the CCP for screenpop information. However, they can be passed as Lambda function inputs on an [AWS Lambda function](invoke-lambda-function-block.md) block, or copied to user-defined attributes using the [Set contact attributes](set-contact-attributes.md) block. When used in [Set contact attributes](set-contact-attributes.md) blocks, the attributes that are copied are included in contact records, and can be used in the CCP.

## User-defined attributes
<a name="user-defined-attributes"></a>

For all other attributes Amazon Connect defines the key and value. For user-defined attributes, however, you provide a name for the key and the value.

Use user-defined attributes in situations where you want to store values in a contact flow, and then refer to those values later. For example, if you integrate Amazon Connect and a CRM or other system, you might want to get input from the customer such as their member number. Then you can use that member number retrieve information about the member from the CRM, and/or use the member number throughout the flow, etc.


| Attribute | Description | Type | JSONPath Reference | 
| --- | --- | --- | --- | 
| Any name you choose | A user-defined attribute has two parts: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/connect/latest/adminguide/connect-attrib-list.html)  | User-defined | \$1.Attributes.*name\$1of\$1your\$1destination\$1key* | 

To create user-defined attributes, use the [Set contact attributes](set-contact-attributes.md) block. 

## Flow attributes
<a name="flow-attributes"></a>

Flow attributes are like a type user-defined attribute, however, they are restricted to the flow where they are set.

Flow attributes are useful in situations where you don't want to persist the data throughout the contact, such as when you need to use sensitive information like the customer's credit card number to do a Lambda data dip.
+ Flow attributes are temporary variables stored locally and only used in the flow. They aren't visible anywhere outside the flow, not even when the contact is transferred to another flow. 
+ They can be up to 32 KB (the maximum size of the contact record attributes section).
+ They aren't passed to a Lambda unless they are explicitly configured as parameters: in the **Invoke AWS Lambda function** block, choose **Add a parameter**. 
+ They aren't passed to modules. You can set a flow attribute within a module, but it won't be passed out of the module.
+ They don't appear in the contact record. 
+ They don't appear to the agent in the CCP.
+ The `GetContactAttributes` API can't expose them.
+ If you have logging enabled on the flow, the key and value appear in the Cloudwatch log.


| Attribute | Description | Type | JSONPath Reference | 
| --- | --- | --- | --- | 
| Any name you choose | A flow attribute has two parts: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/connect/latest/adminguide/connect-attrib-list.html)  | Flow | \$1.FlowAttributes.*name\$1of\$1your\$1destination\$1key* | 

## Loop Attributes
<a name="w2aac18c52b9c41"></a>

The following table lists the attributes that are available with the Loop block if a LoopName is specified in the Loop block.


| Attribute | Description | Type | JSONPath Reference | 
| --- | --- | --- | --- | 
|  Index  | Current index of the Loop. The value starts from 0. This is available with both Count and Array based loop |  Loop  |  \$1.Loop.*name\$1of\$1your\$1loop*.Index   | 
|  Element  | Current Element of the Loop. This is only available with an Array based loop |  Loop  |  \$1.Loop.*name\$1of\$1your\$1loop*.Element  | 
|  Elements  | Elements that were provided as input to the Loop. This is only available with an Array based loop |  Loop  |  \$1.Loop.*name\$1of\$1your\$1loop*.Elements  | 

## Flow modules attributes
<a name="flow-modules-attributes"></a>

Flow module Input attribute are attributes passed into a module that has defined input schema from a flow or another module using [Invoke Module block](contact-flow-modules.md#add-modules). Flow modules Output and Result attributes are returned from the most recent invocation of an [Invoke Module block](contact-flow-modules.md#add-modules). Module Output and Result attributes are overwritten with each invocation of the Module function.

These attributes are not included in contact records, not passed to the next module invocation, and not passed to the CCP for screenpop information. However, they can be copied to user-defined attributes using the [Set contact attributes](set-contact-attributes.md) block. When used in [Set contact attributes](set-contact-attributes.md) block, the attributes that are copied are included in contact records, and can be used in the CCP.

The following table lists the flow modules attributes available in Amazon Connect.


| Attribute | Description | Type | JSONPath Reference | 
| --- | --- | --- | --- | 
| Input | The input data provide access to the input passed into the module. This is returned as a JSON object and the specific format is defined by module input schema. | Modules | \$1.Modules.Input | 
| Result | The result data captures the branch name returned from the module excluding the error branch. This is returned as a string. | Modules | \$1.Modules.Result | 
| Output (Attribute reference from UI) | The output data captures the result-data generated from the module execution. This is returned as a JSON object and the specific format is defined by the module output schema. | Modules | \$1.Modules.ResultData | 

## Data Table attributes
<a name="data-table-attributes"></a>

Attributes returned by Data Table block operations. Use these to access data retrieved from data tables within your contact flows.

### Evaluate Data Table Values attributes
<a name="data-table-evaluate-attributes"></a>

Attributes returned when using the Evaluate action in a Data Table block to query specific attribute values.
+ If the query returns no results or the attribute is not found, the reference will be empty or null.


| Attribute | Description | Type | JSONPath Reference | 
| --- | --- | --- | --- | 
| Data Table evaluated query result | The value of a specific attribute retrieved by a named query. Replace `<QueryName>` with the unique name assigned to your query, and `<AttributeName>` with the name of the attribute you selected to retrieve. | Data Table | \$1.DataTables.<QueryName>.<AttributeName> | 

### List Data Table Values attributes
<a name="data-table-list-attributes"></a>

Attributes returned when using the List action in a Data Table block to retrieve complete records.
+ The list returns complete records (all attributes), not just selected ones.
+ If no matching records are found, the primaryKeyGroups array will be empty.
+ When no primary key group is configured, the entire table is loaded and results are accessible under a "default" group name: `$.DataTableList.ResultData.primaryKeyGroups.default[index]`.
+ The List namespace has a maximum data limit of 32 KB.
+ When accessing array elements in flow blocks, use backticks to wrap the JSONPath reference: ``$.DataTableList.ResultData.primaryKeyGroups.<GroupName>[index]``


| Attribute | Description | Type | JSONPath Reference | 
| --- | --- | --- | --- | 
| Data table ID | The unique identifier of the data table from which records were retrieved. | Data Table List | \$1.DataTableList.ResultData.dataTableId | 
| Lock version | The lock version information for the data table. | Data Table List | \$1.DataTableList.ResultData.lockVersion.dataTable | 
| Default group name | When no primary key group is configured, the entire table is loaded and results are accessible under a "default" group name. | Data Table List | \$1.DataTableList.ResultData.primaryKeyGroups.default[index] | 
| Primary key groups | The collection of retrieved records organized by primary value group name. Replace `<GroupName>` with the name assigned to your primary value group. | Data Table List | \$1.DataTableList.ResultData.primaryKeyGroups.<GroupName> | 
| Specific row | Access a specific row within a primary key group. Replace `<GroupName>` with your group name and `[index]` with the zero-based index of the row. | Data Table List | \$1.DataTableList.ResultData.primaryKeyGroups.<GroupName>[index] | 
| Primary key value | Access the value of a primary key attribute in a specific row. | Data Table List | \$1.DataTableList.ResultData.primaryKeyGroups.<GroupName>[index].primaryKeys[index].attributeValue | 
| Attribute value | Access the value of a non-primary attribute in a specific row. | Data Table List | \$1.DataTableList.ResultData.primaryKeyGroups.<GroupName>[index].attributes[index].attributeValue | 

## Apple Messages for Business attributes
<a name="apple-messages-for-business-attributes"></a>

Use the following contact attributes to route Apple Messages for Business customers. For example, if you have different lines of business using Apple Messages for Business, you can branch to different flows based on the AppleBusinessChatGroup contact attribute. Or, if you want to route Apple Messages for Business messages differently from other chat messages, you can branch based on MessagingPlatform.


| Attribute | Description | Type | JSON | 
| --- | --- | --- | --- | 
|  MessagingPlatform  |  The messaging platform from where the customer request originated.  Exact value: **AppleBusinessChat**  | User-defined | \$1.Attributes.MessagingPlatform | 
|  AppleBusinessChatCustomerId  |  The customer’s opaque ID provided by Apple. This remains constant for the AppleID and a business. You can use this to identify if the message is from a new customer or a returning customer.  | User-defined | \$1.Attributes.AppleBusinessChatCustomerId | 
|  AppleBusinessChatIntent  |  You can define the intent or purpose of the chat. This parameter is included in a URL that initiates a chat session in Messages when a customer chooses the **Business Chat** button.  | User-defined | \$1.Attributes.AppleBusinessChatIntent | 
|  AppleBusinessChatGroup  |  You define the group which designates the department or individuals best qualified to handle the customer’s particular question or problem. This parameter is included in a URL that initiates a chat session in Messages when a customer chooses the **Business Chat** button.   | User-defined | \$1.Attributes.AppleBusinessChatGroup | 
|  AppleBusinessChatLocale  |  Defines the language and AWS Region preferences that the user wants to see in their user interface. It consists of a language identifier (ISO 639-1) and a Region identifier (ISO 3166). For example, **en\$1US**.   | User-defined | \$1.Attributes.AppleBusinessChatLocale | 
|  AppleFormCapability  |  Whether the customer device supports forms. If true, the customer device is supported. If false, the device is not supported.  | User-defined | \$1.Attributes.AppleFormCapability | 
|  AppleAuthenticationCapability  |  Whether the customer device supports Authentication (OAuth2). If true, the customer device is supported. If false, their device is not supported.  | User-defined | \$1.Attributes.AppleAuthenticationCapability | 
|  AppleTimePickerCapability  |  Whether the customer device supports time pickers. If true, the customer device is supported. If false, the device is not supported.  | User-defined | \$1.Attributes.AppleTimePickerCapability | 
|  AppleListPickerCapability  |  Whether the customer device supports list pickers. If true, the customer device is supported. If false, the device is not supported.  | User-defined | \$1.Attributes.AppleListPickerCapability | 
|  AppleQuickReplyCapability  |  Whether the customer device supports quick replies. If true, the customer device is supported. If false, the device is not supported.  | User-defined | \$1.Attributes.AppleQuickReplyCapability | 

## Customer Profiles attributes
<a name="customer-profiles-attributes"></a>

The following table lists the attributes that are used with Amazon Connect Customer Profiles.

The total size of Customer Profiles contact attributes is limited to 14,000 (56 attributes assuming max size of 255 each) characters for the entire flow. This includes all values persisted as **Response** fields in Customer Profiles blocks during the flow.


| Attribute | Description | Type | JSONPath Reference | 
| --- | --- | --- | --- | 
|  profileSearchKey  |  The name of the attribute you want to use to search for a profile.  |  User-defined  |  Not applicable  | 
|  profileSearchValue  |  The value of the key you want to search for, such as customer name or account number.  |  User-defined  |  Not applicable  | 
|  Profile ID  |  The unique identifier of a customer profile.  |  text  |  \$1.Customer.ProfileId  | 
|  Profile ARN  |  The ARN of a customer profile.  |  text  |  \$1.Customer.ProfileARN  | 
|  First Name  |  The customer's first name.  |  text  |  \$1.Customer.FirstName  | 
|  Middle Name  |  The customer's middle name.  |  text  |  \$1.Customer.MiddleName  | 
|  Last Name  |  The customer's last name.  |  text  |  \$1.Customer.LastName  | 
|  Account Number  |  A unique account number that you have given to the customer.  |  text  |  \$1.Customer.AccountNumber  | 
|  Email Address  |  The customer's email address, which has not been specified as a personal or business address.  |  text  |  \$1.Customer.EmailAddress  | 
|  Phone Number  |  The customer's phone number, which has not been specified as a mobile, home, or business number.  |  text  |  \$1.Customer.PhoneNumber  | 
|  Additional Information  |  Any additional information relevant to the customer's profile.  |  text  |  \$1.Customer.AdditionalInformation  | 
|  Party Type  |  The customer's party type.  |  text  |  \$1.Customer.PartyType  | 
|  Business Name  |  The name of the customer's business.  |  text  |  \$1.Customer.BusinessName  | 
|  Birth Date  |  The customer's birth date.  |  text  |  \$1.Customer.BirthDate  | 
|  Gender  |  The customer's gender.  |  text  |  \$1.Customer.Gender  | 
|  Mobile Phone Number  |  The customer's mobile phone number.  |  text  |  \$1.Customer.MobilePhoneNumber  | 
|  Home Phone Number  |  The customer's home phone number.  |  text  |  \$1.Customer.HomePhoneNumber  | 
|  Business Phone Number  |  The customer's business phone number.  |  text  |  \$1.Customer.BusinessPhoneNumber  | 
|  Business Email Address  |  The customer's business email address.  |  text  |  \$1.Customer.BusinessEmailAddress  | 
|  Address  |  A generic address associated with the customer that is not mailing, shipping, or billing.  |  text  |  \$1.Customer.Address1 \$1.Customer.Address2 \$1.Customer.Address3 \$1.Customer.Address4 \$1.Customer.City \$1.Customer.County \$1.Customer.Country \$1.Customer.PostalCode \$1.Customer.Province \$1.Customer.State  | 
|  Shipping Address  |  The customer's shipping address.  |  text  |  \$1.Customer.ShippingAddress1 \$1.Customer.ShippingAddress2 \$1.Customer.ShippingAddress3 \$1.Customer.ShippingAddress4 \$1.Customer.ShippingCity \$1.Customer.ShippingCounty \$1.Customer.ShippingCountry \$1.Customer.ShippingPostalCode \$1.Customer.ShippingProvince \$1.Customer.ShippingState  | 
|  Mailing Address  |  The customer's mailing address.  |  text  |  \$1.Customer.MailingAddress1 \$1.Customer.MailingAddress2 \$1.Customer.MailingAddress3 \$1.Customer.MailingAddress4 \$1.Customer.MailingCity \$1.Customer.MailingCounty \$1.Customer.MailingCountry \$1.Customer.MailingPostalCode \$1.Customer.MailingProvince \$1.Customer.MailingState  | 
|  Billing Address  |  The customer's billing address  |  text  |  \$1.Customer.BillingAddress1 \$1.Customer.BillingAddress2 \$1.Customer.BillingAddress3 \$1.Customer.BillingAddress4 \$1.Customer.BillingCity \$1.Customer.BillingCounty \$1.Customer.BillingCountry \$1.Customer.BillingPostalCode \$1.Customer.BillingProvince \$1.Customer.BillingState  | 
|  Attributes  |  A key value pair of attributes of a customer profile.  |  text  |  \$1.Customer.Attributes.x  | 
|  Object Attributes  |  A key value pair of custom object attributes of a customer profile.  |  text  |  \$1.Customer.ObjectAttributes.y  | 
|  Calculated Attributes  |  A key value pair of calculated attributes of a customer profile.  |  text  |  \$1.Customer.CalculatedAttributes.z  | 
|  Asset  |  A customer's standard Asset.  |  text  |  \$1.Customer.Asset.AssetId \$1.Customer.Asset.ProfileId \$1.Customer.Asset.AssetName \$1.Customer.Asset.SerialNumber \$1.Customer.Asset.ModelNumber \$1.Customer.Asset.ModelName \$1.Customer.Asset.ProductSKU \$1.Customer.Asset.PurchaseDate \$1.Customer.Asset.UsageEndDate \$1.Customer.Asset.Status \$1.Customer.Asset.Price \$1.Customer.Asset.Quantity \$1.Customer.Asset.Description \$1.Customer.Asset.AdditionalInformation \$1.Customer.Asset.DataSource \$1.Customer.Asset.Attributes.x  | 
|  Order  |  A customer's standard Order.  |  text  |  \$1.Customer.Order.OrderId \$1.Customer.Order.ProfileId \$1.Customer.Order.CustomerEmail \$1.Customer.Order.CustomerPhone \$1.Customer.Order.CreatedDate \$1.Customer.Order.UpdatedDate \$1.Customer.Order.ProcessedDate \$1.Customer.Order.ClosedDate \$1.Customer.Order.CancelledDate \$1.Customer.Order.CancelReason \$1.Customer.Order.Name \$1.Customer.Order.AdditionalInformation \$1.Customer.Order.Gateway \$1.Customer.Order.Status \$1.Customer.Order.StatusCode \$1.Customer.Order.StatusUrl \$1.Customer.Order.CreditCardNumber \$1.Customer.Order.CreditCardCompany \$1.Customer.Order.FulfillmentStatus \$1.Customer.Order.TotalPrice \$1.Customer.Order.TotalTax \$1.Customer.Order.TotalDiscounts \$1.Customer.Order.TotalItemsPrice \$1.Customer.Order.TotalShippingPrice \$1.Customer.Order.TotalTipReceived \$1.Customer.Order.Currency \$1.Customer.Order.TotalWeight \$1.Customer.Order.BillingName \$1.Customer.Order.BillingAddress1 \$1.Customer.Order.BillingAddress2 \$1.Customer.Order.BillingAddress3 \$1.Customer.Order.BillingAddress4 \$1.Customer.Order.BillingCity \$1.Customer.Order.BillingCounty \$1.Customer.Order.BillingCountry \$1.Customer.Order.BillingPostalCode \$1.Customer.Order.BillingProvince \$1.Customer.Order.BillingState \$1.Customer.Order.ShippingName \$1.Customer.Order.ShippingAddress1 \$1.Customer.Order.ShippingAddress2 \$1.Customer.Order.ShippingAddress3 \$1.Customer.Order.ShippingAddress4 \$1.Customer.Order.ShippingCity \$1.Customer.Order.ShippingCounty \$1.Customer.Order.ShippingCountry \$1.Customer.Order.ShippingPostalCode \$1.Customer.Order.ShippingProvince \$1.Customer.Order.ShippingState \$1.Customer.Order.Attributes.y  | 
|  Case  |  A customer's standard Case.  |  text  |  \$1.Customer.Case.CaseId \$1.Customer.Case.ProfileId \$1.Customer.Case.Title \$1.Customer.Case.Summary \$1.Customer.Case.Status \$1.Customer.Case.Reason \$1.Customer.Case.CreatedBy \$1.Customer.Case.CreatedDate \$1.Customer.Case.UpdatedDate \$1.Customer.Case.ClosedDate \$1.Customer.Case.AdditionalInformation \$1.Customer.Case.DataSource \$1.Customer.Case.Attributes.z  | 

## Outbound campaign attributes
<a name="campaign-attributes"></a>

You can use data in Amazon Pinpoint [segments](https://docs.aws.amazon.com/pinpoint/latest/userguide/segments-building.html) list to customize experiences in Amazon Connect flows. To reference data in a segment list, use **\$1.Attributes.*attribute coming in the segment***. For example, if you have a segment with two columns "Attributes.FirstName" and "Attributes.ItemDescription, you would refer to them as:
+ \$1.Attributes.FirstName
+ \$1.Attributes.ItemDescription

For more information, see [Adding personalized content to message templates](https://docs.aws.amazon.com/pinpoint/latest/userguide/message-templates-personalizing.html) in the *Amazon Pinpoint User Guide*.

## Connect AI agents attribute
<a name="qic-attributes"></a>

The following attribute stores the Connect AI agents session ARN. A use case for this attribute is when you want to perform any API action, such as [UpdateSession](https://docs.aws.amazon.com/connect/latest/APIReference/API_amazon-q-connect_UpdateSession.html) [UpdateSessionData](https://docs.aws.amazon.com/connect/latest/APIReference/API_amazon-q-connect_UpdateSessionData.html). You can pass the attribute as input to [AWS Lambda function](invoke-lambda-function-block.md) block. And Lambda can call those APIs against the input session ARN.


| Attribute | Description | Type | JSONPath Reference | 
| --- | --- | --- | --- | 
|  SessionArn  |  The Amazon Resource Name (ARN) of a Connect AI agents session.  |  Flow  |  \$1.Wisdom.SessionArn  | 

# How to reference contact attributes in Amazon Connect
<a name="how-to-reference-attributes"></a>

The way you reference contact attributes depends on how they were created and how you are accessing them. 
+ For the JSON syntax for each attribute, see [List of available contact attributes in Amazon Connect and their JSONPath references](connect-attrib-list.md).
+ To reference attributes that contain special characters in their name, such as spaces, place brackets and single quotations around the attribute name. For example: ` $.Attributes.['user attribute name']`. 
+ To reference attributes in the same namespace, such as a system attribute, you use the attribute name, or the name you specified as the **Destination key**.
+ To reference values in a different namespace, such as referencing an external attribute, you specify the JSONPath syntax to the attribute.
+ To use contact attributes to access other resources, set a user-defined attribute in your flow and use the Amazon Resource Name (ARN) of the resource you want to access as the value for the attribute. 

## Lambda examples
<a name="lambda-examples"></a>
+ To reference a customer name from a Lambda function lookup, use \$1.External.AttributeKey, replacing AttributeKey with the key (or name) of the attribute returned from the Lambda function.
+ To use an Amazon Connect prompt in a Lambda function, set a user-defined attribute to the ARN for the prompt, and then access that attribute from the Lambda function.

## Amazon Lex examples
<a name="lex-examples"></a>
+ To reference an attribute from an Amazon Lex bot, you use the format \$1.Lex. and then include the part of the Amazon Lex bot to reference, such as \$1.Lex.IntentName.
+ To reference the customer input to an Amazon Lex bot slot, use \$1.Lex.Slots.*slotName*, replacing *slotName* with the name of the slot in the bot.

## Set contact attribute example
<a name="set-contact-attribute-example"></a>

Use a [Set contact attributes](set-contact-attributes.md) block to set a value that is later referenced in a flow. For example, create a personalized greeting for customers routed to a queue based on the type of customer account. You could also define an attribute for a company name or line of business to include in the text to speech strings said to a customer. The [Set contact attributes](set-contact-attributes.md) block is useful for copying attributes retrieved from external sources to user-defined attributes.

**To set a contact attribute with a [Set contact attributes](set-contact-attributes.md) block**

1. In Amazon Connect, choose **Routing**, **Contact flows**.

1. Select an existing flow, or create a new one.

1. Add a [Set contact attributes](set-contact-attributes.md) block.

1. Edit the [Set contact attributes](set-contact-attributes.md) block, and choose **Use text**.

1. For the **Destination key**, provide a name for the attribute, such as *Company*. This is the value you use for the **Attribute** field when using or referencing attributes in other blocks. For the **Value**, use your company name.

   You can also choose to use an existing attribute as the basis for creating the new attribute.

# Display contact information to the agent in the Contact Control Panel (CCP)
<a name="use-attribs-ccp"></a>

You can use contact attributes to capture information about the contact and then present it to the agent through the Contact Control Panel (CCP). For example, you might want to do this to customize the agent experience when using the CCP integrated with a customer relationship management (CRM) application. 

Also use them when integrating Amazon Connect with a custom application using the Amazon Connect Streams API or Amazon Connect API. You can use all user-defined attributes, in addition to the customer number and the dialed number, in the CCP using the Amazon Connect Streams JavaScript library. For more information, see [Amazon Connect Streams API](https://github.com/aws/amazon-connect-streams) or Amazon Connect API.

When you use the Amazon Connect Streams API, you can access user-defined attributes by invoking contact.getAttributes(). You can access endpoints using contact.getConnections(), where a connection has a getEndpoint() invocation on it.

To access the attribute directly from a Lambda function, use \$1.External.AttributeName. If the attribute is stored to a user-defined attribute from a [Set contact attributes](set-contact-attributes.md) block, use \$1.Attributes.AttributeName.

For example, included with your Amazon Connect instance, there is a flow named "Sample note for screenpop." In this flow, a [Set contact attributes](set-contact-attributes.md) block is used to create an attribute from a text string. The text, as an attribute, can be passed to the CCP to display a note to an agent.

# Use attributes in Amazon Connect to route based on number of contacts in a queue
<a name="attrib-system-metrics"></a>

Amazon Connect includes queue attributes that can help you define routing conditions in your flows based on real-time metrics about the queues and agents in your contact center. For example, here are some common usage scenarios:
+ Check the number of contacts or available agents in a queue, and how long the oldest contact has been in a queue, then route accordingly.
+ To route to the queue with the fewest contacts in it:

  1. Get metrics for multiple queues.

  1. Use a [Set contact attributes](set-contact-attributes.md) block to store the metric attributes for each queue.

  1. compare queue metric attributes using a [Check contact attributes](check-contact-attributes.md) block, and route the contact to the queue with the fewest calls in it, or to a callback if all queues are busy.

# Using a Check contact attributes block to route a contact to a queue


1. In Amazon Connect, choose **Routing**, **Contact flows**.

1. Open an existing flow or create a new one.

1. Optionally, under **Interact**, add a **Play prompt** block to the designer to play a greeting to your customers. Add a connector between the **Entry point** block and the **Play prompt** block.

1. Under **Set**, drag a **Get queue metrics** block to the designer, and connect the **Okay** branch of the **Play prompt** block to it.

1. Choose the title of the **Get queue metrics** block to open the properties for the block. By default, the block retrieves metrics for the current working queue. To retrieve metrics for a different queue, choose **Set queue**.

1. Choose **Select a queue**, then select the queue to retrieve metrics for from the drop-down, then choose **Save**.

   You can also determine which queue to retrieve metrics for using contact attributes.

1. Under **Check**, drag a **Check contact attributes** block to the designer.

1. Choose the title of the block to display the settings for the block. Then, under **Attribute to check**, select **Queue metrics** in the **Type** drop-down menu.

1. Under **Attribute**, choose **Contacts in queue**.

1. To use conditions to route the contact, choose **Add another condition**.

   By default, the **Check contact attributes** block includes a single condition, **No match**. The **No match** branch is followed when there are no matches for any of the conditions you define in the block.

1. Under **Conditions to check**, select **Is less than** as the operator for the condition in the drop-down menu, then in the value field enter 5.

1. Choose **Add another condition**, then choose **Is greater or equal** from the drop-down menu, and enter 5 in the value field.

1. Choose **Save**.

   You now see two new output branches for the **Check contact attributes** block.

You can now add additional blocks to the flow to route the contact as desired. For example, connect the < 5 branch to a **Transfer to queue** block to transfer calls to the queue when there are fewer than five calls currently in the queue. Connect the > 5 branch to a Set customer callback number block and then transfer the call to a callback queue using a **Transfer to queue** block so the customer doesn't have to stay on hold.

## Route contacts based on queue metrics
<a name="route-based-on-queue-metrics"></a>

Many contact centers route customers based on the number of contacts waiting in a queue. This topic explains how to configure a flow that looks similar to the following image. It shows the following three flow blocks connected by Success branches: **Set contact attributes**, **Get queue metrics**, and **Check contact attributes**.

![\[The flow designer with three flow blocks on it.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/get-metrics-specify-set-contact-attributes.png)


1. Add a [Set contact attributes](set-contact-attributes.md) block to your flow.

1. In the [Set contact attributes](set-contact-attributes.md), specify the channel. If you set a channel dynamically using text, for the attribute value enter **Voice** or **Chat**, as shown in the following image. This value is not case-sensitive.   
![\[The properties page of the Set contact attributes block. Namespace is set to User defined, Value set to chat.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/get-metrics-properties2.png)

1. Add a [Get metrics](get-queue-metrics.md) block to your flow. 

 In the Get queue metrics block, dynamic attributes can only return metrics for one channel

## Add a Check contact attributes block after the Get queue metrics block
<a name="get-metrics-tips2"></a>

After a **Get queue metrics** block, add a [Check contact attributes](check-contact-attributes.md) block to branch based on the returned metrics. Use the following steps:

1. After **Get queue metrics**, add a **Check contact attributes** block.

1. In the **Check contact attributes** block, set **Attribute to check** to **Queue metrics**.

1. In the **Attributes to check** dropdown box, you'll see that the following queue metrics are returned by the **Get queue metrics** block. Choose the metric that you want to use for the routing decision.   
![\[The properties page of the Check contact attributes block, Namespace is set to Queue metrics.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/get-metrics-block-returned-metrics.png)

1. Choose **Add a condition** to enter the comparison for your routing decision. The following image shows the block configured to check whether contacts in queue is greater than 5.  
![\[The Attribute to check section, the Conditions to check section.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/get-metrics-check-attributes-block.png)

# Personalize a contact's experience based on how they contact your contact center
<a name="use-channel-contact-attribute"></a>

You can personalize the customer's experience based on the channel that they use to contact you. Here's what you do: 

1. Add a **Check contact attributes** block to the beginning of your flow.

1. Configure the block as shown in the following image. In the **Attribute to check** section, set **Type** to **System**, set **Attribute** to **Channel**. In the **Conditions to check** section, set it to **Equals CHAT**.  
![\[The Attribute to check section set to Channel, the Conditions to check section set to chat.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/channel-attribute.png)

1. The following image of the configured Check contact attributes block shows two branches: **CHAT** and **No Match**. If the customer is contacting you through chat, specify what should happen next. If the customer is contacting you through a call (No Match), specify the next step in the flow.   
![\[A configured Check contact attributes block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/channel-attribute-flow.png)

# Use Amazon Lex and attribute values
<a name="attribs-cust-input-lex-bot"></a>

When you reference attributes in a **Get customer input** block, and choose Amazon Lex as the method of collecting the input, the attribute values are retrieved and stored from the output from the customer interaction with the Amazon Lex bot. You can use an attribute for each intent or slot used in the Amazon Lex bot, as well as the sessions attributes associated with the bot. An output branch is added to the block for each intent you include. When a customer chooses an intent when interacting with the bot, the branch associated with that intent is followed in the flow.

For a list of Amazon Lex attributes you can use and receive back from the Lex bot, see [Amazon Lex contact attributes](connect-attrib-list.md#attribs-lex-table).

# Using an Amazon Lex bot to get customer input


1. Open an existing or create a new flow.

1. Under **Interact**, drag a **Get customer input** block to the designer.

1. Choose the title of the block to display the block settings, then select **Text to speech (Ad hoc)**.

1. Choose **Enter text**, then enter text in the **Enter text to be spoken** field that is used as a message or greeting to your customers. For example, "Thank you for calling" followed by a request to enter information to fulfill the intents you defined in your Amazon Lex bot.

1. Choose the **Amazon Lex** tab, then from the drop-down menu, choose the Amazon Lex bot to use to get customer input.

1. By default, the **Alias** field is populated with \$1LATEST. To use a different alias of the bot, enter the alias value to use.
**Important**  
In a production environment, always use a different alias than **TestBotAlias** for Amazon Lex and **\$1LATEST** for Amazon Lex classic. **TestBotAlias** and **\$1LATEST** support a limited number of concurrent calls to an Amazon Lex bot. For more information, see [Runtime quotas](https://docs.aws.amazon.com/lexv2/latest/dg/quotas.html#quotas-service) or [Runtime Service Quotas (Amazon Lex Classic)](https://docs.aws.amazon.com/lex/latest/dg/gl-limits.html#gl-limits-runtime).

1. Optionally, to pass an attribute to Amazon Lex to use as a session attribute, choose **Add an attribute**. Specify the value to pass using either text or an attribute.

1. To create a branch from the block based on the customer intent, choose **Add an intent**, then enter the name of the intent exactly the same as the intent name in your bot.

1. Choose **Save**.

# Use alternate intent attributes in Amazon Lex
<a name="alternate-intent-attributes"></a>

Usually you configure flows to branch on the winning Lex intent. However, in some situations, you might want to branch on an alternate intent. That is, what the customer might have meant. 

The following image shows the **Properties** page of the **Check contact attributes** block. It is configured to check a Lex attribute. 

![\[The properties page of the Check contact attributes block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/check-contact-attributes-alternate-intents.png)


1. **Intent name** is the name of an alternate intent in Lex. It's case sensitive and must match what's in Lex exactly.

1. **Intent Attribute** is what Amazon Connect is going to check. In this example, it's going to check the **Intent Confidence Score**.

1. **Conditions to check**: If Lex is 70% certain the customer meant the alternate intent instead of the winning intent, branch.

# How flow blocks use Amazon Lex session attributes
<a name="how-to-use-session-attributes"></a>

When a customer starts a conversation with your bot, Amazon Lex creates a *session*. With *session attributes*, also known as *Lex attributes*, you can pass information between the bot and Amazon Connect during the session. For a list of Amazon Lex attributes that you can use, see [Amazon Lex contact attributes](connect-attrib-list.md#attribs-lex-table).

## Life cycle of session attributes
<a name="session-attribute-lifecycle"></a>

Each conversation contains one set of session attributes. In cases where an AWS Lambda function is invoked to do some processing, Amazon Lex runs the attributes in the following order:
+ Service defaults: These attributes are only used if no attributes are defined.
+ Session attributes provided by Amazon Connect: These attributes are defined in the [Get customer input](get-customer-input.md) block.
+ Session attributes provided by Lambda override everything prior: When an AWS Lambda function is invoked and it does some processing, it overrides any session attributes set in the [Get customer input](get-customer-input.md) block.

Let's say a customer utters that they want **a car**. That's the first session attribute to go through processing. When asked what kind of car, they say **luxury car**. This second utterance overrides any Lambda processing that took place on the first utterance. 

For an example of how to create a Lambda function that processes session attributes, see [Step 1: Create a Lambda Function](https://docs.aws.amazon.com/lex/latest/dg/gs2-prepare.html) in the *Amazon Lex Developer Guide*. For information about Amazon Lex V2, see [Setting session attributes](https://docs.aws.amazon.com/lexv2/latest/dg/context-mgmt-session-attribs.html). 

For the structure of the event data that Amazon Lex provides to a Lambda function, see [Lambda Function Input Event and Response Format](https://docs.aws.amazon.com/lex/latest/dg/lambda-input-response-format.html) in the *Amazon Lex Developer Guide*. For information about Amazon Lex V2, see [Interpreting the input event format](https://docs.aws.amazon.com/lexv2/latest/dg/lambda-input-format.html).

## Flow blocks that support Lex session attributes
<a name="blocks-support-lex-session-attributes"></a>

You can use Lex session attributes in the following flow blocks when a Lex bot is called:
+  [Change routing priority / age](change-routing-priority.md) 
+  [Check contact attributes](check-contact-attributes.md) 
+  [Get customer input](get-customer-input.md) 
+  [AWS Lambda function](invoke-lambda-function-block.md) 
+  [Loop](loop.md) 
+  [Set callback number](set-callback-number.md) 
+  [Set contact attributes](set-contact-attributes.md) 
+  [Set customer queue flow](set-customer-queue-flow.md) 
+  [Set disconnect flow](set-disconnect-flow.md) 
+  [Set hold flow](set-hold-flow.md) 
+  [Set logging behavior](set-logging-behavior.md) 
+  [Set whisper flow](set-whisper-flow.md) 
+  [Set working queue](set-working-queue.md) 
+  [Transfer to flow](transfer-to-flow.md) 
+  [Transfer to phone number](transfer-to-phone-number.md) 
+  [Wait](wait.md) 

### More information
<a name="more-info-attributes"></a>

For more information about using Amazon Lex session attributes, see [Managing Conversation Context](https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html) in the *Amazon Amazon Lex V1 Developer Guide*.

# How to use the same Amazon Lex bot for voice and chat
<a name="one-bot-voice-chat"></a>

You can use the same bot for voice and chat. However, you may want the bot to respond differently based on the channel. For example, you want to return SSML for voice so a number is read as a phone number, but you want to return normal text to chat. You can do this by passing the **Channel** attribute.

1. In the **Get customer input** block, choose the **Amazon Lex** tab.

1. Under **Session attributes**, choose **Add an attribute**. In the **Destination key** box, enter **phoneNumber**. Choose **Set dynamically**. In the **Namespace** box, choose **System**, and in the **Value** box, choose **Customer Number**, as shown in the following image.   
![\[The properties page of the Get customer input block, the Session attributes section.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/session_attributes_customer_number.png)

1. Choose **Add an attribute** again.

1. Choose **Set dynamically**. In the **Destination key** box, enter **callType**. In the **Namespace** box, choose **System**, and in the **Value** box choose **Channel**, as shown in the following image.  
![\[The Set dynamically section.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/session_attributes_call_type_channel.png)

1. Choose **Save**.

1. In your Lambda function, you can access this value in the `SessionAttributes` field in the incoming event.

# Store a value from a Lambda functions as a contact attribute in Amazon Connect
<a name="attribs-with-lambda"></a>

Retrieve data from a system that your organization uses internally, such as an ordering system or other database with a Lambda function, and store the values as attributes that can then be referenced in a flow.

The Lambda function returns a response from your internal system in the form of key-value pairs of data. You can reference the values returned in the External namespace. For example, `$.External.attributeName`. To use the attributes later in a flow, you can copy the key-value pairs to user-defined attributes by using a **Set contact attributes** block. You can then define logic to branch your contact based on attribute values by using a **Check contact attributes** block. Any contact attribute retrieved from a Lambda function is overwritten when you invoke any other Lambda function. Make sure you store external attributes if you want to reference them later in a flow.

**Tip**  
For information about invoking a Lambda function from a flow, see [Grant Amazon Connect access to your AWS Lambda functions](connect-lambda-functions.md) The topic also shows how to consume a Lambda function response. 

**To store an external value from a Lambda function as a contact attribute**

1. In Amazon Connect, choose **Routing**, **Contact flows**.

1. Select an existing flow, or create a new one.

1. Add an [AWS Lambda function](invoke-lambda-function-block.md) block, then choose the title of the block to open the settings for the block.

1. Add the **Function ARN** to your AWS Lambda function that retrieves customer data from your internal system.

1. After the [AWS Lambda function](invoke-lambda-function-block.md) block, add a **Set contact attributes** block and connect the **Success** branch of the [AWS Lambda function](invoke-lambda-function-block.md) block to it.

1. Edit the **Set contact attributes** block, and select **Use attribute**.

1. For **Destination key**, type a name to use as a reference to the attribute, such as customerName. This is the value you use in the **Attribute** field in other blocks to reference this attribute.

1. For **Type**, choose **External**.

1. For **Attribute**, enter the name of the attribute returned from the Lambda function. The name of the attribute returned from the function will vary depending on your internal system and the function you use.

After this block executes during a flow, the value is saved as a user-defined attribute with the name specified by the **Destination key**, in this case *customerName*. It can be accessed in any block that uses dynamic attributes.

To branch your flow based on the value of an external attribute, such as an account number, use a **Check contact attributes** block, and then add a condition to compare the value of the attribute to. Next, branch the flow based on the condition.

****

1. In the **Check contact attributes** block, for **Attribute to check** do one of the following:
   + Select **External** for the **Type**, then enter the key name returned from the Lambda function in the **Attribute** field.
**Important**  
Any attribute returned from an AWS Lambda function is overwritten when you invoke any other Lambda function. To reference the attributes later in a flow, store them as user-defined attributes.
   + Select **User Defined** for the **Type**, and in the **Attribute** field, type the name that you specified as the **Destination key** in the **Set contact attributes** block.

1. Choose **Add another condition**.

1. Under **Conditions to check**, choose the operator for the condition, then enter a value to compare to the attribute value. The block creates a branch for each comparison you enter, letting you route the contact based on the conditions specified. If no condition is matched, the contact takes the **No Match** branch from the block.

# Migrate flows to an instance, Region, or environment in Amazon Connect
<a name="migrate-contact-flows"></a>

Amazon Connect lets you efficiently migrate flows to another instance. For example, you might want to expand into new Regions, or move flows from your development environment to your production environment. 

To migrate a few flows, use the [import/export feature](contact-flow-import-export.md) in the flow designer. 

To migrate hundreds of flows, you need developer skills. You use the following procedure:

1. Source instance
   + [ListContactFlow](https://docs.aws.amazon.com/connect/latest/APIReference/API_ListContactFlows.html): Retrieve the Amazon Resource Number (ARN) for the flows that you want to migrate.
   + [DescribeContactFlow](https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribeContactFlow.html): Get information about each flow that you want to migrate.

1. Destination instance
   + [CreateContactFlow](https://docs.aws.amazon.com/connect/latest/APIReference/API_CreateContactFlow.html): Create the flows.
   + [UpdateContactFlowContent](https://docs.aws.amazon.com/connect/latest/APIReference/API_UpdateContactFlowContent.html): Update the flow content.

You must also build an ARN-to-ARN mapping for queues, flows, and prompts between the source and target Amazon Connect instances, and replace every ARN in the source flow with the corresponding ARN from the target instance. Otherwise UpdateContactFlowContent fails with `InvalidContactFlow` error. 

You can update the information in the flows that you migrate. For more information, see [Flow language](https://docs.aws.amazon.com/connect/latest/APIReference/flow-language.html) in the *Amazon Connect API Reference Guide*. 