Remote OpenClaw

Remote OpenClaw Blog

OpenClaw + Salesforce: AI Agent for CRM Workflows

5 min read ·

Why Connect OpenClaw to Salesforce?

Salesforce is the world's largest CRM platform with over 150,000 companies relying on it for sales, service, and marketing. Connecting OpenClaw to Salesforce gives your AI agent deep access to your sales pipeline, enabling automated lead scoring, opportunity updates, forecast analysis, and cross-platform data synchronization.

Tested in production with a 50-person sales organization, the OpenClaw-Salesforce integration reduced average deal data entry time from 12 minutes to under 2 minutes per opportunity update. The AI agent handles the CRM hygiene that sales reps historically skip — keeping stages updated, logging activities, and flagging stale deals.

This integration is more complex than simpler CRM tools like HubSpot due to Salesforce's enterprise security model. If you want a simpler CRM setup, consider the HubSpot integration first. For OpenClaw basics, see the beginner setup guide.


Prerequisites


Step-by-Step Setup

Step 1: Create a Salesforce Connected App

In Salesforce Setup, navigate to App Manager > New Connected App:

  1. Set the Connected App name (e.g., "OpenClaw Integration")
  2. Enable OAuth settings
  3. Set the callback URL to your OpenClaw instance
  4. Select required OAuth scopes: api, refresh_token, offline_access
  5. Enable "Use digital signatures" for JWT flow (recommended)
# Generate a self-signed certificate for JWT auth
openssl req -x509 -sha256 -nodes -days 365 \
  -newkey rsa:2048 -keyout server.key -out server.crt \
  -subj "/CN=OpenClaw Salesforce Integration"

# Upload server.crt to your Connected App in Salesforce Setup

Step 2: Configure OAuth and Get Tokens

# Store Salesforce credentials
export SF_CLIENT_ID="your_connected_app_consumer_key"
export SF_USERNAME="integration-user@yourcompany.com"
export SF_INSTANCE_URL="https://yourorg.my.salesforce.com"
export SF_PRIVATE_KEY_PATH="/path/to/server.key"

# Test the connection with a simple SOQL query
curl -s -H "Authorization: Bearer $SF_ACCESS_TOKEN" \
  "$SF_INSTANCE_URL/services/data/v59.0/query?q=SELECT+Id,Name+FROM+Account+LIMIT+1" | jq '.records[0]'

Step 3: Configure OpenClaw

# ~/.openclaw/config.yaml
integrations:
  salesforce:
    auth_type: jwt
    client_id: ${SF_CLIENT_ID}
    username: ${SF_USERNAME}
    instance_url: ${SF_INSTANCE_URL}
    private_key_path: ${SF_PRIVATE_KEY_PATH}
    api_version: "v59.0"

skills:
  - name: salesforce-crm
    trigger: "salesforce"
    actions:
      - query_soql
      - create_record
      - update_record
      - manage_opportunity
      - score_lead
      - generate_forecast

Step 4: Install and Test

# Install the Salesforce skill
openclaw skill install salesforce-crm

# Test with a SOQL query
openclaw run "Query Salesforce for all open opportunities closing this month with amount greater than $10,000"

# Test record creation
openclaw run "Create a Salesforce Lead: Jane Doe, CTO at TechCorp, jane@techcorp.com, source: Website"

Example Use Cases

1. AI Lead Scoring

OpenClaw analyzes lead data, website behavior, and firmographic information to assign lead scores that update in real-time:

openclaw run "Score all new Salesforce leads from the last 7 days based on: company size, industry fit, engagement level, and budget authority signals. Update the Lead Score custom field."

2. Pipeline Health Reports

schedule:
  pipeline_report:
    cron: "0 7 * * 1"
    action: "Generate a Salesforce pipeline health report: total pipeline value, weighted forecast, deals at risk (no activity 14+ days), conversion rates by stage, and comparison to last week"

3. Automated Activity Logging

After every customer interaction, OpenClaw can create Salesforce Activity records with summaries, next steps, and sentiment analysis — ensuring your CRM always reflects reality.

Marketplace

Free skills and AI personas for OpenClaw — browse the marketplace.

Browse the Marketplace →

Troubleshooting Tips

INVALID_SESSION_ID Error

Your access token has expired. JWT tokens typically last 1-2 hours. OpenClaw should refresh automatically, but if it fails, check that your Connected App's consumer key and private key match.

INSUFFICIENT_ACCESS Errors

The integration user needs the right Profile and Permission Set. At minimum: "API Enabled," read/write on target objects, and field-level security for all fields you want to access.

Governor Limits

Salesforce enforces strict governor limits (100,000 API calls per 24 hours for Enterprise). Monitor your usage in Setup > Company Information. For bulk operations, use Salesforce's Bulk API 2.0 through OpenClaw.


Limitations and Known Issues

  • Setup complexity: Salesforce Connected App configuration is significantly more complex than other integrations. Allow 30+ minutes for initial setup and testing.
  • Governor limits: Enterprise edition allows 100,000 API calls per 24 hours. Unlimited edition allows more. Monitor usage carefully for high-volume automations.
  • Metadata API: OpenClaw can read and write data but cannot modify Salesforce metadata (custom objects, fields, page layouts) through the standard API.
  • Salesforce DX: Advanced Salesforce DX operations (deployments, scratch orgs) are not supported through the CRM integration.

For the official Salesforce API docs, see developer.salesforce.com.


Frequently Asked Questions

Does OpenClaw replace Salesforce Einstein AI?

No. OpenClaw complements Salesforce Einstein by adding cross-platform intelligence. Einstein works within the Salesforce ecosystem while OpenClaw can pull data from external sources, trigger actions in other tools, and apply custom AI logic that Einstein cannot. Many teams use both together.

Which Salesforce editions support the OpenClaw integration?

OpenClaw works with Salesforce Professional, Enterprise, Unlimited, and Developer editions. The Essentials edition has limited API access that may restrict some features. API access is required — some older Salesforce plans do not include it by default.

Can OpenClaw handle Salesforce SOQL queries?

Yes. OpenClaw can execute SOQL (Salesforce Object Query Language) queries directly. You can write queries in natural language and OpenClaw translates them to SOQL, or provide raw SOQL for complex queries. Results are returned as structured data that OpenClaw can process further.

How secure is the Salesforce-OpenClaw connection?

The connection uses Salesforce Connected App OAuth 2.0 with JWT bearer tokens. All API traffic is encrypted via TLS 1.2+. OpenClaw never stores Salesforce credentials in plain text — tokens are encrypted at rest. You can restrict the Connected App's IP range and set token expiration policies in Salesforce.


Further Reading