Genesys Cloud Open Messaging: Handover End Detection¶
By default, to detect the end of a handover with Genesys Cloud Open Messaging, Cognigy.AI establishes a WebSocket connection that subscribes to a channel created through the Notifications API. However, this approach has limitations and may not always be reliable. As an alternative, you can use HTTP webhooks, which require creating Triggers within the Workflow and using the Web Services Data Actions extension on the Genesys platform to send requests to Cognigy.AI. This approach ensures that events from ongoing conversations are reliably captured, especially during high volumes or complex flows with multiple queue transfers in Genesys.
In this guide, you will configure HTTP webhooks in Genesys Cloud Open Messaging for the following Genesys analytics events:
- 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.
Prerequisites¶
Configuration Steps¶
1. Install the Web Services Data Actions Extension
- In the Genesys Cloud interface, go to Admin > Integrations.
- Click + Integrations, find Web Services Data Actions, then click Install.
- Enter a name for your connection:
Web Services Data Actions Integration
. - Toggle the Inactive option next to the connection name to activate the connection, then save changes.
2. Create an Action
- Go to Admin > Integrations > Actions.
- Click + Add Action and select the integration you created.
- Enter a name for your connection:
Send Event to Cognigy
.
3. Configure the Action
- On the Setup tab, go to the Contracts section.
- In Input Contract > JSON, paste the following JSON:
{ "title": "properties", "type": "object", "properties": { "userId": { "type": "string" }, "topic": { "type": "string" }, "disconnectType": { "type": "string" } }, "additionalProperties": true }
- In the Configuration section, follow these steps:
- Select POST from the HTTP Method list.
- In the Request URL Template, enter the Cognigy API URL in the following format:
https://endpoint-<cognigy-instance-domain>/handover/genesysCloudOM
. For example,https://endpoint-trial.cognigy.ai/handover/genesysCloudOM
. - Go to the Test tab, enter a value in the provided fields, for example
123
. Click Run Test. - If the test is successful, click Save & Publish. Otherwise, review and correct the previous steps.
4. Create Workflows
- Go to Admin > Architect and select Workflow from the Flows list.
- Create a new flow for the
AfterCallWorkEvent
event and name itWorkflow conversation.id.acw
. - In the left-side menu, select Resources > Data and create the following String-type variables:
addressTo
disconnectType
- Go to the Initial State, then select Toolbox > Data. Drag Call Data Action to the desired location in the flow editor.
- Name your action and select Web Services Data Action from the Category list.
- From the Data Action list, select the action you created previously.
- Fill in the following fields:
userId
— select Expression and enterFlow.addressTo
.topic
— select Literal and enterv2.detail.events.conversation.id.acw
.disconnectType
— select Expression and enterFlow.disconnectType
. Save and publish your flow.
- Create a new flow for the
UserEndEvent
event and repeat steps 1–7 with these changes:- Name the workflow as
Workflow conversation.id.user.end
. - For the
topic
field, select Literal and enterv2.detail.events.conversation.id.user.end
.
- Name the workflow as
5. Create Triggers
- Go to Admin > Architect > Triggers.
- Create a trigger for the
AfterCallWorkEvent
event and name itTrigger conversation.id.acw
. - Configure the following fields:
- Topic Name — select
v2.detail.events.conversation.{id}.acw
. - Workflow Target — select
Workflow conversation.id.acw
.
- Topic Name — select
- Click + Add Condition and define the criteria:
Save changes.
| JSON Path | Operator | Value | |-------------|-------------|-----------| | mediaType | Equals (==) | "MESSAGE" | | messageType | Equals (==) | "OPEN" |
- Create a new trigger for the
UserEndEvent
event and repeat steps 1–4 with these changes:- Topic Name — select
v2.detail.events.conversation.{id}.user.end
. - Workflow Target — select
Workflow conversation.id.user.end
.
- Topic Name — select
- For both triggers, toggle the Inactive option next to the trigger name to activate them, then save changes.
The integration is complete, ensuring more reliable detection of conversation endings.