Salesforce Integration
Connect Salesforce CRM to enrich agent interactions with customer context.
Overview
The Salesforce integration syncs customer data, accounts, and opportunities with Hyperfold. Agents use this data to personalize negotiations, apply appropriate discounts, and maintain a complete view of customer relationships.
Requires Salesforce Professional Edition or higher with API access. Enterprise Edition recommended for real-time sync via Outbound Messages.
Setup
bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Connect Salesforce CRM$ hyperfold integrate add salesforce Opening browser for Salesforce authorization... Salesforce login successful!Connected to: acme.salesforce.com (Enterprise Edition) Select objects to sync: [x] Contact → customer [x] Account → organization [x] Opportunity → negotiation_context [ ] Lead [ ] Case ✓ Connected to Salesforce✓ Initial sync started (3,450 contacts) # View connection status$ hyperfold integrate show salesforce INTEGRATION: Salesforce━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Instance: acme.salesforce.comEdition: EnterpriseStatus: connectedConnected: 2025-01-15T10:00:00Z SYNCED OBJECTS Contact: 3,450 records Account: 892 records Opportunity: 1,234 records SYNC SCHEDULE Contacts: Every 15 minutes Accounts: Every 30 minutes Opportunities: Real-time (webhook)Prerequisites
- Salesforce account with API access enabled
- Admin permissions to authorize connected apps
- Custom fields created for Hyperfold-specific data (optional)
Object Mapping
bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Configure field mappings$ hyperfold integrate map salesforce \ --source=Contact \ --target=customer FIELD MAPPING: Salesforce Contact → Hyperfold Customer SOURCE FIELD TARGET FIELD TYPEFirstName first_name stringLastName last_name stringEmail email stringPhone phone stringAccount.Name company stringTitle job_title stringLoyalty_Tier__c tier enumAccount.AnnualRevenue metadata.revenue numberMailingCity location.city stringMailingCountry location.country string COMPUTED FIELDS full_name: "{{FirstName}} {{LastName}}" lifetime_value: sum(Opportunities.Amount where Stage='Closed Won') # Custom field mappings$ hyperfold integrate map salesforce \ --source=Contact \ --target=customer \ --custom='[ {"source": "VIP_Status__c", "target": "is_vip", "transform": "boolean"}, {"source": "Preferred_Contact__c", "target": "contact_preference"} ]'Supported Objects
| Salesforce Object | Hyperfold Entity | Use Case |
|---|---|---|
| Contact | Customer | Individual buyer profiles |
| Account | Organization | Company information for B2B |
| Opportunity | Negotiation Context | Deal history and pipeline |
| Lead | Prospect | Pre-qualification data |
Sync Configuration
bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Configure sync settings$ hyperfold integrate config salesforce \ --sync-direction=bidirectional \ --conflict-resolution=salesforce_wins # Set sync filters$ hyperfold integrate config salesforce \ --object=Contact \ --filter="Account.Type = 'Customer' AND IsDeleted = false" # Configure real-time sync via webhooks$ hyperfold integrate config salesforce \ --object=Opportunity \ --sync-mode=realtime \ --events="created,updated,closed" ✓ Outbound Message configured in Salesforce✓ Webhook endpoint: https://api.hyperfold.io/webhooks/sf/xxx # View sync history$ hyperfold integrate sync-history salesforce SYNC HISTORY: Salesforce TIMESTAMP OBJECT DIRECTION RECORDS STATUSJan 20, 10:00 Contact inbound 45 ✓ successJan 20, 09:45 Contact inbound 12 ✓ successJan 20, 09:30 Opportunity realtime 3 ✓ successJan 20, 09:15 Contact outbound 8 ✓ successJan 20, 09:00 Account inbound 2 ✓ successSync Modes
| Mode | Latency | Best For |
|---|---|---|
| Real-time | < 1 second | Opportunities, critical updates |
| Polling (15 min) | Up to 15 minutes | Contacts, accounts |
| On-demand | Manual trigger | Initial loads, reconciliation |
Use Cases
How agents use Salesforce data during commerce interactions:
typescript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Agent using Salesforce data for personalization@OnACPEvent("quote")async handleQuote(event: QuoteEvent) { // Get customer context from Salesforce-synced data const customer = await this.tools.crm.getCustomer(event.customerId); // Access Salesforce-enriched fields const { tier, // From Loyalty_Tier__c lifetime_value, // Computed from Opportunities company, // From Account.Name is_vip // From VIP_Status__c } = customer; // Use context for pricing decisions let discount = 0; if (is_vip) discount += 15; if (lifetime_value > 10000) discount += 5; if (tier === 'platinum') discount += 10; return this.generateQuote(event.product, discount);} // Update Salesforce when negotiation completes@OnACPEvent("checkout.complete")async handleCheckout(event: CheckoutEvent) { // Create Opportunity in Salesforce await this.tools.crm.createOpportunity({ contactId: event.customer.salesforce_id, amount: event.order.total, stage: 'Closed Won', source: 'Hyperfold Agent', metadata: { session_id: event.session_id, negotiation_rounds: event.negotiation.rounds, discount_given: event.negotiation.final_discount } });}Agent Capabilities
Personalized Pricing
Use customer tier, lifetime value, and account relationship to determine appropriate discounts and negotiation flexibility.
Context-Aware Conversations
Reference past purchases, open opportunities, and relationship history during negotiations for more relevant interactions.
CRM Updates
Automatically create opportunities and update contact records when deals close, maintaining a complete audit trail in Salesforce.
Configure field mappings with Data Mapping.