Import and Export Flows between Salesforce Orgs

Import and Export Flows between Salesforce Orgs

Created by Eric Smith


This Post was most recently updated on: 3/21/23
Current Version: 2.0.2

3/21/23 – Eric Smith – Version 2.0.2
Uses the BasePack version of the Flow Picker instead of the stand-alone version

3/18/23 – Eric Smith – Version 2.0.1
Updated to use the current versions of the Flow Base Packs
Intallation updated to use Unlocked Package links


Have you ever wanted to copy or move a Flow or Process Builder from one org to another without having to create a Change Set or rebuild it from scratch?

How about seeing a great Flow that you or someone else has created and would like to share?

Install this Flow in your org if you would like to Export or Import Flows and Process Builders.

Instructions

Export a Flow

  1. Select SetupProcess AutomationFlows
  2. Open Import/Export Flows
  3. Run the Flow
  4. Select Export, choose your Flow and click Next
  5. You will see the export status while the Flow is being transferred
  6. A success message will display once the Flow has been exported
  7. The exported Flow is saved as a Salesforce File linked to your User record.  To see your Files, click on the Waffle, type in Files and select Files.
  8. To download and save your Flow file so it can be shared, select the drop-down arrow and choose Download.

Import a Flow

  1. Select SetupProcess AutomationFlows
  2. Select Import/Export Flows
  3. Run the Flow
  4. Select Import then click on Upload Files
  5. Pick the Flow file from your computer’s file dialog box.  Hint: The file names for Flows and Process Builders will end with .flow-meta.xml
  6. After the file has been uploaded, select Done then click Next
  7. You will see the status while the Flow is being imported and then deployed to the current org
  8. A success message will display once the Flow has been imported and deployed

NOTE: Objects, fields and referenced components must be available and compatible in the new org in order for the Flow to be deployed successfully.


Installation

Step 1

This component requires that you first install or upgrade the Flow Base Packs

Step 2

This component also requires that you first install or upgrade the Flow List Picker Version 1.5.0 or later

Step 3

Install the Flow Import/Export package

Production or Developer Version 2.0.2
Sandbox Version 2.0.2

Step 4

Because this component uses Metadata APIs, you’ll need to have a Remote Site Setting in the org. If you don’t, you’ll see an error like this the first time you try to Import or Export a Flow.

You will need to configure your org to essentially allow applications to run that call out to the internet and then back into the same org via its API endpoints.

The best way to get the correct endpoint is to force the error.

  1. Select SetupProcess AutomationFlows
  2. Open Import/Export Flows
  3. Run the Flow
  4. Select Export, choose your Flow and click Next

If you do not have the correct Remote Site Setting yet, the Flow will display the “Unauthorized endpoint” error.  Copy the endpoint url listed in the error message as you will need it in the next few steps.

In Setup, type remote, select Remote Site Settings and click New Remote Site.

Give the Remote Site a name, paste in the url you copied from the error message and click Save.

That’s it.  The App is ready to go!


Source Code

Source Code


Release Notes:

3/21/23 – Eric Smith – Version 2.0.2
Uses the BasePack version of the Flow Picker instead of the stand-alone version

Production or Developer Version 2.0.1
Sandbox Version 2.0.1

3/18/23 – Eric Smith – Version 2.0.1
Refactored to use the latest Flow Base Packs
Intallation updated to use Unlocked Package links

1/2/21 – Eric Smith – Version 1.2
Refactored the Flow to use the Flow Base Packs

9/3/20 – Eric Smith – Version 1.1
Updated the Flow Base Components (v1.2.6) to resolve an issue where some Flows would generate an error on Import or Export

9/1/20 – Eric Smith – Version 1.0
Initial Release