Skip to content

forcedotcom/sf-skills / skills/sales-agentforce-pipeline-management-configure

sales-agentforce-pipeline-management-configure

Verified

Use to configure, set up, or repair the Sales Management agent and Agentforce Pipeline Management in a Salesforce org. Automates metadata creation for flows, prompt templates, permission sets, and data source configuration. TRIGGER when: user wants to enable Pipeline Management, configure Sales pipeline features, set up the Sales Management agent for opportunity field updates (including autonomous updates), connect enabled data sources like Einstein Conversation Insights or Einstein Activity Capture, customize opportunity stage descriptions, configure post-meeting suggestions, verify or audit configuration status, fix partially configured orgs, or troubleshoot Pipeline Management metadata issues. DO NOT TRIGGER when: user wants to build a custom agent (use agentforce-generate), configure general Agentforce tracing (use platform-tracing-agentforce-configure), work with non-Sales agents, or enable Einstein Conversation Insights or Einstein Activity Capture from scratch (provisioning is out of scope).

FileKindSize
SKILL.mdskill md29.0 KB
assets/field-completion-template.genAiPromptTemplate-meta.xmlconfig8.6 KB
assets/pipeline_management_flow.flow-meta.xmlconfig22.9 KB
assets/sales_management_agent.agentother211.7 KB
assets/sales_management_agent.bundle-meta.xmlconfig163 B
assets/sfdx-project.jsonconfig254 B
assets/stage-descriptions/bant.txtmarkdown2.7 KB
assets/stage-descriptions/meddic.txtmarkdown2.9 KB
assets/stage-descriptions/spiced.txtmarkdown2.9 KB
examples/custom-prompt-instructions.mdmarkdown10.0 KB
references/admin-communication.mdmarkdown14.6 KB
references/agent-creation.mdmarkdown22.5 KB
references/auth-and-cli.mdmarkdown6.7 KB
references/automation-matrix.mdmarkdown2.2 KB
references/autonomous-updates.mdmarkdown8.4 KB
references/canonical-agent-path.mdmarkdown6.9 KB
references/data-sources.mdmarkdown6.6 KB
references/field-completion-prompt-template.mdmarkdown6.4 KB
references/field-completion-prompts.mdmarkdown10.4 KB
references/flags.mdmarkdown3.2 KB
references/flow-clone-from-template.mdmarkdown19.5 KB
references/metadata-inventory.mdmarkdown17.1 KB
references/opportunity-stages.mdmarkdown11.9 KB
references/repair-diagnostics.mdmarkdown14.1 KB
references/setup-order.mdmarkdown12.6 KB
references/soap-api-enablement.mdmarkdown21.7 KB
scripts/CHANGES.mdmarkdown5.6 KB
scripts/README.mdmarkdown3.1 KB
scripts/add-field-suggestion.shexecutablescript35.5 KB
scripts/create-agent.shexecutablescript13.2 KB
scripts/create-flow.shexecutablescript8.5 KB
scripts/define-agent-access.shexecutablescript21.2 KB
scripts/deploy-settings.shexecutablescript1.9 KB
scripts/enable-deal-agent.shexecutablescript10.0 KB
scripts/enable-prerequisites.shexecutablescript22.9 KB
scripts/flow-debug-and-verify.shexecutablescript18.4 KB
scripts/retrieve-settings.shexecutablescript5.7 KB
scripts/setup-all.shscript146.6 KB
scripts/shared/agent-bundle-publish.shscript6.7 KB
scripts/shared/agent-detection.shscript9.7 KB
scripts/shared/flow-builder.shscript9.5 KB
scripts/shared/psg.shscript1.9 KB
scripts/shared/soap.shscript5.6 KB
scripts/shared/stage-descriptions.shscript23.3 KB
scripts/shared/test-opp.shscript9.6 KB
scripts/verify-all.shexecutablescript26.0 KB
scripts/verify-prompt-generation.shexecutablescript13.8 KB

references/autonomous-updates.md

View on GitHub
# Autonomous Updates in Pipeline Management

Pipeline Management generates opportunity field update suggestions by default, but requires manual approval. **Autonomous updates** allow the agent to apply approved suggestions automatically without user intervention.

---

