I am unable to move my latest version of a flow to another environment. The latest version is number 29.

When I use this command:

sfdx force:source:retrieve -m "Flow:My_Flow-29" -u dev

I get the this response:

=== Retrieved Source
FULL NAME                                 TYPE         PROJECT PATH
────────────────────────────────────────  ───────────  ─────────────────────────────────────────────────────────────────────────────────────────────
My_Flow                                 Flow         force-app/main/default/flows/My_Flow.flow-meta.xml

When I try to deploy I use this command:

sfdx force:source:deploy -m "Flow:My_Flow-29" -u staging

I get the following response:

=== Deployed Source
No results found

If I try the same above but without specifying the version number (i.e. sfdx force:source:deploy -m "Flow:My_Flow") I am then able to retrieve, but when I deploy I get the following error:

Invalid version number: 26

TYPE   PROJECT PATH                                                                    PROBLEM
─────  ──────────────────────────────────────────────────────────────────────────────  ──────────────────────────
Error  force-app/main/default/flowDefinitions/My_Flow.flowDefinition-meta.xml        Invalid version number: 26

How do I use the metadata API to upload the latest version of my flow?

  • Remove the <activeVersionNumber></activeVersionNumber> tag from the flowDefinition file and try deploying again.
    – dBeltowski
    Sep 9, 2022 at 20:44

1 Answer 1


I believe since API version 44 you can just remove all flow definition files from the folder and from package file and Flows get deployed with incremental versions for each env

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .