Connect an AI Agent to Salesforce: Agentforce, APIs and Custom Agents
· CompaniesAutomation
The three real routes to connect an AI agent to Salesforce: APIs, Agentforce or middleware. Use cases, honest comparison table and real project costs.
Connecting an AI agent to Salesforce is done today through three real routes: the platform's own REST and Bulk APIs (the preferred path), Agentforce — Salesforce's native agent layer — or an existing integration middleware if your company already runs one. The choice depends on what you want the agent to do: for assistance inside the CRM, the native layer goes a long way; for processes that cross Salesforce with email, the ERP and other systems, a custom agent connected via API is the robust option. In project numbers: a first flow in production costs €3,000-12,000 and takes 2-5 weeks — with the advantage that Salesforce is among the best-documented systems we ever connect agents to.
This article follows the same approach as our guide on connecting AI agents to SAP: what we actually find in real installations, flow by flow and euro by euro, brochure-free.
What can an AI agent do inside Salesforce?
Salesforce already stores the data; what it doesn't do on its own is the work that keeps that data alive and turns it into decisions. The four flows where we see the fastest payback:
- CRM hygiene: the agent detects duplicates, fills fields from emails and public sources, normalizes company names and job titles, and updates opportunity stages that have been frozen for weeks. The CRM goes from dead archive to data you can actually manage by.
- Account summaries: before every meeting, the agent synthesizes the account — recent interactions, open opportunities, tickets, billing, risk signals — into the one-page brief nobody prepares today because it costs 30 minutes per account.
- Next-best-action: with the full pipeline in view, the agent proposes what each rep should touch today: the opportunity with no activity in 15 days, the customer whose contract is expiring, the hot lead left unanswered. With a written rationale, not a black box.
- Automatic logging: emails, calls and meetings land on the record with a summary and next step, independent of rep discipline. It's the silent half of the value: Monday's reports finally tell the truth.
The three connection routes, best to worst
1. REST and Bulk APIs: the preferred route
Salesforce exposes practically everything via API: standard and custom objects, SOQL queries, platform events for real-time reactions, and the Bulk API for large volumes. A custom agent operates through an integration user with narrowly scoped permissions — only the objects and operations it needs — and every change is audited like any other. It's our default route: robust, documented, and immune to surprises in platform updates. The one hidden cost to watch is your edition's daily API call limits, which mid-size orgs rarely come close to.
2. Agentforce: the native layer
Agentforce is Salesforce's bet on agents inside its own platform: configured without code, with natural access to CRM data, it fits service and sales cases that live entirely within Salesforce. Its limits show up at the borders: when the process needs to read the ERP, send email from your domain, query in-house systems or run complex logic, consumption pricing and platform constraints start to weigh. It's pay-per-use — Salesforce has run pricing on the order of dollars per conversation and per-action credit models; verify the current scheme with your account executive, because it has changed more than once — which makes costs hard to predict at high volume.
3. Integration middleware
If your company already runs middleware (MuleSoft, corporate n8n or other), the agent can talk to that layer instead. It makes sense where integration governance is centralized; it adds coordination and some lead time, but respects the house architecture.
Agentforce or custom agent? The honest table
| Agentforce (native) | Custom agent via API | |
|---|---|---|
| Scope | Inside Salesforce | Salesforce + email + ERP + web + whatever else |
| Time to launch | Days-weeks, no code | 2-5 week project |
| Cost | Consumption-based (variable with volume) | €3,000-12,000 project + €100-400/month inference |
| AI model | Whatever Salesforce provides | Best model per task, swappable |
| Lock-in | Full dependence on Salesforce | Portable if you ever change CRM |
| Fits when… | The process lives 100% in Salesforce and volume is moderate | The process crosses systems or volume makes pay-per-use unpredictable |
They're not mutually exclusive: some companies run Agentforce for customer self-service inside their portal and a custom agent operating CRM hygiene and reporting behind the scenes. The right question isn't "which tool?" but "where does the process start and end?" If it starts in an email and ends in the ERP, you already know the answer.
What it costs and how long it takes
- A scoped flow (data hygiene on one object, or automatic account summaries): €3,000-6,000 and 2-3 weeks.
- A complete process (multichannel auto-logging + next-best-action + reporting): €6,000-12,000 and 3-5 weeks.
- Recurring cost: €100-400 per month in inference and infrastructure, plus 10-20% of the project per year in maintenance.
What makes a Salesforce project expensive is rarely the technology — the API is excellent — but the state of the data: orgs with years of undocumented custom fields, sales processes that exist only in each rep's head, and massive duplicates need a cleanup phase first. The general price breakdown is in how much a custom AI agent costs.
Where to start without getting it wrong
- Pick a flow with measurable pain: CRM hygiene and auto-logging usually win, because their absence poisons everything downstream.
- Measure the baseline: % of opportunities with no recent activity, empty fields on key accounts, admin hours per rep per week.
- Create the integration user with minimum permissions and define what the agent may write versus only propose.
- Launch in proposal mode: the agent suggests changes and a person approves; once the hit rate justifies it, grant autonomy by action type.
- Review at 4-6 weeks against the baseline and expand on numbers.
For the map of what else agents can operate across your business, see AI agent use cases by department; and if you'd rather have us analyze your specific Salesforce org — edition, data, processes — before spending a euro, that's how our AI consulting engagements begin.
Frequently asked questions
Do I need a specific Salesforce edition?
API access is included in Enterprise and above; on Professional it may require an add-on. It's the first thing we verify, along with your org's daily API call limits, because it determines the connection route.
Can the agent write directly to production?
Yes, in phases: first in a sandbox, then in production in proposal mode (a person confirms each change), and finally with autonomy by action type — updating an enrichment field is not the same as changing an opportunity amount. Everything with an auditable log of every operation.
Doesn't Einstein/Agentforce already do this?
Part of it, yes: lead scoring, summaries and service agents inside the platform. What it doesn't cover well is the process that crosses borders — reading the sales inbox, querying the ERP, generating the report in your format and sending it — and that's where a custom agent complements (not replaces) the native layer.
Does my data leave Salesforce?
Only the strictly necessary fields for each task, sent to model providers with contractual no-training guarantees and, preferably, EU processing. Minimal-data design — which fields the agent sees and which it never does — is part of the project, not an extra.
How fast does it pay back?
Data hygiene and account summaries are felt in the first week. The sales impact — more touches on time, fewer forgotten opportunities — needs 4-8 weeks of data to read seriously against the baseline.