You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 63da57c
Browse filesBrowse the repository at this point in the historyBrowse files
- q: "How do I build a Salesforce AI agent for lead scoring?"
15
-
a: "Sim builds a Salesforce AI lead-scoring agent by retrieving eligible leads, extracting structured evidence, calculating a deterministic score, routing required approvals, and writing approved results back to Salesforce."
15
+
a: "Sim builds a Salesforce AI lead-scoring agent by retrieving eligible leads, extracting structured evidence, calculating a deterministic score, routing required approvals, and applying only the Salesforce updates supported by the configured write path."
16
16
- q: "Can Sim connect to Salesforce?"
17
17
a: "Sim connects to Salesforce through its documented native Salesforce integration and an authorized Salesforce credential."
18
18
- q: "Does Sim provide a Salesforce MCP server?"
19
19
a: "Sim should not be described as providing a Salesforce-hosted MCP server; this implementation uses Sim’s native Salesforce integration, while Salesforce separately documents its own hosted MCP capability."
20
20
- q: "What is a Salesforce MCP server?"
21
21
a: "A Salesforce MCP server is a Salesforce-provided Model Context Protocol endpoint that exposes supported Salesforce capabilities to compatible MCP clients under Salesforce’s documented authentication and permission model."
22
22
- q: "Do I need a Salesforce MCP server to automate lead scoring?"
23
-
a: "Sim does not need a Salesforce MCP server for the workflow in this guide because its native Salesforce integration handles the required retrieval and write-back steps."
23
+
a: "Sim does not need a Salesforce MCP server for the workflow in this guide because its native Salesforce integration handles retrieval, supported standard-field Lead updates, and Task creation."
24
24
- q: "How should an AI agent score Salesforce leads?"
25
25
a: "Sim should score Salesforce leads with a fixed rubric, constrained evidence extraction, deterministic arithmetic, explicit thresholds, and documented handling for missing data."
26
26
- q: "Should the AI model calculate the final lead score?"
27
27
a: "Sim should use the model to normalize evidence and use deterministic workflow logic to calculate the final Salesforce lead score."
28
28
- q: "Can Sim update Salesforce Lead records?"
29
-
a: "Sim can use its documented Salesforce integration to update approved Lead fields by Salesforce record ID."
29
+
a: "Sim can use its documented Salesforce integration to update the standard Lead fields exposed by its Update Lead action by Salesforce record ID; that action does not accept arbitrary custom fields."
30
30
- q: "Can Sim create Salesforce follow-up tasks?"
31
31
a: "Sim can use its documented Salesforce integration to create a Salesforce Task after the workflow’s routing and approval requirements pass."
32
32
- q: "How do I add human approval before a Salesforce update?"
33
33
a: "Sim adds human approval with a Human in the Loop block followed by a Condition that checks the submitted approval field before routing to Salesforce write actions."
34
34
- q: "Does Sim’s Human in the Loop block automatically approve or reject a change?"
35
35
a: "Sim’s Human in the Loop block pauses and resumes the run with form data, but a downstream Condition must evaluate the approval field to approve or reject the Salesforce change."
36
36
- q: "What Salesforce permissions should the integration user have?"
37
-
a: "Salesforce should grant Sim’s dedicated integration user only the object, field, record, and action permissions required to read scoring inputs, update approved score fields, and create permitted tasks."
37
+
a: "Salesforce should grant Sim’s dedicated integration user only the object, field, record, and action permissions required to read scoring inputs, update supported approved fields, and create permitted tasks."
38
38
- q: "Can I test a Sim Salesforce workflow in a sandbox?"
39
39
a: "Sim should be connected to a Salesforce sandbox or tightly controlled test cohort before production write actions are enabled."
40
40
- q: "How do I prevent duplicate Salesforce tasks?"
41
41
a: "Sim should query for an existing matching open task or use another approved idempotency key before creating a Salesforce follow-up task."
42
42
- q: "How do I prevent AI from overwriting Salesforce data incorrectly?"
43
-
a: "Sim should constrain model output, calculate scores deterministically, update only dedicated fields, require approval where appropriate, and verify the Salesforce record after each write."
43
+
a: "Sim should constrain model output, calculate scores deterministically, update only fields supported by the configured write path, require approval where appropriate, and verify the Salesforce record after each write."
44
44
- q: "What happens when Salesforce data is missing?"
45
45
a: "Sim should record the Salesforce input as missing, award zero points unless the rubric says otherwise, and route consequential ambiguity for human review rather than inventing evidence."
46
46
- q: "What happens when a reviewer rejects the proposed score?"
@@ -69,7 +69,7 @@ faq:
69
69
70
70
## TL;DR
71
71
72
-
**Sim can retrieve Salesforce leads, evaluate them against an explicit scoring rubric, pause high-impact changes for human approval, and write approved scores and follow-up tasks back to Salesforce.**
72
+
**Sim can retrieve Salesforce leads, evaluate them against an explicit scoring rubric, pause high-impact changes for human approval, and create approved follow-up tasks or supported standard-field updates in Salesforce.**
73
73
74
74
The reliable pattern is to let an AI model interpret messy evidence while deterministic workflow logic assigns points, applies thresholds, and controls Salesforce writes. This separation makes the workflow easier to test, explain, and govern than asking a model to invent a score in one step.
75
75
@@ -85,7 +85,7 @@ A production workflow should divide the job into five responsibilities:
85
85
2. Sim orchestrates retrieval, AI analysis, deterministic scoring, approval, and write-back.
86
86
3. The model normalizes ambiguous text into constrained evidence, not an unrestricted final score.
87
87
4. Deterministic logic calculates the score and tier from an approved rubric.
88
-
5. A reviewer approves consequential updates before Sim changes Salesforce or creates a sales task.
88
+
5. A reviewer approves consequential updates before Sim changes a supported Salesforce field or creates a sales task.
89
89
90
90
For broader product rankings, see [Best AI Agents for Sales and CRM Automation](https://www.sim.ai/library/best-ai-agents-sales-crm-automation). This guide focuses specifically on implementing and validating one Salesforce lead-scoring workflow.
91
91
@@ -101,7 +101,7 @@ A useful workflow contract is:
101
101
| Normalize | Approved CRM fields and related signals | Structured evidence with source fields | Mark missing evidence instead of guessing |
102
102
| Score | Structured evidence and fixed rubric | Numeric score and criterion-level breakdown | Reject totals outside 0–100 |
103
103
| Route | Score, tier, confidence, and policy flags | Auto-close, review, or approved-write path | Send ambiguous or sensitive cases to review |
104
-
| Write | Approved score package |Updated Lead fields and, when needed, a Task | Record the error and avoid partial duplicate writes |
104
+
| Write | Approved score package |Supported standard Lead fields and, when needed, a Task | Record the error and avoid partial duplicate writes |
105
105
| Verify | Expected and actual Salesforce values | Pass or exception | Escalate mismatches without silently retrying writes |
106
106
107
107
The workflow should preserve the Salesforce Lead ID throughout the run. That ID is the safest key for updates and task relationships; names and email addresses are not stable identifiers.
@@ -229,38 +229,31 @@ The review form should display:
229
229
- Criterion-level point breakdown.
230
230
- Evidence summary and missing inputs.
231
231
- Proposed Salesforce fields to change.
232
-
- Proposed task owner, subject, and due date.
232
+
- Proposed task subject and due date.
233
233
- Approve or reject field.
234
234
- Required reviewer note for overrides or rejections.
235
235
236
-
A practical policy is to require review when the score is high, the model reports missing or conflicting evidence, an owner would change, or the workflow would create a seller task. Lower-risk updates can follow a separately approved policy, but the workflow should never interpret the Human in the Loop block’s mere completion as approval.
236
+
A practical policy is to require review when the score is high, the model reports missing or conflicting evidence, or the workflow would create a seller task. Lower-risk updates can follow a separately approved policy, but the workflow should never interpret the Human in the Loop block’s mere completion as approval.
237
237
238
238
For a broader explanation of approval patterns, see [What Is Human-in-the-Loop in AI Agents?](https://www.sim.ai/library/what-is-human-in-the-loop-in-ai-agents).
239
239
240
240
## How do I write lead scores and follow-up tasks back to Salesforce?
241
241
242
242
**Sim should update only approved Salesforce fields and create a follow-up Task only when the routing policy requires one.**
243
243
244
-
Create dedicated custom fields instead of overwriting unrelated standard fields. Example destination fields are:
244
+
Sim’s native Update Lead action accepts the Lead ID and a fixed set of standard fields, including Status, Lead Source, Title, and Description. It does not accept arbitrary custom fields. Creating fields such as `AI_Lead_Score__c` in Salesforce therefore does not make them writable through this action.
245
245
246
-
-`AI_Lead_Score__c`
247
-
-`AI_Lead_Tier__c`
248
-
-`AI_Score_Reason__c`
249
-
-`AI_Scored_At__c`
250
-
-`AI_Scoring_Version__c`
251
-
252
-
These are examples, not universal Salesforce fields; an administrator must create or map the actual fields used by the organization.
253
-
254
-
Use the documented Salesforce update action in Sim to update the Lead by ID. Write the numeric score, tier, concise reason, scoring timestamp, and rubric or workflow version together so later audits can identify the policy that produced the result.
246
+
Keep custom-score persistence disabled unless the organization implements and validates a separate Salesforce API or Salesforce-side automation path for those fields. With the native actions alone, retain the score, tier, criterion breakdown, timestamp, and rubric version in the workflow’s execution evidence; update a supported standard Lead field only when the approved policy genuinely calls for it; and create the follow-up Task after approval. Do not overwrite an unrelated standard field merely to store a score.
255
247
256
248
For an approved high-priority lead, use the [documented Salesforce create action](https://docs.sim.ai/integrations/salesforce) to create a Task. A typical mapping includes:
257
249
258
250
-`WhoId`: the Salesforce Lead ID.
259
251
-`Subject`: a stable description such as “Review high-priority AI-scored lead.”
260
-
-`OwnerId`: an approved user or queue assignment resolved by policy.
261
252
-`ActivityDate`: the approved due date.
262
253
-`Description`: the evidence summary and score breakdown, excluding unnecessary sensitive data.
263
254
255
+
The native Create Task action does not expose `OwnerId`. The task therefore cannot be assigned to a chosen user or queue from that action; if explicit assignment is required, route it through separately validated Salesforce-side automation after creation.
256
+
264
257
Add an idempotency check before task creation. For example, query for an open task carrying the same lead ID, workflow version, and purpose; if one exists, update or skip it according to policy instead of creating a duplicate.
265
258
266
259
## How do I verify a Salesforce lead-scoring workflow?
@@ -274,9 +267,9 @@ Build a test matrix that covers:
274
267
| All ten criteria pass | Score 100; high tier; approval path |
275
268
| No criteria pass | Score 0; low tier; no sales task |
| Missing optional signal | Zero points for that criterion; missing input recorded |
281
274
| Invalid structured model output | No Salesforce write; exception path |
282
275
| Reviewer rejects | No Lead update and no Task creation |
@@ -318,7 +311,7 @@ Use this deployment checklist:
318
311
319
312
## Do you need a Salesforce MCP server to build this workflow?
320
313
321
-
**Sim does not require a Salesforce MCP server for this implementation because Sim’s native Salesforce integration can perform the documented retrieval and write-back steps.**
314
+
**Sim does not require a Salesforce MCP server for this implementation because Sim’s native Salesforce integration can perform retrieval, supported standard-field updates, and Task creation.**
322
315
323
316
MCP is useful when a team specifically wants to expose tools through the Model Context Protocol or standardize tool access across compatible clients. Salesforce documents [hosted MCP servers](https://developer.salesforce.com/docs/platform/hosted-mcp-servers/guide/hosted-mcp-servers-overview.html), but that Salesforce capability should not be confused with Sim’s native Salesforce integration or treated as proof that Sim supplies a Salesforce-hosted MCP server.
0 commit comments