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
- Navigate to Twilio Marketplace > Catalog > Twilio > SIPREC Connector.
- Click Install and accept the terms.
- Configure with:
- Unique Name:
SipRec1
- Session Recording Server:Copysip:+<GTP-provisioned-phone-number>@216.239.36.145:5672;transport=tls;secure=true;edge=umatilla
- Unique Name:
2. Set Up IVR in Twilio Studio
- Go to Twilio Console > Phone Numbers > Active Numbers.
- Under Voice – Studio Workflow, select Voice IVR.
- Add a Make HTTP Request widget with:
- Method:
POST
- URL:
https://<your-ui-connector-url>.run.app/register-app
- Body:jsonCopy{ “accountSid”: “<your-account-sid>”, “authToken”: “<your-auth-token>” }
- Method:
- Add a Run Function widget:
- Service:
ui-connector-auth
- Function:
conversation-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 }}” }
- Service:
- Add a Fork Stream widget:
- Stream Type:
Siprec
- Connector Name:
Siprec1
- Stream Parameters:Copyprojects/<gcp-project-id>/conversations/TW-{{trigger.call.From | replace_first:’+’,” }}-{{trigger.call.CallSid}}
- Stream Type:
- Save & Publish the flow.
Step 2: Set Up the Development Project
- Clone the Agent Assist integration repo:bashCopygit clone https://github.com/GoogleCloudPlatform/agent-assist-integrations cd salesforce/aa-lwc
- Generate static resources:bashCopynpm run generate-static-resources npm install
Step 3: Configure Salesforce
1. Deploy the Lightning Web Component (LWC)
- Authenticate with Salesforce CLI:bashCopynpm run login
- Deploy the LWC:bashCopynpm run deploy
2. Create a Connected App
- Go to Setup > App Manager > New Connected App.
- Configure:
- Name:
lwc auth
- API Name:
lwc_auth
- Enable OAuth: ✔
- Callback URL:
https://login.salesforce.com/services/oauth2/callback
- Scopes:
Access the identity URL service
- Enable Client Credentials Flow: ✔
- Name:
- Save and note the Consumer Key & Secret.
3. Set Up CORS & Trusted URLs
- Enable CORS for OAuth in Setup > CORS.
- 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
- Open Service Console > Contacts > Setup > Edit Page.
- Add the agentAssistContainerModule to the layout.
- Configure with:
- endpoint:
https://<your-ui-connector-url>.run.app
- features:
CONVERSATION_SUMMARIZATION, KNOWLEDGE_ASSIST_V2, AGENT_COACHING
- channel:
voice
- channelType:
twilio
- conversationProfile:
projects/<project>/locations/<region>/conversationProfiles/<profile-id>
- consumerKey & consumerSecret: From your Connected App
- endpoint:
Step 6: Test the Integration
- Log into Twilio Flex within Salesforce.
- Call your Twilio Flex number.
- 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.