By Emiliano Fracchia

 

This guide will walk you through the deployment process for Agentforce, highlighting key components and considerations.

Agentforce is a powerful, autonomous AI application that provides specialized, always-on support to employees or customers. You can empower it with specific data and knowledge from your business so that it can execute different tasks according to its role.

As of now, we have learned a lot in Trailhead about how to configure different types of agents for different purposes. We can even find out-of-the-box agents for Sales and Services that we can activate and make work in less than 10 minutes.

Find some use cases here

What about including these agents’ configurations and setup in our regular DevOps process? 

Now we can do it!

In release Winter ‘25, Salesforce introduced Agentforce (GenAi) metadata types, which opens the door to our DevOps world, where we rely on the Metadata API to implement best practices on the Salesforce platform using Salesforce CLI commands in our automation pipelines.

Agentforce Metadata

NOTE: GenAi metadata is supported by Metadata API versions 60 or higher.

Lets see what are the new agentforce metadata types:

  • GenAiPlanner(Agent): Represents an agent reasoning engine that uses a large language model (LLM) and a reasoning strategy to decompose a given task into smaller subtasks, identify the most suitable actions for each subtask, and invoke them.
  • GenAiPlugin(Topic): Represents an agent topic, which is a category of actions related to a particular job to be done by AI agents.
  • GenAiFunction(Action): Represents an agent action that can be added to an AI agent.
  • GenAiPromptTemplate: Represents the definition of a prompt template, including its related objects and fields.

With these metadata types, you can create a manifest (package.xml) to retrieve all your agent components from a sandbox and move them to a test environment, such as UAT or a production organization.

Step-by-Step Guide to Deploying Agentforce

WAIT! Not so quickly.

There are several considerations to keep in mind before deploying your agents to other environments:

  1. You need to include the Bot and BotVersion metadata types in your package as well.
  2. You need to understand all the dependencies with other components like Flows, Apex Classes, sObjects, that are being used by the Agent, as they need to be included in the deployment.
  3. In the destination environment, Einstein Bot and Agents need to be enabled from setup before deployment.
  4. The agent version will be overwritten with the deployment, so the recommended steps would be:
    1. Create and configure a new version in your sandbox environment.
    2. Test and get approval to move it to the upper environment.
    3. Clone existing Agent version in the destination environment to create the new version (source and destination versions must match).
    4. Deploy your new version to the destination environment.
    5. Validate the deployment in the destination environment.
  5. Any data that is being used by your agent needs to be available in the destination environment.

This is a generic package.xml that you can use to retrieve and deploy your agent metadata:

Find below an example of my project structure and components after retrieving my agent:

The new Agentforce metadata types enable DevOps tools like Salesforce DevOps Center to include and support Agentforce deployments. 

Some have already implemented these Agentforce metadata types in their platforms to automate deployments and provide step-by-step instructions.

What’s next in your journey with Agentforce?

Deploying Agentforce in production brings with it exciting possibilities and significant responsibilities. From aligning dependencies to managing metadata across environments, it’s clear that success depends on getting the process right.

At Cloudgaia, we have been working closely with these tools and supporting companies in moving from idea to impact. If you’re experimenting with AI agents or scaling your implementation, we’d be happy to share what we’ve learned along the way.

 

Curious to know how others are doing it?