Salesforce Integration
Connect Agents to Salesforce CRM
Connect Agents to Salesforce to automate CRM tasks, update opportunities, and streamline your sales workflows.
Overview
The Salesforce integration enables workflows to:
- Create tasks associated with opportunities, contacts, or accounts
- Update opportunities with meeting outcomes and next steps
- Query records for workflow decisions
- Log activities from meetings
Prerequisites
Before connecting Salesforce:
- Salesforce account (any edition with API access)
- API access enabled for your user profile
- Permission to install connected apps (or admin assistance)
Connecting Salesforce
Step 1: Navigate to Integrations
- Go to Workspace Settings
- Select Integrations
- Find Salesforce in the list
Step 2: Authorize Connection
- Click Connect
- Log in to your Salesforce org
- Review the requested permissions
- Click Allow
Step 3: Verify Connection
After authorization:
- Connection status shows "Connected"
- Your Salesforce instance URL is displayed
- You can test the connection
Required Permissions
The Salesforce integration requires these permissions:
| Permission | Purpose |
|---|---|
| API Enabled | Make API calls to Salesforce |
| View and Edit Opportunities | Access and update opportunities |
| View and Edit Contacts | Access contact records |
| View and Edit Accounts | Access account records |
| Create and Edit Tasks | Create tasks |
| View Setup and Configuration | Read field metadata |
Profile Configuration
Ensure your Salesforce profile has:
- API Enabled checkbox selected
- Object permissions for objects you want to access
- Field-level security for fields you want to read/update
Available Actions
Create Salesforce Task
Create a task in Salesforce associated with a record.
Configuration:
| Parameter | Type | Required | Description |
|---|---|---|---|
| what_id | string | No | Related record ID (Opportunity, Account) |
| who_id | string | No | Related person ID (Contact, Lead) |
| subject | string | Yes | Task subject |
| description | string | Yes | Task description |
| activity_date | date | No | Due date (YYYY-MM-DD) |
Example:
[AI: Extract follow-up tasks] ──▶ [Create Salesforce Task]
With configuration:
- what_id:
{{ json.opportunityId }} - subject:
{{ json.taskTitle }} - description:
{{ json.taskDescription }} - activity_date:
{{ json.dueDate }}
Update CRM (Opportunity)
Update opportunity fields after meetings.
Configuration:
| Parameter | Type | Required | Description |
|---|---|---|---|
| opportunity_id | string | Yes | Salesforce Opportunity ID (18-char) |
| field_values | object | Yes | Fields to update |
Common updatable fields:
Name- Opportunity nameAmount- Deal valueStageName- Pipeline stageCloseDate- Expected close dateNextStep- Next step textDescription- Opportunity description- Custom fields - Any custom opportunity fields
Working with Salesforce IDs
ID Format
Salesforce IDs come in two formats:
- 15-character - Case-sensitive
- 18-character - Case-insensitive (recommended)
Always use 18-character IDs when possible for reliability.
Finding Object IDs
From meeting context:
{{ json.meeting.externalServiceObjects | where: "type", "DEAL" | first | map: "externalId" }}
From Deal Room:
{{ json.dealRoom.salesforceOpportunityId }}
Object Types
| Salesforce Object | Use For |
|---|---|
| Opportunity | Sales deals |
| Account | Companies/Organizations |
| Contact | Individual people |
| Lead | Unqualified prospects |
| Task | To-do items and follow-ups |
Pipeline Stages
Stage Names
Unlike HubSpot (which uses stage IDs), Salesforce uses stage names directly:
{
"StageName": "Proposal/Price Quote"
}
Finding Stage Names
- Go to Salesforce Setup
- Navigate to Object Manager → Opportunity → Fields & Relationships
- Click on "Stage"
- View picklist values
Common default stages:
- Prospecting
- Qualification
- Needs Analysis
- Value Proposition
- Id. Decision Makers
- Perception Analysis
- Proposal/Price Quote
- Negotiation/Review
- Closed Won
- Closed Lost
Field Mappings
Standard Fields
| Agents | Salesforce Field |
|---|---|
| Opportunity name | Name |
| Amount | Amount |
| Stage | StageName |
| Close date | CloseDate |
| Next step | NextStep |
| Description | Description |
| Owner | OwnerId |
Custom Fields
Access custom fields by their API name (ending in __c):
- Go to Setup → Object Manager → [Object] → Fields & Relationships
- Find your custom field
- Copy the API Name (e.g.,
Custom_Field__c) - Use in field_values
Example:
{
"Custom_Field__c": "value",
"Meeting_Notes__c": "Notes from latest meeting"
}
Task Configuration
Task Subtypes
By default, tasks are created with TaskSubtype: 'Call'. This appears as a "Call" activity type in Salesforce.
WhatId vs WhoId
Salesforce tasks have two relationship fields:
| Field | Links To | Use When |
|---|---|---|
WhatId | Account, Opportunity, Case, etc. | Task relates to a business record |
WhoId | Contact, Lead | Task relates to a person |
Example - Task on Opportunity:
{
"WhatId": "0061234567890abcdef",
"Subject": "Send proposal"
}
Example - Task for Contact:
{
"WhoId": "0031234567890abcdef",
"Subject": "Schedule demo"
}
Example Workflows
Post-Meeting Task Creation
[Event: MEETING_ENDED]
│
▼
[Load Meeting]
│
▼
[AI: Extract action items]
│
▼
[Select Many: action items]
│
▼
[Create Salesforce Task]
Task Configuration:
- what_id:
{{ json.meeting.salesforceOpportunityId }} - subject:
{{ json.item.title }} - description:
{{ json.item.description }} - activity_date:
{{ json.item.dueDate | date: "%Y-%m-%d" }}
Opportunity Stage Update
[Event: MEETING_ENDED]
│
▼
[Load Meeting]
│
▼
[If: has Salesforce opportunity?]
│
├── Yes ──▶ [AI: Analyze deal progress]
│ │
│ ▼
│ [AI: Recommend stage]
│ │
│ ▼
│ [CRM Update Opportunity]
│
└── No ───▶ [Sink]
Update Next Step After Meeting
[Event: MEETING_ENDED]
│
▼
[Load Meeting]
│
▼
[AI: Identify next steps]
│
▼
[CRM Update Opportunity]
field_values:
NextStep: "{{ json.nextStep }}"
Best Practices
1. Use 18-Character IDs
Always prefer 18-character Salesforce IDs to avoid case-sensitivity issues.
2. Validate Stage Names
Stage names are case-sensitive and must match exactly. Test with actual values from your org.
3. Handle Picklist Restrictions
Salesforce may have restricted picklists. If you encounter "INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST":
- Verify the value exists in the picklist
- Check for organization-specific picklist values
- Use exact spelling and case
4. Date Formatting
Salesforce expects dates in YYYY-MM-DD format:
{{ json.date | date: "%Y-%m-%d" }}
For datetime fields, use ISO 8601:
{{ json.datetime | date: "%Y-%m-%dT%H:%M:%SZ" }}
5. Check Field-Level Security
If updates silently fail:
- Verify the user has field-level edit access
- Check if the field is read-only
- Verify the field is not formula-based
Troubleshooting
Common Errors
| Error | Cause | Solution |
|---|---|---|
| "INVALID_SESSION_ID" | Token expired | Reconnect Salesforce integration |
| "MALFORMED_ID" | Invalid Salesforce ID | Verify ID format (15 or 18 chars) |
| "INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST" | Invalid picklist value | Use exact picklist value from Salesforce |
| "FIELD_INTEGRITY_EXCEPTION" | Invalid field value | Check field type and constraints |
| "UNABLE_TO_LOCK_ROW" | Record is locked | Retry or check workflow rules |
Token Refresh Issues
Salesforce tokens are automatically refreshed. If auth consistently fails:
- Disconnect the Salesforce integration
- Clear browser cookies for Salesforce
- Reconnect and re-authorize
- Test with a simple workflow
Query Limits
Salesforce has API limits based on your edition:
| Edition | Daily API Requests |
|---|---|
| Professional | 15,000 |
| Enterprise | 100,000 |
| Unlimited | 500,000 |
Monitor usage in Setup → Company Information → API Requests.
Field Access Issues
If you can't update a field:
- Check field-level security - Your profile may not have edit access
- Check page layouts - Field might not be on your layout
- Check validation rules - A rule may be blocking the update
- Check workflow rules - A rule may be overwriting your value
Security Considerations
Data Access
The integration respects Salesforce's security model:
- Profile permissions - Can only access objects your profile allows
- Field-level security - Can only read/write fields your profile allows
- Sharing rules - Can only see records shared with your user
- Record types - Respects record type assignments
Token Storage
- OAuth tokens are encrypted at rest
- Tokens are automatically refreshed using the refresh token
- Instance URLs are stored to route requests correctly
Sandbox Support
You can connect to Salesforce sandboxes for testing:
- When connecting, select "Login to Sandbox" if available
- Or modify the login URL during OAuth
SOQL Considerations
When workflows query Salesforce data, queries are built with:
- Parameterized inputs - Prevents SOQL injection
- Limited fields - Only requested fields are queried
- Pagination - Large result sets are paginated