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.

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

#tectonic_salesforce_partner
Related Posts
Who is Salesforce?
Salesforce

Who is Salesforce? Here is their story in their own words. From our inception, we've proudly embraced the identity of Read more

Salesforce Marketing Cloud Transactional Emails
Salesforce Marketing Cloud

Salesforce Marketing Cloud Transactional Emails are immediate, automated, non-promotional messages crucial to business operations and customer satisfaction, such as order Read more

Salesforce Unites Einstein Analytics with Financial CRM
Financial Services Sector

Salesforce has unveiled a comprehensive analytics solution tailored for wealth managers, home office professionals, and retail bankers, merging its Financial Read more

AI-Driven Propensity Scores
AI-driven propensity scores

AI plays a crucial role in propensity score estimation as it can discern underlying patterns between treatments and confounding variables Read more