Genesys Cloud Open Messaging: Handover End Detection with Amazon EventBridgeΒΆ
The Amazon EventBridge integration offers a more reliable and stable solution for event handling compared to WebSocket. Unlike WebSocket, which can sometimes result in lost events due to connection instability, EventBridge ensures smooth and consistent event delivery, improving the reliability of the handover process between Cognigy.AI and Genesys Cloud Open Messaging.
In this guide, you will configure Amazon EventBridge connection for the following Genesys analytics events:
- CustomerEndEvent. The event is triggered when the customer session ends, for example, when customers leave the chat. This event allows Cognigy.AI to detect when the customer finishes their interaction in Genesys Cloud Open Messaging. This approach ensures that Cognigy.AI doesn't restart the conversation too early, especially if the human agent is still completing after-call tasks.
- AfterCallWorkEvent. The event is triggered when a user finishes after-call work by applying a wrap-up.
- UserEndEvent. The event is triggered when a user or human agent session ends, indicating that the interaction has been completed. Cognigy.AI uses this event to detect when a session ends, which helps avoid prematurely wrapping up the chat in the middle of a transfer or after receiving an
AfterCallWorkEvent
event.
The configuration depends on the Cognigy installation you have:
- Shared and Dedicated SaaS β you need access to Genesys and must inform Cognigy technical support about the integration.
- On-premises β you need access to both Genesys and Amazon EventBridge.
PrerequisitesΒΆ
- Configured Genesys Cloud Open Messaging.
- You use Cognigy.AI 4.100 and later versions.
- If you want to migrate from Handover End Detection with HTTP webhooks to Amazon EventBridge, make sure you remove the configuration steps after migration to Amazon EventBridge.
- For on-premises installations, activate the
FEATURE_USE_GENESYS_OM_HTTP_END_HANDOVER_REQUEST="true"
feature flag. - Set the timeout to prevent queue transfers from triggering the end of Genesys Cloud Open Messaging handovers with the
GENESYS_OM_HANDOVER_ACW_AFTER_TRANSFER_TIMEOUT_IN_MS
environment variable. The default value is 10 seconds. This timeout is useful when multiple after-call work events are sent through the event bridge and cause handovers to end during queue transfers. - If you have multiple organizations for one Genesys Cloud Open Messaging account, activate the
SKIP_GENESYS_EVENTBRIDGE_ORGANIZATION_ID_CHECK
feature flag to prevent the validation of the Cognigy.AI organization ID during a handover.
Cognigy SaaSΒΆ
1. Contact Cognigy Technical Support
- Contact Cognigy technical support.
- Provide the
organisationId
for the Cognigy.AI organization where you want to enable the Amazon EventBridge integration. Cognigy technical support will provide you with the AWS Account ID and AWS Account Region Code needed to activate the Amazon EventBridge Source. If you need to create two integrations (one for each organization), provide bothorganisationId
values in the same ticket.
2. Configure Amazon EventBridge in Genesys
- In the Genesys interface, navigate to Admin > Integrations, select Amazon EventBridge Source, and click Install.
-
On the Configuration tab, enter the following information:
- AWS Account ID β enter the 12-digit AWS Account ID provided by Cognigy technical support.
- AWS Account Region β enter the AWS region provided by Cognigy technical support.
- Event Source Suffix β enter the
organisationId
of your Cognigy.AI organization. - Topic Filtering β add the following filters:
v2.detail.events.conversation.{id}.customer.end
v2.detail.events.conversation.{id}.user.end
v2.detail.events.conversation.{id}.acw
-
Click Save, go to the Details tab, and activate the integration.
3. Confirm the Integration Setup
- Reply to the same support ticket to inform Cognigy technical support that the setup is complete.
- Cognigy technical support will verify the integration and contact you to confirm whether it was successful. This process takes up to 5 business days.
Cognigy On-PremisesΒΆ
1. Configure Amazon EventBridge in Genesys
- In the Genesys interface, navigate to Admin > Integrations, select Amazon EventBridge Source, and click Install.
-
- AWS Account ID β enter the 12-digit AWS Account ID where the event source will be available for the event bus.
- AWS Account Region β enter the AWS region where the event source will be made available for the event bus. This parameter defines the geographical location of the AWS resources that will handle the event traffic.
- Event Source Suffix β enter the
organisationId
of your Cognigy.AI organization. - Topic Filtering β add the following filters:
On the Configuration tab, fill in the following fields:
v2.detail.events.conversation.{id}.customer.end
v2.detail.events.conversation.{id}.user.end
v2.detail.events.conversation.{id}.acw
-
Click Save, go to the Details tab, and activate the integration.
2. Set up an EventBridge Flow
- Go to Amazon EventBridge.
- In the left navigation pane, go to Integration > API destinations, then click Create API destination.
- On the Create API destination page, fill in the following fields:
- Name β enter
service-handover-api-destination
. - Endpoint β enter
https://endpoint-<your-environment>/handover/genesysCloudOM
. For example,https://endpoint-app.cognigy.ai/handover/genesysCloudOM
, whereyour-environment
isapp.cognigy.ai
. - HTTP Method β select POST.
- Rate limit β enter
300
.
- Name β enter
- In the Connection configuration section, select Create new connection, then fill in the following fields:
- Name β enter
service-handover-connection
. - Description β enter a meaningful description. This parameter is optional.
- Authorization Type β select API Key.
- API Key Name β enter
Authorization
. - API Key Value β this value will be stored in your Kubernetes Secret. Use a securely generated random alphanumeric string (23 characters), base64-encoded for enhanced security.
- Name β enter
- Save changes by clicking Create.
3. Create a Custom Event Bus
- In the left navigation pane of the Amazon EventBridge console, go to Integration > Partner event sources.
- On the Partner event sources page, you will see a partner event source prefixed with
aws.partner/genesys.com/cloud
and suffixed with your Cognigy.AIorganisationId
. If it's missing, the Genesys setup was incorrect. Delete the EventBridge integration in Genesys and create it again. - In the top-right corner, click Associate with event bus and confirm the integration.
4. Create a Rule
- In the left navigation pane of the Amazon EventBridge console, go to Buses > Event buses.
- Select your custom event bus under Custom event buses.
- On the Rules tab, click Create rule.
- At the Define rule detail step, enter a rule name and its description. Make sure the correct event bus and event pattern are preselected.
- At the Build event pattern step, in the Event source section, select Other, then enter the following JSON in the Event pattern field:
{ "detail": { "eventBody": { "mediaType": ["MESSAGE"], "messageType": ["OPEN"] } } }
- At the Select target(s) step, proceed as follows:
6.1 Select EventBridge API destination in the Target types section.
6.2 In the API destination section, select Use an existing API destination.
6.3 In the Execution role section, create a role that uniquely identifies this integration, for example,Amazon_EventBridge_Invoke_API_Destination_Genesys_Integration
. - Skip the Configure tags step. At the Review and create step, complete the configuration.
5. Store your API Key as a Secret
You must expose the EventBridge API key to the Cognigy handover service.
Run the following command by replacing <your-key>
with the actual API key:
kubectl create secret generic genesys-handover-secret \
--from-literal=GENESYS_EVENTBRIDGE_HANDOVER_API_KEY=<your-key>
env:
- name: GENESYS_EVENTBRIDGE_HANDOVER_API_KEY
valueFrom:
secretKeyRef:
name: genesys-handover-secret
key: GENESYS_EVENTBRIDGE_HANDOVER_API_KEY
Now, your integration is complete.