With API V5 for Flow, admins can manage their content and customize their management processes in powerful, new ways.
Use API V5 Flow for these actions.
Import Content Templates
Connect external content builders to Account Engagement
Copy content and assets between business units
Copy assets from Sandbox to Production orgs and vice versa
Basics of Salesforce Flow
Build custom user interfaces, create custom tasks, and schedule automated workflows by using Salesforce Flow.
This guide focuses on-screen flow use cases. To learn about other Salesforce Flow use cases, and to learn more about flow in general, refer to these Trailheads.
This guide assumes you have a baseline understanding of Salesforce Flow. Flow will seem familiar to users of Engagement Studio, in that it also includes:
A Visual Builder Interface using a Canvas
Top-to-Bottom Workflow using Steps
Salesforce Object Triggers (Flow doesn’t have the concept of triggers within a flow)
Three basic concepts for screen flows:
Screens - Used to Interact with User and Gather Input
Actions - Used to Retrieve Data or Execute an Action
Conditions - Used to create criteria to determine a path
Because it’s designed for general processes, Flow is more advanced than Engagement Studio. Note these capabilities.
Define objects
Add custom actions
Perform loops
Package Flows
API V5 Flow Actions
API V5 is integrated into Flow using Apex Invocable Actions, which expose the Account Engagement API to Flow.
With Flow, you can perform these general functions.
Generate Picklists
Use: A user can search for and select a record.
Input:
Object Name
Business Unit ID
Output
JSON String of Content Name, Content Record IDs
Create an Asset
Use: Creates a content record.
Action Naming Schema: Create X Record
Input:
Asset ID
Read an Asset
Use: Retrieve all the data for an asset.
Action Naming Schema: Read X Record
Input:
Asset ID
Output:
Content Record
To store the results of the Read and Create actions, each supported object needs an associated Apex Defined Object Class to represent the data in the object.
Getting Started Checklist
Access to Salesforce org with Marketing Cloud Account Engagement
User Access to build and run Flows
User Access to relevant business units
Install the latest Marketing Cloud Account Engagement Managed Package
API V5 for Flow Actions
Bulk Action Endpoints
Get My Business Unit Retrieves the list of business units relevant to a given user.
From Sandbox (Boolean) Choose to query for Business Units from the Sandbox (applicable for Sandbox-Production Bulk Asset Copy Flow).Overrides the Folder
Named Credential (String) Use for Salesforce Metadata API Access.
Picklist Output (Object List) A list of business units names and IDs.Overrides the Folder
The results only include the business units that the active user of the flow has access to.
Generate Flow Context Combine all the variables, and then generate a context that can be used as an input for all the invocable actions.
Inputs
Outputs
Additional Details
Interview Guide (String) The value of $Flow.InterviewGuide.Overrides the Folder
Named Credential to Use for Account Engagement API Access (String - Optional) API name to access cross-org Account Engagement API.Overrides the Folder
Production Business Unit ID (String - Optional)
Sandbox Business Unit ID (String - Optional)
Copy from Production to Sandbox (Boolean - Optional) True when copying from Sandbox to Production org. The default value is null.
Message (String) An action success or failure message.
Is Success? (Boolean) An action success or failure indicator.
Flow Context (FlowContextModel) The generated Flow Context.
All the fields except the Interview Guide are only applicable when copying assets from Sandbox to Production orgs and vice versa.
Get Dropdown Options Retrieves a list of options for the given object and business unit.
API Object
Inputs
Outputs
Additional Details
Multiple
Business Unit ID (String) The ID of the business unit to access.
Query Object (String) The V5 API name of the object that you want to retrieve dropdown options.
Field Parameters (String - Optional) The fields to use for the name and value for the dropdown. The default is “id, name” and, for most objects, doesn’t require a change.
Picklist Output (PickListOutput[]) The names and values of the returned object records
The action uses the API V5 query API, so it follows any query data restrictions that exist for that object. For example, the HTML field for email templates can’t be returned in a query.
Objects Supported:
email-templates
custom-fields
custom-redirects
files
folders
campaigns
tracker-domains
engagement-studio-programs
forms
form-handlers
dynamic-content
landing-pages
layout-templates
Get Email Template Retrieves the details of an Email Template.
Business Unit ID (String) The ID of the business unit to access.
Destination Business Unit ID (String) The ID of the business unit to access.
Folder ID (String) Overrides the Folder to use when creating the Engagement Studio Program.
Engagement Studio Program (EngagementStudioProgramModel) An Engagement Studio Program object record. Can pass the object returned in the Get Engagement Studio Program action as an input.
Message (String) An action success or failure message.
Is Success? (Boolean) An action success or failure indicator.
Landing Page (LandingPageModel) The newly created Landing Page.
API V5 for Flow Lightning Web Components
LWC
Purpose
Input
Output
combobox
Type ahead search with multi-select/single-select option.
label: String:
required: Boolean multiSelect: Boolean whether the combobox is multi-select or not
messageWhenInvalid: String Displays the given error with this message if necessary is true and the user doesn’t select the value.
options: PicklistOutput[]
selectedValue: String Returns selected value for single-select combobox. selectedValues: String[] Returns a list of selected values for a multi-select combobox.
previewAssets
Preview the asset in a tabular format with given data.
Displays the progress indicator (steps) on the flow screen.
API V5 for Flow Apex Defined Objects
These sections detail the unique objects provided in the API V5 for Flow toolkit.
Picklist Output
The following is a general class to store picklist values for Account Engagement objects. A picklist output includes a display value that shows the user, and a reference ID to retrieve the record the user selects.
1PicklistOutput{2 String id;3 String name;4 String domain; // to support tracker-domain picklist5}
Email Template
The Email Template model represents an Account Engagement Email Template.
You can find the provided flow, Account Engagement Bulk Asset Copy, from Setup →Flow. This default flow provides a moderately complex example of how a copy flow is built.
The flow just repeats the same basic pattern on multiple assets.
The steps are:
Determine the Business Unit that contains the assets you want to copy, and the Business Unit that you want to copy those assets into
Select the assets to copy
Read the assets to copy
Configure the assets for copying
Create the copied assets
To start, pull the available Business Units and select the source and destination.
Next, pull the picklist values used for the rest of the flow.
These queries are made to prepare for selecting and configuring the assets to copy.
Configuration
Campaigns
Folders
Tracker Domains
Assets
Email Templates
Custom Fields
Custom Redirects
Files
Engagement Studio Programs
Select the assets to copy and validate to ensure a copy can occur.
A screen presents a dropdown for each asset using a multi-select picklist, allowing for multiple options per dropdown.
If any assets are selected, the process continues to read the assets.
The following loops, repeated for each asset, pull the asset data from the source business unit.
The loop goes through each asset selected and reads its record from the source business unit, adding it to a new collection.
The loop repeats for each asset so that all the data for copying is available for later steps.
After all the information is read, summary information is presented to confirm the correct files are copied.
From here, configure the campaign, folder, and tracker domain to use in the destination business unit.
The second set of loops go through each copy request and creates the record in the destination business unit.
The loop cycles through the selected asset records, using the field settings as input to the copy action.
The final step records the new records ID and provides success confirmation.
The same patterns apply for custom flows, only with a different set of loops to build a different bulk copy flow. With custom flows, you can also remove the loop to create copies one at a time.
General Use Cases
Note: We recommend an understanding of the standard flow before attempting a custom flow.
Cross-Business-Unit Asset Copy
Create a custom copy flow to move the right assets between business units. The standard process for a copy is to select the assets to copy, read the assets, and then create the assets using the read data.
Integrate an External Builder
Select an asset in an external location and copy it into Account Engagement.
Note: This use case requires an invocable action be built for the external builder service to retrieve the desired content.
After the content is received, the remainder of the flow is the same.
Configure the asset.
Create the asset.
Embed an Asset into Another Asset
Select an asset URL to embed into another piece of content.
This use case is more advanced and requires development to parse and embed the desired content. However, it’s possible to read the URL for forms, files, and custom redirects to embed them into HTML.
Package a Flow
Flows built with API V5 for Flow can be packaged, so you can share them via AppExchange or make it easy to install into production.
The process of packaging a flow is the same as other packages. Under Salesforce Setup, go to Package Manager, and follow these steps.