

# Interactions in the Amazon Connect Flow language
Interactions

Interactions actions have side effects, but they don't require a contact or a participant. They include actions such as invoking an AWS Lambda function. They generally work in every circumstance.

**Topics**
+ [AssociateContactToCustomerProfile](interactions-associatecontacttocustomerprofile.md)
+ [CreateCallbackContact](interactions-createcallbackcontact.md)
+ [CreateCustomerProfile](interactions-createcustomerprofile.md)
+ [InvokeLambdaFunction](interactions-invokelambdafunction.md)
+ [GetCustomerProfile](interactions-getcustomerprofile.md)
+ [GetCustomerProfileObject](interactions-getcustomerprofileobject.md)
+ [GetCalculatedAttributesForCustomerProfile](interactions-getcalculatedattributesforcustomerprofile.md)
+ [UpdateCustomerProfile](interactions-updatecustomerprofile.md)

# AssociateContactToCustomerProfile
AssociateContactToCustomerProfile

Associate a contact to a customer profile. Customer Profiles must be enabled for your Amazon Connect instance.

See [AddProfileKey](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_AddProfileKey.html) in the *Amazon Connect Customer Profiles API Reference*.

## Parameter object


A `ProfileId` and `ContactId` must be present.

```
{
    "ProfileRequestData": {
        "ProfileId": Profile being associated
        "ContactId": ContactId being associated
    },
   "ProfileResponseData": {
       None.
   }
}
```

## Results and conditions


None. Conditions are not supported.

## Errors

+ NoMatchingError - if no other Error matches.

## Corresponding block in the UI


[Customer profiles block](https://docs.aws.amazon.com/connect/latest/adminguide/customer-profiles-block.html) 

# CreateCallbackContact
CreateCallbackContact

Creates a new callback contact. If no customer number is specified, and this is run in context of a contact, the contact's CustomerCallbackNumber is used as the customer number. If you specify a ContactFlowId, then InitialCallDelaySeconds parameter is ignored.

## Parameter object


```
{
    "QueueId": [Optional] A queue ID or queue ARN. The callback contact is routed with this queue, or if this is not specified, the contact's current TargetQueue. Must be specified fully statically or with a single valid JSONPath identifier.
    "AgentId": [Optional] An agent ID or agent ARN, representing an agent queue. If QueueId is specified, this may not be specified. This must be either defined fully statically or as a single valid JSONPath identifier.
    "InitialCallDelaySeconds": The amount of time, in seconds, to wait at a minimum before routing the callback contact. This gives the customer enough time to end their existing contact before being called back. Must be larger than 0, no greater than 259,200 (three days), and an integer. Must be defined statically.
    "MaximumConnectionAttempts": The number of attempts at a maximum to connect this contact to a customer, if the callback is not answered. Must be larger than zero, and an integer. Must be defined statically.
    "RetryDelaySeconds": The minimum amount of time to wait, in seconds, between an unanswered callback attempt is made and the next attempt to reach the customer. Must be larger than 0, no greater than 259,200 (three days), and an integer. Must be defined statically.
    "ContactFlowId": [Optional] A contactFlow ID or contactFlow ARN. Callback contact created will execute this flow post creation, if specified. This must be either defined fully statically or as a single valid JSONPath identifier.
    "CallerId": [Optional] A caller ID representing the phone number to use for the callback. This is what the customer sees when dialed. Must be a valid phone number claimed in your Amazon Connect instance. This must be either defined fully statically or as a single valid JSONPath identifier.
}
```

## Results and conditions


None. No conditions are supported. 

## Errors

+ NoMatchingError - if no other Error matches.

## Restrictions


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

## Corresponding block in the UI


[Set callback number](https://docs.aws.amazon.com/connect/latest/adminguide/set-callback-number.html) 

# CreateCustomerProfile
CreateCustomerProfile

Create a customer profile. Customer Profiles must be enabled for your Amazon Connect instance.

See [CreateProfile](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_CreateProfile.html) in the *Amazon Connect Customer Profiles API Reference*.

## Parameter object


```
{
"ProfileRequestData": {
    All of these fields are optional.
        "FirstName",
        "MiddleName",
        "LastName",
        "PhoneNumber",
        "EmailAddress",
        "AccountNumber",
        "AdditionalInformation",
        "PartyType",
        "BusinessName",
        "BirthDate",
        "Gender",
        "MobilePhoneNumber",
        "HomePhoneNumber",
        "BusinessPhoneNumber",
        "BusinessEmailAddress",
        "Address1",
        "Address2",
        "Address3",
        "Address4",
        "City",
        "County",
        "Country",
        "PostalCode",
        "Province",
        "State",
        "ShippingAddress1",
        "ShippingAddress2",
        "ShippingAddress3",
        "ShippingAddress4",
        "ShippingCity",
        "ShippingCounty",
        "ShippingCountry",
        "ShippingPostalCode",
        "ShippingProvince",
        "ShippingState",
        "MailingAddress1",
        "MailingAddress2",
        "MailingAddress3",
        "MailingAddress4",
        "MailingCity",
        "MailingCounty",
        "MailingCountry",
        "MailingPostalCode",
        "MailingProvince",
        "MailingState",
        "BillingAddress1",
        "BillingAddress2",
        "BillingAddress3",
        "BillingAddress4",
        "BillingCity",
        "BillingCounty",
        "BillingCountry",
        "BillingPostalCode",
        "BillingProvince",
        "BillingState",
        "Attributes.x"
    },
   "ProfileResponseData": {
       All of these fields are optional.
       Newly created profile ID is persisted under the Customer -> ProfileID attribute + $.Customer.ProfileId
        "FirstName",
        "MiddleName",
        "LastName",
        "PhoneNumber",
        "EmailAddress",
        "AccountNumber",
        "AdditionalInformation",
        "PartyType",
        "BusinessName",
        "BirthDate",
        "Gender",
        "MobilePhoneNumber",
        "HomePhoneNumber",
        "BusinessPhoneNumber",
        "BusinessEmailAddress",
        "Address1",
        "Address2",
        "Address3",
        "Address4",
        "City",
        "County",
        "Country",
        "PostalCode",
        "Province",
        "State",
        "ShippingAddress1",
        "ShippingAddress2",
        "ShippingAddress3",
        "ShippingAddress4",
        "ShippingCity",
        "ShippingCounty",
        "ShippingCountry",
        "ShippingPostalCode",
        "ShippingProvince",
        "ShippingState",
        "MailingAddress1",
        "MailingAddress2",
        "MailingAddress3",
        "MailingAddress4",
        "MailingCity",
        "MailingCounty",
        "MailingCountry",
        "MailingPostalCode",
        "MailingProvince",
        "MailingState",
        "BillingAddress1",
        "BillingAddress2",
        "BillingAddress3",
        "BillingAddress4",
        "BillingCity",
        "BillingCounty",
        "BillingCountry",
        "BillingPostalCode",
        "BillingProvince",
        "BillingState",
        "Attributes.x"
}
```

## Results and conditions


None. Conditions are not supported. If an error does not occur, the response's attributes are available dynamically under the `$.Customer` path based on the attributes included in `ProfileResponseData`.

## Errors

+ NoMatchingError - if no other Error matches.

## Corresponding block in the UI


[Customer profiles block](https://docs.aws.amazon.com/connect/latest/adminguide/customer-profiles-block.html) 

# InvokeLambdaFunction
InvokeLambdaFunction

Invokes an AWS Lambda function with a collection of optional parameters. This AWS Lambda function is also given a copy of the flow run data if there is an associated contact with the flow. 

## Parameter object


```
{
    "LambdaFunctionARN": The ARN of the AWS Lambda function to be invoked. May be defined statically or dynamically. 
    "InvocationTimeLimitSeconds": The number of seconds to wait for a response from the AWS Lambda function. Must be greater than 0, no larger than 8, and an integer. Must be set statically. 
    "InvocationType": Specifies the invocation type, allowed values: "SYNCHRONOUS" | "ASYNCHRONOUS".
    "LambdaInvocationAttributes" { A map of additional data to send to the AWS Lambda function when invoking it. Keys and values may be set statically or dynamically.
    }
    "ResponseValidation": {
      "ResponseType": "STRING_MAP" or "JSON", If response validation is set to STRING_MAP, 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. Must be set statically.
    }
}
```

## Results and conditions


None. Conditions are not supported. If an error does not occur, the response's attributes are available dynamically under the \$1.External path. 

## Errors

+ NoMatchingError - if no other Error matches.

## Restrictions


None. This action is supported by all channels and in all types of flows.

## Corresponding block in the UI


[AWS Lambda function](https://docs.aws.amazon.com/connect/latest/adminguide/invoke-lambda-function-block.html) 

# GetCustomerProfile
GetCustomerProfile

Retrieve a customer profile based any search identifier, up to five total. Customer Profiles must be enabled for your Amazon Connect instance.

See [SearchProfiles](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_SearchProfiles.html) in the *Amazon Connect Customer Profiles API Reference*.

## Parameter object


At least one search identifier must be present.

```
{
    "ProfileRequestData": {
        Requires either IdentiferName and IdentifierValue, or SearchCriteria.
       
        "IdentifierName": Name to search for profiles with one identifier,
        "IdentiferValue": Value to search for profiles with one identifier,
        
        "SearchCriteria": [
            {
                "IdentifierName": Name to search for profiles with multiple identifiers,
                "IdentifierValue": Value to search for profiles with multiple identifiers
            }
        ],
        Required when using SearchCriteria
        "LogicalOperator": AND or OR
        
    },
   "ProfileResponseData": {
       All of these fields are optional.
       Newly created profile ID is persisted under the Customer -> ProfileID attribute + $.Customer.ProfileId
        "FirstName",
        "MiddleName",
        "LastName",
        "PhoneNumber",
        "EmailAddress",
        "AccountNumber",
        "AdditionalInformation",
        "PartyType",
        "BusinessName",
        "BirthDate",
        "Gender",
        "MobilePhoneNumber",
        "HomePhoneNumber",
        "BusinessPhoneNumber",
        "BusinessEmailAddress",
        "Address1",
        "Address2",
        "Address3",
        "Address4",
        "City",
        "County",
        "Country",
        "PostalCode",
        "Province",
        "State",
        "ShippingAddress1",
        "ShippingAddress2",
        "ShippingAddress3",
        "ShippingAddress4",
        "ShippingCity",
        "ShippingCounty",
        "ShippingCountry",
        "ShippingPostalCode",
        "ShippingProvince",
        "ShippingState",
        "MailingAddress1",
        "MailingAddress2",
        "MailingAddress3",
        "MailingAddress4",
        "MailingCity",
        "MailingCounty",
        "MailingCountry",
        "MailingPostalCode",
        "MailingProvince",
        "MailingState",
        "BillingAddress1",
        "BillingAddress2",
        "BillingAddress3",
        "BillingAddress4",
        "BillingCity",
        "BillingCounty",
        "BillingCountry",
        "BillingPostalCode",
        "BillingProvince",
        "BillingState",
        "Attributes.x"
}
```

## Results and conditions


None. Conditions are not supported. If an error does not occur, the response's attributes are available dynamically under the `$.Customer` path based on the attributes included in `ProfileResponseData`.

## Errors

+ MultipleFoundError - if multiple profiles were found for the associated profile search key.
+ NoneFoundError - if no profiles were found for the associated profile search key.
+ NoMatchingError - if no other Error matches.

## Corresponding block in the UI


[Customer profiles block](https://docs.aws.amazon.com/connect/latest/adminguide/customer-profiles-block.html) 

# GetCustomerProfileObject
GetCustomerProfileObject

Retrieve a customer profile object of the desired type, based on recency or any search identifier. Customer Profiles must be enabled for your Amazon Connect instance.

See [ListProfileObjects](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_ListProfileObjects.html) in the *Amazon Connect Customer Profiles API Reference*.

## Parameter object


A `ProfileId` and `ObjectType` must be present. Either `UseLatest`, or `IdentifierName` and `IdentifierValue` must be present.

```
{
    "ProfileRequestData": {
        "ProfileId": Profile owning the object,
        "ObjectType": Type of object being retrieved,
        
        "IdentifierName": Optional name of search identifier,
        "IdentifierValue": Optional value of search identifier,
        "UseLatset": true / false 
    },
   "ProfileResponseData": {
       All of these fields are optional.
       Asset ID, if a single asset is found, is always persisted under the Customer -> Asset -> AssetID attribute + $.Customer.Asset.AssetId
       Order ID, if a single order is found, is always persisted under the Customer -> Order -> OrderId attribute + $.Customer.Order.OrderId
       Case ID, if a single case is found, is always persisted under the Customer -> Case -> CaseID attribute + $.Customer.Case.CaseId
        "AssetAssetId",
        "AssetProfileId",
        "AssetAssetName",
        "AssetSerialNumber",
        "AssetModelNumber",
        "AssetModelName",
        "AssetProductSKU",
        "AssetPurchaseDate",
        "AssetUsageEndDate",
        "AssetStatus",
        "AssetPrice",
        "AssetQuantity",
        "AssetDescription",
        "AssetAdditionalInformation",
        "AssetDataSource",
        "AssetAttributes.x",
        "OrderOrderId",
        "OrderProfileId",
        "OrderCustomerEmail",
        "OrderCustomerPhone",
        "OrderCreatedDate",
        "OrderUpdatedDate",
        "OrderProcessedDate",
        "OrderClosedDate",
        "OrderCancelledDate",
        "OrderCancelReason",
        "OrderName",
        "OrderAdditionalInformation",
        "OrderGateway",
        "OrderStatus",
        "OrderStatusCode",
        "OrderStatusUrl",
        "OrderCreditCardNumber",
        "OrderCreditCardCompany",
        "OrderFulfillmentStatus",
        "OrderTotalPrice",
        "OrderTotalTax",
        "OrderTotalDiscounts",
        "OrderTotalItemsPrice",
        "OrderTotalShippingPrice",
        "OrderTotalTipReceived",
        "OrderCurrency",
        "OrderTotalWeight",
        "OrderBillingName",
        "OrderBillingAddress1",
        "OrderBillingAddress2",
        "OrderBillingAddress3",
        "OrderBillingAddress4",
        "OrderBillingCity",
        "OrderBillingCounty",
        "OrderBillingCountry",
        "OrderBillingPostalCode",
        "OrderBillingProvince",
        "OrderBillingState",
        "OrderShippingName",
        "OrderShippingAddress1",
        "OrderShippingAddress2",
        "OrderShippingAddress3",
        "OrderShippingAddress4",
        "OrderShippingCity",
        "OrderShippingCounty",
        "OrderShippingCountry",
        "OrderShippingPostalCode",
        "OrderShippingProvince",
        "OrderShippingState",
        "OrderAttributes.x",
        "CaseCaseId",
        "CaseProfileId",
        "CaseTitle",
        "CaseSummary",
        "CaseStatus",
        "CaseReason",
        "CaseCreatedBy",
        "CaseCreatedDate",
        "CaseUpdatedDate",
        "CaseClosedDate",
        "CaseAdditionalInformation",
        "CaseDataSource",
        "CaseAttributes.x",
        "ObjectAttributes.x"
   }
}
```

## Results and conditions


None. Conditions are not supported. If an error does not occur, the response's attributes are available dynamically under the `$.Customer` path based on the attributes included in `ProfileResponseData`.

## Errors

+ NoneFoundError - if no profiles were found for the associated profile search key.
+ NoMatchingError - if no other Error matches.

## Corresponding block in the UI


[Customer profiles block](https://docs.aws.amazon.com/connect/latest/adminguide/customer-profiles-block.html) 

# GetCalculatedAttributesForCustomerProfile
GetCalculatedAttributesForCustomerProfile

Retrieve calculated attributes for a customer profile. Customer Profiles must be enabled for your Amazon Connect instance.

## Parameter object


A `ProfileId` must be present.

```
{
    "ProfileRequestData": {
        "ProfileId": Profile owning the calculated attribute
    },
   "ProfileResponseData": {
       All of these fields are optional.
       "CalculatedAttributes._average_hold_time",
       "CalculatedAttributes._frequent_caller",
       "CalculatedAttributes.x",
   }
}
```

## Results and conditions


None. Conditions are not supported. If an error does not occur, the response's attributes are available dynamically under the `$.Customer` path based on the attributes included in `ProfileResponseData`.

## Errors

+ NoneFoundError - if no profiles were found for the associated profile search key.
+ NoMatchingError - if no other Error matches.

## Corresponding block in the UI


[Customer profiles block](https://docs.aws.amazon.com/connect/latest/adminguide/customer-profiles-block.html) 

# UpdateCustomerProfile
UpdateCustomerProfile

Update a customer profile that was previously created or retrieved in the flow. Customer Profiles must be enabled for your Amazon Connect instance.

See [UpdateProfile](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_UpdateProfile.html) in the *Amazon Connect Customer Profiles API Reference*.

## Parameter object


```
{
"ProfileRequestData": {
    All of these fields are optional.
        "FirstName",
        "MiddleName",
        "LastName",
        "PhoneNumber",
        "EmailAddress",
        "AccountNumber",
        "AdditionalInformation",
        "PartyType",
        "BusinessName",
        "BirthDate",
        "Gender",
        "MobilePhoneNumber",
        "HomePhoneNumber",
        "BusinessPhoneNumber",
        "BusinessEmailAddress",
        "Address1",
        "Address2",
        "Address3",
        "Address4",
        "City",
        "County",
        "Country",
        "PostalCode",
        "Province",
        "State",
        "ShippingAddress1",
        "ShippingAddress2",
        "ShippingAddress3",
        "ShippingAddress4",
        "ShippingCity",
        "ShippingCounty",
        "ShippingCountry",
        "ShippingPostalCode",
        "ShippingProvince",
        "ShippingState",
        "MailingAddress1",
        "MailingAddress2",
        "MailingAddress3",
        "MailingAddress4",
        "MailingCity",
        "MailingCounty",
        "MailingCountry",
        "MailingPostalCode",
        "MailingProvince",
        "MailingState",
        "BillingAddress1",
        "BillingAddress2",
        "BillingAddress3",
        "BillingAddress4",
        "BillingCity",
        "BillingCounty",
        "BillingCountry",
        "BillingPostalCode",
        "BillingProvince",
        "BillingState",
        "Attributes.x"
    },
   "ProfileResponseData": {
       All of these fields are optional.
       Newly created profile ID is persisted under the Customer -> ProfileID attribute + $.Customer.ProfileId
        "FirstName",
        "MiddleName",
        "LastName",
        "PhoneNumber",
        "EmailAddress",
        "AccountNumber",
        "AdditionalInformation",
        "PartyType",
        "BusinessName",
        "BirthDate",
        "Gender",
        "MobilePhoneNumber",
        "HomePhoneNumber",
        "BusinessPhoneNumber",
        "BusinessEmailAddress",
        "Address1",
        "Address2",
        "Address3",
        "Address4",
        "City",
        "County",
        "Country",
        "PostalCode",
        "Province",
        "State",
        "ShippingAddress1",
        "ShippingAddress2",
        "ShippingAddress3",
        "ShippingAddress4",
        "ShippingCity",
        "ShippingCounty",
        "ShippingCountry",
        "ShippingPostalCode",
        "ShippingProvince",
        "ShippingState",
        "MailingAddress1",
        "MailingAddress2",
        "MailingAddress3",
        "MailingAddress4",
        "MailingCity",
        "MailingCounty",
        "MailingCountry",
        "MailingPostalCode",
        "MailingProvince",
        "MailingState",
        "BillingAddress1",
        "BillingAddress2",
        "BillingAddress3",
        "BillingAddress4",
        "BillingCity",
        "BillingCounty",
        "BillingCountry",
        "BillingPostalCode",
        "BillingProvince",
        "BillingState",
        "Attributes.x"
}
```

## Results and conditions


None. Conditions are not supported. If an error does not occur, the response's attributes are available dynamically under the `$.Customer` path based on the attributes included in `ProfileResponseData`.

## Errors

+ NoMatchingError - if no other Error matches.

## Corresponding block in the UI


[Customer profiles block](https://docs.aws.amazon.com/connect/latest/adminguide/customer-profiles-block.html) 