Sub topic 1
What You Are Deploying: Agents, Topics, and Actions
Prerequisites
Assume you understand Salesforce orgs, sandboxes, permission sets, and basic Salesforce CLI commands. You should also know that an Agentforce agent uses topics to organize conversations and actions to perform work.
Agents, Topics, and Actions
An Agentforce agent is a configured conversational system. It receives a user request, selects a relevant topic, follows instructions, and invokes an action when it needs data or must change a record.
A topic defines a job area, such as returns or appointment scheduling. It contains guidance, boundaries, and the actions available for that job. An action is an operation the agent can invoke. It might call an Apex class, run a Flow, or use another supported capability.
Deployment must preserve these relationships. Moving only the agent shell can produce an agent that appears in the target org but cannot complete its tasks.
How an Agent Is Stored as Metadata
Salesforce stores the agent and its configuration as metadata components. The exact components depend on the Agentforce features and API version in use. Common types include:
| Metadata type | Purpose |
|---|---|
| `Bot` | Identifies the agent definition |
| `BotVersion` | Stores a version of the agent configuration |
| `GenAiPlanner` | Represents planning behavior |
| `GenAiPlugin` | Groups or exposes agent capabilities |
| `GenAiFunction` | Represents an invokable function |
Topics, instructions, and actions can reference other metadata. For example, an action may depend on a Flow, an Apex class, custom objects, or permission sets. Treat the agent metadata and its supporting components as one deployable unit.
Finding Dependencies
Create a dependency inventory before retrieving or deploying. For each topic and action, record its implementation, referenced objects and fields, named credentials or external settings, and required permissions. Include flows, Apex classes, custom metadata, and permission sets where applicable.
Preparing the Target Org
Before deployment, verify that the target org has the required Agentforce features enabled and uses a compatible Salesforce release. Confirm that referenced objects, fields, Flows, Apex classes, and integration settings exist or are included in the package.
Plan environment-specific values separately. URLs, named credentials, users, and permission assignments often differ between sandbox and production. Deploy metadata first, then configure those values in the target org. Finally, identify the agent user and grant only the permissions required by the agent’s actions.
Exercise
Why can an agent deploy successfully but still fail when a user invokes an action?
Show answer
Deployment may not grant the agent user access to the action’s Flow, Apex class, objects, or fields.