

# Participant actions in the Amazon Connect Flow language
Participant actions

Participant actions are attempted only when the flow is run in context of a participant. They generally result in an action that the participant experiences, such as playing a prompt or disconnecting.

**Topics**
+ [ConnectParticipantWithLexBot](participant-actions-connectparticipantwithlexbot.md)
+ [DisconnectParticipant](participant-actions-disconnectparticipant.md)
+ [GetParticipantInput](participant-actions-getparticipantinput.md)
+ [MessageParticipant](participant-actions-messageparticipant.md)
+ [MessageParticipantIteratively](participant-actions-messageparticipantiteratively.md)
+ [ShowView](participant-actions-showview.md)

# ConnectParticipantWithLexBot
ConnectParticipantWithLexBot

Connects the participant with the specified Amazon Lex bot. When the interaction is over, the Intent and Slots of the bot are available to the flow during its run. 

## Action syntax


```
{
      "Parameters": {
        "PromptId": "string",
        "Text": "string",
        "SSML": "string",
        "Media": {
            "Uri": "string",
            "SourceType": "string",
            "MediaType": "string"
        },
        "LexV2Bot": {
          "AliasArn": "string"
        },
        "LexBot": {
            "Name": "string",
            "Region": "string",
            "Alias": "string"
        },
        "LexSessionAttributes": {
          "string": "string"
        },
        "LexInitilizationData": {
          "InitialMessage": "string"
        },
        "LexTimeoutSeconds": {
          "Text": "number"
        }
      },
      "Identifier": "string",
      "Type": "ConnectParticipantWithLexBot",
      "Transitions": {
        "NextAction": "string",
        "Errors": [
          {
            "NextAction": "string",
            "ErrorType": "InputTimeLimitExceeded"
          },
          {
            "NextAction": "string",
            "ErrorType": "NoMatchingError"
          },
          {
            "NextAction": "string",
            "ErrorType": "NoMatchingCondition"
          }
        ]
      }
    }
```

## Parameter object


Provide either LexBot or LexV2Bot object depending on the Amazon Lex version in the following format.

 **PromptId** 

 A prompt ID or prompt ARN to play to the participant along with gathering input. This is an optional property and is not required if Text or SSML is specified. This must be either statically defined or a single valid JSONPath identifier. 

 Type: String 

 Required: No 

 **Text** 

 An optional string that defines text to send to the participant along with gathering input. May not be specified if PromptId or SSML is also specified. May be defined statically or dynamically. 

 Type: String 

 Required: No 

 **SSML** 

 An optional string that defines SSML to send to the participant along with gathering input. May not be specified if Text or PromptId is also specified. May be defined statically or dynamically. 

 Type: String 

 Required: No 

 **Media** 

 An optional object that defines an external media source.
+ **Uri**: Location of the message.
+ **SourceType**: The source from which the message will be fetched. The only supported type is S3.
+ **MediaType**: The type of the message to be played. The only supported type is Audio.

 **LexV2Bot** 

 The details of the LexV2 bot to invoke.
+ **AliasArn**: The alias ARN of the LexV2 bot to invoke. May be specified statically or dynamically.

 Required: Yes 

 **LexSessionAttributes** 

 A map of session attributes to pass to the Amazon LexV2 bot when it is invoked. The keys and values may be static or dynamic. 

 Required: No 

 **LexInitializationData** 

 A mapping that defines the initialization data which will be passed to Lex to prime the bot to improve end-customer experience. Lex initialization experience is only supported for Chat channel today. The Voice channel is not supported.
+ **InitialMessage**: An optional string that defines the initial message parsed to Lex to prime the bot. The value for InitialMessage parameter is always serialized to\$1.Media.InitialMessage which resolves to the customer's initial chat message.

 Required: No 

**Note**  
 If the initial message attribute is not included as part of the contact, it will result in the Get customer input block taking the error branch in the flow. To have separate flow configurations for different messaging types, such as web chat, SMS, or Apple Messages for Business, you can use the Check contact attributes block prior to using the Get customer input block to verify the initial message is available. 

 **LexTimeoutSeconds** 

 A mapping that defines the length of Lex timer in second, which will timeout inactive customers in a Lex interaction.
+ **Text**: An optional string that defines the Lex timer length for chat.

 Required: No 

## Transitions


If the Amazon Lex interaction succeeds, the result is the Intent of the bot. Conditions are supported, but only the Equals operator is supported within these conditions.

## Errors

+ **NoMatchingCondition**: If no specified condition evaluated to True.
+ **NoMatchingError**: If an error occurred and no other error matched.
+ **InputTimeLimitExceeded**: if there is no response before the configured LexTimeoutSeconds.

## Conditions

+ **NextAction**: A string that contains the Identifier of the Action that should be run after this Action, if no error or condition is preferentially chosen.
+ **Supported Conditions**: Conditions are supported but only the EQUALS operator may be used on conditions. 

