Get a List of Flows
Retrieve a list of flows using the Flow object in Metadata API.
Prerequisite
This procedure uses the Salesforce CLI to interact with Metadata API. Before you begin, complete these prerequisite steps.
Step 1: Create a Manifest File
Before you can retrieve data from Metadata API, you must create a manifest file. This file specifies the type of information that you want to interact with.
- In your project directory, create a file called
package.xml. - Paste this code into the file.
1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3 <types>
4 <members>*</members>
5 <name>Flows</name>
6 </types>
7 <version>60.0</version>
8</Package>Step 2: Retrieve the Flows
After you create the manifest file, you can execute a command to retrieve the flows. The Salesforce CLI connects to your target org and downloads the objects that are specified in the manifest file.
- At the command line, run this command to retrieve the flows in your org.
1sf project retrieve start --manifest package.xmlThe CLI connects to Metadata API and begins to retrieve content.
- In your project directory, go to the
force-app/main/default/flowsdirectory. The directory contains an XML file for each flow in your org.
Flows that are associated with campaigns follow the naming format flow_{campaignId}_{epochTimeMs}.flow-meta.xml. In this naming format, {campaignId} is the unique ID of the campaign ID that the flow is associated with. {epochTimeMs} is the date and time when the campaign was created, expressed as a Unix timestamp with milliseconds.