## Safety Default: Suggestion-Only Mode

By default, Pipeline Management operates in **suggestion-only mode**:
- Agent generates `AiGenActionItem` records (`Type = 'FIELD_UPDATE'`) with suggested field updates
- Suggestions appear in Sales Console under "Pipeline Management" component
- Users manually review and approve/reject each suggestion
- No automatic writes to opportunity fields

This is the **safest mode** for initial deployment and testing.

---

## Global Autonomous Toggle

### Setting: `enableDealAgentAutoApproveAllTasks`

Located in `SalesDealAgentSettings` (SOAP API only — CLI deploy silently fails).

**When enabled**:
- Agent automatically applies **all** field update suggestions without user approval
- Suggestions are still logged as `AiGenActionItem` records but are immediately applied
- Users see updates in Opportunity field history
- No review workflow

**When disabled** (default):
- Suggestion-only mode (manual approval required)

---

## Enabling Global Autonomous Updates

### Via SOAP API v64.0

```bash
ORG="pipeline-mgmt-org"
AUTH_INFO=$(sf org display --target-org $ORG --json 2>/dev/null)
ACCESS_TOKEN=$(echo "$AUTH_INFO" | jq -r '.result.accessToken')
INSTANCE_URL=$(echo "$AUTH_INFO" | jq -r '.result.instanceUrl')

curl -s "${INSTANCE_URL}/services/Soap/m/64.0" \
  -H "Content-Type: text/xml; charset=UTF-8" \
  -H "SOAPAction: update" \
  -d "<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:met='http://soap.sforce.com/2006/04/metadata'>
  <soapenv:Header>
    <met:SessionHeader>
      <met:sessionId>${ACCESS_TOKEN}</met:sessionId>
    </met:SessionHeader>
  </soapenv:Header>
  <soapenv:Body>
    <met:updateMetadata>
      <met:metadata xsi:type='met:SalesDealAgentSettings' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
        <met:fullName>SalesDealAgent</met:fullName>
        <met:enableDealAgent>true</met:enableDealAgent>
        <met:enableDealAgentAutoApproveAllTasks>true</met:enableDealAgentAutoApproveAllTasks>
      </met:metadata>
    </met:updateMetadata>
  </soapenv:Body>
</soapenv:Envelope>" | xmllint --format - 2>/dev/null
```

### Verification

```bash
sf data query -q "SELECT enableDealAgent, enableDealAgentAutoApproveAllTasks FROM SalesDealAgentSettings" --target-org $ORG --json 2>/dev/null
```

**Expected output**:
```json
{
  "enableDealAgent": true,
  "enableDealAgentAutoApproveAllTasks": true
}
```

---

## Per-Field Autonomous Updates

**Status**: Not yet available in current Pipeline Management release (as of API v67.0).

**Future capability**: Salesforce plans to support per-field autonomous toggles, allowing fine-grained control:
- Enable autonomous updates for `Stage` (high confidence field)
- Require manual approval for `Amount` (high impact field)
- Enable autonomous updates for `NextStep` (low risk field)

**Current workaround**: Use global toggle only. If per-field control is required, implement custom Apex trigger to block autonomous updates on specific fields based on business logic.

---

## Daily LLM Request Limits

Pipeline Management has **daily LLM request limits** to prevent quota exhaustion:

| Limit | Value |
|-------|-------|
| Max LLM requests per day | 8,000 |
| Approximate opportunities processed | ~4,000 (2 requests per opportunity: grounding + suggestion) |

The 8,000/day figure was observed live: the suggestion flow's debug log emits `{enqueuedStatus=Successful, currentLLMUsage=N, dailyLLMLimit=8000}`. Confirm the current value for your org/edition — `dailyLLMLimit` in that log line is the source of truth.

**What happens when limit is reached**:
- Agent stops generating new suggestions until next day (UTC reset)
- Existing suggestions remain visible and actionable
- No error messages shown to users

**Monitoring usage**:
```bash
# Query suggestion records created today
sf data query -q "SELECT COUNT() FROM AiGenActionItem WHERE Type = 'FIELD_UPDATE' AND CreatedDate = TODAY" --target-org $ORG --json 2>/dev/null

# Each AiGenActionItem represents 1 field-update suggestion
# Grounding + suggestion together consume ~2 LLM requests per opportunity
```

