Skip to main content

Resolving validation errors -"<xxx> (Action) - We can't find an action with the name and action type that you specified" on Flow deployment with GenAiPromptTemplate included

Solution to this validation error surfacing on a Flow deployment with GenAiPromptTemplate (Prompt template) metadata included in the package

David Martin avatar
Written by David Martin
Updated this week

Error overview

When deploying a Salesforce Flows that references a GenAiPromptTemplate (an Einstein Prompt Template), you may encounter a validation error indicating that an action cannot be found, even if it appears to exist in the deployment package, source and target orgs.


An example of the error message in our app:
​"<xxx> (Action) - We can't find an action with the name and action type that you specified" - where <xxx> refers to a specific action name (e.g. Read_E_O_Certificate referenced on below screenshot).
​


​
This issue often presents with a NotFound suffix at the end of a 15 character long object key which is a reference to the action's ID within the Flow's metadata, such as 0hfgK000003k1PBNotFound.

Explanation of the error

This error occurs because during metadata retrieval, if the user or service account being used lacks the necessary permissions to access the referenced GenAiPromptTemplate, Salesforce replaces the action name with the object key and the NotFound suffix.

This broken reference then causes deployment failures. Deployments via Change Sets or the CLI might succeed in some cases, likely due to different underlying permission contexts or retrieval mechanisms.

The cause of this specific "NotFound" error is the lack of the Prompt Template Manager permission set for the user or profile performing the metadata retrieval. Without this permission, Salesforce's Metadata API cannot correctly retrieve the GenAiPromptTemplate metadata, leading to the corrupted reference in the Flow.

Resolution

To resolve this error when using GenAiPromptTemplate in your flows, ensure your comparison is running on API version is 60 or higher, then follow these steps:

  1. Grant the "Prompt Template Manager" Permission Set:

    • Ensure that the user or integration profile used for retrieving and deploying metadata (e.g., the user account connected to your Gearset account) has the Prompt Template Manager permission set assigned.

    • This permission set grants the necessary access to view and manage Einstein Prompt Templates.

  2. Re-retrieve Metadata from the Source org:

    • After assigning the permission set, perform a fresh metadata retrieval of the affected Flow and the GenAiPromptTemplate from your source organization.

  3. Include GenAiPromptTemplate in the deployment package:

    • Verify that the GenAiPromptTemplate referenced by your Flow is included in your deployment package or in the target environment.

    • Ensure your CI job filters are configured to include GenAiPromptTemplate metadata type, especially when deploying via Gearset Pipelines.

  4. Redeploy the Flow

By following these steps, you should be able to successfully deploy your Flows that reference GenAiPromptTemplate components without encountering the "NotFound" validation error.

Disclaimer: This error is returned by Salesforce directly, rather than Gearset. Even so, we offer guidance based on our combined experience with the Metadata API. Where possible, we try to help guide you to fix or avoid this error. In the case that this isn't possible, we may need to direct you to Salesforce support for further clarification.

Did this answer your question?