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.

Setup

# 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.com
Edition:            Enterprise
Status:             connected
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

# Configure field mappings
$ hyperfold integrate map salesforce \
  --source=Contact \
  --target=customer
FIELD MAPPING: Salesforce Contact Hyperfold Customer
SOURCE FIELD              TARGET FIELD       TYPE
FirstName                 first_name         string
LastName                  last_name          string
Email                     email              string
Phone                     phone              string
Account.Name              company            string
Title                     job_title          string
Loyalty_Tier__c           tier               enum
Account.AnnualRevenue     metadata.revenue   number
MailingCity               location.city      string
MailingCountry            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 ObjectHyperfold EntityUse Case
ContactCustomerIndividual buyer profiles
AccountOrganizationCompany information for B2B
OpportunityNegotiation ContextDeal history and pipeline
LeadProspectPre-qualification data

Sync Configuration

# 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 Modes

ModeLatencyBest For
Real-time< 1 secondOpportunities, critical updates
Polling (15 min)Up to 15 minutesContacts, accounts
On-demandManual triggerInitial loads, reconciliation

Use Cases

How agents use Salesforce data during commerce interactions:

// Agent using Salesforce data for personalization
@OnACPEvent("quote")
async handleQuote(event: QuoteEvent) {
  const customer = await this.tools.crm.getCustomer(event.customerId);
  const {
    tier,
    lifetime_value,
    company,
    is_vip
  } = customer;
  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) {
  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.