Skip to main content
All CollectionsCompare and deploy metadataGuides on comparing and deploying specific metadata
How to deploy Agentforce Agent Action (GenAiFunction) metadata
How to deploy Agentforce Agent Action (GenAiFunction) metadata

A walkthrough on how to deploy Agentforce Agent Action (GenAiFunction) metadata

Gareth Hefferon avatar
Written by Gareth Hefferon
Updated over a week ago

Gearset's Agentforce metadata deployment solution simplifies the deployment of AI-powered configurations, such as Agent Actions, in Salesforce. Agent Actions are how AI Agents get things done - they're basically a list of jobs that an AI Agent can do.

This guide will explain how to successfully deploy the Agent Action (GenAiFunction) metadata via Gearset.

Prerequisites

You must use at least API version 60 for the comparison. Read the prerequisite section of the How to deploy GenAi metadata guide to find out how to do this.

What metadata is needed in the filter?

In your metadata filter you will only need to include GenAiFunction.

How to deploy GenAiFunction with Gearset

To deploy the GenAiFunction metadata type, you need to make sure that all dependencies already exist on the target org. If they don't, then you'll need to deploy them alongside the GenAiFunction. Note: This is not required for VCS targets, however it's strongly recommended to keep your VCS up to date with all required metadata.

Example

The invocationTarget and invocationTargetType must correspond to a valid target on your org. In the example above there must be a flow with the name Issue_Resort_Credit in the target org. If this doesn't exist then it must be deployed along side the GenAiFunction metadata — otherwise the validation/deployment will fail.


Limitations

GenAiFunction metadata types have two accompanying schema.json files associated with the metadata, each located in an input and an output folder.

GenAiFunction folder structure


There are two known Salesforce limitations:

  1. If you want to deploy changes to either schema then they MUST be accompanied by changes to the GenAiFunction metadata xml.

  2. Any .json formatting changes (e.g. adding or removing whitespace) won't be updated.

Example scenerios

Scenario 1 - schema.json content changes but no xml changes:

This scenario will show as a successful deployment but will not actually deploy the schema content changes to your Salesforce org.

Scenario 2 - schema.json content changes and xml changes:

This scenario will successfully deploy both xml and schema changes to your Salesforce org.

Scenario 3 - schema.json content and formatting changes and xml changes

This scenario will successfully deploy both xml and schema content changes to your Salesforce org, however the formatting changes won't be deployed.

Before deployment (VCS to org):

The formatting changes are not deployed. This is a Salesforce limitation.
After deployment (org to VCS):

If there are a few editors using different formatting then the .json files can become inconsistent like the example above.

If you're having this issue then we recommend pushing the content changes to the org and then pulling the file back down from the org into your VCS.

Did this answer your question?