agent-action-input-slot-extraction
Use when designing how an Agentforce agent extracts structured input parameters (slots) from a user's natural-language utterance to invoke an action. Triggers: 'agent extract date from user', 'agent action argument extraction', 'agentforce slot filling', 'agent invocable input mapping', 'agent fails to fill required parameter'. NOT for action authoring (use agentforce/agent-actions) or for prompt-template variable binding (use agentforce/prompt-builder-templates).
Best use case
agent-action-input-slot-extraction is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Use when designing how an Agentforce agent extracts structured input parameters (slots) from a user's natural-language utterance to invoke an action. Triggers: 'agent extract date from user', 'agent action argument extraction', 'agentforce slot filling', 'agent invocable input mapping', 'agent fails to fill required parameter'. NOT for action authoring (use agentforce/agent-actions) or for prompt-template variable binding (use agentforce/prompt-builder-templates).
Teams using agent-action-input-slot-extraction should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/agent-action-input-slot-extraction/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How agent-action-input-slot-extraction Compares
| Feature / Agent | agent-action-input-slot-extraction | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Use when designing how an Agentforce agent extracts structured input parameters (slots) from a user's natural-language utterance to invoke an action. Triggers: 'agent extract date from user', 'agent action argument extraction', 'agentforce slot filling', 'agent invocable input mapping', 'agent fails to fill required parameter'. NOT for action authoring (use agentforce/agent-actions) or for prompt-template variable binding (use agentforce/prompt-builder-templates).
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Agent Action Input Slot Extraction
Activate when the agent invokes an Apex/Flow action correctly but with the *wrong* arguments — date misread, account id missing, picklist value paraphrased, phone number truncated. The skill produces tuned input-variable descriptions, utterance-level test cases, and a re-prompt policy for ambiguous or missing inputs.
---
## Before Starting
Gather this context before working on anything in this domain:
- The action's invocable definition: each input variable's `name`, `type`, `description`, and `required` flag. The description is the primary signal the LLM uses to extract values; vague descriptions → wrong slots.
- Real user utterances. Synthetic test cases miss the verbal patterns users actually produce ("schedule it for next Tuesday afternoon, ish").
- Whether the action is a one-shot invocation or part of a multi-turn flow. Multi-turn allows re-prompts; one-shot must succeed-or-fail with the first utterance.
---
## Core Concepts
### How slot extraction works
When the agent recognizes that an action should be invoked, it constructs an LLM prompt containing:
- The action's invocable input variables and their descriptions
- The user's utterance(s)
- The conversation context
The LLM extracts values for each input variable and validates them against the input type. Missing required inputs trigger a re-prompt cycle.
The **description** field is the lever. A description like `"Date"` gets misread for any date in the utterance. `"The customer's preferred appointment date in ISO 8601 (YYYY-MM-DD); reject relative phrases like 'next week'"` constrains extraction.
### Types and coercion
| Input type | Extraction behavior | Common failure |
|---|---|---|
| `Date` | LLM parses natural language → ISO date | "next Tuesday" parses inconsistently across timezones |
| `DateTime` | Same + time-of-day | Vague times ("afternoon") get pinned to noon by default |
| `String` | Free-form | Verbose users put unrelated content in the slot |
| `Picklist` (Apex enum / Flow choice) | LLM matches utterance to one of the values | Synonyms get rejected unless described |
| `Id` (lookup) | LLM extracts a name; the action must resolve to an Id | LLM hallucinates IDs starting with valid prefixes |
| `Boolean` | Affirmative/negative cues | Negation in mid-sentence ("no, wait, yes") |
### Re-prompt strategy
When a required slot can't be extracted, the agent re-prompts: `"What date should I schedule the appointment for?"`. The re-prompt template should be configured per input. Without configuration, the agent generates a generic prompt that often confuses the user.
For **ambiguous** extraction (two plausible values), the better pattern is to confirm: `"Did you mean Tuesday March 12 or March 19?"`.
---
## Common Patterns
### Pattern: explicit format constraint in description
**When to use:** Date, datetime, phone, id, anything with a canonical format.
**How it works:** Description includes the format and an explicit reject clause. `"Account record ID; must be exactly 18 alphanumeric characters starting with '001'. Reject names or fragments."`
**Why not the alternative:** A description of "Account ID" alone causes the LLM to hallucinate IDs from account names.
### Pattern: enumerate picklist values inline
**When to use:** Apex enum or Flow choice as input.
**How it works:** Description lists every valid value with disambiguation. `"Severity: one of LOW (cosmetic, no impact), MEDIUM (workaround exists), HIGH (production blocked). Synonyms: 'critical' = HIGH; 'minor' = LOW."`
**Why not the alternative:** Without enumeration, the LLM matches user phrasing to the closest type member, often wrong (`'urgent'` → MEDIUM when policy says HIGH).
### Pattern: name-to-Id resolution outside the LLM
**When to use:** Action takes a record Id but users speak in names.
**How it works:** Define the input as a `String accountName`. Inside the Apex/Flow action, resolve to Id via SOQL with proper escaping and ambiguity handling. Never let the LLM emit IDs.
---
## Decision Guidance
| Situation | Recommended Approach | Reason |
|---|---|---|
| User must specify an exact date | `Date` input + ISO-format description + reject relatives | Relative phrasing parses inconsistently |
| Action takes a lookup record | `String name` input; Apex resolves to Id | LLMs hallucinate IDs; resolution belongs in Apex |
| Required slot may be missing | Configure re-prompt text per input | Generic re-prompt confuses users |
| Multiple plausible values for a slot | Disambiguate via confirmation prompt before action | Action with wrong slot is worse than slow action |
| Free-form note text | `String` with no constraint description | LLM extracts the user's verbatim sentence; no extraction logic needed |
---
## Recommended Workflow
1. List every invocable input the action exposes. For each, ask: what's the canonical type? what synonyms or formats might appear? is it required?
2. Write a **specific** description per input. Include format, examples, reject clauses. Treat the description as the LLM's instruction manual for that slot.
3. Build a sample-utterance test set: 10–20 utterances per slot covering typical, edge-case, and adversarial phrasings.
4. For required slots, configure a re-prompt template that names the missing slot and gives an example.
5. For lookup-type slots, change the input from `Id` to `String <name>` and resolve inside the action; document the lookup ambiguity policy (first match? prompt for clarification? abort?).
6. Run the test utterances through the agent test harness (Agent Builder → Test in App). Record extraction accuracy per slot.
7. Iterate on the descriptions until extraction accuracy crosses your bar (typically ≥95% for high-stakes actions, lower for low-stakes).
---
## Review Checklist
- [ ] Each input has a description that includes format + examples + reject clauses
- [ ] Picklist/enum inputs enumerate values with synonym disambiguation
- [ ] Lookup/Id inputs are taken as names, resolved inside the action
- [ ] Required-slot re-prompts configured with slot name and example
- [ ] Test-utterance suite covers ≥10 utterances per slot
- [ ] Accuracy measured and meets the action's stakes
---
## Salesforce-Specific Gotchas
1. **Description text is the primary lever; the variable name is secondary** — `String d` with description "appointment date" extracts as well as `String appointmentDate` with the same description. Don't rely on naming.
2. **Date inputs default to the running user's timezone** — "next Tuesday" relative to which timezone? Specify in the description.
3. **Required + no value extracted = agent emits a built-in re-prompt** — Often phrased awkwardly. Always override.
4. **Hallucinated IDs validate as the right shape but reference no record** — Apex must check existence and surface a clear error to the agent loop, not silently fail.
5. **Picklist values must match exactly** — The LLM may emit "high" when the picklist value is "HIGH". Apex enum coercion fails. Normalize case in the action.
---
## Output Artifacts
| Artifact | Description |
|---|---|
| Tuned invocable input definitions | Updated `description=` strings on every input |
| Test-utterance suite | YAML/CSV: utterance → expected slot values |
| Re-prompt template per slot | Per-input override of the generic agent re-prompt |
| Resolution policy for lookup inputs | Documented in the action's class header |
---
## Related Skills
- agentforce/agent-actions — for the broader action design and invocation flow
- agentforce/agentforce-tool-use-patterns — for when an action call leads into another tool call
- agentforce/agentforce-eval-harness — for measuring extraction accuracy at scale
- agentforce/custom-agent-actions-apex — for Apex implementation patterns of name-to-Id resolutionRelated Skills
transaction-security-policies
Transaction Security policy creation and configuration: condition builder, enhanced policies, enforcement actions (block, MFA, notification, end session), real-time monitoring mode, and policy troubleshooting. NOT for Event Monitoring log analysis or Shield Event Monitoring setup (use event-monitoring). NOT for Apex testing or debug-log analysis.
omnistudio-remote-actions
Use when configuring, troubleshooting, or choosing between Remote Action types in OmniScript or FlexCard. Triggers: 'remote action', 'OmniScript action', 'IP action', 'Apex action element', 'VlocityOpenInterface2', 'Send/Response JSON Path'. NOT for Integration Procedure internal design (use integration-procedures) or generic Apex callout patterns (use apex integration skills).
lwc-slots-composition
Use when a Lightning Web Component needs to let a parent inject markup into predefined regions using `<slot>` — default and named slots, `slotchange` wiring, fallback content, and detecting slot emptiness. NOT for rendering a dynamic component whose tag name is chosen at runtime — that is `lwc-dynamic-components` — and NOT for cross-component messaging via Lightning Message Service.
lwc-quick-actions
Use when building a Lightning Web Component that runs from a record page quick-action button — either a screen action that renders UI in a modal or a headless action that invokes logic with no UI. Triggers: 'lwc quick action on record page', 'headless quick action no ui', 'closeactionscreenevent not working', 'how to pass recordid into quick action lwc', 'quick action vs flow action', 'quick action modal size'. NOT for Flow screen components — use `lwc-in-flow-screens` — and NOT for global actions without a record context or for list-view bulk actions that do not receive a single `recordId`.
flow-transactional-boundaries
Reason about when a Flow is inside the caller's transaction vs starts its own. Pick Before-Save vs After-Save vs Async Path vs Pause + Resume when transaction boundaries matter. Covers governor-limit sharing, DML sequencing, recoverability, and the exact semantics of each Flow entry point. NOT for choosing Flow vs Apex (use automation-selection.md). NOT for Flow-to-Flow invocation contracts (use subflows-and-reusability).
flow-transaction-finalizer-patterns
Use when a Flow needs to do work that must survive the triggering transaction — post-commit notifications, callouts, audit rows, or compensating actions. Covers Flow Transaction Control element, scheduled paths, Platform Event + finalizer escalation, and Apex Queueable finalizer bridging. Does NOT cover general Flow async decisions (see async-selection).
flow-screen-input-validation-patterns
Design input validation inside Screen Flow screens using component-level <validationRule> (formula + errorMessage), isRequired, cross-field rules on the second field, reactive components, and screen-level Decision fallbacks for cross-screen checks. Trigger keywords: screen flow validation rule, EndDate after StartDate validation in flow screen, block Next button until input valid. NOT for record-level Validation Rules — see admin/validation-rules-and-formulas. NOT for Apex-side input checks — see apex/input-validation-patterns.
flow-record-save-order-interaction
Reason about how record-triggered flows interleave with the Salesforce Save Order (validation, before-save flows, before triggers, duplicate rules, after-save flows, workflow, after triggers, assignment, auto-response, escalation). Trigger keywords: save order, before-save flow, after-save flow, dml order, trigger vs flow order. Does NOT cover writing trigger handlers, approval process setup, or workflow rule migration.
flow-http-callout-action
Call external HTTP APIs directly from Flow using HTTP Callout actions (no Apex), handling auth, schema, and errors. NOT for complex Apex-based integration logic.
flow-action-framework
Use when designing or troubleshooting Salesforce Flow actions in Flow Builder: standard and core actions, the Apex action element for @InvocableMethod classes, how list-shaped inputs and outputs map at the Flow–Apex boundary, subflows, and choosing between declarative actions versus custom Apex versus packaged invocables. Triggers: 'Flow Apex action', 'add Apex to Flow', 'InvocableMethod in Flow', 'Flow action palette', 'map Flow variables to Apex invocable inputs'. NOT for authoring or testing Apex @InvocableMethod bodies (use the Apex invocable-methods skill), External Services or HTTP callout registration (use flow-external-services), OmniStudio action packs, or LWC screen component local actions.
github-actions-for-salesforce
Use this skill to set up, review, or troubleshoot GitHub Actions CI/CD pipelines for Salesforce using SFDX JWT Bearer Flow authentication, Apex test gates, and branch-conditional deployments. Trigger keywords: github actions, CI pipeline, jwt auth, sfdx ci, workflow yaml, github secrets, apex coverage threshold. NOT for other CI tools such as Jenkins, Copado, Bitbucket Pipelines, or Azure DevOps.
fsl-custom-actions-mobile
Use this skill when building custom LWC actions for the FSL Mobile app: barcode scanning, GPS capture, photo/signature capture, or custom guided workflows on mobile. Trigger keywords: FSL Mobile custom action, lightning__GlobalAction FSL, barcode scanner LWC, mobileCapabilities, Nimbus plugin, FSL lightning SDK. NOT for standard Salesforce Mobile App quick actions, standard Experience Cloud pages, or desktop Lightning Experience LWC components.