Skip to content

How to retrieve disconnect reason in real-time when using Disconnect flow in Amazon Connect?

0

I'm working with Amazon Connect and using a Disconnect flow to handle specific chat and voice contact terminations. I need to determine why a contact was disconnected — for example, whether it was customer-initiated, agent-initiated, a timeout, or a system error.

I know that Contact Trace Records (CTRs) stored in Amazon S3 contain this information, but those records are not immediately available — there’s a delay before they're written to S3, which makes them unsuitable for real-time use cases (like routing logic or logging immediately after the contact ends).

My questions are:

Is there a way to access the disconnect reason in real-time from within the Disconnect flow or shortly after the flow is triggered?

Can this information be obtained through a Lambda function, API call (like GetContactAttributes)

1 Answer
0

Amazon Connect does provide ways to access disconnect reasons, though the availability and methods depend on your specific use case.

For outbound campaigns, Amazon Connect can provide disconnect reason details through the DisconnectReason attribute. This field contains a code indicating the method of termination.

For chat contacts, Amazon Connect has enhanced functionality that includes granular disconnect reasons in the contact record. This allows you to determine if a chat was disconnected due to specific reasons like network issues on the agent's end or customer idleness.

The DescribeContact API has been updated to provide richer contact information, including disconnect reasons. This enables you to programmatically detect disconnect reasons and take appropriate actions, such as re-queuing a chat for follow-up if it was disconnected due to a network issue.

For real-time access within a Disconnect flow, you can use system attributes. In your flow, you can access various system attributes using the "Check contact attributes" block. For the disconnect reason specifically, you would use the appropriate system attribute that contains this information.

If you need to perform more complex processing based on the disconnect reason, you could invoke a Lambda function from your Disconnect flow. However, be aware that Lambda functions invoked from Amazon Connect flows have an 8-second execution time limit. If you need to perform longer operations, you'll need to implement an asynchronous pattern where the Lambda function initiates a longer-running process and returns quickly to the flow.

This approach would involve:

  1. Invoking a Lambda that generates a unique ID and starts an asynchronous process
  2. Storing relevant information with that ID
  3. Having your flow continue processing while the asynchronous work completes

By leveraging these capabilities, you can access disconnect reasons in near real-time and implement appropriate routing logic or logging immediately after contact termination.
Sources
DisconnectReason - Amazon Connect
Amazon Connect adds enhanced contact information to DescribeContact API - AWS
Amazon Connect now provides granular disconnect reasons for chats - AWS
Invoke Lambda Function in Amazon Connect Limit to 8 seconds | AWS re:Post

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.