C
Cody
CRM & Sales

Connecting OpenClaw with Salesforce: A Practical Guide

·3 min read

Salesforce has excellent API coverage, but it's also the most complex CRM integration you'll attempt. Connected App setup, OAuth, SOQL queries, and governor limits all require careful handling.

How OpenClaw Integrations Work

OpenClaw is a self-hosted AI assistant that runs on your own server — typically an EC2 instance — and connects to Slack. It uses Claude under the hood to process requests. Out of the box, OpenClaw doesn't ship with pre-built connections to third-party tools. Instead, integrations are built using the skills system: markdown files in ~/.openclaw/skills/ that give Claude instructions for a particular domain, combined with HTTP tool calls to any API you expose to it.

In practice, adding a real integration means: getting API credentials from the third-party service, building or configuring a small proxy/endpoint that OpenClaw can call, and writing a skill file that tells Claude how to use it. For some tools this is an afternoon of work. For others — like Salesforce — it's considerably more involved.

Connecting OpenClaw with Salesforce: Step by Step

Step 1: Create a Salesforce Connected App

In Salesforce Setup → App Manager → New Connected App. Enable OAuth, add the callback URL for your proxy, and select the OAuth scopes you need (at minimum: api, refresh_token). After saving, note the Consumer Key and Consumer Secret — these are your OAuth credentials.

Step 2: Implement OAuth 2.0 or Use a Named Credential

For a service-to-service integration, the OAuth 2.0 Username-Password flow or JWT Bearer flow is simplest (though the Username-Password flow may be disabled in stricter orgs). Alternatively, Salesforce Named Credentials can manage auth for you. Your proxy needs to handle token refresh — Salesforce tokens expire.

Step 3: Build SOQL Queries and the Proxy

Salesforce's REST API accepts SOQL (Salesforce Object Query Language) via /services/data/v58.0/query?q=SELECT+.... Write a proxy that translates your common queries into SOQL. Write ~/.openclaw/skills/salesforce.md with your key object names, fields, and the SOQL patterns that answer common team questions.

Challenges and Caveats

Governor Limits Are Real

Salesforce enforces governor limits on API calls per day based on your edition and number of licenses. Exceeding them blocks all API access until the limit resets. Design your proxy to cache results and avoid unnecessary calls.

SOQL Is Powerful but Error-Prone

Claude can generate SOQL queries from natural language, but SOQL has specific requirements around relationship queries, subqueries, and aggregate functions. Expect to debug Claude's SOQL output during the initial skill tuning phase.

Sandbox vs Production

Salesforce has separate sandbox and production environments with different OAuth endpoints. Make sure your proxy is configured for the right environment and that you've tested in sandbox before touching production.


Skip All of This — Use Cody Instead

Cody has Salesforce integration built in. Query opportunities, accounts, and forecasts from Slack without Connected Apps, SOQL, or governor limit worries.

Get started with Cody →


Related Guides


Need the model-flexible version? See: How to Connect Salesforce to OpenClaw: Setup, Models, and Workflow Guide.