Get a List of Flows

Retrieve a list of flows using the Flow object in Metadata API.

This procedure uses the Salesforce CLI to interact with Metadata API. Before you begin, complete these prerequisite steps.

  1. Install the Salesforce CLI.
  2. Create a project.
  3. Authorize your org.

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.

  1. In your project directory, create a file called package.xml.
  2. Paste this code into the file.

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.

  1. At the command line, run this command to retrieve the flows in your org.

The CLI connects to Metadata API and begins to retrieve content.

  1. In your project directory, go to the force-app/main/default/flows directory. 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.