[SalesForce] Deploying project via SFDX spawns new Process Builder versions

We just started using VCS for all metadata changes for our orgs.

One problem we encountered is, that when we deploy changes to org via sfdx force:source:deploy, sometimes a new inactive Process Builder version is spawned, even though a Process Builder is not changed. It doesn't happen for every Process Builder, and it's not persistent sometimes a deployment spawns new version of PB every deployment, sometimes it doesnt.
The problem results in hitting Maximum flow versions reached error.

Is there a best practice storing Process Builder in VCS(Git)?

Best Answer

Is there a best practice storing Process Builder in VCS(Git)?

Ideally? Don't deploy Processes or Flows (same metadata type) to persistent orgs via Continuous Integration, because you will hit the limit sooner or later. If you use scratch orgs, they won't be affected, but the persistent org that is your metadata's ultimate destination will be.

If you are a Salesforce end user, you can probably fix the issue just by deleting old Flow versions (although there isn't a definite way to stop them from accumulating in the first place).

If you are an ISV using a 1GP packaging org, you won't be able to delete Flow versions that have been packaged, making this issue extremely serious for users of CI/CD. Additionally, each managed package version that's installed by your subscribers containing a new Flow versions accrues that version in their org, so 50 total upgrades will result in a non-upgradeable subscriber org.

I've discussed this issue with the Flow PM and engineering team (I work on managed packages at Salesforce.org) and they are evaluating ways to address it in the future (safe harbor, no timeline available at present).

Related Topic