Overview

This guide walks through integrating Google’s Agent Assist with Salesforce using Twilio Flex as the call center platform. The setup enables real-time AI-powered agent suggestions during voice calls by streaming conversation data to Agent Assist.

Key Components

  • Twilio Flex: Acts as the softphone inside Salesforce.
  • SIPREC Connector: Forks call audio to Agent Assist for real-time analysis.
  • Salesforce Lightning Web Component (LWC): Displays Agent Assist insights directly in the Service Console.

Prerequisites

Before starting, ensure you have:

Node.js v18.20.4 (Node 20.x has compatibility issues)
Salesforce CLI (Install via npm install -g @salesforce/cli)
Google Cloud CLI (gcloud auth login)
Salesforce Access (Note your My Domain URL and Org ID)
Twilio Flex Account


Step 1: Configure Twilio Flex

1. Install the SIPREC Connector

  1. Navigate to Twilio Marketplace > Catalog > Twilio > SIPREC Connector.
  2. Click Install and accept the terms.
  3. Configure with:
    • Unique NameSipRec1
    • Session Recording Server:Copysip:+<GTP-provisioned-phone-number>@216.239.36.145:5672;transport=tls;secure=true;edge=umatilla
    (Work with Google to provision the GTP number.)

2. Set Up IVR in Twilio Studio

  1. Go to Twilio Console > Phone Numbers > Active Numbers.
  2. Under Voice – Studio Workflow, select Voice IVR.
  3. Add a Make HTTP Request widget with:
    • MethodPOST
    • URLhttps://<your-ui-connector-url>.run.app/register-app
    • Body:jsonCopy{ “accountSid”: “<your-account-sid>”, “authToken”: “<your-auth-token>” }
  4. Add a Run Function widget:
    • Serviceui-connector-auth
    • Functionconversation-name
    • Parameters:jsonCopy{ “token”: “{{widgets.register_twilio.parsed.token}}”, “endpoint”: “<your-ui-connector-url>.run.app/conversation-name”, “phone”: “{{ trigger.call.From | replace_first:’+’,” }}”, “conversationName”: “projects/<project>/locations/<location>/conversations/TW-{{ trigger.call.From | replace_first:’+’,” }}-{{ trigger.call.CallSid }}” }
  5. Add a Fork Stream widget:
    • Stream TypeSiprec
    • Connector NameSiprec1
    • Stream Parameters:Copyprojects/<gcp-project-id>/conversations/TW-{{trigger.call.From | replace_first:’+’,” }}-{{trigger.call.CallSid}}
  6. Save & Publish the flow.

Step 2: Set Up the Development Project

  1. Clone the Agent Assist integration repo:bashCopygit clone https://github.com/GoogleCloudPlatform/agent-assist-integrations cd salesforce/aa-lwc
  2. Generate static resources:bashCopynpm run generate-static-resources npm install

Step 3: Configure Salesforce

1. Deploy the Lightning Web Component (LWC)

  1. Authenticate with Salesforce CLI:bashCopynpm run login
  2. Deploy the LWC:bashCopynpm run deploy

2. Create a Connected App

  1. Go to Setup > App Manager > New Connected App.
  2. Configure:
    • Namelwc auth
    • API Namelwc_auth
    • Enable OAuth: ✔
    • Callback URLhttps://login.salesforce.com/services/oauth2/callback
    • ScopesAccess the identity URL service
    • Enable Client Credentials Flow: ✔
  3. Save and note the Consumer Key & Secret.

3. Set Up CORS & Trusted URLs

  1. Enable CORS for OAuth in Setup > CORS.
  2. Add Trusted URLs for:
    • https://<your-ui-connector-url>.run.app
    • wss://<your-ui-connector-url>.run.app (for WebSockets)
    • Your Salesforce domain (https://YOUR_SUBDOMAIN.my.salesforce.com)

Step 4: Install Twilio Flex CTI in Salesforce

Follow Twilio’s Flex CTI setup guide to embed Flex in Salesforce.


Step 5: Add Agent Assist to Salesforce Console

  1. Open Service Console > Contacts > Setup > Edit Page.
  2. Add the agentAssistContainerModule to the layout.
  3. Configure with:
    • endpointhttps://<your-ui-connector-url>.run.app
    • featuresCONVERSATION_SUMMARIZATION, KNOWLEDGE_ASSIST_V2, AGENT_COACHING
    • channelvoice
    • channelTypetwilio
    • conversationProfileprojects/<project>/locations/<region>/conversationProfiles/<profile-id>
    • consumerKey & consumerSecret: From your Connected App

Step 6: Test the Integration

  1. Log into Twilio Flex within Salesforce.
  2. Call your Twilio Flex number.
  3. Accept the call in Salesforce—Agent Assist should load in the sidebar with real-time suggestions.

Conclusion

This integration enables AI-powered agent assistance directly in Salesforce, leveraging Twilio Flex for call handling and Google’s Agent Assist for real-time insights.

🔗 GitHub Repo: Agent Assist Integrations
🔗 Twilio Flex CTI Docs: Salesforce Integration Guide

For troubleshooting, refer to the Google Cloud documentation or contact support.

Related Posts
Salesforce OEM AppExchange
Salesforce OEM AppExchange

Expanding its reach beyond CRM, Salesforce.com has launched a new service called AppExchange OEM Edition, aimed at non-CRM service providers. Read more

The Salesforce Story
The Salesforce Story

In Marc Benioff's own words How did salesforce.com grow from a start up in a rented apartment into the world's Read more

Salesforce Jigsaw
Salesforce Jigsaw

Salesforce.com, a prominent figure in cloud computing, has finalized a deal to acquire Jigsaw, a wiki-style business contact database, for Read more

Service Cloud with AI-Driven Intelligence
Salesforce Service Cloud

Salesforce Enhances Service Cloud with AI-Driven Intelligence Engine Data science and analytics are rapidly becoming standard features in enterprise applications, Read more

author avatar
get-admin