Skip to main content
All CollectionsTroubleshootingSalesforce validation errors
Resolving validation errors - "Invalid version number <x>" on FlowDefinition metadata type
Resolving validation errors - "Invalid version number <x>" on FlowDefinition metadata type

Cause and resolution to this Salesforce validation error

Mateusz Kochanowicz avatar
Written by Mateusz Kochanowicz
Updated over a month ago

Error overview

Users may come across this Salesforce validation error when deploying new Flows:
"Invalid version number <x>" - where <x> in refers to a version number of a Flow.


​Example scenario

Flow exists in the source environment, but not in the target org, and you're deploying a new Flow via API version higher than v44, and you have added FlowDefinition metadata type to your deployment package.

An example of the error message in our app would look like this:

Explanation of the error

This error is specific to deploying Flows with FlowDefinition metadata in the package when following deployment methods that were recommended before API version 44 was released.

However, with the introduction of Salesforce API version 44 and onwards, Salesforce encourages users not to use FlowDefinition metadata to define which version of the Flow is active in the org.

You can learn more on this subject from our blog post:
How Flows and Flow Definitions changed with the Salesforce Metadata API v44


Resolution

As per the guidance in our documentation on Changes to Flows in v44 of the metadata API, consider discontinuing using FlowDefiniton object to activate or deactivate Flow when making your deployments.

To quickly resolve this error - exclude FlowDefinition type from your metadata filter, or exclude failing FlowDefinition component(s) from the deployment package, and re-validate it against the target org.

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?