Official-sources
Part of Sf ai agentscript. Install the skill and your agent reads this page when it needs the depth.
Official Sources Registry
Canonical Salesforce documentation URLs for Agent Script. Use this registry to verify syntax, resolve errors, and stay current with platform changes.
Primary References (Agent Script Documentation)
URL Prefix Note: Agent Script docs migrated from
/docs/einstein/genai/guide/ascript-*(older beta path) to/docs/ai/agentforce/guide/ascript-*(current path). Also note that some older per-topic/per-lifecycle URLs have been folded into newer pages or renamed (for example,ascript-ref-before-after-reasoning.htmlandascript-blocks.html#topic-blocks).
Official Pattern Pages
| # | Page | URL | Use When |
|---|---|---|---|
| P1 | System Overrides | https://developer.salesforce.com/docs/ai/agentforce/guide/ascript-patterns-system-overrides.html | Topic-level system.instructions overrides |
| P2 | Variables Pattern | https://developer.salesforce.com/docs/ai/agentforce/guide/ascript-patterns-variables.html | State sharing, slot filling, variable usage |
| P3 | Transitions Pattern | https://developer.salesforce.com/docs/ai/agentforce/guide/ascript-patterns-transitions.html | @utils.transition to, deterministic vs LLM-selected routing |
Recipe Repository
Diagnostic Decision Tree
When something fails, use this tree to determine which doc page to fetch:
Error or Ambiguity
│
├─ Compilation / SyntaxError
│ ├─ Block-level error → Fetch #3 (Blocks Reference)
│ ├─ Expression error → Fetch #10 (Expressions) + #12 (Operators)
│ └─ Action error → Fetch #5 (Actions Reference)
│
├─ Action not executing
│ ├─ Action defined but LLM doesn't pick it → Fetch #5 (Actions) + #7 (Tools)
│ └─ Action target not found → Fetch #5 (Actions) + #18 (Agent DX)
│
├─ Variable not updating
│ ├─ Linked var empty → Fetch #6 (Variables)
│ └─ Mutable not changing → Fetch #6 (Variables) + #9 (Instructions)
│
├─ Topic transition wrong
│ ├─ Wrong topic selected → Fetch #13 (Topic Blocks) + #8 (Utils)
│ └─ Transition vs delegation confusion → Fetch #7 (Tools) + #13 (Topic Blocks)
│
├─ Lifecycle hook issue
│ └─ before/after_reasoning error → Fetch #11 (Before/After)
│
└─ New / unfamiliar syntax
└─ Start with #1 (Overview), then narrow to specific reference
Fallback Search Patterns
When a specific URL 404s or doesn't have the answer:
# Primary search pattern
site:developer.salesforce.com agent script <topic>
# Recipe search
site:developer.salesforce.com sample-apps agent-script-recipes <topic>
# GitHub issues (known bugs, community solutions)
site:github.com trailheadapps agent-script-recipes <error message>
# Salesforce Stack Exchange
site:salesforce.stackexchange.com agent script <topic>
URL Health Check
When verifying URLs, use WebFetch to confirm each resolves. If a URL redirects or 404s:
- Try swapping the URL prefix (see note above)
- Use the fallback search pattern
- If consistently broken, update this file and note the date
Last updated: 2026-03-12