**Recommendations**:
- Start with suggestion-only mode to gauge usage patterns
- Enable autonomous updates only after confirming daily volume stays under 4,000 opportunities
- Monitor `AiGenActionItem` record creation rate
- Consider stage-based filtering (only generate suggestions for opportunities in specific stages)

---

## Risk Matrix: When to Enable Autonomous Updates

| Scenario | Autonomous Mode | Rationale |
|----------|-----------------|-----------|
| Initial deployment | ❌ Disabled | Validate suggestion quality first |
| Sandbox testing | ✅ Enabled | Test end-to-end flow with real data |
| Production pilot (< 50 users) | ⚠️ Optional | Depends on confidence in suggestion accuracy |
| Production rollout (> 50 users) | ❌ Disabled initially | Start with manual approval, enable after 2 weeks |
| High-value opportunities (> $1M) | ❌ Disabled | Manual approval for high-stakes updates |
| Standard opportunities (< $100K) | ✅ Enabled | Low risk for autonomous updates |

---

## Disabling Autonomous Updates

To revert to suggestion-only mode:

```bash
curl -s "${INSTANCE_URL}/services/Soap/m/64.0" \
  -H "Content-Type: text/xml; charset=UTF-8" \
  -H "SOAPAction: update" \
  -d "<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:met='http://soap.sforce.com/2006/04/metadata'>
  <soapenv:Header>
    <met:SessionHeader>
      <met:sessionId>${ACCESS_TOKEN}</met:sessionId>
    </met:SessionHeader>
  </soapenv:Header>
  <soapenv:Body>
    <met:updateMetadata>
      <met:metadata xsi:type='met:SalesDealAgentSettings' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
        <met:fullName>SalesDealAgent</met:fullName>
        <met:enableDealAgent>true</met:enableDealAgent>
        <met:enableDealAgentAutoApproveAllTasks>false</met:enableDealAgentAutoApproveAllTasks>
      </met:metadata>
    </met:updateMetadata>
  </soapenv:Body>
</soapenv:Envelope>" | xmllint --format - 2>/dev/null
```

---

## Troubleshooting

### Autonomous updates enabled but suggestions still require approval

**Symptom**: `enableDealAgentAutoApproveAllTasks = true` but suggestions appear in UI for manual approval

**Causes**:
1. **Setting not propagated** — Wait up to 5 minutes after SOAP API call
2. **User permission mismatch** — Autonomous updates may require specific permission set (verify with Salesforce support)
3. **Opportunity-level override** — Some orgs have custom validation rules or process builders blocking automatic updates

**Diagnosis**:
```bash
# Check setting value
sf data query -q "SELECT enableDealAgentAutoApproveAllTasks FROM SalesDealAgentSettings" --target-org $ORG --json 2>/dev/null

# Check suggestion status (Subject = the field API name, ParentId = the Opportunity Id)
sf data query -q "SELECT Id, Subject, Status, ParentId FROM AiGenActionItem WHERE Type = 'FIELD_UPDATE' AND CreatedDate = TODAY LIMIT 10" --target-org $ORG --json 2>/dev/null
```

### Autonomous updates apply wrong values

**Symptom**: Agent autonomously updates fields but values are incorrect

**Causes**:
1. **Insufficient grounding data** — Agent lacks recent notes, emails, or call transcripts
2. **Stage descriptions missing or outdated** — See `references/opportunity-stages.md`
3. **Prompt template misconfiguration** — Custom prompt templates may override default logic

**Fix**:
1. Disable autonomous updates immediately
2. Review `AiGenActionItem` records for patterns (which fields have high error rates — group by `Subject`)
3. Add or update stage descriptions for frequently misidentified stages
4. Re-enable autonomous updates after validation

---

## Notes

- Always test autonomous updates in sandbox before production enablement
- Use suggestion-only mode for at least 2 weeks in production to validate accuracy
- Monitor field history on opportunities to detect autonomous update patterns
- Consider custom Apex triggers for org-specific autonomous update rules (e.g., block updates on closed opportunities)
- SOAP API v64.0+ required for `SalesDealAgentSettings` (CLI deploy silently fails)
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall