AI & Agents

How to Build an OpenClaw Salesforce Agent for CRM Automation

An OpenClaw Salesforce agent connects your self-hosted AI assistant to Salesforce CRM via MCP, enabling SOQL queries, opportunity management, and automated pipeline reporting through natural language commands. This guide walks through the full setup, from creating a Salesforce Connected App to running your first pipeline query, with persistent file storage for CRM exports and reports.

Fastio Editorial Team 8 min read
AI agents managing CRM data with persistent workspace storage

What an OpenClaw Salesforce Agent Actually Does

Most Salesforce AI coverage focuses on Einstein AI or Agentforce, both locked inside Salesforce's own ecosystem. An OpenClaw Salesforce agent takes a different approach: it runs on your hardware, connects to Salesforce through MCP, and lets you query your CRM data conversationally from a terminal, chat interface, or messaging app.

The practical difference matters. Instead of switching to the Salesforce UI to pull pipeline numbers, you ask your agent: "Show me all opportunities closing this month over $50K." The agent translates that into a SOQL query, hits the Salesforce REST API, and returns structured results. You can then ask follow-up questions, request a summary grouped by stage, or have the agent create a report file you can share with your team.

Composio provides the managed MCP integration layer that handles OAuth tokens, API authentication, and scope management. The SFAILabs guide confirms that the core capabilities include SOQL query execution, opportunity tracking, lead management, and daily pipeline summaries. NVIDIA's NemoClaw announcement at GTC 2026 named Salesforce among its launch partners, validating the enterprise readiness of OpenClaw-based CRM workflows.

Salesforce serves over 150,000 customers globally, and 90% of Fortune 500 companies use the platform. Connecting an open-source agent framework to that data opens workflows that proprietary tools cannot match in flexibility.

AI-powered semantic search and data summaries

What You Need Before Connecting OpenClaw to Salesforce

Before connecting OpenClaw to Salesforce, you need three things: a working OpenClaw installation, a Salesforce org with API access enabled, and about 30 minutes.

Salesforce Connected App

Start in Salesforce Setup under App Manager and create a new Connected App with OAuth 2.0 settings. The SFAILabs guide walks through the full configuration: you'll set a callback URL, add OAuth scopes for API access and refresh tokens, and enable PKCE for security. Save and wait a few minutes for the Connected App to propagate.

Copy your Client ID and Client Secret. Store credentials in environment variables or a secrets manager, never in skill files or agent configurations. Credentials in workspace files risk exposure through logs or shared repositories.

Salesforce Instance URL

You also need your Salesforce instance URL. If your org uses a My Domain hostname (most do), that hostname is the instance URL. The connection authenticates through standard Salesforce OAuth and bearer tokens, so the same setup works whether you're on a Developer Edition, Sandbox, or Production org.

Security Note

Create a dedicated Salesforce integration user with a restricted permission profile. This user should have API access and read/write permissions only for the objects your agent needs. Test all operations in a sandbox org before pointing at production data. Field-level security gives you additional control over which data the agent can access.

How to Connect OpenClaw to Salesforce Through Composio

Composio acts as the bridge between OpenClaw and Salesforce. It manages OAuth flows, token refresh, and API scoping so your agent doesn't need to handle authentication logic directly. There are two ways to set up the connection.

Plugin approach. Install the Composio plugin for OpenClaw, then configure your API key from the Composio dashboard. The plugin connects to Composio's MCP server and registers Salesforce tools directly into your agent. This is the more permanent setup and handles token refresh automatically. Refer to the Composio OpenClaw toolkit page for current installation steps, since commands and configuration keys may change between releases.

Setup prompt approach. For a quicker start, visit the Composio dashboard, copy the generated setup prompt, and paste it into your OpenClaw chat interface. Authenticate Salesforce through the dashboard, and you can start issuing commands immediately. This works well for testing before committing to the plugin route.