## Restrictions


This action is supported by all channels.

This action is available only in contact flows, transfer flows, and customer queue flows. It is not available in whisper flows or hold flows.

## Corresponding block in the UI


[Get customer input](https://docs.aws.amazon.com/connect/latest/adminguide/get-customer-input.html) 

# DisconnectParticipant
DisconnectParticipant

Disconnects the participant from the contact and stops this flow from running. 

## Parameter object


No parameters are expected.

## Results and conditions


None. Conditions are not supported.

## Errors


None.

## Restrictions


This action is supported for all channels and in contact flows, transfer flows, and customer queue flows. 

## Corresponding block in the UI


[Disconnect / hang up](https://docs.aws.amazon.com/connect/latest/adminguide/disconnect-hang-up.html) 

# GetParticipantInput
GetParticipantInput

Gathers customer input (a DTMF collection for voice contacts, or an entered string for other channels). There are many optional behaviors after gathering this: encryption, validation, storing to a "LastParticipantInput" section on the flow run data, specifying a custom DTMF terminator for voice contacts and so on. Details are in the parameter object section. 

## Parameter object


```
{
    "PromptId": [Optional] A prompt ID or prompt ARN to play to the participant along with gathering input. May not be specified if Text or SSML is also specified. Must be either statically defined or a single valid JSONPath identifier.
    "Text":  An optional string that defines text to send to the participant along with gathering input. May not be specified if PromptId or SSML is also specified. May be defined statically or dynamically.
    "SSML": An optional string that defines SSML to send to the participant along with gathering input. May not be specified if Text or PromptId is also specified. May be defined statically or dynamically. 
    "Media": { An optional object that defines an external media source
        "Uri": Location of the message
        "SourceType": The source from which the message will be fetched. The only supported type is S3
        "MediaType": The type of the message to be played. The only supported type is Audio
    }
    "InputTimeLimitSeconds": The number of seconds to wait for input to be collected before proceeding with a timeout error. 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.
    "StoreInput": "True" or "False". Must be statically defined.
    "InputValidation": { An object that defines how to validate customer inputs, required if and only if StoreInput is True
        "PhoneNumberValidation": { Optional, one of the ways to validate inputs, make sure that it's a valid phone number. May not be specified if CustomValidation is specified.
             "NumberFormat": "Local" or "E164". If "Local" is specified, it is validated to be a local number (without the + and the country code), "E164" enforces that the customer input is a fully defined e.164 phone number. Must be defined statically.
             "CountryCode": If the number format is "Local", this must be defined. This is the two letter country code to be associated with the input number when validating. Must be defined statically. 
        }
        "CustomValidation": { Optional, the other way to validate inputs. May not be specified if PhoneNumberValidation is specified.
            "MaximumLength": A number representing the maximum length of the input. May be defined statically or dynamically.
        }
    },
    "InputEncryption": { An optional object that defines how to encrypt the customer input. May only be specified if "CustomValidation" is provided.
        "EncryptionKeyId": The identifier of a key that has been uploaded in the AWS console for the purposes of customer input encryption. May be specified statically or dynamically.
        "Key": The PEM definition of the public key to use to encrypt this data. This key must be signed with the encryption key identified by the EncryptionKeyId. May be specified statically or dynamically. 
    },
    "DTMFConfiguration": { An optional object to override default DTMF behavior for voice calls
        "InputTerminationSequence": Up to five digits to serve as the terminating sequence when gathering DTMF
        "DisableCancelKey": "True" or "False". If "True", the "*" key doesn't cancel gathering DTMF digits.
        "InterdigitTimeLimitSeconds": The number of seconds to wait between each DTMF digit entry before proceeding with a timeout error. This timeout applies after the first digit has been entered and resets after each subsequent digit. May be defined statically or dynamically, and must be a valid integer between 1 and 20 seconds.
    }
}
```

## Results and conditions


If the "StoreInput" option is "True", there is no run result and conditions are not supported. If the "StoreInput" option is not defined or is "False", the run result is the participant input, and conditions are supported but only the Equals operator may be used on conditions. The values being compared must be static and be a single character - 0-9 numeric, \$1, or \$1.

## Errors

+ NoMatchingCondition - None of the specified conditions evaluated to true. Must be defined only if StoreInput is False.
+ NoMatchingError - if no other Error matches. Must always be defined.
+ InvalidPhoneNumber - the stored input was not a valid phone number according to the specified PhoneNumberValidation. Must be defined only if StoreInput is true, and PhoneNumberValidation is specified.
+ InputTimeLimitExceeded - if there is no response before the configured InputTimeLimitSeconds.

## Restrictions


This action is only supported on the voice channel.

This action can be used in contact flows, transfer flows, and customer queue flows but not in whisper flows or hold flows.

## Corresponding block in the UI


[Get customer input](https://docs.aws.amazon.com/connect/latest/adminguide/get-customer-input.html) 

# MessageParticipant
MessageParticipant

Sends a message to the participant. This is an audio prompt or text-to-speech for voice contacts, or a text message for other channels. 

## Parameter object


```
{
    "PromptId": [Optional] A prompt ID or prompt ARN to play to the participant along with gathering input. May not be specified if Text or SSML is also specified. Must be specified either statically or as a single valid JSONPath identifier.
    "Text":  An optional string that defines text to send to the participant along with gathering input. May not be specified if PromptId or SSML is also specified. May be specified statically or dynamically.
    "SSML": An optional string that defines SSML to send to the participant along with gathering input. May not be specified if Text or PromptId is also specified May be specified statically or dynamically.
    "Media": { An optional object that defines an external media source
        "Uri": Location of the message
        "SourceType": The source from which the message will be fetched. The only supported type is S3
        "MediaType": The type of the message to be played. The only supported type is Audio
    }
}
```

## Results and conditions


None. No conditions are supported.

## Errors


NoMatchingError - If an error occurred and no other error matched.

## Restrictions


This action is supported in contact flows, transfer flows, whisper flows, and customer queue flows. It is not supported in hold flows.

"PromptId" and "SSML" are only supported for the voice channel. All other channels support only the "Text" option.

## Corresponding block in the UI


[Play](https://docs.aws.amazon.com/connect/latest/adminguide/play.html) 

# MessageParticipantIteratively
MessageParticipantIteratively

Loops a sequence of prompts while a customer or agent is on hold or in queue. This block can be configured with an interruption timeout when in a Queue flow that interrupts the message loop to run other flow logic. The message loop can include entries for both Text and Prompts. 

## Parameter object


```
{
   "Messages" : [ A List of messages to be played in a loop. These are defined with either TTS or a Prompt
       {
         "Text" : An optional string that defines text to send to the participant
       },
       {
         "PromptId" : A prompt ID or prompt ARN to play to the participant
       },
       { 
         "SSML" : An optional string that defines the ssml  
       },
       {
         "Media": { An optional object that defines an external media source
           "Uri": Location of the message
           "SourceType": The source from which the message will be fetched. The only supported type is S3
           "MediaType": The type of the message to be played. The only supported type is Audio
         }
       }
       
   ],
   "InterruptFrequencySeconds" : [Optional] Time to elapse before the action completes with "MessagesInterrupted" run result 
}
```

## Results and conditions


When the timeout elapses, the action completes with the result as "MessagesInterrupted". Conditions are supported, but only the "Equals" operator is supported. The only supported operand is MessagesInterrupted.

## Errors

+ NoMatchingError - if no other Error matches.

## Restrictions


This action is supported in Customer Queue, Customer Hold, and Agent Hold flows.

"PromptId" is supported only for the Voice channel, all other channels support only the "Text" option.

If this action is used on the chat channel, it immediately takes the error branch. If no error branch is available, the flow stop running and the contact is routed to next available agent. 

## Corresponding block in the UI


[Loop prompt](https://docs.aws.amazon.com/connect/latest/adminguide/loop-prompts.html) 

# ShowView
ShowView

Initiates a UI-based workflow that can be surfaced to users of front end applications. This action can be used to create [step-by-step guides ](https://docs.aws.amazon.com/connect/latest/adminguide/step-by-step-guided-experiences.html) for agents who are using the Amazon Connect agent workspace.

## Parameter object


```
{
    "ViewResource": {
        "Id": "Id of the View Resource that will be shown in the UI.",
        "Version": "Version of the View Resource that will be shown in the UI."
    },
    "InvocationTimeLimitSeconds": 400,
    "ViewData": {
        "Description": "An optional map of data that will be passed to the View Resource. Keys and values may be set statically or dynamically."
    },
    "SensitiveDataConfiguration": {
        "HideResponseOn": ["TRANSCRIPT"]
    }
}
```

## Results and conditions


The result that the user selects when interacting with the View. The available conditions will be dependent on the View resource specified in action parameters.

## Errors

+ NoMatchingError - if no other Error matches.
+ NoMatchingCondition - if no other Condition matches.
+ TimeLimitExceeded - if there is no response before the configured `InvocationTimeLimitSeconds`.

## Restrictions


This action is only supported on the chat channel.

This action can be used in inbound flows and customer queue flows.

To ensure reliable show view rendering, limit combined inputs and contact attributes to 16KB or less.

## Corresponding block in the UI


 [Show View](https://docs.aws.amazon.com/connect/latest/adminguide/show-view-block.html) 

This action routes step-by-step guides that are to be displayed to agents in the agent workspace. It routes the guides as chat contacts. This type of chat contact is different from the customer-based contact that the agent is handling.

This action can only be used in inbound contact flows.