6

I usually use SFDX to retrieve all of the metadata from my sandbox. I usually work on this in VSCode.

Right now I'm trying to use SFDX in VSCode to retrieve a flow so I can test that flow in another sandbox.

However, when I retrieve the data using "sfdx force:mdapi:retrieve" there is no associated metadata/xml for that flow.

And then during deployment, it says "MissingContentOrMetadataFile: Expected file at path: ..."

Does anyone know how I might properly move this flow from one sandbox to another? What is the best way?

Note: The Flow is not active.

3 Answers 3

11

before retrieve and push the flows , you have to connect source org and target org from vscode using cli commands. then use below commands.

retrieve the flow from source org by using below command:

sfdx force:source:retrieve -m Flow:yourflowName -o sourceorg

push the source in to target org using below command.

 sfdx force:source:deploy -o targetorg
1
  • The CLI has been updated and the correct flag is now -o for specifying the source/target org. sfdx force:source:retrieve -m Flow:flow_api_name -o source-org-alias
    – mjaggard
    Commented Sep 27, 2023 at 10:15
5

In addition to the accepted answer, you can modify your package.xml accordingly. E.g.

    <Package xmlns="http://soap.sforce.com/2006/04/metadata">
        <!-- other types removed for brevity -->
        <types>
          <members>*</members>
          <name>Flow</name>
        </types>
        <version>50.0</version>
    </Package>
-2

Add these to the standard package.xml that comes with VSCode "SFDX Create Project with Manifest".

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>*</members>
        <name>Flow</name>
    </types>
    <types>
        <members>*</members>
        <name>FlowDefinition</name>
    </types>
    <version>59.0</version>
</Package>
1
  • 2
    The only difference to Alex Nolasco's answer is the FlowDefinition. Why is this necessary? Commented Apr 2 at 21:39

You must log in to answer this question.

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