Both methods register the same Salesforce toolkit, which provides access to tools spanning Sales Cloud and Service Cloud. The most useful for CRM automation include:

  • Contact and lead management: create, update, search, and score
  • Opportunity handling: clone deals, add products, update stages
  • Campaign automation: add or remove members, track engagement
  • Task creation: link tasks to contacts, leads, or opportunities
  • SOQL query execution: run arbitrary queries against your org
  • Case management: create, assign, escalate, and close support cases

Your agent can call these tools from any OpenClaw interface, whether that's the terminal, a web UI, or a messaging integration like Telegram or Slack. Composio also lets you scope which Salesforce actions the agent can access, so you can disable write tools entirely for read-only reporting workflows.

Audit logging for agent actions and API calls
Fastio features

Store your Salesforce reports where your whole team can find them

Free 50 GB workspace with semantic search, no credit card. Your OpenClaw agent writes CRM exports to Fastio via MCP, and your team accesses them instantly through the browser.

Running SOQL Queries and Pipeline Reports

The real power of an OpenClaw Salesforce agent shows up in conversational data access. Instead of building Salesforce reports through the UI, you describe what you need in plain language.

Lead Queries

Ask your agent to retrieve leads by status, source, or creation date. The underlying SOQL handles field selection automatically:

SELECT Name, Email, Company, LeadSource, Status
FROM Lead
WHERE Status = 'Open - Not Contacted'
AND CreatedDate = LAST_N_DAYS:30

The agent translates natural language requests like "Show me uncontacted leads from the past month" into queries like this, executes them, and formats the results.

Opportunity Tracking

Pipeline queries group results by stage for quick summaries:

SELECT StageName, COUNT(Id), SUM(Amount)
FROM Opportunity
WHERE IsClosed = false
GROUP BY StageName

This gives you a weighted pipeline view without opening Salesforce. You can drill down by asking follow-up questions: "Which of those closing this week have amounts over $25K?"

Contact and Account Lookups

Search contacts by email, find all contacts at a specific account, or filter by date ranges using Salesforce date literals like THIS_WEEK, LAST_MONTH, and LAST_N_DAYS:30.

Record Modifications

The agent can create new leads, update opportunity stages, and create tasks linked to specific records. The SFAILabs guide enforces confirmation requirements before any write operation, so your agent will ask for approval before modifying data. This is a smart safety mechanism for production orgs.

Three Automation Recipes Worth Setting Up

The SFAILabs guide includes three production-ready automations that work well as starting points:

  1. Lead Scoring Alerts. The agent identifies high-value leads based on employee count and lead source, then flags them for immediate follow-up. Run this on a schedule to catch hot leads before they go cold.

  2. Deal Movement Tracking. Monitors opportunity stage changes and flags backward movements. If a deal drops from "Negotiation" back to "Qualification," the agent alerts you with context about what changed.

  3. Daily Pipeline Summary. Groups all open opportunities by stage, calculates weighted pipeline value, and highlights deals closing within the next 14 days. This replaces the morning ritual of logging into Salesforce and clicking through dashboard tabs.

Storing CRM Exports and Reports in Fastio

An OpenClaw agent that queries Salesforce generates artifacts: pipeline summaries, lead lists, deal reports, exported CSVs. Those files need to live somewhere accessible to your team, not buried in a local directory on whatever machine runs your agent.

Local filesystem storage works for personal use, but breaks down when multiple people need access or when agents run on ephemeral infrastructure. S3 or Google Drive can store files, but they lack built-in semantic search and require additional tooling to make files queryable.

Fastio provides workspaces designed for this workflow. Your OpenClaw agent writes CRM reports to a Fastio workspace using the MCP server, and anyone on the team can access them through a browser with previews, comments, and search. Enable Intelligence Mode on the workspace, and those reports become semantically searchable. Ask "What was our pipeline value last Tuesday?" and get an answer with citations from the stored reports.

The Business Trial includes 50 GB of storage, included credits, and 5 workspaces, with no credit card required. For a Salesforce automation workflow, that covers months of daily pipeline reports and lead exports.

The ownership transfer feature fits naturally here: an agent builds and maintains a reporting workspace, then transfers it to a sales manager who takes over as the primary owner. The agent retains admin access to keep updating reports, while the human controls sharing and permissions.

File locks prevent conflicts if you run multiple agents writing to the same workspace. Webhooks can trigger downstream workflows when new reports land, such as posting a Slack notification when the daily pipeline summary is ready.

Fastio workspaces for organizing agent-generated CRM reports

Security and Production Deployment

Running an AI agent against production Salesforce data requires careful access controls. OpenClaw's local-first architecture helps here: your CRM data never passes through a third-party agent platform. Queries execute from your hardware, through Composio's authenticated MCP connection, directly to your Salesforce org.

Salesforce-Side Controls

  • Create a dedicated integration user with a restricted profile. Grant API access and object permissions only for what the agent needs.
  • Use field-level security to prevent the agent from accessing sensitive fields like Social Security numbers or financial details.
  • Monitor agent activity through Salesforce's event logging and login history. Every API call is traceable to the integration user.
  • Test all operations in a sandbox org first. Salesforce sandbox environments mirror production data without the risk.

OpenClaw-Side Controls

  • The SFAILabs guide enforces confirmation rules for write operations. Keep these enabled in production so the agent asks before modifying records.
  • Store credentials in environment variables or a secrets manager, never in skill files or agent configurations.
  • NVIDIA's NemoClaw adds enterprise security controls on top of OpenClaw, including sandboxed skill execution and privacy guardrails. If your organization requires additional compliance layers, NemoClaw provides them without abandoning the OpenClaw ecosystem.

Composio Scoping

Configure which Salesforce actions your agent can access when setting up the Composio connection. If the agent only needs read access for reporting, disable write tools entirely at the Composio dashboard level. You can also bring your own OAuth credentials instead of using Composio's managed authentication, giving you full control over token lifecycle and scoping.

Frequently Asked Questions

How do I connect OpenClaw to Salesforce?

Install the Composio plugin for OpenClaw, configure your API key from the Composio dashboard, and authenticate your Salesforce org through OAuth. The plugin registers Salesforce tools directly into your OpenClaw agent via MCP. Check the Composio toolkit page for current install steps. The full setup takes about 30 minutes.

Can OpenClaw run Salesforce queries?

Yes. Once connected via Composio, your OpenClaw agent can execute arbitrary SOQL queries against your Salesforce org. You describe what you need in natural language, and the agent translates it into SOQL, runs the query, and returns formatted results. This covers leads, opportunities, contacts, accounts, cases, and custom objects.

Is OpenClaw safe for Salesforce data?

OpenClaw runs locally on your hardware, so CRM data stays within your infrastructure. Create a dedicated Salesforce integration user with restricted permissions, enable write confirmation rules, and test in a sandbox before production. Composio lets you scope which actions the agent can perform, and you can disable write access entirely for read-only reporting workflows.

How do I automate Salesforce with an AI agent?

Set up the OpenClaw-Salesforce connection through Composio, then configure recurring automations like daily pipeline summaries, lead scoring alerts, and deal movement tracking. The agent runs SOQL queries on a schedule, formats the results, and can store reports in a shared workspace like Fastio for team access.

What Salesforce objects can OpenClaw access?

Through the Composio integration, OpenClaw can access standard Salesforce objects including Leads, Contacts, Accounts, Opportunities, Cases, Campaigns, and Tasks. Custom objects are also accessible if the integration user has the appropriate permissions. The toolkit provides over 200 tools spanning Sales Cloud and Service Cloud operations.

Do I need Salesforce Einstein AI to use OpenClaw with Salesforce?

No. OpenClaw connects to Salesforce through the standard REST API and SOQL, independent of Einstein AI or Agentforce. This means you can use any LLM as the reasoning layer, whether that is Claude, GPT-4, Gemini, LLaMA, or a locally hosted model, while still accessing all your Salesforce data.

Related Resources

Fastio features

Store your Salesforce reports where your whole team can find them

Free 50 GB workspace with semantic search, no credit card. Your OpenClaw agent writes CRM exports to Fastio via MCP, and your team accesses them instantly through the browser.