Salesforce Messaging agent availability

Overview

Set up a Salesforce Flow to retrieve agent availability and wait time attributes. Use these values to display information to end users or apply conditional logic before a Handoff to Salesforce.

Quick start

Complete these steps to set up agent availability checking. See Implementation & usage for detailed instructions.

1

Create a Connected App

Set up a Connected App in Salesforce with Client Credentials Flow enabled.

2

Create a custom Flow

Build an Autolaunched Flow that checks queue availability and returns agent status.

3

Configure HTTP Request blocks in Ada

Add blocks to call the token endpoint and custom flow endpoint before the Handoff.

Implementation & usage

Configure Salesforce and Ada to check agent availability before Handoffs.

Set up the Connected App in Salesforce

Create a Connected App to allow Ada to authenticate and call the availability endpoint.

To set up the Connected App:

  1. In the Quick Find search field, search for External Client Apps. Then, under Apps > External Client Apps, select Settings.

  2. On the External Client App Settings page, under Connected Apps, click New Connected App.

    External Client App Settings
  3. On the New Connected App page, under Basic Information, complete the following fields:

    FieldNotes
    Connected App NameDisplayed in the App Manager and on its App Launcher tile.
    API NameThe API name used to reference your app programmatically. By default, this is a version of the app name with spaces removed. Only letters, numbers, and underscores are allowed, so if the original app name contains other characters, update the default value accordingly.
    Contact EmailThe contact email for Salesforce to use when contacting you or your support team in the event of an error.
  4. Go to Setup > Apps > App Manager, then go to the right drop-down of the respective Connected App and select Edit.

  5. Under API (Enable OAuth Settings), toggle Enable Client Credentials Flow on. Click Save at the bottom.

    Enable Client Credentials Flow
  6. Go to Apps > Manage Connected Apps and select Edit on the respective app. Next, under Client Credentials Flow at the bottom, add your profile for Run As .

    Profile to Client Credentials Flow

Set up the Flow in Salesforce

Create a custom Flow to return queue availability and wait time attributes.

To set up the Flow:

  1. Go to Process Automation > Flows in Setup, and select New Flow

  2. Select Autolaunched Automations > Autolaunched Flow (No Trigger)

    New Process Automation
  3. Between the Start and End elements, select the + symbol and add an Action element, selecting the Check Availability for Routing action. Select the following options:

    Check Availability for Routing
    1. Service Channel: Messaging

    2. Check Availability for: Queue

    3. Queue > Use variable: {!queueId}

      You can also set a fixed queue with Select Queue.
    4. Select Output: Return all

    5. Check Manually assign variables

      • Add variables to the respective fields.

        Assign Variables
    6. On the upper left, select Toolbox and go to Manager > Resources > Variables.

      1. Ensure that queueId has Available for input selected.

      2. Ensure that the other variables (from Store Output Values) has Available for output selected.

        Store Output Variables

Set up the Handoff in Ada

Configure HTTP Request blocks in your Handoff to call the Salesforce endpoints.

To set up the Handoff:

  1. The token endpoint: Add an HTTP Request block to generate an access token for calling the flow endpoint. Store the Client ID and Client Secret in the token vault, and save the access_token as a sensitive variable.

    For example: https://**{{subdomain}}**.sandbox.my.salesforce.com/services/oauth2/token?grant_type=client_credentials&client_id=**{{salesforce_client_id}}**&client_secret=**{{salesforce_client_secret}}**

    Call Custom Endpoints
  2. The custom flow endpoint, called by adding the flow name to the URL and passing the access token as a bearer token in the request header.

    If you’re using a variable to select the queue, pass the id in the body using this key: inputs[0].queueId.

    For example: https://**{{subdomain}}**.sandbox.my.salesforce.com/services/data/v64.0/actions/custom/flow/**{{flow_name}}**.

    HTTP Request Block Setup

From there, you can store the relevant outputs using the key 0.outputValues.{{variableName}}. These values can then be used in conditional logic or surfaced to end users via a Text block before reaching the Salesforce Messaging Utils block.