With the release of Winter '19 (v44 of the metadata API), Salesforce have made major changes to how Flow and Flow Definitions are handled by the metadata API.

This article explains what the changes are and how to use Gearset to deploy changes to your Flows.

What are the changes?

There are changes to Flows, and to Flow Definitions.

Flows

  • Flow names no longer include the version number (e.g. instead of being called  myFlow-4 , they are just myFlow).
  • When retrieving Flows over the metadata API, Salesforce will no longer return the full set of Flow versions - it will only return the latest version.
  • When deploying a Flow, it will be created in the target as a new version, which may or may not match the version number that was in the source.
  • Flows now have a status property that tells you whether that version is active or a draft. If you deploy an active Flow, the new Flow version created in the target will be created as active, otherwise it will be a draft.

Flow Definitions

  • FlowDefinition metadata, which used to be used to define which version was active, may now point to a version which doesn't exist in the target (since the versions may not match up).
  • Salesforce recommends: "In API version 44.0, we recommend upgrading your flows to flow metadata file names without version numbers and discontinue using the FlowDefinition object to activate or deactivate a flow. Then use the Flow object to activate or deactivate a flow".

See the Salesforce release notes for more information on the changes.

How does this affect deploying changes to Flows?

If your source org has a draft version of a Flow that is newer than the active version, there's no way to deploy the active version. Salesforce will only return the later draft version over the API.

Workaround using API v43

If you do need to deploy a version of a Flow that isn't the latest version, you can force Gearset to use API version 43 (Summer '18), which should mean you see the previous behaviour you're used to. 

However, if you're using any features which are new in API version 44, you may need to deploy those changes separately.

You can change the API version used by setting the API version in the Manage custom filters window.

Did this answer your question?