Configure External Routing integration in Salesforce Service Cloud
AI-generated summary
Genesys Cloud integrates with Salesforce Service Cloud through External Routing, enabling seamless connection between Salesforce objects and Genesys Cloud's Automatic Call Distribution (ACD) system. The integration requires installing the External Routing package in Salesforce and configuring three essential sections: Get Started, Configure Genesys Cloud OAuth Settings, and External Routing Settings.
OAuth configuration establishes secure authentication by creating a Client Credentials grant type OAuth client in Genesys Cloud with appropriate permissions, then entering the Client ID and Client Secret in Salesforce's Configure OAuth Settings section and selecting the appropriate Genesys Cloud region. For Implicit Grant OAuth flows, administrators must add the Salesforce redirect URI to Genesys Cloud's allowed redirect URIs and enable pop-up authentication in browser settings to facilitate Genesys Cloud login and automatic session closure upon successful authentication.
External Routing Settings enable configuration of conversation type (Messaging), logger configuration with selectable log levels (DEBUG, INFO, WARN, ERROR), and routing options. Queue Mappings allow administrators to map Salesforce queues to corresponding Genesys Cloud queues and designate default routing queues when specific mappings are unavailable. User Mapping synchronizes user associations between Salesforce and Genesys Cloud at agent login, ensuring correct agent-to-user correlation during transfers when primary email addresses differ between systems. All Disconnect Rules must be enabled in Genesys Cloud, except when implementing custom disconnect logic.
Omni-Channel Flow creation automates incoming interaction routing by establishing recordId and input_record variables, configuring a Route Work action that specifies the messaging service channel and queue destination, and adding a Create Records action to configure the External Routing Request object with Open_Messaging_Integration__c and Work_Item_ID__c fields. Work item transfers are initiated by setting the isTransfer field to true in External_Routing_Request records, while setting it to false creates new interactions.
Agent-to-agent transfer for Messaging Sessions requires configuring Change Data Capture (CDC) to monitor Pending Service Routing, Agent Work, and User Presence entities in real-time, enabling Enhanced Omni-Channel Routing, and activating the Enable User mapping and sync option. Implementation requires assigning specific permission sets including Contact Center Bring Your Own Channel, Service Cloud User, and Contact Center Admin (Partner Telephony), along with custom permissions for ending messaging sessions and initiating outbound messaging.
The configuration includes automatic return functionality for declined Messaging Session transfers, which reassigns conversation ownership to the receiving agent before acceptance. If the receiving agent declines or allows the transfer to time out, the conversation returns to the original agent without disconnecting the customer interaction. This feature requires deployment of both Digital and AI for Salesforce Service Cloud and External Routing for Salesforce Service Cloud packages.
During failed transfers, the original agent's client maintains its live Genesys connection, recognizes the agent-to-agent transfer, subscribes to destination agent updates, and activates a backstop timer to monitor acceptance status. When a transfer is accepted, the session remains with the receiving agent; if declined or not answered within the configured timeout period, the system returns session ownership to the original agent, re-offers the work, logs an activity history entry, and displays a localized notification.
Genesys Cloud also integrates with Salesforce through the CX Cloud External Routing component to enable screen pop functionality, which automatically displays relevant customer information to agents upon receiving interactions. Configuration involves adding the CX Cloud External Routing utility item to a Lightning app, specifying the Genesys Cloud region, and enabling automatic startup, allowing organizations to create Omni-Channel and Record-Triggered flows in Salesforce for routing cases through Genesys Cloud.
Note: This article applies to External Routing in CX Cloud from Genesys and Salesforce integration.
Configure the following components in Salesforce after installing the External Routing package in Salesforce. Launch the GC External Routing Integration app, which is available upon installation of the External Routing package.
On the Setup Home page in Salesforce, click the App Launcher icon.
Search for GC External Routing Integration in the Search apps and items box and open the app.
The integration provides the following sections that are essential for setting up the External Routing integration with the Salesforce Service Cloud:
Get Started
Configure Genesys Cloud OAuth Settings
External Routing Settings
Get Started
This section provides the setup information and explains how External Routing integration works. It details the seamless integration between Salesforce objects and Genesys Cloud’s Automatic Call Distribution (ACD).
Configure Genesys Cloud OAuth settings
CX Cloud from Genesys and Salesforce integration needs additional authentication to configure specific features. For External Routing authentication, you require a Genesys Cloud OAuth client with the correct permissions. The OAuth client serves as the intermediary between your Genesys Cloud and Salesforce Service Cloud providing secure access to the required resources. For more information, see OAuth client permissions for CX Cloud from Genesys and Salesforce.
To configure the OAuth settings in Genesys Cloud, create an OAuth client of Client Credentials grant type. For more information, see Create an OAuth client. Copy the Client ID and Client Secret from the OAuth client.
On the Setup Home page in Salesforce, click the App Launcher icon.
Search for GC External Routing Integration in the Search apps and items box and select the item.
The CX Cloud, External Routing for Salesforce Service Cloud page displays.
Click Configure OAuth Settings.
In the Configure OAuth Settings section, click Edit.
Enter the Client ID and Client Secret from your OAuth client in Genesys Cloud.
Click Save.
Under the Region section, select a Genesys Cloud region from the list.
Click Save.
Click Validate to test the credentials.
Manage external routing settings
You can configure the following routing rules and the integration settings:
Conversation Type – Select Messaging as the interaction type.
Logger Configuration – To capture detailed information about the execution of Apex code, select Enable Apex Logging. Enter the number of logs to store and the log level. You can configure different log levels, such as DEBUG, INFO, WARN, and ERROR. Click Save Logger Settings.
Routing Options – To retrieve the Genesys Cloud queues, messaging integrations, and open messaging integration picklist values, click Retrieve Options.
Queue Mappings – Map Salesforce queues to Genesys Cloud queues. Click Add Mapping and select the Salesforce queue and the corresponding Genesys Cloud queue from the list. Also, select a default external routing queue when there is no specific mapping is available. Click Save Queue Mapping.
User Mapping – Enable this option when External Routing is used for Message Sessions and agents do not have a common primary email address shared between Salesforce and Genesys. When enabled, this option maintains a synchronized user mapping at login to ensure that agents selected for transfer in Salesforce are correctly associated with the corresponding Genesys Cloud users. This option is not required when the primary email addresses are the same. To map Salesforce agents with the Genesys Cloud profiles and enable agent-to-agent transfers for externally routed Messaging Sessions, click Sync Users.
Enable disconnect rules for interaction
Enable all Disconnect Rules as shown in the illustration. The only exception is when you use custom disconnect logic that removes the interaction from Genesys Cloud when Salesforce can no longer route it.
Configure Genesys Cloud Implicit Grant setup for Salesforce
To set up the Implicit Grant flow for Genesys Cloud integration with Salesforce:
Add your Salesforce redirect URI to the list of allowed redirect URIs in the Genesys Cloud OAuth configuration. Use the following format for the redirect URI:
Replace xxxx with the base name of your Salesforce org. For example, if the base name of the Salesforce org is genesys-1d6-dev-ed.develop, then the redirect URI is:
The authentication process opens a new window or tab for the Genesys Cloud login. Ensure that your browser settings allow pop-ups for your Salesforce domain. After successful authentication, the pop-up closes automatically and the main Salesforce window is updated with the authenticated session. If pop-ups are blocked, the authentication process fails. Hence, allow pop-ups for the Salesforce domain in your browser settings.
Note: Pop-up authentication provides a smoother user experience and helps prevent issues with browser redirects and token storage. However, it requires that users have pop-ups enabled for the Salesforce domain.
Troubleshooting authentication issues
If you encounter issues with authentication, ensure that the redirect URI is correctly configured in both Genesys Cloud and Salesforce org.
If the authentication window does not appear, check your browser’s pop-up blocker settings.
If you experience persistent authentication issues, clear your browser cache and cookies.
Create an Omni-Channel Flow in Salesforce
An Omni-Channel Flow in Salesforce helps to automate the routing process for incoming interactions, ensuring that they are directed to the appropriate queues and handled efficiently. Follow these steps to set up an Omni-Channel Flow:
In Salesforce, create a flow using the Omni-Channel Flow template.
From Setup, search for Flows in the Quick Find box and select Flows.
Click New Flow.
Select Start From Scratch and click Next.
Under All Flow Types, select Omni-Channel Flow as the flow type and click Create.
To add elements to the canvas, select Free-Form.
Create the recordId and input_record variables as described in the Salesforce documentation. These variables hold specific data used within the flow.
Drag the Route Work action onto the canvas and enter the values for the new action.
Give the action a Label and API Name and optionally, a Description.
Under Set Input Values > RecordID, select the recordId that you created.
Under Service Channel, select the channel created for Messaging.
Under Route To, select Queue.
Under Queue, enter the Salesforce queue ID that you want to route through Genesys Cloud.
Click Done.
Drag the Create Records action onto the canvas and enter the details of the record.
Type a name for the record.
Select the option Manually to configure the record fields.
Select the object External Routing Request from the list.
Add the following fields Open_Messaging_Integration__c and Work_Item_ID__c and set the values for the fields.
Open Messaging Integration – Select the picklist values retrieved from Genesys Cloud.
Work Item ID – Select the recordId variable that you created for the messaging session object.
Add the ParticipantData_Attributes and the values in the format Attribute1=Value1, Attribute2=Value2. If you are adding any Salesforce objects, use the format Attribute={!Object.Value}. For example, priority={!Case.Priority} and status={!Case.Status}.
Click Done.
Note: You can add or edit the external routing package message attributes in the OpenMessageService.apxc file except for the custom attribute, SF_ExternalRoutingWorkItemId. Ensure that you do not edit or remove the custom attribute SF_ExternalRoutingWorkItemId. For more information about the API referenced by the routing package, see Inbound open messages .
Connect the Start element to the Route Work action element in the flow.
Connect the Route Work action element to the Create Record element in the flow.
Click Save.
Click Activate.
This setup ensures that interactions are effectively managed and directed to the appropriate queues and agents, enhancing operational efficiency.
Note: Ensure that the External Routing Request Deletion flow remains disabled in Salesforce, as using it can lead to configuration issues.
Transfer work items using external routing
To transfer a workitem to another queue using external routing, follow these steps:
1. External Routing settings
In the External Routing settings, click Retrieve Options to fetch the available Genesys Cloud queues.
Map the Salesforce queues to the corresponding Genesys Cloud queues.
Set a default External Routing queue. If no specific queue is mapped, the workitem is routed to the default queue.
Select Enable User mapping and sync option to facilitate agent-t0-agent transfer for externally routed Messaging sessions. This option maintains a synchronized user mapping at login to ensure that agents selected for transfer in Salesforce are correctly associated with the corresponding Genesys Cloud users.
2. External Routing request
The External Routing Request Salesforce object has a field called isTransfer. When creating a External_Routing_Request record, set the isTransfer field to true. The variable indicates that the workitem must be transferred to another queue.
3. Omni-Channel flow for transfer
Create an Omni-Channel flow that triggers when the owner of a workitem is updated. In this flow, create a new External_Routing_Request record with the isTransfer field set to true. This variable initiates the transfer of the interaction to the specified queue in Genesys Cloud.
4. Create a new interaction
If the requirement is to create a new interaction instead of transferring the existing one, set the isTransfer field to false when creating the External_Routing_Request record. It creates a new interaction in Genesys Cloud rather than transferring the existing one.
Manage agent-to-agent transfer for Messaging Sessions
To enable agent-to-agent transfer for Messaging Sessions using external routing, follow these steps:
1. External Routing via Change Data Capture (CDC)
To support agent transfers, CDC must be configured to publish event notifications for core Service Cloud objects. This option allows the system to monitor routing lifecycle events in real-time.
On the Setup Home page in Salesforce, search for Change Data Capture in the Quick Find box and select Change Data Capture.
Move the following entities from Available to Selected entities list:
Pending Service Routing – Manages items currently awaiting assignment.
Agent Work – Tracks active work assignments and their lifecycle.
User Presence – Monitors real-time user status.
Click Save.
2. Enable enhanced Omni-Channel routing
For the transfer functionality to operate correctly, enable Enhanced Omni-Channel Routing within the organization settings. For more information, see Enable and Configure Omni-Channel in the Salesforce documentation.
3. Enable user mapping and sync
To facilitate agent-t0-agent transfer for externally routed Messaging sessions, select Enable User mapping and sync option in the External Routing Settings of the GC External Routing Integration app . This option maintains a synchronized user mapping at login to ensure that agents selected for transfer in Salesforce are correctly associated with the corresponding Genesys Cloud users. To map Salesforce agents with the Genesys Cloud profiles and enable agent-to-agent transfers for externally routed Messaging Sessions, click Sync Users.
4. Assign permission set
Assigned the following specific permissions to initiate or receive transferred messaging sessions:
Contact Center Bring Your Own Channel
Service Cloud User
Contact Center Admin (Partner Telephony)
Contact Center Agent (Partner Telephony)
Also, create a custom permission set that includes the following permissions:
End Messaging Session – End in-progress Messaging sessions with end users.
Enhanced Chat Rep – Accept Enhanced Chat conversations from Omni-Channel.
Initiate Messaging Sessions – Initiate messaging sessions with customers by sending outbound messages in enhanced Messaging channels and Messaging for In-App.
Configure automatic return for declined Messaging Session transfers
When an agent transfers a Messaging Session to another agent through External Routing, Salesforce Omni-Channel reassigns ownership to the second agent immediately, before that agent accepts. Without this configuration, if the second agent declines the transfer or lets it time out, the conversation remains assigned to the agent who never picked it up, with no way to return it to the original agent. The customer interaction is not dropped or disconnected during this process.
Note: This configuration works only when both the packages are deployed:
Digital and AI for Salesforce Service Cloud
External Routing for Salesforce Service Cloud
When External Routing for Salesforce Service Cloud package is not installed, disable the Enable MessagingSession Decline Handling option in the GC Digital and AI Integration Setup app. With the setting disabled, the default After Call Work (ACW) and close flow runs unchanged.
Create an autolaunched flow
In Salesforce, create a flow under the Autolaunched Automations category.
From Setup, search for Flows in the Quick Find box and select Flows.
Click New Flow.
Select Autolaunched Automations category.
Under Autolaunched Automations, select Autolaunched Flow (No Trigger).
To add elements to the canvas, select Free-Form.
Create the two text input variables with the following information: recordId
recordId
agentId
Resource Type
Variable
Variable
API Name
recordId
agentId
Data Type
Text
Text
Availability Outside the Flow
Available for Input
Available for Input
Drag Action element to the canvas, search and select Route Work action from the list.
Enter Reoffer_ER_Work_To_Agent as the API Name for the action.
Under Set Inout Values section, enter the following details for the action:
How Many Work Records to Route? – Single
RecordID Variable – Select the recordId that you created
Service Channel – Messaging
Route To – Agent
Agent – Use Variable
Agent ID – Select agentId that you created
Click Done.
Click Save and then Activate.
Enable the setting in Digital and AI settings
Open the GC Digital and AI Integration Setup app.
Select the Digital and AI Settings tab.
Select the Enable MessagingSession Decline Handling option.
Click Save.
How does this automatic return works for failed transfers?
When an agent transfers a conversation to another agent, the original agent’s client keeps its live Genesys connection open rather than closing out immediately. The client recognizes this transfer as a agent-to-agent transfer, subscribes to updates on the destination agent’s conversation, and starts a backstop wait timer to track whether the transfer is actually accepted.
The transfer is then resolved in one of two ways:
Accepted – The destination agent connects. The client treats the transfer as accepted and stops monitoring..
Not accepted – The destination leg disconnects without connecting, the transfer is canceled or declined, or the timer expires. In this scenario, the client:
Returns session ownership to the original agent
Re-offers the work
Adds an entry to the session’s activity history
Displays a notification to the original agent
Subscriptions are cleaned up in every outcome.
Acceptance criteria
Scenario
Expected result
Second agent accepts
The session stays with the second agent. No return and no notification.
Second agent declines
Ownership returns to the original agent, the work is re-offered, and the original agent gets a notification.
Second agent does not respond within the configured wait time
Treated the same as a decline: the session is returned, the work is re-offered, and a notification is shown.
After return
The original agent can continue the conversation seamlessly.
Queue and same-agent transfers
Behave exactly as they do today.
Setting disabled
The current ACW and close flow runs unchanged.
Notes:
The original agent sees a notification, for example, Interaction Returned, with a message tailored to whether the transfer was declined or not answered. These strings are localized.
The returned session gets an activity-history entry noting that the destination agent did not accept the transfer and that the work was re-offered.
No new Genesys-side event pipeline is required. The original agent’s existing Genesys session is reused to watch the outcome.
Configure screen pop in Salesforce
The screen pop feature in Salesforce automatically displays relevant information to agents when they receive an interaction, which improves agents’ efficiency and response times. To set up a screen pop in Salesforce using the CX Cloud, External Routing component, follow these steps:
On the Setup Home page, search for App in the Quick Find box and select App Manager.
Select an existing Lightning app from the list and click Edit.
The Lightning App Builder opens.
Select the Utility Items tab and click Add Utility Item.
From the list of available custom components, select CX Cloud, External Routing and set the component properties:
Genesys Cloud Region – Enter the region of your Genesys Cloud organization.
Genesys Cloud Implicit Grant Client Id – This option is no longer required because PKCE is configured. For more information, see CX Cloud setup for PKCE.
Start automatically – Ensure to select this option to make the component start when the app is launched.
Click Save and then click Back to return to the App Manager.
Example to create flows in Salesforce to route cases
The following video shows how to create Omni-Channel flow and Record-Triggered flow in Salesforce to route cases through Genesys Cloud: