KEMBAR78
Extend Click Automate | PDF | Business Process | Workflow
0% found this document useful (0 votes)
121 views715 pages

Extend Click Automate

Uploaded by

Vishwanath Patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
121 views715 pages

Extend Click Automate

Uploaded by

Vishwanath Patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 715

Automate Your Business

Processes
Salesforce, Summer ’22

@salesforcedocs
Last updated: June 2, 2022
© Copyright 2000–2022 salesforce.com, inc. All rights reserved. Salesforce is a registered trademark of salesforce.com, inc.,

as are other names and marks. Other marks appearing herein may be trademarks of their respective owners.
CONTENTS

AUTOMATE YOUR BUSINESS PROCESSES . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1


Which Automation Tool Do I Use? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Migrate to Flow Tool Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Salesforce Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Orchestrator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
Approvals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586
Einstein Next Best Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639
Perform Automated Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690

INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711
AUTOMATE YOUR BUSINESS PROCESSES

Instead of relying on your users to perform each part of a business process, automate it! The benefits are two-fold: your users can spend
their time on other tasks, and you can trust that the process is always done just so. Salesforce offers tools to automate several kinds of
business processes: guided visual experiences, behind-the-scenes automation, and approval automation. You'll be happy to know that
these tools don't require you to write code—they're all point-and-click.

Which Automation Tool Do I Use?


Salesforce provides multiple tools to automate your organization’s repetitive business processes: Approvals, Process Builder, Workflow,
and Flow Builder.
Migrate to Flow Tool Considerations
Review considerations and supported workflow rules for the Migrate to Flow tool. Learn manual conversion methods for specific
workflow rules.
Salesforce Flow
No matter whether they’re buying movie tickets, paying bills, or changing restaurant reservations, if a customer is interacting with
a company, they expect a seamless, personalized experience. Salesforce Flow provides declarative process automation for every
Salesforce app, experience, and portal with two point-and-click automation tools: Process Builder and Flow Builder.
Orchestrator
As your company grows, so does the complexity of your workflows. Processes often require input from multiple users in multiple
departments across multiple time zones. This increased complexity results in an increased amount of time spent waiting for each
person to complete their task in the proper order.
Workflow
Workflow lets you automate standard internal procedures and processes to save time across your org. A workflow rule is the main
container for a set of workflow instructions. These instructions can always be summed up in an if/then statement.
Approvals
It’s likely that you’re familiar with process automation in the form of workflow rules. Approvals take automation one step further,
letting you specify a sequence of steps that are required to approve a record.
Einstein Next Best Action
Display the right recommendations to the right people at the right time with Einstein Next Best Action. Create and display offers
and actions for your users that are tailored to meet your unique criteria. Develop a strategy that applies your business logic to refine
those recommendations. Your strategy distills your recommendations into a few key suggestions, like a repair, a discount, or an
add-on service. Display the final recommendations in your Lightning app or Experience Builder site.
Perform Automated Actions
An automated action is a reusable component that performs some sort of action behind the scenes—like updating a field or sending
an email. Once you create an automated action, add it to a process, milestone, or other automated process.

1
Automate Your Business Processes Which Automation Tool Do I Use?

Which Automation Tool Do I Use?


Salesforce provides multiple tools to automate your organization’s repetitive business processes:
EDITIONS
Approvals, Process Builder, Workflow, and Flow Builder.
The best automation tool for your needs depends on the type of business process that you’re Available in: Lightning
automating. Experience and Salesforce
Classic

Processes and flows are


How a Record Gets Approved available in: Essentials,
For example, when an employee requests time off, that time has to be approved by the employee’s Professional, Enterprise,
manager. You need to ensure that when a time-off request is submitted for approval, the right Performance, Unlimited,
person (the employee’s manager) receives the request. and Developer Editions

To automate your organization’s processes for approving records, create approval processes. Approvals and Workflow are
available in Enterprise,
Performance, Unlimited,
What to Do When a Record Has Certain Values and Developer Editions

Three of our tools can address this use case: Workflow, Process Builder, and Flow Builder. Respectively,
these tools create workflow rules, processes, and flows.
We recommend starting with Process Builder, especially for business processes that can be simplified to if/then statements. For example:
if a case is escalated, then notify the account owner.
Process Builder includes almost all the functionality that’s available in workflow rules, and more. In fact, a single process can do what it
would normally take multiple workflow rules to do.
If the process is too complicated for the Process Builder or requires more advanced functionality, create a flow by using Flow Builder.
For example, create a flow to:
• Use complex branching logic (if certain conditions are true, evaluate for further conditions)
Example: First, check whether a case is escalated. If the case is escalated, check the account’s region and route the case accordingly.

• Sort through, iterate over, and operate on several records


Example: After an opportunity is closed and won, calculate the opportunity’s discount. Then apply that discount to all the related
opportunity products.

Getting Information from Users or Customers and Then Doing Something


with It
If you need to build a wizard to collect information, Flow Builder is the tool for you. Create a flow that displays information to and requests
information from a user. Then take the information that they enter and perform actions in Salesforce with it.
For example, create a flow that walks customer support representatives through a call script. The flow uses information that the
representative entered, such as the caller’s name and account number, to create a case that’s assigned to the right person.
You can add more complexity to the flow to match your business process. For example:
• Route the representative to different screens, depending on earlier choices. This flow prevents the representative from doing things
like trying to upsell a product to a customer who already bought that product.
• Check whether the reported problem is blocking the customer’s business and the account is high-value. If so, the flow notifies the
region director.

2
Automate Your Business Processes Which Automation Tool Do I Use?

Automation Tool Features


Here’s the breakdown of all the features and actions that are supported in each of our automation tools. Use it to figure out which tool
is best for your business needs.

Process Builder Flow Builder Workflow Approvals


Complexity Multiple if/then Complex A single if/then A single if/then statement
statements statement

Visual designer

Starts when • Record is • User clicks button or link Record is changed • User clicks button or link
changed • User accesses Lightning page, • Process or flow starts that
• Invoked by Experience Cloud site page, includes a Submit for
another process Visualforce page, or custom tab Approval action
• Platform event • User accesses item in a utility • Apex is called
message is bar
received • Process starts
• Apex is called

Supports
time-based
actions

Supports user
interaction

Supported Actions

Call Apex code

Create records Tasks only Tasks only

Invoke processes

Delete records

Launch a flow

(Pilot)1

Post to Chatter

Send email

(Email alerts only) (Email alerts only) (Email alerts only)

Send custom
notification

3
Automate Your Business Processes Equivalent Features in Flows and Workflow Rules

Process Builder Flow Builder Workflow Approvals


Send outbound
messages without
code

Submit for
approval

Update fields Any related record Any record The record or its The record or its parent
parent

1
The Process Builder has superseded flow trigger workflow actions, previously available in a pilot program. Orgs that are using flow
trigger workflow actions can continue to create and edit them, but they aren’t available for new orgs.

Equivalent Features in Flows and Workflow Rules


Features and fields in workflow rules correspond to certain things in flows. Use the equivalent features and fields to build flows that
can replace your workflow rules.
Browser Requirements
These are the web browsers supported by our automation tools.

Equivalent Features in Flows and Workflow Rules


Features and fields in workflow rules correspond to certain things in flows. Use the equivalent
EDITIONS
features and fields to build flows that can replace your workflow rules.
Available in: both Salesforce
Classic and Lightning
General
Experience

Workflow Rules Flows Available in: Essentials,


Professional, Enterprise,
Create New Rule When creating a flow, select Record-Triggered Performance, Unlimited,
Flow. and Developer Editions
Description Use the Description field. The field is available
when saving the flow.

Email Alerts Use the Action element.

Outbound Messages Use the Action element.

Rule Name Use the Flow Label field. The field is available
when saving the flow.

Select Object Use the Object field. The field is available in the
Start element, in the Select Object section.

Tasks Use the Create Records element. For How to Set


the Record Fields, select Use separate
resources, and literal values and then select
the Task object.

4
Automate Your Business Processes Equivalent Features in Flows and Workflow Rules

Workflow Rules Flows


Time Triggers Use a scheduled path. To create a scheduled path, in the Start
element, optimize the flow for Actions and Related Records.
Then, from the flow canvas, select Add Scheduled Path on the
Start node.

Evaluation Criteria
In flows, evaluation criteria are defined in the Start element, in the Set Entry Conditions section.

Workflow Rules Flows


created Trigger the Flow When:
• A record is created

created, and any time it's edited to subsequently meet criteria Trigger the Flow When:
• A record is created or updated
When to Run the Flow for Updated Records:
• Only when a record is updated and meets the condition
requirements

created, and every time it's edited Trigger the Flow When:
• A record is created or updated
When to Run the Flow for Updated Records:
• Every time a record is updated and meets the condition
requirements

To manually convert workflow rules with unsupported use cases in entry criteria, use the Decision element.
1. Create a Decision element inside the Flow as the first step.
2. Recreate the workflow rule steps with the condition builder.

Note: With this method, the flow will always run and check on the decision after entering. This method can impact performance
or prevent time-based workflow triggers from migrating.

Rule Criteria
In flows, rule criteria are defined in the Start element, in the Set Entry Conditions section.

Workflow Rules Flows


Run this rule if the criteria are met For Condition Requirements, select All Conditions Are Met (AND)

Run this rule if the formula evaluates to true N/A

5
Automate Your Business Processes Equivalent Features in Flows and Workflow Rules

Field Updates
In flows, field updates are done using the Update Records element. In the Update Records element, for How to Find Records to Update
and Set Their Values, select Use the {object name} record that triggered the flow. In flows, you can enter values directly, or use
formulas or references for field values. You can also update multiple fields in a single flow. To improve performance, place field updates
in a flow optimized for fast field updates (before-save).
Flows don’t support field update notifications for the Owner field.
A Get Records element can be required to reference certain elements, like users or groups.

Task Fields
To create a task in a flow, use the Create Records element.

Workflow Rules Flows


Assigned To API Name
OwnerId
Field Name
Assigned To

Comments API Name


Description
Field Name
Comments

Due Date API Name


ActivityDate
Field Name
Due Date

Object API Name


WhatId
Field Name
Related To

Priority API Name


Priority
Field Name
Priority

Protected Component N/A

Status API Name


Status
Field Name
Status

6
Automate Your Business Processes Equivalent Features in Flows and Workflow Rules

Workflow Rules Flows


Subject API Name
Subject
Field Name
Subject

Unique Name N/A

Operators
Flow Builder shows only the operators that are relevant to the field. Less Than, Greater Than, Less Than or Equal,
and Greater Than or Equal, appear only for number fields.

Workflow Rules Flows


does not contain N/A

equals Equals

excludes N/A

greater or equal Greater Than or Equal (only number fields)

greater than Greater Than (only number fields)

includes N/A

less or equal Less Than or Equal (only number fields)

less than Less Than (only number fields)

N/A Ends With

N/A Is Null

N/A Is Changed

not equal to Does Not Equal

starts with Starts With

within N/A

To manually convert workflow rules that use the does not contain operator, use custom condition logic. For example, create a
condition that uses the Contains operator in the first condition, and in the condition logic, enter NOT 1.

SEE ALSO:
Migrate to Flow Tool Considerations
Migrate to Flow Tool Considerations

7
Automate Your Business Processes Browser Requirements

Browser Requirements
These are the web browsers supported by our automation tools.
Supported Browsers
• Google Chrome™ (latest stable version)
• Mozilla® Firefox® (latest stable version)
• Microsoft® Edge (latest stable version)
• Apple® Safari® (latest stable version)
Microsoft® Internet Explorer® isn’t supported.

Note: The browser vendor defines latest for their own browser. Check with your browser vendor to determine the latest
version available.
Screen Resolution
The minimum screen resolution required is 1024 x 768. We recommend using a width of at least 1200.

Migrate to Flow Tool Considerations


Review considerations and supported workflow rules for the Migrate to Flow tool. Learn manual
EDITIONS
conversion methods for specific workflow rules.
Available in: both Salesforce
Classic and Lightning
Considerations Experience
If a workflow rule contains only field updates, the tool converts it into a fast field update (before-save)
Available in: Essentials,
flow. Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
Supported Workflow Rules
The Migrate to Flow tool supports workflow rules that contain these items.
• Field-based criteria
• Field updates
• Email alerts
• Outbound messages
• Time-dependent workflow actions
• Rule criteria formula that's set to true (unless evaluation criteria is also set to created, and any time it's edited to subsequently meet
criteria)
• Equal to null
• Not equal to null
• Rule criteria formula
Workflow rules that contain the following can't migrate with the Migrate to Flow tool.
• Criteria with no defined workflow actions
• Global variable fields
• Fields on related records

8
Automate Your Business Processes Salesforce Flow

• Record types
• The does not contain, includes, excludes, or within operators
• The greater than, greater or equal, less than, less or equal operators on picklist fields
• Formulas that use Hour, Minute, Second, TimeNow, TimeValue, IsClone, or $RecordType
• Tasks
• Relative date values in date fields
• Multiple currencies

Manual Conversion Methods


Certain features are unsupported by the Migrate to Flow tool, but you can manually convert them.
To manually convert workflow rules with unsupported use cases in entry criteria, use the Decision element.
1. Create a Decision element inside the Flow as the first step.
2. Recreate the workflow rule steps with the condition builder.

Note: With this method, the flow will always run and check on the decision after entering. This method can impact performance
or prevent time-based workflow triggers from migrating.

To manually convert workflow rules that use the does not contain operator, use custom condition logic. For example, create a
condition that uses the Contains operator in the first condition, and in the condition logic, enter NOT 1.
To manually convert workflow rules that use tasks, use the Create Records option and create a record of the Task object.
Flows support workflow actions for Email Alerts and Outbound Messages. To add these workflow actions to a flow, use the Action
element.
To replicate relative date values, such as TODAY or NEXT WEEK, use the Decision element.

SEE ALSO:
Equivalent Features in Flows and Workflow Rules
Equivalent Features in Flows and Workflow Rules

Salesforce Flow
No matter whether they’re buying movie tickets, paying bills, or changing restaurant reservations,
EDITIONS
if a customer is interacting with a company, they expect a seamless, personalized experience.
Salesforce Flow provides declarative process automation for every Salesforce app, experience, and Available in: both Salesforce
portal with two point-and-click automation tools: Process Builder and Flow Builder. Classic and Lightning
Experience
Process Builder Available in: Essentials,
Many of the tasks you assign, the emails you send, and other record updates are vital parts of Professional, Enterprise,
your standard processes. Instead of doing this repetitive work manually, you can configure Performance, Unlimited,
processes to do it automatically. Process Builder helps you automate your business processes and Developer Editions
and gives you a graphical representation as you build it.

9
Automate Your Business Processes Process Builder

Flows
A flow is the part of Salesforce Flow that collects data and performs actions in your Salesforce org or an external system. Salesforce
Flow provides two types of flows: screen flows and autolaunched flows.

Process Builder
Many of the tasks you assign, the emails you send, and other record updates are vital parts of your
EDITIONS
standard processes. Instead of doing this repetitive work manually, you can configure processes to
do it automatically. Process Builder helps you automate your business processes and gives you a Available in: both Salesforce
graphical representation as you build it. Classic and Lightning
Process Builder supports three types of processes for your automation needs. The type determines Experience
what triggers the process.
Available in: Essentials,
• A record change process starts when a record is created or updated. Professional, Enterprise,
• An event process starts when a platform event message is received. Performance, Unlimited,
and Developer Editions
• An invocable process starts when something else, like another process, invokes it.
Each process consists of:
• Criteria that determine when to execute an action group.
• Action groups, which consist of immediate or scheduled actions. Only record change processes support scheduled actions.

Process Builder vs. Workflow


Use the more powerful and flexible Process Builder to perform the same actions as Workflow. With Process Builder, you can:
• Create a record of any object type
• Update any related record—not just the record or its parent
• Use a quick action to create a record, update a record, or log a call
• Invoke a process from another process
• Launch a flow—you can’t schedule this action with workflow
• Send an email
• Send a custom notification
• Post to Chatter
• Submit a record for approval
If you need your process to do more than what process actions allow, don’t worry. You can also call Apex or a flow from a process.

Examples of Processes
See how Process Builder can make automating your business processes super easy.
Process Limits and Considerations
Before you start creating, managing, and activating processes, understand the limits and considerations.
Setting Values in the Process Builder
Throughout the Process Builder, you need to set values, for example, to set conditions in a criteria node, to set the fields on a new
case in a Create a Record action, or to specify an Apex method to reference.
Setting Advanced Options in the Process Builder
The Process Builder lets you choose some advanced options for executing actions in your processes.

10
Automate Your Business Processes Process Builder

Create a Process
To create a process, define its properties and which records it should evaluate, and then add criteria nodes and actions.
Troubleshoot Processes
Use the error messages that appear in the Process Builder and the emails you receive when a process fails to help solve problems
that arise when you’re working with processes. When all else fails, look at the Apex debug logs for your processes.

SEE ALSO:
Which Automation Tool Do I Use?

Examples of Processes
See how Process Builder can make automating your business processes super easy.
EDITIONS

Sample Process: Opportunity Management Available in: both Salesforce


This example automates a single business process by using the Process Builder instead of Classic and Lightning
workflow rules. Experience

Sample Process: Printer Management Available in: Essentials,


The example demonstrates how you can use Process Builder to subscribe to and evaluate a Professional, Enterprise,
platform event. Performance, Unlimited,
and Developer Editions
Sample Process: Managing Documents
This example uses Process Builder to manage documents in Salesforce. The example moves a
document to a shared folder in Quip whenever the record that the document is associated with is created or updated. This process
ensures that the documents associated with a Salesforce record object are always available to users who have access to the shared
folder.

Sample Process: Opportunity Management


This example automates a single business process by using the Process Builder instead of workflow
EDITIONS
rules.
The example demonstrates how you can use the Process Builder to automate a single process by Available in: both Salesforce
adding multiple groups of criteria and then associating individual actions with those criteria. In Classic and Lightning
addition, some actions are available with the Process Builder that you can’t perform with workflow Experience
rules, such as creating records.
Available in: Essentials,
In this example, the process is defined to start when an opportunity record (1) is created or edited. Professional, Enterprise,
Performance, Unlimited,
Three criteria nodes are then set up to check whether a high-value deal was won (2), a high-value
and Developer Editions
deal was lost (3), or a quote was given (4). For the first criteria node that evaluates to true, the
associated action group is executed.

11
Automate Your Business Processes Process Builder

The High Value Deal Won criteria checks whether the opportunity’s stage is closed and won and also whether the opportunity’s amount
is greater than $1,000,000.00. If both of these conditions are met, the associated action group is executed. For this criteria node, three
immediate actions (5) and one scheduled action (6) are defined.
These actions:
• Create a draft contract record that's associated with the opportunity’s account.
• Congratulate the opportunity owner for closing and winning the opportunity by posting to the Sales Chatter group.
• Notify the VP of sales via email that the opportunity was closed and won.
• Create a high priority follow-up task for the associated account’s owner, which is scheduled to execute six days after the opportunity’s
Close Date.
If the High Value Deal Won criteria conditions aren’t met, the associated group of actions doesn’t execute and the next criteria node
(High Value Deal Lost) is evaluated.
The High Value Deal Lost criteria node checks whether the opportunity stage is closed and lost and whether the opportunity amount
is greater than or equal to $1,000,000.00. If these conditions are true, we’ve set up an action (7) to notify the VP of sales by creating a
chatter post on the opportunity record. The post identifies the opportunity and the opportunity amount that was lost.
If neither of the previous criteria conditions are met, the next criteria node defined in this process checks whether the opportunity stage
is set to “Proposal/Quote Given.” If this condition is true, a scheduled action (8) is executed three days after the record is updated. The
scheduled action creates a follow-up task for the opportunity owner to make a call to inquire about the opportunity.
Using the Process Builder, we’ve combined three criteria nodes and associated actions into a single, automated process. To automate
the same business process with workflow, you would have to create three different workflow rules and use Apex triggers to create the
contract record and post to the Sales Chatter group.

12
Automate Your Business Processes Process Builder

Sample Process: Printer Management


The example demonstrates how you can use Process Builder to subscribe to and evaluate a platform
EDITIONS
event.
Using platform events and the Salesforce REST API, your printer publishes a Printer Status event at Available in both Salesforce
the end of each work day. This event includes the printer’s serial number, how much ink and paper Classic and Lightning
it has, and how many pages it has printed in total. Experience

When Salesforce receives the Printer Status event, your Printer Management process uses the serial Available in: Performance,
number to find a matching asset in your Salesforce org. Unlimited, Enterprise, and
Developer Editions

If the process finds a match, it evaluates the event’s data.


• The first criteria always update the asset’s print count.
• The second criteria checks if the ink is low. If so, it launches a flow that orders more ink and assigns a service technician to install the
ink cartridge.
• The third criteria checks if the paper is low. If so, it launches a flow that orders more paper and assigns a service technician to add
the paper.

13
Automate Your Business Processes Process Builder

SEE ALSO:
Platform Events Developer Guide: Considerations for Defining and Publishing Platform Events

Sample Process: Managing Documents


This example uses Process Builder to manage documents in Salesforce. The example moves a
EDITIONS
document to a shared folder in Quip whenever the record that the document is associated with is
created or updated. This process ensures that the documents associated with a Salesforce record Available in: both Salesforce
object are always available to users who have access to the shared folder. Classic and Lightning
In the example, it is assumed that: Experience

• The Account object has a custom field labeled Quip Account Plan Doc (API name Available in: Essentials,
Quip_Account_Plan_Doc__c). For each account, the custom field stores the URL of an associated Professional, Enterprise,
document that contains a plan for the account. Performance, Unlimited,
• All the Account Plan documents are in a shared folder. The folder’s URL is and Developer Editions
https://acme.quip.com/123FakeURL456.

14
Automate Your Business Processes Process Builder

The process starts when an Account record (1) is created or updated.

The criteria (2) checks whether the value of the Quip Account Plan Doc custom field has changed and whether the field isn't null. If both
conditions are true, an immediate action (3) moves the Quip Account Plan doc to the specified shared folder. Let’s dig a little deeper
into the criteria and action in this sample process.
The criteria’s Set Conditions section defines which conditions must be met in the Quip Account Plan Doc field to move a document.
There are two conditions: that the Quip Account Plan Doc field isn’t null and that it’s changed. The Field column requires the full API
name of the field, in this case, [Account].Quip_Account_Plan_Doc__c. The Conditions section specifies that all the conditions must be
met to execute the action.

15
Automate Your Business Processes Process Builder

For the action definition, you select Quip for Action Type to view the Quip-related actions. Enter an Action Name (Move Doc to
Folder in our example) then select the action (Add Document to Folder). The Document URL is a field reference to the custom field
([Account].Quip_Account_Plan_Doc__c) that contains the URL of the document to move. The Folder URL is a String type that specifies
the URL of the shared folder.

16
Automate Your Business Processes Process Builder

Process Limits and Considerations


Before you start creating, managing, and activating processes, understand the limits and
EDITIONS
considerations.
Available in: both Salesforce
Process Limits Classic and Lightning
When building processes, keep shared limits and Apex governor limits in mind. In addition, a Experience
process’s API name must be unique across all processes and flows in your Salesforce org. Available in: Essentials,
Process Usage-Based Entitlements Professional, Enterprise,
Like feature licenses, usage-based entitlements don’t limit what you can do in Salesforce; they Performance, Unlimited,
add to your functionality. If your usage exceeds the allowance, Salesforce will contact you to and Developer Editions
discuss additions to your contract. In the meantime, your processes continue to run as usual.
When Do Processes Evaluate Record Changes?
Processes start automatically and are invisible to the user. Before you design or activate a process, understand which changes trigger
processes.
Considerations for Designing Processes
Before you design a process, understand the limitations and guidelines.
Considerations for Managing Processes
Understand what happens when you install, activate, or delete processes.
Considerations for Deploying Processes
Keep these considerations in mind when deploying processes, such as when using packages or change sets.
Considerations for Processes in Transactions
Each process runs in the context of a transaction. A transaction represents a set of operations that are executed as a single unit. When
a process is triggered more than once in a single transaction, Salesforce executes similar actions in one batch.

Process Limits
When building processes, keep shared limits and Apex governor limits in mind. In addition, a
EDITIONS
process’s API name must be unique across all processes and flows in your Salesforce org.
Available in: both Salesforce
Limits Shared with Other Features Classic and Lightning
Experience
Processes share some limits with rules and flows.
Available in: Essentials,
Essentials or Enterprise, Professional, Enterprise,
Professional Unlimited, Performance, Unlimited,
Edition Performance, and Developer Editions
Per-Org Limit
or
Developer
Edition
Active record change processes and rules per object 50 50
Rules include workflow rules, escalation rules, assignment rules,
and auto-assignment rules.

Total processes 5 per process 4,000 per


type process type

17
Automate Your Business Processes Process Builder

Essentials or Enterprise,
Professional Unlimited,
Per-Org Limit
Edition Performance, or
Developer Edition
Active processes 5 per process type 2,000 per process
type

Criteria nodes that are evaluated and actions that are executed at runtime per process 2,000 2,000

Groups of scheduled actions that are executed or flow interviews that are resumed per 1,000 1,000
hour

Combined total of these automations that start or resume based on a record’s field value. 20,000 20,000
• Resume events that are defined in active flows
• Groups of scheduled actions that are defined in active processes
• Time triggers that are defined in active workflow rules
• Inactive flow interviews that are resumed

The daily limit for emails sent from email alerts is 1,000 per standard Salesforce license per org, except for Developer Edition orgs. For a
Developer Edition org, the daily workflow email limit is 15 per standard Salesforce license. The overall org limit is 2,000,000, which is
shared across all features that use workflow email alerts: workflow rules, approval processes, flows, and processes.

Apex Governors and Limits for Processes


Salesforce strictly enforces limits to ensure that runaway processes don’t monopolize shared resources in the multitenant environment.
Processes are governed by the per-transaction limits that are enforced by Apex. If a process launches other automation in the same
transaction, that automation shares the process transaction’s limits. If the process or its launched automation causes the transaction to
exceed governor limits, the system rolls back the entire transaction. For details about the operations that are included in the transaction,
see Triggers and Order of Execution in the Apex Developer Guide.

Description Per-Transaction Limit


Total number of SOQL queries issued 100

Total number of records retrieved by SOQL queries 50,000

Total number of DML statements issued 150

Total number of records processed as a result of DML statements 10,000

Maximum CPU time on the Salesforce servers 10,000 milliseconds

Each Create a Record action uses one DML statement. Each Quick Action action uses one DML statement. Each Update Records action
uses one SOQL query and one DML statement. Each Flows action can use multiple SOQL queries and DML statements, depending on
the elements that the flow executes. For details, see Per-Transaction Flow Limits on page 206.

Limits for Creating and Managing Processes


Consider these limits when creating and managing processes.

18
Automate Your Business Processes Process Builder

Per-Process Limit Value


Total characters in a process name 255

Total characters in a process’s API name 79

Total versions of a process 50

Total criteria nodes in a process 200

Process Usage-Based Entitlements


Like feature licenses, usage-based entitlements don’t limit what you can do in Salesforce; they add
EDITIONS
to your functionality. If your usage exceeds the allowance, Salesforce will contact you to discuss
additions to your contract. In the meantime, your processes continue to run as usual. Available in: both Salesforce
For per-month entitlements, your contract determines the start and end of the month. You can Classic and Lightning
view the start and end dates for your org’s usage-based entitlements on the Company Information Experience
page in Setup.
Available in: Essentials,
Note: Professional, Enterprise,
Performance, Unlimited,
• When a process built in Process Builder launches a flow, both the process and the flow and Developer Editions
count toward your allocation of flow interviews.
• If you enable recursion for a process built in Process Builder, a separate flow interview
starts each time the process evaluates a record. Each flow interview counts toward your
allocation of flow interviews.

This table describes the free allocations that are granted based on your org’s edition.

Per-Org Usage-Based What’s Counted Essentials Performance Enterprise


Entitlement and and and
Professional Developer Unlimited
Editions Editions Editions
Maximum paused and waiting Paused flow interviews and groups of 30,000 50,000 50,000
flow interviews scheduled actions from processes

Maximum flow interviews without Interviews of flow types that can’t have 10,000,000 10,000,000,000 10,000,000,000
UI per month screen elements, such as autolaunched
flows, transaction security flows, and
processes built in Process Builder

19
Automate Your Business Processes Process Builder

If you have questions about increasing your allocation, contact your Salesforce account executive.

SEE ALSO:
Usage-Based Entitlements
View Your Salesforce Org’s Usage-Based Entitlements
Reevaluate Records in the Process Builder
Flow Types
How Does Salesforce Process Scheduled Actions?

When Do Processes Evaluate Record Changes?


Processes start automatically and are invisible to the user. Before you design or activate a process,
EDITIONS
understand which changes trigger processes.

Important: Where possible, we changed noninclusive terms to align with our company Available in: both Salesforce
value of Equality. We maintained certain terms to avoid any effect on customer Classic and Lightning
Experience
implementations.
A record change can apply to more than just processes. When a record is created or edited, Salesforce Available in: Essentials,
evaluates whether to run other setup items, such as validation rules on the record. Salesforce Professional, Enterprise,
evaluates the setup items in this order. Performance, Unlimited,
and Developer Editions
1. Validation rules
2. Assignment rules
3. Auto-response rules
4. Workflow rules and processes (and their immediate actions)
5. Escalation rules
For more information, see Triggers and Order of Execution in the Apex Developer Guide.
When you create a process, you associate the process with exactly one object. You also specify whether to evaluate only created records
or both created and edited records. When you activate a process, it starts when a record change meets those settings.
Processes Evaluate Record Changes When:
• A record is saved or created. Processes that are created after records are saved don’t evaluate those records retroactively.
• A standard object in a master-detail relationship is reparented.
• Users synchronize records that were changed while using Connect Offline.
• Leads are converted, if the lead setting Require Validation for Converted Leads is enabled.
• Another process, workflow rule, or flow updates the record in the same save operation, if the process is configured to reevaluate
records.
Processes can reevaluate records up to five times in one save operation. In a batch update, processes reevaluate only changed
records.

Note: A record change can trigger more than one process. You can’t determine which process starts first.

Processes Don’t Evaluate Record Changes When:


• Campaign statistic fields, such as individual campaign statistics or campaign hierarchy statistics, are updated.
• Picklist values are mass replaced.

20
Automate Your Business Processes Process Builder

• Address fields are mass updated.


• Divisions are mass updated.
• Territory assignments of accounts and opportunities are modified.
• Self-Service Portal, Customer Portal, or partner portal users are deactivated.
• State and country/territory data are converted with the Convert tool.
• Values for state and country/territory picklists are modified using AddressSettings in the Metadata API.

Considerations for Designing Processes


Before you design a process, understand the limitations and guidelines.
EDITIONS
Tip: We recommend that you use the most recent stable version of Google Chrome™.
Available in: both Salesforce
Classic and Lightning
Best Practices for Designing Processes Experience
Before you design a process in Process Builder, understand the best practices. Available in: Essentials,
Process Builder Accessibility Considerations Professional, Enterprise,
Process Builder is 508-compliant, with one exception. You can’t close modal dialogs with your Performance, Unlimited,
keyboard. and Developer Editions

Considerations for Event Processes


These considerations are specific to processes that start when a platform event message is received.
Compatibility Considerations for Processes
Before you design a process, understand how processes interact with other Salesforce features, like custom objects and fields.
Process Formula Limitations
Formulas that are used as conditions in a criteria node have some limitations. If a process contains an invalid formula, you can’t save
or activate the process.
Considerations for Scheduling Process Actions
Scheduled actions are supported only in record-change processes and event processes. The scheduled time depends on the type
of schedule, whether the field changed, and whether the process was deactivated.
Considerations for Processes that Send Custom Notifications
Before you begin sending custom notifications, learn about important storage, recipient, and org limits.
Considerations for Processes That Post to Chatter
The Post to Chatter action doesn’t support Experience Cloud sites, and there are some limitations around what you put in the
message.
Considerations for Processes That Update Records
Understand what happens when you change a record owner, update the same field multiple times, or update currency fields in a
multiple currency org.

SEE ALSO:
Best Practices for Designing Processes

21
Automate Your Business Processes Process Builder

Best Practices for Designing Processes


Before you design a process in Process Builder, understand the best practices.
EDITIONS

Build in a test environment. Available in: both Salesforce


Classic and Lightning
To test whether a process is working properly, you must activate it. Build and test your processes
Experience
in a sandbox environment, so that you can identify any issues without affecting your production
data. Available in: Essentials,
Professional, Enterprise,
Performance, Unlimited,
For each object, use one automation tool. and Developer Editions
If an object has one process, one Apex trigger, and three workflow rules, you can’t reliably predict
the results of a record change.

Tip: When you replace a workflow rule with a process, deactivate the workflow rule before you activate the process. Otherwise,
you can get unexpected results, such as overwritten records or redundant email messages. This best practice also applies when
you replace an Apex trigger with a process.

Have only one record-change process per object.


Each time a record is created or updated, all record-change processes for its object are evaluated. We recommend restricting your org
to one record-change process per object. Here’s why.
• Get a consolidated view of your org’s automation for an object
With one consolidated record-change process for an object, you can see all the criteria that are evaluated each time that object’s
records are updated, as well as the actions that are performed when the criteria are met.

• Avoid hitting limits


When you consolidate your processes for one object into one master process, you also consolidate the actions in those processes.
With fewer actions, your org is less likely to hit limits, such as number of SOQL queries.

• Determine the order of operations


If you create multiple record-change processes for an object, Salesforce can’t guarantee the order in which those processes are
evaluated. When you automate everything in a single process, you explicitly set the order. The first criteria node is evaluated first,
the second criteria node is evaluated second, and so on.

Here are a couple features that can ease your path to one master process.
ISNEW()
Some automation applies only to created records. The rest applies to created and edited records. How could you possibly combine
all of them into one process? Meet the formula function that detects whether the record being evaluated was just created: ISNEW().
To add a create-only automation to a process that starts when a record is created or edited, convert the associated criterion’s
conditions to a formula. Then add && ISNEW() to your formula.
Invocable processes
Just like a process can call flows, a process can call other processes. Invocable processes are modular processes that start only when
another process tells them to.
For example, several criteria nodes in your “Account” process each evaluate some conditions, including whether the account is high
value. Move those criteria nodes, without the high-value condition that they have in common, into a “Top Account” invocable
process. Then configure your ”Account” process to invoke the “Top Account” process if the account is high value.

22
Automate Your Business Processes Process Builder

Combine actions when possible.


The more actions that a process executes, the more likely your org is to reach limits, such as the number of DML statements or total CPU
usage. Avoid creating multiple actions when a single action would do.
For example, a process updates an account’s address. Instead of creating a different action to update each individual field, create one
action to update all the address fields.

Build reusable actions.


Some process actions are always reusable: email alerts, quick actions, processes, flows, and Apex. But how do you reuse other types of
actions in multiple criteria groups or multiple processes?
• To reuse a Create a Record action or an Update Records action, build a quick action. Quick actions can be used in processes, flows,
and on record pages.
• To reuse other process actions, configure the actions in an invocable process. In the relevant criteria groups, add a Processes action
to call the invocable process. Invocable processes can be used only in processes.

Watch out for actions that overwrite previous changes.


Avoid having or be careful when multiple action groups update the same field.

Avoid generating infinite loops.


For example, an Update Records action in Process1 triggers Process2, and a Create a Record action in Process2 triggers Process1. The
looping causes your org to exceed its limits.

Make sure that immediate actions don’t cancel scheduled actions.


Pending scheduled actions are canceled when the associated criteria are no longer true. Make sure that the later immediate actions in
your process don’t unintentionally cancel pending scheduled actions.

Test as many permutations of your process as you possibly can.


As with all customizations in Salesforce, it’s important to test your work. Make sure that you test as many possibilities as you can think
of before you deploy the process to your production org.

To access external data after changing Salesforce data, use scheduled actions.
If Salesforce creates, updates, or deletes data in your org and then accesses external data in the same transaction, an error occurs. In your
processes, we recommend using a separate transaction to access data in an external system. To do so, end the prior transaction by
adding a scheduled action. For a record-change process, don't use a field-based schedule.
For example, an event process starts when it receives a platform event message from the custom platform event, Order Status. If the
order status is new, the process creates a contact and schedules an action to update the order status in the external system. The event
process doesn’t fail because the scheduled action creates a separate transaction to access the external system.

SEE ALSO:
Considerations for Designing Processes
Considerations for the ISNEW Function
Transactions and Scheduled Actions

23
Automate Your Business Processes Process Builder

Process Builder Accessibility Considerations


Process Builder is 508-compliant, with one exception. You can’t close modal dialogs with your
EDITIONS
keyboard.
Close UI Elements with the Esc key Available in: both Salesforce
Classic and Lightning
You can close modal dialogs using the Esc key on your keyboard, but you can’t close side panels.
Experience
Reorder Criteria Nodes
To reorder criteria nodes with your keyboard: Available in: Essentials,
Professional, Enterprise,
1. Select a criteria node by pressing the Space key. Performance, Unlimited,
2. Change the order of a criteria node by using the Up and Down arrow keys. and Developer Editions

3. Save your changes by pressing the Space key.


4. Cancel by pressing the Esc key.

Considerations for Event Processes


These considerations are specific to processes that start when a platform event message is received.
EDITIONS
Supported Platform Events
Processes can subscribe to custom platform events and these standard platform events. Available in both Salesforce
Classic and Lightning
• AIPredictionEvent
Experience
• BatchApexErrorEvent
Available in: Performance,
• FlowExecutionErrorEvent
Unlimited, Enterprise, and
• FOStatusChangedEvent Developer Editions
• OrderSummaryCreatedEvent
• OrderSumStatusChangedEvent
• PlatformStatusAlertEvent
Apex Actions
You can’t use an event reference to set an sObject variable in the Apex class.
Email Alerts Actions
Email alerts can’t use values from platform event messages. For the process to send an email that contains values from the platform
event message that starts the process, use this workaround.
1. Create an autolaunched flow.
2. In the flow, create a variable for each field in the platform event. Be sure to use compatible data types and make the variables
available for input.
3. In the flow, add a Send Email action, and set the action’s input variables with the flow variables.
4. In the process, add a Flows action and specify the autolaunched flow. Use event references to assign each platform event field
to its corresponding flow variable.
Flows Actions
You can’t use an event reference to set a record variable in the flow, even when the platform event is specified as the record variable’s
object. To pass values into the flow from the platform event message that starts the process, use this workaround.
1. In the flow, create a variable for each field in the platform event. Be sure to use compatible data types and make the variables
available for input.

24
Automate Your Business Processes Process Builder

2. In the process, when you add the Flows action, use event references to assign each platform event field to its corresponding
flow variable.
Associating with a Record
Use the process’s matching conditions to find exactly one record. If the process can’t find one record based on your matching
conditions—because either it found multiple records or no records—the creator of the process receives an error email. If an error
occurs, adjust the conditions in the process’s trigger to be more specific.
Publishing Event Messages
With event processes, we don’t block you from publishing the same event message that starts the process. To avoid creating an
endless loop, make sure that the new event message’s field values don’t meet the filter criteria for the associated criteria node.
If a platform event is configured to publish immediately, the process publishes each event message outside of the database transaction.
If the transaction fails and is rolled back, the event message is still published and can’t be rolled back. So if you see an informational
message under the selected platform event, consider whether you want the process to publish an event message only after the
transaction commits successfully.
Subscriptions Related List
On the platform event’s detail page, the Subscriptions related list shows which entities are waiting to receive that platform event’s
messages. The related list includes a link to each subscribed process. If flow interviews are waiting for that platform event's messages,
one “Process” subscriber appears in the Subscriptions related list.
Packaging
When you package an event process, the associated object isn’t automatically included. Advise your subscribers to create the object
or manually add the object to your package. For example, when you package an event process that’s associated with the Participants
custom object, manually add the object to your package.
Uninstalling Events
Before you uninstall a package that includes a platform event, deactivate all processes that reference the platform event.
Einstein Predictions
A prediction event is sent for each Einstein prediction result, so use process matching conditions if you want your process to be
triggered only by predictions on a specific object. For example, if your process acts only on predictions written to Lead records, add
a matching condition to check that the Lead ID field equals the AI Predicted Object ID event reference.
If your process updates a field that is used by an Einstein prediction, Einstein runs the prediction again and writes back the new
results. The new results generate a new prediction event that could trigger your process again, resulting in a loop. To avoid creating
a process loop, only update fields that aren’t used in Einstein predictions.

SEE ALSO:
Platform Events Developer Guide: Decoupled Publishing and Subscription
Platform Events Developer Guide: Platform Event Fields
Platform Events Developer Guide: Subscribe to Platform Event Messages with Processes

25
Automate Your Business Processes Process Builder

Compatibility Considerations for Processes


Before you design a process, understand how processes interact with other Salesforce features, like
EDITIONS
custom objects and fields.
Objects Available in: both Salesforce
Process Builder doesn’t support: Classic and Lightning
Experience
• Deprecated custom objects
• Signup Request — unsupported in schedules only Available in: Essentials,
Professional, Enterprise,
• Social Post
Performance, Unlimited,
• Social Persona and Developer Editions
External Objects
• External objects aren’t supported in record-change processes.
• When you create or update external object records, don’t set values for indirect lookup relationships that map to a different data
type on the external system. For example, don’t set a value for a Text indirect lookup relationship that maps to a Date value on
the external system.
Custom Fields
• Process Builder doesn’t support custom fields of type File.
• If a process references a custom field:
– You can’t delete the field.
– If you change the field type or name, the process breaks.
– If you change the field label, the process doesn’t break. But it still uses the original label.

Derived Fields
Process Builder doesn’t support fields whose values are derived from other records. Examples of derived fields include
Contact.Name and User.MediumPhotoUrl.
Polymorphic Fields
Queue labels aren't supported in process criteria. For example, you can't use [Lead].Owner:Queue.Name in process criteria.
Instead, use [Lead].Owner:Queue.DeveloperName to reference the queue's API name.
Validation Rules
• Scheduled Update Records actions skip validation rules.
• Immediate Update Records actions obey validation rules.
Shield Platform Encryption
You can’t use an encrypted field as a filter in an Update Records action.
Duplicate Rules
If a duplicate is found when a process tries to create or update a record, the process fails.
Converted Leads
To evaluate records that result from converted leads, enable the lead setting Require Validation for Converted Leads.
Formula Field Values
If a standard formula field references a field on a related object, that field's value is always null when a process starts. This limitation
doesn’t apply to custom formula fields that reference a field on a related object. For a custom formula field that uses the same
formula, the field’s value is derived when a process starts.

26
Automate Your Business Processes Process Builder

For example, the RevenueShare field on Campaign Influence calculates CampaignInfluence.Opportunity.Amount


* CampaignInfluence.Influence. Because the formula references a field on Opportunity (a related object), the field’s
value is null.
Platform Cache
When a process contains a scheduled action, make sure that later actions in the process don't invoke Apex code that stores or
retrieves values from the session cache. The session-cache restriction applies to Apex actions and to changes that the process makes
to the database that cause Apex triggers to fire.

Process Formula Limitations


Formulas that are used as conditions in a criteria node have some limitations. If a process contains
EDITIONS
an invalid formula, you can’t save or activate the process.
All formulas that are used in a criteria node must: Available in: both Salesforce
Classic and Lightning
• Return true or false. If the formula returns true, the associated actions are executed.
Experience
• Not contain more than 3,000 characters.
Available in: Essentials,
• Not contain an unsupported function.
Professional, Enterprise,
• Reference the process trigger object for that process. Performance, Unlimited,
• Use the correct capitalization when referring to the process trigger object. and Developer Editions

Tip: Parentheses aren’t included automatically when you insert a function. Be sure to add
parentheses, for example, TODAY(), when building a formula.

Unsupported Functions
If a formula in a process uses any of the following functions, the formula returns null.
• GETRECORDIDS
• IMAGE
• INCLUDE
• PARENTGROUPVAL
• PREVGROUPVAL
• REQUIRE SCRIPT
• VLOOKUP
For a complete list of operators and functions for building formulas in Salesforce, see Formula Operators and Functions by Context.

Note:
• If your process criteria uses a formula, don’t create a formula that always evaluates to true, such as 2 < 5.

27
Automate Your Business Processes Process Builder

• ISCHANGED is available as both a formula function and as an operator. When it’s used as a formula function in process criteria,
you can’t reference a child record’s related fields. For example, ISCHANGED isn’t supported when referencing a
[Case].Contact.AccountId field, but it can be used when referencing [Case].ContactId.

SEE ALSO:
Tips for Working with Picklist and Multi-Select Picklist Formula Fields
Process Builder Advanced Option Considerations
Tips for Working with Picklist and Multi-Select Picklist Formula Fields
Custom Metadata Types and Process Builder

Considerations for Scheduling Process Actions


Scheduled actions are supported only in record-change processes and event processes. The
EDITIONS
scheduled time depends on the type of schedule, whether the field changed, and whether the
process was deactivated. Available in: both Salesforce
Classic and Lightning
Process Schedule Limitations Experience
Before you add a schedule to a process, understand the limits and what isn’t supported. Available in: Essentials,
How Does Salesforce Process Scheduled Actions? Professional, Enterprise,
Understand the expected behavior for processing scheduled actions based on which type of Performance, Unlimited,
schedule they’re associated with, whether the field changed, and whether the process was and Developer Editions
deactivated.
Transactions and Scheduled Actions
Immediate actions in processes are executed in the same transaction as the operation that triggered the process, such as when a
user creates or edits a record. Scheduled actions are included in a separate transaction.

Process Schedule Limitations


Before you add a schedule to a process, understand the limits and what isn’t supported.
EDITIONS
• If an action group contains scheduled actions, you can’t continue evaluating the next criteria
in your process after executing those actions. Available in: both Salesforce
• SignupRequest processes don’t support scheduled actions. Classic and Lightning
Experience
• Field-based schedules can’t reference a Date or Date/Time field that contains automatically
derived functions, such as TODAY or NOW. Available in: Essentials,
Professional, Enterprise,
• Field-based schedules can’t reference a formula field that includes related-object merge fields.
Performance, Unlimited,
• If you add a schedule for 0 Days Before a date, when you later reopen the process, the schedule and Developer Editions
changes to 0 Days After the date. The process still executes at the specified time.

28
Automate Your Business Processes Process Builder

How Does Salesforce Process Scheduled Actions?


Understand the expected behavior for processing scheduled actions based on which type of
EDITIONS
schedule they’re associated with, whether the field changed, and whether the process was
deactivated. Available in: both Salesforce
Classic and Lightning
Limits for Processing Scheduled Actions Experience

• An org can process up to 1,000 groups of scheduled actions per hour. Available in: Essentials,
Professional, Enterprise,
Each group of scheduled actions is associated with a schedule, such as “3 days from now.” When
Performance, Unlimited,
a schedule is processed, the associated actions are executed. If an org exceeds this limit,
and Developer Editions
Salesforce processes the remaining schedules in the next hour.
For example, an org has 1,200 groups of pending actions scheduled to be processed between
4:00 and 5:00 PM. Salesforce processes 1,000 groups between 4:00 and 5:00 PM, and it processes the remaining 200 groups between
5:00 and 6:00 PM.

• An org can have up to 50,000 pending schedules and paused flow interviews at one time.

Schedules Based on the Current Time


For example: 3 days from now.
The schedule is evaluated based on the time zone of the user who created the process.

Schedules Based on a Field Value


For example: 3 days after a case’s Created Date.
Field-based schedules behave differently for record-change processes than they do for event processes.
All Processes
These considerations apply to both record-change processes and event processes.
• If a schedule evaluates to a time in the past, Salesforce executes the associated actions as soon as possible. Depending on how
many actions Salesforce is processing at the time, actions are executed within one hour.
For example, a process emails an opportunity owner seven days before the close date. The process starts for an opportunity with
the close date set to today, so Salesforce executes the scheduled action as soon as possible.

• If you set a schedule to 0 Days After a date, Salesforce executes the associated actions as soon as possible after the time
represented by the date field. Depending on how many actions Salesforce is processing at the time, actions are executed within
one hour.
• If the field referenced by a schedule has a null value, Salesforce ignores the schedule and the associated actions aren’t executed.
• When a process schedules an action, Salesforce creates a flow interview record and pauses the interview until the scheduled
time occurs. If the paused flow interview is deleted, Salesforce doesn't resume the paused flow interview, and the scheduled
action isn't executed.
Record-Change Processes
These considerations apply only to record-change processes.
When a record-change process executes a field-based schedule, Salesforce uses the field’s current value. If the value is a date/time
field, Salesforce uses the time zone of the user who created the process. If the value is a date field, Salesforce uses the org’s time
zone.

29
Automate Your Business Processes Process Builder

What Happens When the Field Value Changes?


• For processes that start when a record is created or edited:
– Actions remain scheduled only as long as the criteria for the actions are still valid. If a record no longer matches the
criteria, Salesforce cancels the scheduled actions for the record.
– If the referenced field value changes and the schedule hasn’t been processed, Salesforce recalculates the scheduled
time for the actions using the updated field value.
For example, a process emails an opportunity owner seven days before the opportunity close date. The close date is set
to 2/20/20XX, and Salesforce schedules the email to be sent on 2/13/20XX. Before the email is sent, the close date is
updated to 2/10/20XX. Salesforce recalculates the scheduled time and schedules the email to be sent on 2/3/20XX.

• For processes that start when a record is created, Salesforce never reevaluates the record associated with that process. The
scheduled time for the actions stays the same, even if the record no longer meets the associated criteria when the scheduled
actions are executed.
• If the record or object that the schedule is associated with is deleted, Salesforce cancels the scheduled actions for the record.
Limitations for Converted Leads
• You can’t convert a lead when an unexecuted schedule is based on one of the lead’s fields.
• When Validation and Triggers from Lead Convert is enabled, scheduled actions on leads aren’t executed during lead
conversion.
• If a lead is converted into a campaign member before the associated scheduled actions finish, Salesforce still executes the
scheduled actions.
Event Processes
These considerations apply only to event processes.
• When an event process executes a field-based schedule, Salesforce uses the field’s current value in the time zone of the user
who created the process.
• The scheduled time for the actions stays the same, even if the field value changes, the associated record or object is deleted, or
the record no longer meets the associated criteria.
• If the criteria are met when the process starts, Salesforce executes the scheduled actions.

What Happens When the Associated Process Is Deactivated?


After you deactivate a process, the scheduled time for pending scheduled actions stays the same. If a deactivated process has pending
scheduled actions and the record whose field the schedule is based on is changed, Salesforce recalculates the schedule for those actions.
After a process is deactivated, Salesforce ignores all other changes to the associated records.

What Happens When Scheduled Actions Fail?


If a scheduled action fails—for example, because the user who caused the process to start is inactive—the admin who created the
process receives an email with details about the failure. Salesforce makes additional attempts to execute a failed scheduled action before
canceling it.

30
Automate Your Business Processes Process Builder

Transactions and Scheduled Actions


Immediate actions in processes are executed in the same transaction as the operation that triggered
EDITIONS
the process, such as when a user creates or edits a record. Scheduled actions are included in a
separate transaction. Available in: both Salesforce
Scheduled actions aren’t performed independently. They’re batched in one transaction with other Classic and Lightning
actions that are scheduled to execute at the same time, have the same process version ID, and are Experience
executed by the same user ID. This behavior can cause you to exceed your Apex governor limits if
Available in: Essentials,
the batch’s actions execute DML operations or SOQL queries. Professional, Enterprise,
A DML operation is used each time a Salesforce record is created, updated, or deleted, such as when Performance, Unlimited,
a process executes a Create a Record action. A SOQL query is used each time Salesforce looks up and Developer Editions
information about an existing record, such as when a process executes an Update Records action.
For details on Apex governor limits, see Process Limits on page 17.
To improve performance further and help avoid Apex governor limits, design scheduled actions to take advantage of bulkification.

Tip: Design a process with a scheduled action so that it doesn’t execute mixed DML operations. A single transaction can’t mix
DML operations on data objects (such as Account), Setup objects (such as User Role), and external objects. For example, you can’t
update an account and a user role in a single transaction.
If a process has more than one group of scheduled actions and a group fails to execute in a batch:
• Prior groups of scheduled actions in that batch’s transaction are successful.
• The immediate actions for that process are successful.
• All scheduled actions in that group aren’t executed.
• Each remaining group of scheduled actions in that batch is executed in a separate transaction.

Example: Salesforce processes two groups of scheduled actions in the same batch. In the first group, one action fails, so the
process fails. Subsequent actions within the first group aren't tried. Salesforce processes the second group in a separate transaction.

Note: The execution time is now in the past, so Salesforce executes the second group of scheduled actions within 1 hour.

31
Automate Your Business Processes Process Builder

Considerations for Processes that Send Custom Notifications


Before you begin sending custom notifications, learn about important storage, recipient, and org
EDITIONS
limits.
• You can create up to 500 custom notification types. Available in: both Salesforce
• Each notification can have up to 10,000 users as recipients. However, you can add an action to Classic and Lightning
the same process within Process Builder or to the same flow in Flow Builder to have more Experience
recipients. Available in: Essentials,
• Your org saves your most recent 1 million custom notifications for view in notification trays. Professional, Enterprise,
Your org can save up to 1.2 million custom notifications, but it trims the amount to the most Performance, Unlimited,
recent 1 million notifications when you reach the 1.2 million limit. and Developer Editions

• An org can execute up to 10,000 notification actions per hour. When you exceed this limit, no
more notifications are sent in that hour, and all unsent notifications are lost. Notification actions USER PERMISSIONS
resume in the next hour.
To create, edit, or view
For example, your notification action processes are triggered 10,250 times between 4:00 and processes:
4:59. Salesforce executes the first 10,000 of those actions. The remaining 250 notifications aren’t • Manage Flow
sent and are lost. Salesforce begins executing notification actions again at 5:00.
AND
• When you send a custom notification from a process, the Target ID for the notification is the View All Data
record that started the process. However, target records that don't have their own detail page
(for example, a case comment, which appears only in a Case Comment related list) don't support
direct navigation. Use Flow Builder to send the notification from a flow and specify either a different Target ID or Target Page Reference.

Tip: To see how to specify the target using JSON, see pageReference.

• Custom notification title and body fields support plain text only.
• The content of custom push notifications depends on the Display full content push notifications setting. If full content push notifications
aren’t enabled, only the notification title is sent.

Considerations for Processes That Post to Chatter


The Post to Chatter action doesn’t support Experience Cloud sites, and there are some limitations
EDITIONS
around what you put in the message.
Unsupported Feeds Available in: both Salesforce
Processes can’t post to an Experience Cloud site user or group. Classic and Lightning
Experience
Chatter Message
• You can add up to 25 @mentions to a Chatter message. Available in: Essentials,
Professional, Enterprise,
• If you use Microsoft® Internet Explorer® version 11, you can’t paste text into a message. Copy Performance, Unlimited,
and paste actions are allowed in all other supported browsers. and Developer Editions
• Don’t start the message with a field reference, such as {![Account].Name}. Otherwise,
the action fails to save. To work around this issue, add a space at the beginning of the
message.
Deploying Processes That Post to Chatter
If your process posts to the Chatter feed of a specific user or group, the process runs only in the source org. The IDs referenced by
the Post to Chatter action don’t exist in the target org.

32
Automate Your Business Processes Process Builder

Considerations for Processes That Update Records


Understand what happens when you change a record owner, update the same field multiple times,
EDITIONS
or update currency fields in a multiple currency org.
Updating a Record’s Owner Available in: both Salesforce
Processes that update owners don’t automatically transfer the associated items. Use an Update Classic and Lightning
Records action for each type of child record that you want to transfer. Experience

For example, you want to transfer an account to a new owner. Add four Update Records actions Available in: Essentials,
to your process. The first updates the account. The second updates the child contacts. The third Professional, Enterprise,
updates the child opportunities. And the fourth updates the child contracts. Performance, Unlimited,
and Developer Editions
Multiple Updates to the Same Field
If multiple Update Records actions apply different values to the same field, the last action’s
value is used.
Multiple Currencies
If your org uses multiple currencies, the currency fields are updated using the record’s currency code. If you use a formula to update
a field, the formula values use the record’s currency code.
Inactive Users
Processes can't update records that are owned by inactive users. When you deactivate a user, also transfer that user's records to an
active user to avoid failed processes.

SEE ALSO:
Transferring Records

Considerations for Managing Processes


Understand what happens when you install, activate, or delete processes.
EDITIONS
Installed Processes
If you install a non-template process from a managed package, you can only activate or Available in: both Salesforce
deactivate it. If the process is a template, you can view and clone it, and you can edit the clone. Classic and Lightning
Experience
Active Processes
After you activate a process, you can no longer edit it. Available in: Essentials,
Deleting Processes Professional, Enterprise,
Performance, Unlimited,
You can’t delete a process when it has unexecuted groups of scheduled actions. The workaround
and Developer Editions
is to delete the unexecuted groups of unscheduled actions on page 84.

33
Automate Your Business Processes Process Builder

Considerations for Deploying Processes


Keep these considerations in mind when deploying processes, such as when using packages or
EDITIONS
change sets.
Processes That Reference Other Components Available in: both Salesforce
If you deploy a process that contains any of the following actions, the corresponding components Classic (not available in all
aren’t included in the package or change set automatically. To deploy successfully, manually orgs) and Lightning
add the referenced components to the package or change set. Experience

• Apex Change sets are available


• Email Alerts in: Professional, Enterprise,
Performance, Unlimited,
• Launch a Flow and Developer Editions
• Post to Chatter
Packages are available in:
• Quick Actions Essentials, Professional,
• Submit for Approval Enterprise, Performance,
Unlimited, and Developer
Templates
Editions
If you install a process template from a package, make sure the process is inactive unless you
want it to actively run in your org.
If you add a process template to a package, first deactivate the process unless you’re sure that installers want that process to be
active in their orgs.
Deploying Processes That Post to Chatter
If your process posts to the Chatter feed of a specific user or group, the process runs only in the source org. The IDs referenced by
the Post to Chatter action don’t exist in the target org.

SEE ALSO:
Deploy Processes and Flows as Active

Considerations for Processes in Transactions


Each process runs in the context of a transaction. A transaction represents a set of operations that
EDITIONS
are executed as a single unit. When a process is triggered more than once in a single transaction,
Salesforce executes similar actions in one batch. Available in: both Salesforce
By default, if one process in a batch fails, it causes all the processes in the batch to fail, and the Classic and Lightning
transaction rolls back. If one process in a batch fails while executing one of these actions, Salesforce Experience
attempts to save all successful record changes in the batch up to three times.
Available in: Essentials,
• Create a Record Professional, Enterprise,
• Flows (Create Records and Update Records elements only) Performance, Unlimited,
and Developer Editions
• Processes (Create a Record and Update Records actions only)
• Update Records

Example: When you upload 100 cases, the flow MyProcess_2 triggers one process for each case.
• 50 processes stop at Create a Record action Create_Task_1.
• The other 50 processes stop at Create a Record action Create_Task_2.
The result? At least two groups of bulk operations to execute.
• One for the 50 processes that execute Create_Task_1

34
Automate Your Business Processes Process Builder

• One for the 50 processes that execute Create_Task_2

Setting Values in the Process Builder


Throughout the Process Builder, you need to set values, for example, to set conditions in a criteria
EDITIONS
node, to set the fields on a new case in a Create a Record action, or to specify an Apex method to
reference. Available in: both Salesforce
Classic and Lightning
Field Picker Experience
Use the field picker to reference fields on the record that started the process or fields on related Available in: Essentials,
records. Professional, Enterprise,
Process Builder Value Types Performance, Unlimited,
When setting a value for a given field—whether on the record that started the process or a and Developer Editions
related record— the available value types are filtered based on the field that you’ve selected.
Multi-Select Picklists in the Process Builder
The Process Builder lets you select multiple values for a multi-select picklist field.

Field Picker
Use the field picker to reference fields on the record that started the process or fields on related
EDITIONS
records.

To use fields on a related record, click a field with next to the value. For example, use the Account Available in: both Salesforce
ID field value on the case’s contact account. Classic and Lightning
Experience

Available in: Essentials,


Professional, Enterprise,
Performance, Unlimited,
and Developer Editions

The field picker displays only the fields that are compatible with the selected parameter.
If you see a field multiple times, that means the field can relate to multiple objects. For example, if you created a queue for cases, a case’s
owner can be either a user or a queue. Owner ID is a polymorphic field—a field that relates to more than one object.

35
Automate Your Business Processes Process Builder

To access a field on the case’s owner, choose the appropriate relationship. Be aware that if you select Owner ID (User) and the owner
of the record is a queue, the process fails.

Note: Queue labels aren't supported in process criteria. For example, you can't use [Lead].Owner:Queue.Name in process
criteria. Instead, use [Lead].Owner:Queue.DeveloperName to reference the queue's API name.

Process Builder Value Types


When setting a value for a given field—whether on the record that started the process or a related
EDITIONS
record— the available value types are filtered based on the field that you’ve selected.
The available value types are: Available in: both Salesforce
Classic and Lightning
• Currency—Manually enter a currency value.
Experience
• Boolean—Choose a true/false boolean value.
Available in: Essentials,
• Date/Time or Date—Manually enter a date/time or date value.
Professional, Enterprise,
• Formula—Create a formula expression. Performance, Unlimited,
• Global Constant—Choose a global constant to set a value to null or an empty string—for and Developer Editions
example, choose $GlobalConstant.Null.

Note: These global constant values aren’t supported with the is null operator.
– $GlobalConstant.Null
– $GlobalConstant.EmptyString

• ID—Manually enter a Salesforce ID value, for example, 00300000003T2PGAA0.

Note: If your process is based on a user ID (for example, when an [Event].OwnerId equals a specific ID value) make sure that
the ID value is an 18-character ID and not a 15-character ID. You can convert a 15-character ID to 18 characters at
www.adminbooster.com/tool/15to18.

• Multi-Picklist—Choose one or more multi-select picklist values.


• Number—Manually enter a number value.
• Picklist—Choose a picklist value.
• Queue—Search for a specific queue in your org.
• Reference—Choose a field on the record or on a related record.
• String—Manually enter a string value.
• User—Search for a specific user in your org.

36
Automate Your Business Processes Process Builder

Multi-Select Picklists in the Process Builder


The Process Builder lets you select multiple values for a multi-select picklist field.
EDITIONS
For example, set multiple values for the Country field for a company record that operates in
Ireland, the UK, and France. Available in: both Salesforce
Classic and Lightning
You can use multi-select picklists in:
Experience
• Formulas
Available in: Essentials,
• Process criteria
Professional, Enterprise,
• Create a Record actions Performance, Unlimited,
• Quick Actions and Developer Editions
• Update Records actions
In process criteria, set multiple values by creating one condition for each individual multi-select picklist value. For example, if your process
checks whether changes were made to an account’s office locations, reference multiple values by choosing the same field for each
multi-select picklist value.

Refer to Tips for Working with Picklist and Multi-Select Picklist Formula Fields for more information.
When you reference a multi-select picklist field in an action, enter values by clicking Choose values…
Add or remove values by dragging them between the Available (1) and Selected (2) columns.

37
Automate Your Business Processes Process Builder

Keep these considerations in mind when using operators with multi-select picklists.
• You can use the Equals operator if you select only one value from a multi-select picklist field.
• If you use the Equals operator with multiple multi-select picklist values and choose the Any of the conditions are met (OR) option,
the condition matches on one value only. For example, if your process checks whether a Region field equals West or East, the condition
evaluates to true when the value is West or when the value is East, but won’t evaluate to true when both West and East are selected
values.
• If you use Contains and OR to evaluate multiple multi-select picklist values, the condition evaluates to true on multiple values. For
example, if your process checks whether a Region field contains West or East, the condition evaluates to true when a Region
field contains West and East or when a Region field contains West or East values.

Setting Advanced Options in the Process Builder


The Process Builder lets you choose some advanced options for executing actions in your processes.
EDITIONS

Process Builder Advanced Option Considerations Available in: both Salesforce


Keep these considerations in mind when choosing advanced options. Classic and Lightning
Experience
Reevaluate Records in the Process Builder
When you add objects to your process, you can choose to evaluate a record multiple times in Available in: Essentials,
a single save operation. Professional, Enterprise,
Performance, Unlimited,
Nest Processes in the Process Builder and Developer Editions
Invocable processes let you modularize sections of your processes and add more logic to them.
An invocable process is process that starts when another process invokes it. Whether a process
is invocable or not is controlled by The process starts when in the process’s properties.

38
Automate Your Business Processes Process Builder

Avoid Unwanted Actions in Processes


When you add criteria to your process, you can choose to execute actions when specified criteria change.

Process Builder Advanced Option Considerations


Keep these considerations in mind when choosing advanced options.
EDITIONS
• Avoid creating an infinite loop when allowing your process to reevaluate records. For example,
if your process checks whether an account description changes and then updates an account Available in: both Salesforce
description and creates a Chatter post every time an account record is created or edited, the Classic and Lightning
process will evaluate and trigger actions resulting in six Chatter posts. Experience
• If you choose to evaluate a record multiple times in a single save operation when you specify Available in: Essentials,
an object for your process, we recommend not setting any of your criteria to No criteria—just Professional, Enterprise,
execute the actions!. Performance, Unlimited,
• We recommend that you don’t use the advanced options if your process uses ISCHANGED, and Developer Editions
ISNEW, or PRIORVALUE formula functions. If you do use these options, keep these considerations
in mind.
– When a record is first created, ISNEW evaluates to true. If your process uses the ISNEW formula function and reevaluates a record
multiple times in a single save operation, the process may execute actions multiple times.
For example, your process checks whether an account is created or updated.
1. When ISNEW evaluates to true, the process updates the account’s annual revenue and posts to Chatter.
2. When the process updates the account’s annual revenue, the process then reevaluates the record (up to five additional
times) because the record was changed.
Each time the criteria is evaluated, ISNEW evaluates to true. The result is six Chatter posts. This example is true only if the process
is triggered because an account record is created.

– When a record is created, PRIORVALUE returns the current value as the prior value. When a record is updated, PRIORVALUE
returns the field value that was set immediately before the save operation started. If your process uses the PRIORVALUE formula
function and reevaluates a record multiple times in a single operation, the process may execute actions multiple times. If your
process reevaluates a record multiple times in a single save operation and executes actions only when specified criteria changes,
the prior value returns the values that existed before the record was saved.
For example, your process checks whether an account is created or updated.
1. When PRIORVALUE([Account].Type) = 'Prospect' evaluates to true, the process updates the account’s
annual revenue and posts to Chatter.
2. When an account is created with Prospect as the account type, the criteria is always true until the end of the process
transaction.
3. If the process is changed to update the account type to Other when the criteria is true, then for an account created with
Prospect as the account type, the formula PRIORVALUE([Account].Type) = 'Prospect' will be true
until the end of process transaction.
Each time the record is reevaluated, the prior value of the account’s type is Prospect. The result is six Chatter posts.

– ISCHANGED always evaluates to false when a record is first created.


For example, your process checks whether an account description
changes—ISCHANGED([Account].Description)—and the process also reevaluates records multiple times in a
single save operation. If an account is first created with a blank description value and another process updates the account

39
Automate Your Business Processes Process Builder

description in the same save operation, ISCHANGED evaluates to true every time the record is reevaluated because it compares
the account description value when the record was first created (a blank value) with whatever’s set for the current value.
Let’s say this same process creates a Chatter post every time ISCHANGED([Account].Description) evaluates to true. This process
would create a recursive loop resulting in six Chatter posts because ISCHANGED evaluates to true throughout the save operation.

Reevaluate Records in the Process Builder


When you add objects to your process, you can choose to evaluate a record multiple times in a
EDITIONS
single save operation.
It's kind of like using a roundabout instead of a four-way stop to control process traffic. Instead of Available in: both Salesforce
stopping and waiting for separate save operations, reevaluating records helps your business traffic Classic and Lightning
flow a little more freely. Experience

If you choose this option, the process can evaluate the same record up to five additional times in Available in: Essentials,
a single save operation. It might reevaluate the record because a process, workflow rule, or flow Professional, Enterprise,
updated the record in the same save operation. When a record is reevaluated, the process uses the Performance, Unlimited,
most recent values for that record. and Developer Editions
For example, your sales review process includes multiple steps, approvals, notifications, and fields
that need to be updated. Some of these changes may be part of your process, or they may be
managed by other workflow rules or flows in your org. If you let the process reevaluate a record multiple times in a single save operation,
you can manage and evaluate all of these changes—even changes from other processes—in a single save operation in your process.

SEE ALSO:
Process Builder Advanced Option Considerations

Nest Processes in the Process Builder


Invocable processes let you modularize sections of your processes and add more logic to them. An
EDITIONS
invocable process is process that starts when another process invokes it. Whether a process is
invocable or not is controlled by The process starts when in the process’s properties. Available in: both Salesforce
To invoke a process from another process, you configure a Processes action. That configuration Classic and Lightning
includes passing a record to the invocable process. That’s how the process knows which record to Experience
start with. Because the record is passed from one process to another, the invocable process receives Available in: Essentials,
a certain version of that record. That version differs, depending on when the Processes action is Professional, Enterprise,
executed. Performance, Unlimited,
Immediate Action and Developer Editions
When you invoke a process through an immediate action, the process receives the values that
the record contained when the top-level process starts.
Example: Process 1 updates an account and then invokes Process 2 based on that account. Process 2 receives the version of the
account when Process 1 started.
Scheduled Action
When you invoke a process through a scheduled action, the process receives the latest values for the record.
Example: Process 1 updates an account and, 15 minutes later, invokes Process 2 based on that account. Process 2 receives the latest
version of the account from the database.

40
Automate Your Business Processes Process Builder

When Should I Build an Invocable Process?


Do you find yourself building the exact same actions for multiple action groups? Configure those actions one time in an invocable
process, and then invoke that process from all the relevant action groups. Later, to update those actions, update the one invocable
process. All the other processes then use the updated actions.
Another cool scenario for invocable processes: nesting simple logic. Processes handle simple “if/then” statements. But what if you need
to nest some of those statements? Rather than having to build a flow or write code, build the second level of logic into another process.
Invoke the second process from the first, and voila!

Example: Let’s say you handle all of your case management in a single process. But you need to treat escalated cases for
high-revenue accounts differently from escalated cases for regular accounts. If the case is escalated by an account whose renewal
date is less than a month away, notify the account owner, the regional manager, and the VP of that region. If the case is escalated
by an account whose renewal date is more than a month away, notify only the account owner and the regional manager.
To do so, you build an invocable process. Let’s call it “Escalated Cases.” The process operates on the Case object and has two criteria
nodes.
• The first criteria node evaluates whether the associated account’s renewal date is less than a month away. When a case meets
that criteria, the process posts to the account’s feed with a link to the case and mentions the account owner, regional manager,
and regional VP.
• The second criteria node has no criteria. If a case doesn’t meet the first node’s criteria, the process performs the same action,
except that it doesn’t mention the regional VP.
Now back to the process that automates your case management. You already have a criteria node that checks whether the case
is escalated. Add a Processes action to that criteria’s action group, and configure the action to invoke the “Escalated Cases” process.

Avoid Unwanted Actions in Processes


When you add criteria to your process, you can choose to execute actions when specified criteria
EDITIONS
change.
For example, your process sends an email alert whenever a case has an Escalated status. Let’s say Available in: both Salesforce
your support team repeatedly updates the case description with new information. Whenever the Classic and Lightning
case is saved with a new description, your process can check specifically whether the Escalated Experience
status changed, rather than repeatedly sending email alerts. This way, the process executes actions
Available in: Essentials,
only if the status was changed to Escalated during the latest update. Professional, Enterprise,
Tip: Check out this short video Avoid Unwanted Actions in Your Process to learn more Performance, Unlimited,
and Developer Editions
about this option.
This setting isn’t supported if:
• Your process starts only when a record is created.
• Your process starts when a record is created or edited and the criteria node doesn’t evaluate any criteria.
• The criteria node evaluates a formula, but the formula doesn’t include a reference to the record that started the process.
• Your process uses the Is changed operator in a filter condition.

If Yes is... Actions are executed if... Actions are not executed if...
Selected • The record was created. • The record’s current values meet the conditions, and
• The record was updated. Its current values meet the the record’s most recent previous values met the
conditions, and its most recent previous values did not criteria.
meet the conditions. • The record’s current values don’t meet the conditions.

41
Automate Your Business Processes Process Builder

If Yes is... Actions are executed if... Actions are not executed if...
Deselected • The record was created. The record’s current values don’t meet the conditions.

• The record was updated, and its current values meet


the conditions.

SEE ALSO:
Process Builder Advanced Option Considerations

Create a Process
To create a process, define its properties and which records it should evaluate, and then add criteria
EDITIONS
nodes and actions.
Available in: both Salesforce
1. Define the Process Properties Classic and Lightning
The process properties uniquely identify your process. Experience

2. Configure the Process Trigger Available in: Essentials,


Every process includes a trigger, which tells the process when to start. How you configure that Professional, Enterprise,
trigger depends on what type of process you’re creating. Performance, Unlimited,
and Developer Editions
3. Add Process Criteria
Define the criteria that must be true before the process can execute the associated actions.
USER PERMISSIONS
4. Add Actions to Your Process
After you define a criteria node, define the actions that are executed when the criteria are met. To create, edit, or view
Actions are executed in the order in which they appear in the Process Builder. processes:
• Manage Flow
5. Execute Actions for Multiple Criteria
AND
Choose whether to stop or continue your process after specific criteria are met and associated
actions execute. View All Data

42
Automate Your Business Processes Process Builder

Define the Process Properties


The process properties uniquely identify your process.
EDITIONS
1. From Setup, in the Quick Find box, enter Builder, and select Process Builder.
Available in: both Salesforce
2. Click New, or click the process name and then click Edit Properties.
Classic and Lightning
3. Define the process properties by completing the fields. Experience

Field Description Available in: Essentials,


Professional, Enterprise,
Process The name for your process, up to 255 characters. Performance, Unlimited,
Name This name appears in the process management page, so name your process and Developer Editions
to differentiate it from other processes. To see the page in Setup, enter
Builder in the Quick Find box, then select Process Builder. USER PERMISSIONS

API Name The name that the API and managed packages use, up to 79 characters. To create, edit, or view
processes:
This name must be unique across all processes and flows. The name must
• Manage Flow
begin with a letter and use only alphanumeric characters and underscores.
It can’t include spaces, end with an underscore, or have two consecutive AND
underscores. View All Data

Important: After it’s saved, you can’t change the process’s API name.

Description Optional. A description for your process.


The description also appears in the process management page. It’s intended
to help you differentiate between processes, such as to explain what a process
does.

The Identifies when the process begins. You can set your process to start when:
process • A record changes
starts
• A platform event message is received
when
• It’s invoked by another process
This field is available only when creating a new process.

Template Specifies whether the process is a template. When a template is installed


from a managed package, the subscriber can view and clone the process and
customize the clones. Non-template processes that are installed from
managed packages can only be activated and deactivated.
Suppose that your company needs a process that differs slightly for each
country where you do business. You can create or install a template for the
base process and then clone it to create each country-specific process. Even
if you don’t use managed packages, you can use this field to clearly identify
the base process.
This field is available only when editing a process.

43
Automate Your Business Processes Process Builder

Field Description
API Version Determines which versioned run-time behavior improvements the process adopts.
for Running Changing this field requires the Manage Flows permission. Before you select a new API version, review all
the Process run-time improvements that were delivered between the currently selected API version and the new API
version. You can find all flow and process run-time improvements for an API version in the Salesforce Release
Notes.
By default, when you create a process, it runs in the latest API version. If you clone an existing process as a
new process or process version, the existing process’s run-time API version is used in the new process or
process version.
The run-time API version doesn’t change as future Salesforce releases roll out. You decide when, if ever, to
change the API version for running each process. This field lets you test and upgrade your processes one by
one, and at your own pace. You can even opt to never adopt versioned updates for one or all your processes.

4. Click Save.

Configure the Process Trigger


Every process includes a trigger, which tells the process when to start. How you configure that
EDITIONS
trigger depends on what type of process you’re creating.
Available in: both Salesforce
Record Change Classic (not available in all
If the process starts when a record changes, associate the process with an object, and specify orgs) and Lightning
when to start the process. Experience

Event Available in: Essentials,


If the process starts when a platform event message is received, associate the process with a Professional, Enterprise,
platform event and an object, and specify matching conditions. Because every process acts on Performance, Unlimited,
and Developer Editions
a Salesforce record, it requires a single record as a starting point. That way, the criteria and
actions know where to start evaluating and executing. Event processes are
available in: Performance,
Invocable
Unlimited, Enterprise, and
If the process starts when another process invokes it, associate the process with an object. Developer Editions

Record Change
USER PERMISSIONS
If the process starts when a record changes, associate the process with an object, and specify when
to start the process. To create, edit, or view
processes:
1. Click Add Object. • Manage Flow
2. Configure the trigger. AND
View All Data
For this field Select ...
...
Object The object that you want to base this process on. Click Find an object. Type
to filter the dropdown list.

44
Automate Your Business Processes Process Builder

For this field ... Select ...


Start the process Which type of record change triggers the process.
• only when a record is created
• when a record is created or edited

Note: If you’re familiar with workflow rules and you’re wondering what happened to the third
option (created, and any time it’s edited to subsequently meet criteria), don’t worry! You see that
setting when you add criteria nodes if you selected when a record is created or edited.

Recursion - Allow Yes, if you want the process to evaluate a record multiple times in a single save operation. To see this field,
process to evaluate a expand the Advanced area.
record multiple times When enabled, the process can evaluate the same record up to five more times in a single save operation.
in a single save It might reevaluate the record because a process, workflow rule, or flow updated the record in the same
operation? save operation. For more information, see Reevaluate Records in the Process Builder on page 40.

3. Before saving your changes, confirm the selection because you can’t change the object after you save it.

Event
If the process starts when a platform event message is received, associate the process with a platform event and an object, and specify
matching conditions. Because every process acts on a Salesforce record, it requires a single record as a starting point. That way, the
criteria and actions know where to start evaluating and executing.
1. Click Add Trigger.
2. Configure the trigger.

For this field ... Select...


Platform Event The platform event whose event messages can start the process.

Object The object whose records you want to associate with the event.

Matching Conditions Criteria to identify one record to associate the event with. We recommend using an ID or other field that
uniquely identifies records so the process can pick exactly one record.
The process fails if it finds:
• Multiple records that match the criteria.
• No records that match the criteria.

45
Automate Your Business Processes Process Builder

3. Before saving your changes, confirm the selection because you can’t change the platform event or object after you save it.

Invocable
If the process starts when another process invokes it, associate the process with an object.
1. Click Add Object.
2. Select an object to associate with the process. Type to filter the dropdown list.
This process can be invoked from any other process as long as the master process passes a record of this object type. For example,
an Account-based invocable process can be called from a Contact-based record change process, because you can pass the contact’s
account to the invocable process.

3. Before saving your changes, confirm the selection because you can’t change the object after you save it.

Add Process Criteria


Define the criteria that must be true before the process can execute the associated actions.
EDITIONS
When criteria are met, the process executes the associated action group. When criteria aren’t met,
the process skips the action group and evaluates the criteria for the next action group. Available in: both Salesforce
Classic and Lightning
1. Click Add Criteria.
Experience
2. Enter a name for this criteria node.
Available in: Essentials,
The name appears on the canvas, so use a name that helps you differentiate this from other
Professional, Enterprise,
criteria nodes. Actions have their own names, so we recommend summarizing only the criteria Performance, Unlimited,
with this name. For example, if the criteria checks whether a case is escalated, use Is and Developer Editions
Escalated?.

3. Select the type of criteria that you need to define. This selection determines which fields appear USER PERMISSIONS
later in the dialog box.
To create, edit, or view
If you need... Select processes:
• Manage Flow
The record to have certain field values. Conditions are
AND
met
View All Data

46
Automate Your Business Processes Process Builder

If you need... Select


For example, to execute the associated actions on opportunity records with an amount greater than
$5,000, set the filter to:
[Opportunity].Amount greater than $5000.00

To evaluate the record by using a formula. Formula evaluates to true


For example, to execute the associated actions on accounts whose annual revenue is over $1,000,000
when the account is changed by someone other than the owner, use this formula.
AND (([Account].LastModifiedBy.Id <> [Account].Owner.Id) ,
([Account].AnnualRevenue > 1000000) )

To simply execute the associated actions without evaluating the record. No criteria—just execute
The process executes all the actions that are associated with this criteria node and, unless you specify the actions!
otherwise, doesn’t evaluate any remaining criteria nodes in the process. If you choose to stop your
process after executing these actions, we recommend choosing this option for only the last criteria
node in your process.

4. If you selected “Conditions are met”:


a. Define the filter conditions by identifying the field values that the process needs to evaluate.

Field Select the field whose value you want to evaluate. You can also evaluate values for records that are related to
the one that started the process. To do so, click on a related record with next to the ID field.
For example, if a contact record started the process, you can evaluate the value for the contact’s account’s
Annual Revenue field. To access that field, click Account Id , select Annual Revenue, and then
click Choose.

Operator The available operators depend on the field’s data type.

Type The available value types depend on the field’ data type.

Value Identify the value that you want to evaluate the field for. See Setting Values in the Process Builder on page 35
for details.

b. For Conditions, identify which conditions must be true for the process to execute the associated actions.
If you choose to use custom logic, enter up to 1000 characters by using:
• Numbers to refer to each condition
• AND, OR, or NOT to identify which combination of conditions must true
• Parentheses to group parts of the string together
For example, if you enter 1 AND NOT (2 OR 3), the outcome evaluates to true if the first condition is true and neither
the second nor third outcome is true.

47
Automate Your Business Processes Process Builder

Tip: Ambiguous logic may cause validation errors. To avoid ambiguity, use parentheses in your custom logic. For example:
• 1 AND 2 OR 3 results in an error
• 1 AND (2 AND 3) OR 4 doesn't result in an error

5. If you selected “Formula evaluates to true,” define the formula.


6. Optionally, to specify whether you want to execute the actions only if the record was created or edited to meet criteria, click Advanced
at the bottom of the panel.
For details, see Avoid Unwanted Actions in Processes on page 41.

Note: This setting is available only if the process starts when a record is created or edited and you selected “Filter conditions
are met” or “Formula evaluates to true.”

7. Click Save.

SEE ALSO:
Execute Actions for Multiple Criteria

Add Actions to Your Process


After you define a criteria node, define the actions that are executed when the criteria are met.
EDITIONS
Actions are executed in the order in which they appear in the Process Builder.
An action group can consist of a combination of immediate and scheduled actions. Immediate Available in: both Salesforce
actions are executed when evaluation criteria are met. Scheduled actions are executed at a specified Classic and Lightning
time. For example, Salesforce can automatically send an email reminder to the account team if a Experience
high-value opportunity is still open 10 days before the specified close date.
Available in: Essentials,
Before you begin, consider whether you want this action to be executed immediately or at a specific Professional, Enterprise,
time. If you want to execute the action at a specific time, identify when those actions should be Performance, Unlimited,
executed. and Developer Editions
1. Click Add Action.
2. Select the type of action to create, and then fill out the fields to define the action. USER PERMISSIONS

To create, edit, or view


Create a Record from a Process processes:
Create a record by manually entering values or by using the values of related records. • Manage Flow

Invoke a Process from Another Process AND

Invoke a process from another process. With invocable processes, you have the option of reuse View All Data
so that you don’t spend your time on repetitive work.
Create a Chatter Post from a Process
Post to the feed of a user, a Chatter group, or the record that started the process.
Use a Quick Action from a Process
Create a record, update a record, or log a call by using a quick action that you or another admin created for your organization.
Work with Quip from a Process
Create documents, chat rooms, and folders when important events occur. Attach a document to a record so your users have
information in context. Update your spreadsheets with the latest Salesforce data. Send a message to a chat room or document. Add
new slides to a deck, copy documents, add members to a document or chat, and more.

48
Automate Your Business Processes Process Builder

Launch a Flow from a Process


Start an autolaunched flow from your process to automate complex business processes. Create flows to perform logic and have
events trigger the flows via processes without writing code.
Send an Email from a Process
Easily send an email from a process by using an email alert. Email alerts are configured outside of the Process Builder and contain
the standard text, list of recipients, and template for an email.
Send a Custom Notification from a Process
Send customized notifications when important events occur. Alert an account owner if a new support case is logged while trying
to close a deal, or send a notification for a workflow built entirely with custom objects. Add recipients and content to your custom
notification, then add it to your process.
Send a Survey Invitation from a Process
Send an email invitation containing the link to a particular survey question or to launch a survey.
Submit a Record for Approval from a Process
Submit the record that started the process for approval.
Update Records from a Process
Update one or more records that are related to the record that started the process by manually entering values or by using the values
from related records.
Call Apex Code from a Process
Add customized functionality to your process by calling Apex from the process.

Specify When Your Actions Execute with a Schedule


In record-change processes and event processes, you can schedule actions to execute at a specific
EDITIONS
time. An action group that supports scheduled actions can have multiple schedules. For example,
you can schedule some actions to execute one day from now and others to execute three days Available in: both Salesforce
from now. Classic and Lightning
Experience
Note: Before adding scheduled actions to your process, understand how they work. Review
Scheduled Actions Considerations. Available in: Essentials,
To schedule actions in a record-change process, make sure that one of the following options is true Professional, Enterprise,
for your action group. Performance, Unlimited,
and Developer Editions
• The process starts only when a record is created (1).
• The process starts when a record is created or edited (2), and the associated criteria node
USER PERMISSIONS
executes actions only when specified changes are made (3).
To create, edit, or view
processes:
• Manage Flow
AND
View All Data

49
Automate Your Business Processes Process Builder

1. In an action group that supports scheduled actions, click Set Schedule.


2. If you need to schedule actions based on a date/time field on the record that started the process:
a. Leave the first radio button selected.
b. From the dropdown list on the right side of the panel, select the date to schedule the action.
For example, if your process is based on an account record, choose the account’s Created Date.
c. Specify the number of days or hours before or after the field.
For a record-change process, if the criteria for this action group are still met when this time occurs, Salesforce executes the
scheduled actions. For an event process, the criteria aren’t checked when this time occurs. If the criteria was met when the
process started, Salesforce executes the scheduled actions.

3. If you need to schedule actions after a certain number of days or hours from when the process is executed:
a. Select the second radio button.
b. Specify the number of days or hours from when the process is executed.
If the criteria for this action group are still met when this time occurs, Salesforce executes the scheduled actions.

4. Save the schedule.

50
Automate Your Business Processes Process Builder

Create a Record from a Process


Create a record by manually entering values or by using the values of related records.
EDITIONS
After you create an action and select “Create a Record” for the type, fill in the relevant fields to add
the action to your process. The new record’s Created By field is then set to the user who started Available in: both Salesforce
the process by creating or editing a record. Classic and Lightning
Experience
Warning: If you create processes to replace any workflow rules, ensure that you delete those
workflow rules when you activate the equivalent processes. Otherwise, both workflow rules Available in: Essentials,
and processes fire and cause unexpected results, such as overwritten records or redundant Professional, Enterprise,
email messages. Do the same if you create processes to replace any Apex triggers. Performance, Unlimited,
and Developer Editions
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your
USER PERMISSIONS
process. The name truncates to fit on the canvas.

2. For Record Type, select the object that you want to create a record for. To filter the To create, edit, or view
processes:
drop-down list, type the name of the object to filter the drop-down list.
• Manage Flow
When you select an object, at least one row appears to allow you to set field values for the new
AND
record.
View All Data
Warning: Rows appear automatically for fields required by the API. You might need to
provide values for other fields. We recommend that you refer to your organization's page
layouts to determine which fields are required.

3. Set the record’s field values.

Field Select the field whose value you want to set. To filter the drop-down list, type the name of the field.

Type Select the type of value that you want to use. The available types depend on the field that you’ve selected.

Value Set a value for the field. by using the text entry field to manually enter a value or the field picker to use a field value
from a related record. See Setting Values in the Process Builder on page 35 for details.

4. Click Save.

Tip:
• If you set up your process to create an account record, Name appears as a required field. If you want to create a person
account, you can add LastName as a field but it doesn’t appear as required by default. You can enter a dummy value
for the Name field.
• When you create a record, required fields normally appear at the top of the list. However, if you save a Create a Record
action, close the process, and then reopen the action, required fields may not appear in the normal order.
• If a platform event is configured to publish immediately, the process publishes each event message outside of the database
transaction. If the transaction fails and is rolled back, the event message is still published and can’t be rolled back. So if you

51
Automate Your Business Processes Process Builder

see an informational message under the selected platform event, consider whether you want the process to publish an
event message only after the transaction commits successfully.

SEE ALSO:
Platform Events Developer Guide: Decoupled Publishing and Subscription
Platform Events Developer Guide: Platform Event Fields

Invoke a Process from Another Process


Invoke a process from another process. With invocable processes, you have the option of reuse so
EDITIONS
that you don’t spend your time on repetitive work.
After you create an action and select “Processes” for the type, fill in the relevant fields to add the Available in: both Salesforce
action to your process. Classic and Lightning
Experience
You can invoke processes with objects that share at least one unique ID. For example, in the Account
and Case objects, the AccountId field is unique to Account and also used by Case. You can Available in: Essentials,
create an invocable process that updates a Case record. Then you can invoke it from: Professional, Enterprise,
Performance, Unlimited,
• A process that updates an Account record’s owner
and Developer Editions
• A process that adds an Account shipping address or updates it
When you create a process that invokes another process, each one counts toward your process
USER PERMISSIONS
and other applicable limits. DML limits in processes that invoke processes count as one transaction.
To create, edit, or view
Warning: If you create processes to replace any workflow rules, delete those workflow rules
processes:
when you activate the equivalent processes. Otherwise, both workflow rules and processes
• Manage Flow
fire and cause unexpected results, such as overwritten records or redundant email messages.
Do the same if you create processes to replace any Apex triggers. AND
View All Data
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your
process. The name truncates to fit on the canvas.

2. Select an invocable process. You can only select active invocable processes.
3. Select your process variable. Remember that you can only select fields related to the object associated with the process you invoke.

52
Automate Your Business Processes Process Builder

Create a Chatter Post from a Process


Post to the feed of a user, a Chatter group, or the record that started the process.
EDITIONS
This action is available only if your organization has Chatter enabled. The feed item will appear as
if the user who started the process—by creating or editing a record—created the post. Available in: both Salesforce
Classic and Lightning
Experience
Post to a User’s Chatter Feed from a Process
Post to the feed of a user by identifying a specific user in your organization or a User lookup Available in: Essentials,
field on a record. Professional, Enterprise,
Performance, Unlimited,
Post to a Chatter Group from a Process
and Developer Editions
Post to the feed of a specific Chatter group.
Post to a Record’s Chatter Feed from a Process
USER PERMISSIONS
Post to the feed of the record that started the process.
Mention a User or Group in a “Post to Chatter” Process Action To create, edit, or view
processes:
When you post to a Chatter feed from a process, you can mention users if you can reference
• Manage Flow
the corresponding User ID field from the field picker.
AND
View All Data
SEE ALSO:
Chatter Settings
Considerations for Processes That Post to Chatter

Post to a User’s Chatter Feed from a Process


Post to the feed of a user by identifying a specific user in your organization or a User lookup field
EDITIONS
on a record.
After you’ve created an action and selected “Post to Chatter” for the action type, fill in the relevant Available in: both Salesforce
fields to add the action to your process. Classic and Lightning
Experience
Warning: If the feed that the process tries to post to isn't available when the process is
triggered (for example, because the user is now inactive), the user sees an error and the Available in: Essentials,
process fails. Professional, Enterprise,
Performance, Unlimited,
1. Enter a name for this action. and Developer Editions
This text appears on the canvas and helps you differentiate this action from others in your
process. The name truncates to fit on the canvas.
USER PERMISSIONS
2. In the Post to field, select User.
To create, edit, or view
3. For User, select where you want to find the user. processes:
4. Based on your selection for User, search for or browse for the user whose feed you want to • Manage Flow
post to. AND
When you select a user from a record, you must ultimately select a field that contains a user’s View All Data
ID—for example, Owner ID or User ID.

5. Fill out the message that you want to post. You can insert merge fields, add a topic, and mention
users or groups.
The message can contain up to 10,000 characters.

53
Automate Your Business Processes Process Builder

You can only reference topics that already exist. If you reference a merge field and that field doesn’t have a value, it appears as a
blank value.

6. Save the action.

SEE ALSO:
Chatter Settings

Post to a Chatter Group from a Process


Post to the feed of a specific Chatter group.
EDITIONS
After you’ve created an action and selected “Post to Chatter” for the action type, fill in the relevant
fields to add the action to your process. Available in: both Salesforce
Classic and Lightning
Warning: If the feed that the process tries to post to isn't available when the process is Experience
triggered, the user sees an error and the process fails.
Available in: Essentials,
1. Enter a name for this action.
Professional, Enterprise,
This text appears on the canvas and helps you differentiate this action from others in your Performance, Unlimited,
process. The name truncates to fit on the canvas. and Developer Editions

2. In the Post to field, select Chatter Group.


3. For Group, search for the Chatter group whose feed you want to post to. USER PERMISSIONS

4. Fill out the message that you want to post. You can insert merge fields, add a topic, and mention To create, edit, or view
users or groups. processes:
• Manage Flow
The message can contain up to 10,000 characters.
AND
You can only reference topics that already exist. If you reference a merge field and that field
doesn’t have a value, it appears as a blank value. View All Data

5. Save the action.

SEE ALSO:
Chatter Settings

54
Automate Your Business Processes Process Builder

Post to a Record’s Chatter Feed from a Process


Post to the feed of the record that started the process.
EDITIONS
You can post to the record’s Chatter feed only if feed tracking is enabled for the object that the
process is associated with. Available in: both Salesforce
Classic and Lightning
After you’ve created an action and selected “Post to Chatter” for the action type, fill in the relevant
Experience
fields to add the action to your process.
Available in: Essentials,
Warning: If the feed that the process tries to post to isn't available when the process is
Professional, Enterprise,
triggered (for example, because the user is now inactive), the user sees an error and the Performance, Unlimited,
process fails. and Developer Editions
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your USER PERMISSIONS
process. The name truncates to fit on the canvas.
To create, edit, or view
2. In the Post to field, select This Record. processes:
3. Fill out the message that you want to post. You can insert merge fields, add a topic, and mention • Manage Flow
users or groups. AND
The message can contain up to 10,000 characters. View All Data
You can only reference topics that already exist. If you reference a merge field and that field
doesn’t have a value, it appears as a blank value.

4. Save the action.

SEE ALSO:
Chatter Settings

Mention a User or Group in a “Post to Chatter” Process Action


When you post to a Chatter feed from a process, you can mention users if you can reference the
EDITIONS
corresponding User ID field from the field picker.
When you’re configuring the Post to Chatter action: Available in: both Salesforce
Classic and Lightning
1. In the Message field, enter @[].
Experience
2. Place your cursor between the square brackets.
Available in: Essentials,
3. Click Merge Field, navigate to the user who you want to mention, select the corresponding Professional, Enterprise,
ID field, and click Choose. Performance, Unlimited,
and Developer Editions

USER PERMISSIONS

To create, edit, or view


processes:
• Manage Flow
AND
View All Data

55
Automate Your Business Processes Process Builder

The field reference appears between the square brackets.

@[{!fieldReference}]

4. Save the action.

Example: To @mention a case’s account owner, navigate to the account’s fields and select Owner ID. Insert that field reference
between the square brackets in @[], so that the result is:
@[{![Case].Account.OwnerId}]

Use a Quick Action from a Process


Create a record, update a record, or log a call by using a quick action that you or another admin
EDITIONS
created for your organization.
Quick actions can be object-specific or global actions. Only Create, Update, and Log a Call actions Available in: both Salesforce
are supported. To use a quick action from a process, the action must exist in your organization. Classic and Lightning
Experience
If your organization is using quick actions to help your users more easily create and update records,
you can also use those actions in your process. When you use these quick actions in a process, you Available in: Essentials,
can only set values for fields that are part of the action's layout. If you don’t already have one of Professional, Enterprise,
these actions created, see Create Global Quick Actions or Create Object-Specific Quick Actions for Performance, Unlimited,
details. and Developer Editions
After you’ve created an action and selected “Quick Actions” for the type, fill in the relevant fields to
add the action to your process. The new or updated record will appear as if the user who started USER PERMISSIONS
the process—by creating or editing a record—created or updated it.
To create, edit, or view
1. Enter a name for this action. processes:
This text appears on the canvas and helps you differentiate this action from others in your • Manage Flow
process. The name truncates to fit on the canvas. AND
2. Filter to specify the kind of action you want to use. View All Data

Filter Lets You Search Through


Search By
Global actions All global actions in your organization. You then filter even further by selecting
the Type of actions that you need to search through.

Object All object-specific actions in your organization that are associated with a
certain Object Name. Global actions can’t be filtered by object.

Type All object-specific and global actions in your organization based on the type,
such as Create a Record or Log a Call.

• If you selected Global actions or Type, for Type select the specific type of quick action that you want to use.
• If you selected Object, for Object search for and select the object that you want to filter by.

3. For Action, search for and select the action that you want to use.
4. Set field values for the action.
Rows that appear automatically represent the action’s required fields. To set values for the action’s optional fields, add rows.

56
Automate Your Business Processes Process Builder

Field Select the field whose value you want to set. To filter the drop-down list, type the name of the field.
You can set values for fields that are included in the action’s layout only.

Type Select the type of value that you want to use. The available types depend on the field that you’ve selected.

Value Set a value for the field. by using the text entry field to manually enter a value or the field picker to use a field
value from a related record. See Setting Values in the Process Builder on page 35 for details.

5. Save the action.

Work with Quip from a Process


Create documents, chat rooms, and folders when important events occur. Attach a document to
EDITIONS
a record so your users have information in context. Update your spreadsheets with the latest
Salesforce data. Send a message to a chat room or document. Add new slides to a deck, copy Available in: both Salesforce
documents, add members to a document or chat, and more. Classic and Lightning
Experience
Create a Document, Folder, or Chat Room from a Process Available in: Essentials,
Use Process Builder to create new documents, folders, and chat rooms. Professional, Enterprise,
Add a Document to a Folder from a Process Performance, Unlimited,
Add a document to one or more folders. and Developer Editions

Remove a Document from a Process


Remove a document from a folder. Make a shared document private again. USER PERMISSIONS
Add a Live App to a Template from a Process To create, edit, or view
Keep your templates up-to-date with the latest Salesforce data. Add live Salesforce records and processes:
list views to your templates using Process Builder. • Manage Flow

Attach a Document to a Record from a Process AND


Keep information in context by attaching a document to a Salesforce record. View All Data

Copy a Document from a Process


To use a document as a template, create a copy. By default, copied documents are saved to
the running user’s Private folder in Quip.
Add Members to a Document or Chat from a Process
Add up to 50 members to a document or chat.
Add Members with Different Access Levels to a Document from a Process
Automatically share a document with members with different permissions using Process Builder.
Remove Document Members from a Process
Trigger a process to auto-remove users from a document when the collaboration is over.
Copy Content from a Process (Retired)
Copy content from one slide deck to another.
Edit a Document from a Process
Add content to an existing document.

57
Automate Your Business Processes Process Builder

Update a Template Section from a Process


Edit a section of a template using text detection. Update sections of cloned documents at scale.
Copy Content with Live Paste from a Process
Copy content from a source document and paste it with Live Paste in a new document. After you update the source content, set
the content to automatically update in all documents that reference it.
Update Content Based on a Document Range from a Process
Edit or add content to a defined template section, called a document range, when something changes in Salesforce.
Edit a Spreadsheet from a Process
Add data to an existing spreadsheet.
Edit a Slide from a Process (Retired)
Insert a new slide or change an image in an existing slide deck.
Lock Document Edits from a Process
Lock edits to mark a document as complete.
Lock Section Edits from a Process
To keep a document or template section safe from edits, lock it.
Export a Document to a PDF from a Process
To mark a document as complete or to keep a document view-only for record keeping, export it to a PDF. You can choose to attach
the PDF to a document or to a Salesforce record.
Send a Message from a Process
Send a message in a chat room or in a document. Messages sent in a document appear as inline comments or in the document
body.
Copy Comments from a Process
Copy comments from a template’s source document to the newly-created target document.

Create a Document, Folder, or Chat Room from a Process


Use Process Builder to create new documents, folders, and chat rooms.
EDITIONS
After you’ve created a Quip action and selected Create New Document, Create New Folder, or
Create Chat, fill in the relevant fields to add the action to your process. Available in: both Salesforce
Classic and Lightning
1. Enter a name for this action.
Experience
This text appears on the canvas and helps you differentiate this action from others in your
process. The name truncates to fit on the canvas. Available in: Essentials,
Professional, Enterprise,
2. Choose a document, folder, or chat name. Performance, Unlimited,
Names can be formatted as a string, field reference, global constant, or formula. and Developer Editions

3. Enter the content that you want to add to your chat or document.
USER PERMISSIONS
This step is optional for new documents.

4. Save the action. To create, edit, or view


processes:
• Manage Flow
AND
View All Data

58
Automate Your Business Processes Process Builder

Add a Document to a Folder from a Process


Add a document to one or more folders.
EDITIONS
After you’ve created a Quip action and selected Add Document to Folder, fill in the relevant fields
to add the action to your process. Available in: both Salesforce
Classic and Lightning
1. Enter a name for this action.
Experience
This text appears on the canvas and helps you differentiate this action from others in your
process. The name truncates to fit on the canvas. Available in: Essentials,
Professional, Enterprise,
2. Enter the URL of the document you want to add. Performance, Unlimited,
3. Enter the URL of the folder where you want to add your document. and Developer Editions

Add your document to multiple folders by adding commas between each folder URL.
USER PERMISSIONS
4. Save the action.
To create, edit, or view
processes:
• Manage Flow
AND
View All Data

Remove a Document from a Process


Remove a document from a folder. Make a shared document private again.
EDITIONS
After you create a Quip action and select Remove Document from Folder, fill in the relevant fields
to add the action to your process. Available in: Lightning
Experience
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your
process. The name truncates to fit on the canvas. USER PERMISSIONS

2. Enter the URL of the document you want to move. To create, edit, or view
processes:
3. Enter the URL of the folder your document is in.
• Manage Flow
To remove a document from multiple folders, separate folder URLs with commas.
AND
Note: Removing a document from your Private folder removes your access to it. View All Data

4. Save the action.

59
Automate Your Business Processes Process Builder

Add a Live App to a Template from a Process


Keep your templates up-to-date with the latest Salesforce data. Add live Salesforce records and list
EDITIONS
views to your templates using Process Builder.
After you create a Quip action and select Create New Document or Edit Document, fill in the Available in: Lightning
relevant fields to add the action to your process. Experience

USER PERMISSIONS

To create, edit, or view


processes:
• Manage Flow
AND
View All Data

1. From the Content Type dropdown, select Quip Live App.


2. To add a live Salesforce record, select Salesforce Record.
a. Enter the Salesforce Record ID.

Note: To add a dynamic Salesforce record that updates based on the record that the document is embedded in, enter
the value as a Reference. To add a specific record, enter the numbers that appear in the record URL as a String.

b. The following steps are optional and used as placeholders if the record can’t be found.
c. Optional: Enter the Salesforce record name.
d. Optional: Enter the record type.
e. Optional: Enter the name of the Salesforce org.

3. To add a live Salesforce list view, select Salesforce List.


a. Enter the Salesforce List View ID.

Note: To add a dynamic Salesforce list view that updates based on the record that the document is embedded in, enter
the value as a Reference. To add a specific list view, enter the numbers that appear in the record URL as a String.

b. Enter the list view object type.


c. Optional: Enter the name of the Salesforce org.

4. Save the action.


Take note of these considerations to using Process Builder to add a Salesforce live app to your templates.
• You can’t select which record fields to display from Process Builder.

60
Automate Your Business Processes Process Builder

• The owner of a live app added by Process Builder to a template is the first user to open the copied document. Only the live app owner
can save changes to Salesforce. Other users can edit and comment on the live app, but these changes don’t sync to Salesforce.

Attach a Document to a Record from a Process


Keep information in context by attaching a document to a Salesforce record.
EDITIONS
After you’ve created a Quip action and selected Attach Document to Record, fill in the relevant
fields to add the action to your process. Available in: both Salesforce
Classic and Lightning
1. Enter a name for this action.
Experience
This text appears on the canvas and helps you differentiate this action from others in your
process. The name truncates to fit on the canvas. Available in: Essentials,
Professional, Enterprise,
2. For Document URL, enter the URL of the document you want to attach to a record. Performance, Unlimited,
3. Select the record type that you want to attach a document to, and then click Choose. and Developer Editions

4. Save the action.


USER PERMISSIONS

To create, edit, or view


processes:
• Manage Flow
AND
View All Data

Copy a Document from a Process


To use a document as a template, create a copy. By default, copied documents are saved to the
EDITIONS
running user’s Private folder in Quip.
After you’ve created a Quip action and selected Copy Document, fill in the relevant fields to add Available in: both Salesforce
the action to your process. Classic and Lightning
Experience
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your Available in: Essentials,
process. The name truncates to fit on the canvas. Professional, Enterprise,
Performance, Unlimited,
2. For Document URL, enter the URL of the document you want to copy. and Developer Editions
By default, newly copied documents appear in the Private folder in Quip.

Note: Newly copied documents aren’t automatically attached to the record. See step 5 USER PERMISSIONS
for more info.
To create, edit, or view
3. Use the Advanced section to enter a document title, add members by email address, or add processes:
• Manage Flow
the document to a specific parent folder.
AND
4. Save the action.
View All Data

61
Automate Your Business Processes Process Builder

5. Optional: To attach the newly created document to the record and use Synced Sharing, use the Attach Document to Record action
after the Copy Document action.

SEE ALSO:
Automate Pricing Proposals with Salesforce Flow
Automate Close Plans with Salesforce Flow
Add Opportunity Team Members to a Close Plan

Add Members to a Document or Chat from a Process


Add up to 50 members to a document or chat.
EDITIONS
After you’ve created a Quip action and selected Add Members to Document or Add Members
to Chat, fill in the relevant fields to add the action to your process. Available in: both Salesforce
Classic and Lightning
1. Enter a name for this action.
Experience
This text appears on the canvas and helps you differentiate this action from others in your
process. The name truncates to fit on the canvas. Available in: Essentials,
Professional, Enterprise,
2. Enter the URL of the document or chat where you want to add members. Performance, Unlimited,
3. Enter up to 50 email addresses. and Developer Editions

Emails must belong to Quip users in the same Quip site as the acting user.
USER PERMISSIONS
4. Save the action.
To create, edit, or view
processes:
• Manage Flow
AND
View All Data

Add Members with Different Access Levels to a Document from a Process


Automatically share a document with members with different permissions using Process Builder.
EDITIONS
After you create a Quip action and select Add Members to Document or Add Members to Chat,
fill in the relevant fields to add the action to your process. Available in: Lightning
Experience
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your
process. The name truncates to fit on the canvas. USER PERMISSIONS

2. Enter the URL of the document or chat where you want to add members. To create, edit, or view
processes:
3. Enter the email addresses of the members you want to add based on the access level you want
• Manage Flow
to grant.
AND
You can enter up to 50 email addresses per access level. Emails must belong to Quip members
in the same Quip site as the acting member. View All Data

62
Automate Your Business Processes Process Builder

Quip Access Level Description

Full Access Full-access members can view, comment on, edit, and share
documents that they’re added to.

Edit Access Edit-access members can view, comment on, and edit documents
that they’re added to.

Comment Access Comment-access members can view and comment on


documents that they’re added to.

View Access View-access members can view documents that they’re added
to.

4. Save the action.

Remove Document Members from a Process


Trigger a process to auto-remove users from a document when the collaboration is over.
EDITIONS
After you create a Quip action and select Remove Members From Document, fill in the relevant
fields to add the action to your process. Available in: Lightning
Experience
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your
process. The name truncates to fit on the canvas. USER PERMISSIONS

2. Enter the URL of the document you want to manage access to. To create, edit, or view
processes:
3. Enter the email addresses of the members you want to remove from the document.
• Manage Flow
You can enter up to 50 email addresses. Emails must belong to Quip members in the same
AND
Quip site as the acting member.
View All Data
4. Save the action.

63
Automate Your Business Processes Process Builder

Copy Content from a Process (Retired)


Copy content from one slide deck to another.
EDITIONS
After you’ve created a Quip action and selected Copy Content, fill in the relevant fields to add the
action to your process. Available in: both Salesforce
Classic and Lightning
Warning: Quip is retiring slides on January 31, 2021. After this date, the Copy Content action Experience
in Process Builder and Flow Builder no longer works, and Slides isn’t a valid document type
for the Edit Document and Create Document actions. Tell Me More Available in: Essentials,
Professional, Enterprise,
1. Enter a name for this action. Performance, Unlimited,
This text appears on the canvas and helps you differentiate this action from others in your and Developer Editions
process. The name truncates to fit on the canvas.

2. Select Slides as your Document Type. USER PERMISSIONS


3. Enter the URL of the slide deck you want to copy. To create, edit, or view
4. Enter the slide number with the content you want to copy. processes:
• Manage Flow
5. Enter the URL of the slide deck where you want to add content.
AND
6. Enter the slide number where you want your copied content to appear.
View All Data
7. Use the Advanced section to include anchor links instead of slide numbers.
8. Save the action.

Edit a Document from a Process


Add content to an existing document.
EDITIONS
After you’ve created a Quip action and selected Edit Document, fill in the relevant fields to add
the action to your process. Available in: both Salesforce
Classic and Lightning
1. Enter a name for this action.
Experience
This text appears on the canvas and helps you differentiate this action from others in your
process. The name truncates to fit on the canvas. Available in: Essentials,
Professional, Enterprise,
2. Select Document as the Document Type. Performance, Unlimited,
3. Enter the URL of the document you want to edit. and Developer Editions

4. Select the location in the document where you want to add content.
To add content after or before a section or to replace a section, enter the document section USER PERMISSIONS
anchor link. To create, edit, or view
5. Select the Content Type. processes:
• Manage Flow
6. Enter the new content.
AND
7. Optionally, select Disable Extra Lines in Quip to prevent Quip from automatically adding a
View All Data
blank line after each paragraph.
8. Save the action.

64
Automate Your Business Processes Process Builder

Update a Template Section from a Process


Edit a section of a template using text detection. Update sections of cloned documents at scale.
EDITIONS
After you create a Quip action and select Edit Document, fill in the relevant fields to add the action
to your process. Available in: Lightning
Experience
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your
process. The name truncates to fit on the canvas. USER PERMISSIONS

2. Select Document as the Document Type. To create, edit, or view


processes:
3. Enter the URL of the document you want to edit.
• Manage Flow
4. To edit a document based on a section, select After Section, Before Section, or Replace AND
Section as the location for your new content.
View All Data
5. Use text detection to reference a document section by text. Under Section in Document, select
Text Detection.

6. Enter the section text you want to reference using text detection.
7. Under Section Style, select whether the section text is a heading, paragraph, or list.
8. Select the content type.
9. Enter your new content.
10. Save your action.

65
Automate Your Business Processes Process Builder

Copy Content with Live Paste from a Process


Copy content from a source document and paste it with Live Paste in a new document. After you
EDITIONS
update the source content, set the content to automatically update in all documents that reference
it. Available in: Lightning
After you create a Quip action and select Copy with Live Paste, fill in the relevant fields to add the Experience
action to your process.
1. Enter a name for this action. USER PERMISSIONS
This text appears on the canvas and helps you differentiate this action from others in your
To create, edit, or view
process. The name truncates to fit on the canvas.
processes:
2. Enter the anchor links of the sections in the source document you want to copy with Live Paste. • Manage Flow
To copy content from multiple sections of the same document, enter anchor links and separate AND
with commas. Your content appears in the order that the anchor links are entered. You can’t View All Data
copy content from multiple documents at the same time.

3. Select the location in the document where you want to paste your content. Live pasted content can appear at the end or beginning
of a document, before or after a section, or can replace a document section.
4. To paste content at the beginning or end of a document, enter the target document URL. To paste content in a target document
based on a section, enter the anchor link of the section where you want your copied content to appear.
5. To have content copied with Live Paste automatically update in the target document, select Update Automatically.
6. Save the action.

66
Automate Your Business Processes Process Builder

Update Content Based on a Document Range from a Process


Edit or add content to a defined template section, called a document range, when something
EDITIONS
changes in Salesforce.
Document ranges are supported only in documents and templates. To see your highlighted Available in: Lightning
document ranges, use a template. Experience
After you create a Quip action and select Edit Document or Copy with Live Paste, fill in the
relevant fields to add the action to your process. USER PERMISSIONS
1. To add new content to a document based on a document range, select the Edit Document
To create, edit, or view
action. processes:
a. Under Location for New Content, select a document range placement. You can choose to • Manage Flow
add content after a document range, before it, or you can replace it. AND
View All Data

b. Enter the document range heading. This is the heading text in your template that marks the start of a document range.
c. Enter your new content and save the action.

2. To live paste existing content to a template, select the Copy with Live Paste action.
a. Choose whether you want to copy content based on an anchor link or document range content type.
b. Enter the URL of the template or anchor link you want to copy content from.
c. To live paste content based on document range, select a document range placement. You can choose to paste your copied
content after a document range, before it, or you can replace it.
d. Enter the URL of the template where you want to paste your copied content.
e. Enter the document range heading of the target template that you want to use to place your copied content.
f. Save the action.

67
Automate Your Business Processes Process Builder

Edit a Spreadsheet from a Process


Add data to an existing spreadsheet.
EDITIONS
After you’ve created a Quip action and selected Edit Document, fill in the relevant fields to add
the action to your process. Available in: both Salesforce
Classic and Lightning
1. Enter a name for this action.
Experience
This text appears on the canvas and helps you differentiate this action from others in your
process. The name truncates to fit on the canvas. Available in: Essentials,
Professional, Enterprise,
2. Select Spreadsheet as the Document Type. Performance, Unlimited,
3. Enter the URL of the spreadsheet you want to edit. and Developer Editions

4. Select the location in the spreadsheet where you want to add content.
USER PERMISSIONS
5. To add content after a section, before a section, or to replace a section, enter the Section Anchor
Link. To create, edit, or view
6. Select Row or Column as the element type where you want to add content. processes:
• Manage Flow
7. Enter the new content.
AND
8. Save the action.
View All Data

Edit a Slide from a Process (Retired)


Insert a new slide or change an image in an existing slide deck.
EDITIONS
After you’ve created a Quip action and selected Edit Document, fill in the relevant fields to add
the action to your process. Available in: both Salesforce
Classic and Lightning
Warning: Quip is retiring slides on January 31, 2021. After this date, the Copy Content action Experience
in Process Builder and Flow Builder no longer works, and Slides isn’t a valid document type
for the Edit Document and Create Document actions. Tell Me More Available in: Essentials,
Professional, Enterprise,
1. Enter a name for this action. Performance, Unlimited,
This text appears on the canvas and helps you differentiate this action from others in your and Developer Editions
process. The name truncates to fit on the canvas.

2. Select Slides as the Document Type. USER PERMISSIONS


3. Enter the URL of the slide deck you want to edit. To create, edit, or view
4. Select Insert New Slide or Change Image In Slide. processes:
• Manage Flow
5. Select the location in the slide deck where you want to add content.
AND
6. To add content before or after a section, enter the slide number.
View All Data
7. Use the Advanced section to include anchor links instead of slide numbers.
8. To add text to a slide, select Text Layout and add your content.
9. To add an image, select Image Layout and enter the URL of the image you want to add.
10. Save the action.

68
Automate Your Business Processes Process Builder

Lock Document Edits from a Process


Lock edits to mark a document as complete.
EDITIONS
After you create a Quip action and select Lock Document Edits, fill in the relevant fields to add
the action to your process. Available in: Lightning
Experience

USER PERMISSIONS

To create, edit, or view


processes:
• Manage Flow
AND
View All Data

1. Enter a name for this action.


This text appears on the canvas and helps you differentiate this action from others in your process. The name truncates to fit on the
canvas.

2. Enter the URL of the document you want to lock.


3. To lock document edits, select Lock. To unlock document edits, select Unlock.

Note: Only users with full access to a document can lock or unlock edits.

4. Save the action.

Lock Section Edits from a Process


To keep a document or template section safe from edits, lock it.
EDITIONS
After you create a Quip action and select Lock Document Section Edits, fill in the relevant fields
to add the action to your process. Available in: Lightning
Experience
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your
process. The name truncates to fit on the canvas. USER PERMISSIONS

2. Enter the anchor link URL of the section you want to lock. To create, edit, or view
processes:
3. To lock section edits, select Lock. To unlock section edits, select Unlock.
• Manage Flow
Note: Only users with full access to a document can lock or unlock section edits. AND
View All Data
4. Save the action.

69
Automate Your Business Processes Process Builder

Export a Document to a PDF from a Process


To mark a document as complete or to keep a document view-only for record keeping, export it
EDITIONS
to a PDF. You can choose to attach the PDF to a document or to a Salesforce record.
After you create a Quip action and select Export to PDF, fill in the relevant fields to add the action Available in: Lightning
to your process. Experience
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your USER PERMISSIONS
process. The name truncates to fit on the canvas.
To create, edit, or view
2. Optional. Enter the URL of the document you want to export to a PDF. To use a document processes:
housed in a URL field, set Type to Field Reference, and select the object’s field. • Manage Flow

3. Optional: To attach the PDF to a document, enter a target document URL. The PDF is added to AND
the end of the document. View All Data
4. To attach the PDF to a Salesforce record, enter the record’s Salesforce Organization ID and the
Target Record ID. PDFs attached to a record are added to the record’s Files component and
Notes and Attachments component, and are visible to any user with access to the record.
5. Save the action.

SEE ALSO:
Automate Pricing Proposals with Salesforce Flow

Send a Message from a Process


Send a message in a chat room or in a document. Messages sent in a document appear as inline
EDITIONS
comments or in the document body.
After you’ve created a Quip action and selected Send Message in Document or Send Message Available in: both Salesforce
in Chat, fill in the relevant fields to add the action to your process. Classic and Lightning
Experience
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your Available in: Essentials,
process. The name truncates to fit on the canvas. Professional, Enterprise,
Performance, Unlimited,
2. Enter the URL of the document or chat where you want to send your message. and Developer Editions
3. To send a message in a specific section of the document body, enter the Document Section
Anchor Link. USER PERMISSIONS
4. Enter the message you want to send.
To create, edit, or view
5. Save the action. processes:
• Manage Flow
AND
View All Data

70
Automate Your Business Processes Process Builder

Copy Comments from a Process


Copy comments from a template’s source document to the newly-created target document.
EDITIONS
1. Create a Quip action in Process Builder and select Copy Document.
Available in: Lightning
2. Under Advanced, select Copy comments to new document.
Experience
3. Save the action.

USER PERMISSIONS

To create, edit, or view


processes:
• Manage Flow
AND
View All Data

Launch a Flow from a Process


Start an autolaunched flow from your process to automate complex business processes. Create
EDITIONS
flows to perform logic and have events trigger the flows via processes without writing code.
To launch a flow from a process, you must create and activate the flow. The flow must be Available in: both Salesforce
autolaunched. Classic and Lightning
Experience
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your Available in: Essentials,
process. The name truncates to fit on the canvas. Professional, Enterprise,
Performance, Unlimited,
2. For Flow, search for and select the flow that you want to launch from this process. and Developer Editions
Only active, autolaunched flows are available.

3. Optionally, click Add Row to set values for the flow’s variables. USER PERMISSIONS

To create, edit, or view


Flow Start typing the name of the flow variable whose value you want to set, or processes:
Variable click to select a flow variable from the dropdown list. • Manage Flow
You can set values for any variables in the flow that allow input access. AND
View All Data
Note: However, for a text, picklist, or multi-select picklist variable
that isn’t a collection, a value of null is converted to an empty string
in the flow.

Type Select the type of value that you want to set. For example, select String to
manually enter the values for a Text collection variable, or select Reference
to use the value of a record for a record variable.

Value Set a value for the flow variable.


• For collection variables, use the text entry field to specify a value. The
value must match the collection variable's data type.
• For record variables, use the field picker to select an ID field. The ID must
correspond to a record whose object type matches the record variable’s
object.

71
Automate Your Business Processes Process Builder

• For record collection variables, use the field picker to select a related list. The selected records’ object
type must match the record collection variable’s object. For example, populate an record collection
variable with all child contact records associated with the account that started the process.

Note: If the related list is empty when the flow tries to populate the record collection variable
with field values from those records, the process fails.

4. Save the action.

Send an Email from a Process


Easily send an email from a process by using an email alert. Email alerts are configured outside of
EDITIONS
the Process Builder and contain the standard text, list of recipients, and template for an email.
Before you begin: Available in: both Salesforce
Classic and Lightning
• Make sure that the email alert you want to call from your process exists. If not, create the email
Experience
alert on page 692.
• Understand the daily limits for emails sent from email alerts. Available in: Essentials,
Professional, Enterprise,
You can use only email alerts that are associated with the same object that the process is associated Performance, Unlimited,
with. The record that started the process is used as the starting point for any merge fields that are and Developer Editions
used in the email alert.
After you’ve created an action and selected “Email Alerts” for the type, fill in the relevant fields to
USER PERMISSIONS
add the action to your process.
1. Enter a name for this action. To create, edit, or view
processes:
This text appears on the canvas and helps you differentiate this action from others in your
• Manage Flow
process. The name truncates to fit on the canvas.
AND
2. For Email Alert, type two or more letters to search for the email alert that you want to View All Data
use to send an email.
3. Save the action.

72
Automate Your Business Processes Process Builder

Send a Custom Notification from a Process


Send customized notifications when important events occur. Alert an account owner if a new
EDITIONS
support case is logged while trying to close a deal, or send a notification for a workflow built entirely
with custom objects. Add recipients and content to your custom notification, then add it to your Available in: both Salesforce
process. Classic and Lightning
Before you begin, make sure that the notification type you want to call from your process exists. If Experience
not, create a custom notification type.
Available in: Essentials,
After you’ve created an action and selected Send Custom Notification for the type, fill in the Professional, Enterprise,
relevant fields to add the action to your process. Performance, Unlimited,
and Developer Editions
1. Enter an easily recognizable name for this action.
The name appears on the canvas and helps you differentiate this action from others in your
process. The name truncates to fit on the canvas. USER PERMISSIONS

2. Select a notification type. To create, edit, or view


processes:
3. Select a recipient category, and designate or find a recipient ID.
• Manage Flow
• Current User — The user who initiated the record change, platform event, or process that AND
triggered the process. This option is useful for confirmation notifications, such as a successful
View All Data
submission of a form.
• Find User — The user who receives the notification each time this action is executed.
• User Field from a Record — A user referenced via UserId on the record that initiated the process or on a related record.
• Find Group — All users in the group that receives the notification each time this action is executed.
• Find Queue — All users in the queue that receives the notification each time this action is executed.
• Account Field from a Record — All users on the account team for an account referenced via AccountId on the record that initiated
the process or on a related record. This option is available if you’ve enabled account teams for your org.
• Opportunity Field from a Record — All users on the opportunity team for an opportunity referenced via OpportunityId on the
record that initiated the process or a related record. This option is available if you’ve enabled team selling for your org.
• Owner Field from a Record — An owner or queue referenced via OwnerId on the record that initiated the process or a related
record. With this option, you can send a notification to all record owners, regardless of whether the owner is an individual owner
or a queue.

4. Write a helpful notification title and body using text and merge fields.

Note: The content of custom push notifications depends on the Display full content push notifications setting. If full content
push notifications are not enabled, only the notification title is sent.

5. Save the action.

73
Automate Your Business Processes Process Builder

Send a Survey Invitation from a Process


Send an email invitation containing the link to a particular survey question or to launch a survey.
EDITIONS
After you select Send Survey Invitation as the action, fill in the relevant fields.
Available in: both Salesforce
1. Enter a name for this action.
Classic and Lightning
This text appears on the canvas and helps you differentiate this action from others in your Experience
process. The name truncates to fit on the canvas.
Available in: Developer,
2. Select an active survey. Enterprise, Performance,
3. Select a question or the survey link. and Unlimited Editions.

Note: You can send email invitations for questions of the following types: Like or Dislike,
Net Promoter Score (NPS), Rating, and Score. USER PERMISSIONS

4. Select the email template used to send the invitation. To create, edit, or view
processes:
Important: The available templates depend on whether you choose to send a question • Manage Flow
or the survey link. AND

5. Select the recipient type. View All Data

You can only send survey invitations to leads, contacts, and users in your org.

6. Select the recipient based on the object that's associated with the process.
7. Select your invitation settings.
8. Click Save.

Example: If you want to send an invitation to a case's contact, select Case as the object for the process, Contact as the recipient
type, and Contact ID as the recipient.

SEE ALSO:
Customize the Survey Invitation Email Templates

74
Automate Your Business Processes Process Builder

Submit a Record for Approval from a Process


Submit the record that started the process for approval.
EDITIONS
After you’ve created an action and selected “Submit for Approval” for the type, fill in the relevant
fields to add the action to your process. Available in: both Salesforce
Classic and Lightning
Only the record that started the process is submitted. You can’t submit any related records for
Experience
approval.
1. Enter a name for this action. Available in: Enterprise,
Performance, Unlimited,
This text appears on the canvas and helps you differentiate this action from others in your and Developer Editions
process. The name truncates to fit on the canvas.

2. For Approval Process, indicate whether to submit the record through the default USER PERMISSIONS
approval process or through a specific approval process.
The process fails if: To create, edit, or view
processes:
• The record is submitted to the default approval process, and there are no active approval • Manage Flow
processes for the record’s object type.
AND
• The record is submitted to the default approval process, and it doesn’t meet the criteria for
View All Data
any of the approval processes for the record’s object type.
• The record is submitted to a specific approval process, and it doesn’t meet the entry criteria.

3. To submit the record to a specific approval process:


a. Search for and select the approval process.
b. Indicate whether to skip the entry criteria for the approval process.

4. For Submitter, identify who receives notifications about the approval request.

Value Description
Current User The user who triggered the process by creating or editing a record.

User Field from a Record The user ID that’s stored in a field value on the record that’s being submitted for approval or another
record.

Other User A specific user in your organization.

If the submitter isn’t an allowed initial submitter on the approval process that runs, the process fails. Make sure that the initial
submitters for the approval processes that are related to this object include all users who could trigger this process. For details about
setting the initial submitters for an approval process, see Create an Approval Process with the Standard Wizard on page 591.
Any user with the "Modify All" permission to the object is allowed to submit a record for approval. They are permitted to submit the
record, even if they aren’t listed as initial submitter.

5. If necessary, enter submission comments. Don’t reference merge fields or formula expressions.
Submission comments appear in the approval history for the specified record. This text also appears in the initial approval request
email if the template uses the {!ApprovalRequest.Comments} merge field.

6. Save the action.

75
Automate Your Business Processes Process Builder

Update Records from a Process


Update one or more records that are related to the record that started the process by manually
EDITIONS
entering values or by using the values from related records.
After you’ve created an action and selected “Update Records” for the action type, fill in the relevant Available in: both Salesforce
fields to add the action to your process. The records’ Last Modified By field is set to the Classic and Lightning
user who started the process by creating or editing a record. Experience

1. Enter a name for this action. Available in: Essentials,


This text appears on the canvas and helps you differentiate this action from others in your Professional, Enterprise,
process. The name truncates to fit on the canvas. Performance, Unlimited,
and Developer Editions
2. For Record Type, select the record or records that you need to update, and then click
Choose.
USER PERMISSIONS
You can update only the record that started the process or records that are related to it. For
example, you can reference [Case].ContactId, but not To create, edit, or view
[Case].Contact.AccountId. processes:
• Manage Flow
• To update the record that started the process, click the appropriate radio button. For
example, if your process is based on a case record, click next to Select the Case record AND
that started your process. View All Data

• To update a record that’s related to the record that started the process, click the appropriate radio button and select one of the
field names in the drop-down list.
If you select a field that ends in “ID,” you’re selecting a single record. This field name corresponds to a lookup field on the original
record. For details on lookup fields, see Custom Field Types.
For example, if a case record started the process and you select Account Id, this action updates the account that’s associated
with the case.

76
Automate Your Business Processes Process Builder

If you select a plural item that doesn’t end in “ID,” you’re updating all the records of that object type that are related to the record
that started the process. This plural item corresponds to child records of the original record, which might appear in a related list
on the original record.
For example, if you select CaseComments, this action updates all the case comments that are related to the case.

• To update fields on a related record, click on a field with next to it (ending in “ID”) to access that record’s fields.
For example, let’s say that, for a process that evaluates a case record (1), you want to update all contacts that are related to the
case’s parent account. Click Account ID (2), then Contacts (3), and then Choose.

77
Automate Your Business Processes Process Builder

3. Optionally, specify conditions to filter the records you’re updating.


For example, if your process updates the status of a parent case, specify conditions so that you won’t update the parent case if its
status is set to On Hold.

Note: When you define conditions for updating records, you can’t:
• Reference a Long Text Area field
• Reference a Rich Text field
• Reference a child record’s related fields
For example, you can reference [Case].ContactId, but not [Case].Contact.AccountId.
When you define multiple filters, the filter logic usually defaults to AND. However, if multiple filters have the same field
selected and use the equals operator, the filters are combined with OR. For example, your filters check whether a case’s
Type equals Problem (1), Type equals Feature Request (2), and Escalated equals true (3). At run time, the filters are combined
to (1 OR 2) AND 3.
If you’re updating the record that started the process, Process Builder adds an implicit filter for you in the background:
[Object].Id equals myCurrentVariable.Id. If you add filter criteria that set the record’s ID to a value
using the equals operator, at runtime the [Object].Id equals filters are combined using OR filter logic. For
example, you update the case that started the process and add this filter: [Case].Id equals 500D00000044XgV.
At runtime, your filter is combined with the implicit filter ([Case].Id equals myCurrentVariable.Id) with
OR.

a. Select Updated records meet all conditions.


b. Set the conditions that you want to use to filter the updated records.

Field Select the field whose value you want to evaluate.

Operator The available operators depend on the field’s data type.

Type The available value types depend on the field’ data type. See Process Builder Value Types on page 36 for details.

Value Identify the value that you want to evaluate the field for.

78
Automate Your Business Processes Process Builder

For example, if your process updates account records, you can choose to update only accounts with an annual revenue (1)
greater than (2) $1,000,000 (3).

4. Specify the new field values.

Field Select the field whose value you want to set. To filter the drop-down list, type the name of the field.
You can assign values to fields only on the record or records that you identified in the Object field. Use a separate
Update Records action to update fields on related records.

Type Select the type of value that you want to use. The available types depend on the field that you’ve selected.

Value Set a value for the field. For example, if you select a Formula value type, click Build a formula... to create a formula
value for the field.

5. Save the action.

Call Apex Code from a Process


Add customized functionality to your process by calling Apex from the process.
EDITIONS
After you’ve created an action and selected “Apex” for the type, fill in the relevant fields to add the
action to your process. Available in: both Salesforce
Classic (not available in all
Important: To use this action in a process, ask your developer to annotate the appropriate orgs) and Lightning
method with @InvocableMethod. For details, see “InvocableMethod Annotation” Experience
in the Apex Developer Guide.
Available in: Enterprise,
The Apex class and the process are executed by the user whose action triggered the process. Performance, Unlimited,
1. Enter a name for this action. and Developer Editions
This text appears on the canvas and helps you differentiate this action from others in your
process. The name truncates to fit on the canvas. USER PERMISSIONS
2. Choose an Apex class by entering the name of the class to filter results or select a class from To create, edit, or view
the drop-down list. processes:
3. If the class includes an invocable variable, you can manually enter values or reference field • Manage Flow
values from a related record. AND
The value must match the variable’s data type. You can set values for sObject and primitive View All Data
type list variables only.
• To set values for sObject variables and sObject list values, reference an object’s related
records, for example, all child contact records associated with the Account object that started the process.

79
Automate Your Business Processes Process Builder

• To set a value for a primitive list variable (String, Integer, Time, and so on), select the String value type and enter a value in the
text input field. You can’t pass multiple values to lists.

4. Click Save.

Note: If you define an Apex action in your process and then modify the Apex class by adding a standard field reference (for
example, User.Phone), the Apex action is no longer visible in the process and must be added again.

Execute Actions for Multiple Criteria


Choose whether to stop or continue your process after specific criteria are met and associated
EDITIONS
actions execute.
For each criteria node and associated action group, choose whether to stop the process after Available in: both Salesforce
executing the actions or to continue the process and evaluate the next criteria node. Classic and Lightning
Experience
Important: When a process continues to the next criteria node, it evaluates the values that
the record had at the beginning of the process. For example: Available in: Essentials,
Professional, Enterprise,
1. The status of a case is New. Performance, Unlimited,
2. The case is edited. and Developer Editions
3. The process evaluates Criteria 1. The conditions are met, so the process updates the case’s
status to Escalated. USER PERMISSIONS
4. The process evaluates Criteria 2 using the record values from step 2.
To create, edit, or view
If you want a process to react to changes that occur in the process, select the advanced option processes:
in the object node. • Manage Flow
1. Make sure you’ve defined the next criteria and that your action group includes only immediate AND
actions. You can’t evaluate the next criteria when an action group contains scheduled actions. View All Data
2. To change what happens after actions execute, click STOP (1) or EVALUATE THE NEXT
CRITERIA (2). Initially, each action group is set to stop after executing actions.

80
Automate Your Business Processes Process Builder

3. Save your changes, and your choice appears on the canvas.

SEE ALSO:
Reevaluate Records in the Process Builder

Process Management
Process Builder allows you to see and manage all your processes in one place.
EDITIONS
To manage a process, from Setup, enter Builder in the Quick Find box, then select Process
Builder. Available in: both Salesforce
Classic and Lightning
From the process management page, you can:
Experience
• Create a process
Available in: Essentials,
• Edit a process
Professional, Enterprise,
• Delete an inactive process Performance, Unlimited,
• See the status of your existing processes and Developer Editions
• Sort your processes by name, description, object, last modified date, or status
When you open a process, you can: USER PERMISSIONS
• Clone the process To manage processes:
• Activate or deactivate the process • Manage Flow
• Edit the process properties AND

From the list of paused flow interviews in Setup, you can: View All Data

• Monitor scheduled actions that haven’t yet been executed


• Delete groups of scheduled actions that you no longer need to wait for

81
Automate Your Business Processes Process Builder

Process Status
Each process has a status that determines whether the process can be edited, activated, or deleted.
EDITIONS
Status Description Editable? Available in: both Salesforce
Active The process has been activated. No Classic and Lightning
Experience
You can’t make changes to an active process. However, you can
clone it. Make any necessary changes to the cloned process and Available in: Essentials,
then activate it. Don’t forget to deactivate the original process if Professional, Enterprise,
appropriate. Performance, Unlimited,
and Developer Editions
Inactive The process is inactive and can be activated. Yes

Clone a Process
If you want to make changes to an existing process, save a clone of that process. You can save the
EDITIONS
clone as either a new inactive process with its own version history, or as a new inactive version of
the existing process. Available in: both Salesforce
To make changes to an active process, you have a few options. Classic and Lightning
Experience
• Deactivate it, make changes, and then reactivate it.
• Clone it as an inactive version, make changes, and then activate the new version. The original Available in: Essentials,
version is automatically deactivated. Professional, Enterprise,
Performance, Unlimited,
• Clone it as a new inactive process, make changes and then activate it. The original process is
and Developer Editions
not automatically deactivated, so consider whether it’s appropriate for both processes to be
active.
USER PERMISSIONS
You can create up to 50 versions of a process, but only one version of a given process can be active.
1. From Setup, enter Builder in the Quick Find box, then select Process Builder. To create, edit, or view
processes:
2. Open the process or process version that you want to activate.
• Manage Flow
3. Click Clone. AND
4. You can create a version of the current process or a completely new process with its own version View All Data
history.
5. Enter a name, API name, and description.
6. Click Save.

82
Automate Your Business Processes Process Builder

Activate a Process
Salesforce doesn’t start using a new or revised process to evaluate records until you activate it.
EDITIONS
After you activate a process, you can no longer edit it. However, you can click Clone to save the
process as a new inactive process. Available in: both Salesforce
Classic and Lightning
You can’t activate a process unless it has:
Experience
• At least one defined criteria node
Available in: Essentials,
• At least one defined immediate or scheduled action
Professional, Enterprise,
1. From Setup, enter Builder in the Quick Find box, then select Process Builder. Performance, Unlimited,
and Developer Editions
2. Open the process version that you want to activate.
3. Click Activate.
USER PERMISSIONS
If you activate a version of a process that already has an active version, the previously active
version is automatically deactivated. To see that version later, refer to the process’s version To activate or deactivate
history. processes:
• Manage Flow
After you’ve activated your process, consider creating or editing test records that will start the
process to make sure it’s working correctly. If you do, remember to delete those test records or AND
return them to their previous values once you’ve confirmed that your process works as designed. View All Data
If you later want Salesforce to stop using a process to evaluate records as they’re created or edited, AND
open the active process and click Deactivate. Customize Application

Delete a Process Version


If you no longer need to use a process version that you’ve defined, delete it.
EDITIONS
To delete an active process, you must first deactivate it. You can’t delete process versions with an
Active status. If another process references your invocable process, you can’t delete the invocable Available in: both Salesforce
process. If a process has any scheduled actions, it can’t be deleted until those pending actions have Classic and Lightning
been executed or deleted. Experience

1. In Setup, enter Builder in the Quick Find box, then select Process Builder. Available in: Essentials,
2. Next to the appropriate process, click Professional, Enterprise,
to view all versions. Performance, Unlimited,
3. For the version that you want to delete, click Delete. and Developer Editions
If your process has only one version and you delete that version, the entire process is deleted.

4. Click OK. USER PERMISSIONS

To delete processes:
• Manage Flow
AND
View All Data

83
Automate Your Business Processes Process Builder

Monitor Your Processes’ Pending Scheduled Actions


You can check which of your processes are waiting to execute scheduled actions.
EDITIONS
1. From Setup, enter Flow in the Quick Find box, then select Paused And Failed Flow
Interviews. Available in: both Salesforce
If Paused Flow Interviews isn’t available as its own page, select Flows and scroll down to the Classic and Lightning
list of paused interviews. Experience

Available in: Essentials,


2. Create a view to see scheduled actions in the list of paused interviews.
Professional, Enterprise,
We recommend displaying these fields. Performance, Unlimited,
• Flow API Name or Flow Name—Contains the process name. and Developer Editions
• Paused Date—When the schedule started for the action group.
• Current Element—Identifies the group of scheduled actions that the process is USER PERMISSIONS
waiting to execute.
To see unexecuted
The format of a Current Element value is myWait_myRule_N, where N is the scheduled actions:
number of the associated criteria and action group. For example, myWait_myRule_2 • View Setup and
indicates that the scheduled action is associated with the second criteria node in the process. Configuration

• Type—Processes that are waiting to execute scheduled actions are of type Record Change
Process.

SEE ALSO:
Delete Unexecuted Scheduled Actions

Delete Unexecuted Scheduled Actions


If you no longer want to execute a process’s scheduled actions, you can delete them from the list
EDITIONS
of paused flow interviews in Setup.
1. From Setup, enter Flow in the Quick Find box, then select Paused Flow Interviews. Available in: both Salesforce
If Paused Flow Interviews isn’t available as its own page, select Flows and scroll down to the Classic and Lightning
list of paused interviews. Experience

Available in: Essentials,


2. In the Flow API Name or Flow Name column, find the process whose scheduled actions you
Professional, Enterprise,
want to delete.
Performance, Unlimited,
3. For each unexecuted group of scheduled actions that you want to delete, click Del, or click and Developer Editions
and select Delete.

USER PERMISSIONS
SEE ALSO:
Monitor Your Processes’ Pending Scheduled Actions To delete unexecuted
scheduled actions:
• Manage Flow

84
Automate Your Business Processes Process Builder

Troubleshoot Processes
Use the error messages that appear in the Process Builder and the emails you receive when a process
EDITIONS
fails to help solve problems that arise when you’re working with processes. When all else fails, look
at the Apex debug logs for your processes. Available in: both Salesforce
Classic and Lightning
Common Reasons Why Processes Fail Experience
Here are some common design problems that cause processes to fail. Available in: Essentials,
Errors in the Process Builder Professional, Enterprise,
The API names for criteria nodes and actions are created in the background. When you create Performance, Unlimited,
or update processes, you might see error messages that reference those names to help you and Developer Editions
identify specifically where the problem occurred.
What Happens When a Process Fails?
When a user does something that triggers a process, such as create a record, and the process fails, the user gets an error message.
The error message includes the process name, error ID, and sometimes technical information that the user can give to you, the
Salesforce admin. You can use the error ID to locate the detailed error email that is sent when the process failed.
Troubleshoot Processes with Apex Debug Logs
Use debug logs to find detailed information about your running processes after they finish running. For example, investigate why
a process doesn’t to trigger when a record meets the process’s criteria, or explore the sequence of processes being executed.
Send Alerts When a Screen Flow Fails
To save time troubleshooting screen flows that fail, subscribe to the Flow Execution Error Event platform event. When a flow interview
fails, Salesforce publishes a platform event message. In Process Builder, you can subscribe to the platform event and perform actions,
such as posting to Chatter or sending custom notifications.

SEE ALSO:
Common Reasons Why Processes Fail

Common Reasons Why Processes Fail


Here are some common design problems that cause processes to fail.
EDITIONS
• A user creates or edits a person account. An Account-based process evaluates the record. The
process’s criteria node references an account field, for example, [Account].Name Equals Available in: both Salesforce
Acme. Classic and Lightning
Experience
• The process references a field that hasn’t been set. For example, you reference
[Contact].Account.Description in your process. If the Account lookup field isn’t Available in: Essentials,
set on the contact, the process fails because it doesn’t know which account to reference. Professional, Enterprise,
The workarounds for this issue depend on where the reference exists in the process. Performance, Unlimited,
and Developer Editions
– If you reference it in filter conditions, add another filter condition that checks whether the
lookup field is set. You can do the same workaround if it’s referenced in a formula, for
example, [Contact].AccountId Is null False.

85
Automate Your Business Processes Process Builder

– Otherwise, consider making the fields required.

SEE ALSO:
Troubleshoot Processes
Errors in the Process Builder
What Happens When a Process Fails?

Errors in the Process Builder


The API names for criteria nodes and actions are created in the background. When you create or
EDITIONS
update processes, you might see error messages that reference those names to help you identify
specifically where the problem occurred. Available in: both Salesforce
Classic and Lightning
API Name Description Experience
myVariable_current.field field is the name of the field that’s referenced. Available in: Essentials,
myVariable_current refers to the field values that Professional, Enterprise,
the record had when it started the process. Performance, Unlimited,
For example, myVariable_current.Id corresponds and Developer Editions
to the record’s field value for Id when the record started
the process.

myVariable_old.field field is the name of the field that’s referenced.


myVariable_old refers to the most recent previous
values of the record that started the process.
For example, myVariable_old.Id corresponds to the
record’s field value for Id immediately before the record
started the process.

Example:

The element has an invalid reference to “myVariable_current.AnnualRevenue”.

myVariable_current.AnnualRevenue refers to the value for the field AnnualRevenue when the record started
the process.

Note: Error or warning messages might refer to a “flow” instead of a “process.” Those messages still apply to your process.

SEE ALSO:
Common Reasons Why Processes Fail

86
Automate Your Business Processes Process Builder

What Happens When a Process Fails?


When a user does something that triggers a process, such as create a record, and the process fails,
EDITIONS
the user gets an error message. The error message includes the process name, error ID, and
sometimes technical information that the user can give to you, the Salesforce admin. You can use Available in: both Salesforce
the error ID to locate the detailed error email that is sent when the process failed. Classic and Lightning
The email includes the element that failed, the error message from that failure, and details about Experience
the criteria and actions that the process tried to execute. The subject line is Error Occurred
Available in: Essentials,
During Flow “Process_Name”: Error. Professional, Enterprise,
Example: Performance, Unlimited,
and Developer Editions
Error Occurred During Flow "Opportunity_Management": No
applicable approval process was found.
// The error occurred when the LeadConvertEmail process was
triggered.
An error occurred at element myRule_1_A1 (FlowActionCall).
No applicable approval process was found.
// The error occurred at the first action (A1) that’s
associated with the
// first criteria node (myRule_1).

Flow Details
Flow Name: Opportunity_Management
Type: Workflow
Version: 3
Status: Active
Org: Acme (00DR00000000o82)
// The user triggered version 3 of the Opportunity_Management
process.

Flow Interview Details


Interview Label: Opportunity_Management-3_Opportunity
Current User: Madison Rigsby (0051a000000qJXL)
Start time: 2/2/2017 11:21 AM
Duration: 0 seconds
// The process was triggered by user Madison Rigsby.

How the Interview Started


Madison Rigsby (0051a000000qJXL) started the flow interview.
Some of this flow's variables were set when the interview
started.
myVariable_old = 0061a00000D3ibfAAB
myVariable_current = 0061a00000D3ibfAAB

ASSIGNMENT: myVariable_waitStartTimeAssignment
{!myVariable_waitStartTimeVariable} Equals
{!Flow.CurrentDateTime}
Result
{!myVariable_waitStartTimeVariable} = "2/2/2017 11:21 AM"

DECISION: myDecision
Executed this outcome: myRule_1
Outcome conditions: and

87
Automate Your Business Processes Process Builder

1. {!myVariable_current.StageName} (Proposal/Price Quote) Equals Proposal/Price Quote


Logic: All conditions must be true (AND)
// The first criteria node (myRule_1) checks whether the opportunity’s StageName
// is “Proposal/Price Quote”. It is, so the process moves on to execute the associated
// actions.

SUBMIT FOR APPROVAL: myRule_1_A1


Inputs:
objectId = {!myVariable_current.Id} (0061a00000D3ibfAAB)
comment = null
Error Occurred: No applicable approval process was found.
// The process tries to execute the first associated action.
// The action fails because no approval processes exist that
// the record can be submitted to. Maybe the org doesn’t include
// any active Opportunity approval processes. Or maybe it does, but the
// record doesn’t meet the entry criteria for any of them.
Salesforce Error ID: 593281227-1030 (-1996259564)

SEE ALSO:
Common Reasons Why Processes Fail
Send Alerts When a Screen Flow Fails
Control Who Receives Flow and Process Error Emails

Troubleshoot Processes with Apex Debug Logs


Use debug logs to find detailed information about your running processes after they finish running.
EDITIONS
For example, investigate why a process doesn’t to trigger when a record meets the process’s criteria,
or explore the sequence of processes being executed. Available in: both Salesforce
Tip: Make sure that your filters include FINER events in the WORKFLOW category. For details, Classic and Lightning
Experience
see Debug Log Levels.
When using debug logs to troubleshoot a process, consider the following. Available in: Essentials,
Professional, Enterprise,
• Processes created in the Process Builder appear as flows and workflow rules in debug logs. The Performance, Unlimited,
generated names have some resemblance to the process names, but they don’t map one-to-one. and Developer Editions
• Record change processes appear as flows of type Workflow. Invocable processes appear as
flows of type InvocableProcess. Event processes appear as flows of type CustomEvent.
• Immediate actions that are executed in a block are strung together in the flow. If one action fails in the middle, then the following
actions aren’t executed.
• Scheduled actions are executed after a FLOW_WAIT element. The actions are executed similarly to immediate actions after the
process resumes.
• WF_CRITERIA_BEGIN and WF_CRITERIA_END refer to the workflow rule criteria that are always set to true and not the
criteria defined in your process.
• Here’s how elements in the Process Builder correspond to flow debug events.

Process Builder Flow Debug Event


Element
Criteria FLOW_RULE_...

88
Automate Your Business Processes Process Builder

Process Builder Flow Debug Event


Element
Create a Record FLOW_ELEMENT_...

Update Records FLOW_ELEMENT_...

Post to Chatter FLOW_ACTIONCALL_...

Submit for Approval FLOW_ACTIONCALL_...

Email Alerts FLOW_ACTIONCALL_...

Flows FLOW_ACTIONCALL_...

Processes FLOW_ACTIONCALL_...

Apex FLOW_ACTIONCALL_...

Schedule FLOW_WAIT_...

Example: Debugging Immediate Actions


This example covers a process with an immediate Post to Chatter action.
Here’s what you can tell from this first snippet.
• The process is triggered by a lead named “Madison Rigby”.
• The name of the process is Hello_World. The number appended to the name is the process version’s ID:
301R000000009n0.
• The process is set to trigger when a record is created (ON_CREATE_ONLY).
10:11:26.594 (595241802)|EXECUTION_STARTED
10:11:26.594 (595255829)|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:Lead
10:11:26.594 (685753138)|WF_RULE_EVAL_BEGIN|Workflow
10:11:26.594 (686312384)|WF_CRITERIA_BEGIN|
[Lead: Ms. Madison Rigsby 00QR0000001HqC4]|Hello_World301R000000009n0|
01QR00000000Nz8|ON_CREATE_ONLY|0

In this snippet, the process compares the record’s current values to the values it had before it was changed.
myVariable_current contains all the record’s current field values. myVariable_old contains all the field values of
the record immediately before it was changed. In this example,myVariable_old has no values (null), because the process is
evaluating a newly created lead.
10:11:26.594 (688919502)|WF_FORMULA|
Formula:ENCODED:[treatNullAsNull]true|Values:
10:11:26.594 (689128428)|WF_CRITERIA_END|
true
10:11:26.594 (695758445)|WF_SPOOL_ACTION_BEGIN|
Workflow
10:11:26.594 (714823342)|WF_ACTION|
Flow Trigger: 1;
10:11:26.594 (714900811)|WF_RULE_EVAL_END
10:11:26.594 (719777561)|WF_FLOW_ACTION_BEGIN|
09LR000000005Td10:11:26.594 (720281142)|WF_FLOW_ACTION_DETAIL|

89
Automate Your Business Processes Process Builder

09LR000000005Td|[Lead: Ms. Madison Rigsby 00QR0000001HqC4]|Id=09LR000000005Td|


CurrentRule:Hello_World301R000000009n0 (Id=01QR00000000Nz8)
10:11:26.722 (722465931)|FLOW_CREATE_INTERVIEW_BEGIN|
00DR00000000o82|300R00000004PQB|301R000000009n0
10:11:26.722 (740702983)|FLOW_CREATE_INTERVIEW_END|
2416dcc6212273331b3d50a38a161dd464e3e-7fdd|Hello World
10:11:26.594 (748183550)|WF_FLOW_ACTION_DETAIL|
Param Name: myVariable_current,
Param Value: ENCODED:{![treatNullAsNull]{!ID:this}},
Evaluated Param Value: {Entity type: Lead, id: 00QR0000001HqC4MAK}|

Param Name: myVariable_old,


Param Value: {!old},
Evaluated Param Value: null

When the process started:


• This instance of the process starts with the FLOW_START_INTERVIEW_BEGIN event.
• Each FLOW_START_INTERVIEW_LIMIT_USAGE event displays the usage of a given limit when the process started.
In this example, the transaction hasn't done anything that counts toward a limit.
• A handful of variables are set. The process uses these variables to perform logic later.
– myVariable_old is set to nothing because the record didn't exist before this transaction.
– myVariable_current is set to the current values of the lead record.
– myVariable_waitStartTimeVariable is set to the current time.

10:11:26.750 (750700361)|FLOW_START_INTERVIEWS_BEGIN|1
10:11:26.750 (751285739)|FLOW_START_INTERVIEW_BEGIN|
2416dcc6212273331b3d50a38a161dd464e3e-7fdd|
Hello World
10:11:26.750 (751341782)|FLOW_START_INTERVIEW_LIMIT_USAGE|
SOQL queries: 0 out of 100
10:11:26.750 (751367432)|FLOW_START_INTERVIEW_LIMIT_USAGE|
SOQL query rows: 0 out of 50000
10:11:26.750 (751384035)|FLOW_START_INTERVIEW_LIMIT_USAGE|
SOSL queries: 0 out of 20
10:11:26.750 (751397896)|FLOW_START_INTERVIEW_LIMIT_USAGE|
DML statements: 0 out of 150
10:11:26.750 (751412225)|FLOW_START_INTERVIEW_LIMIT_USAGE|
DML rows: 0 out of 10000
10:11:26.750 (751427529)|FLOW_START_INTERVIEW_LIMIT_USAGE|
CPU time in ms: 0 out of 15000
10:11:26.750 (751472968)|FLOW_START_INTERVIEW_LIMIT_USAGE|
Heap size in bytes: 0 out of 6000000
10:11:26.750 (751490226)|FLOW_START_INTERVIEW_LIMIT_USAGE|
Callouts: 0 out of 100
10:11:26.750 (751505266)|FLOW_START_INTERVIEW_LIMIT_USAGE|
Email invocations: 0 out of 10
10:11:26.750 (751519128)|FLOW_START_INTERVIEW_LIMIT_USAGE|
Future calls: 0 out of 50
10:11:26.750 (751533892)|FLOW_START_INTERVIEW_LIMIT_USAGE|
Jobs in queue: 0 out of 50
10:11:26.750 (751547542)|FLOW_START_INTERVIEW_LIMIT_USAGE|

90
Automate Your Business Processes Process Builder

Push notifications: 0 out of 10


10:11:26.750 (752380627)|FLOW_VALUE_ASSIGNMENT|
2416dcc6212273331b3d50a38a161dd464e3e-7fdd|
myVariable_old|
10:11:26.750 (754872639)|FLOW_VALUE_ASSIGNMENT|
2416dcc6212273331b3d50a38a161dd464e3e-7fdd|
myVariable_current|
{LastModifiedDate=2018-02-28 18:11:26, Company=Acme Wireless, Email=null,
HasOptedOutOfFax=false, Latitude=null, MobilePhone=null, Industry=Apparel,
CreatedById=005R0000000J01RIAS, Street=null, PhotoUrl=null,
ConvertedOpportunityId=null, MasterRecordId=null,
LastModifiedByID=005R0000000J01RIAS, Status=Contacted, IsDeleted=false,
ConvertedAccountId=null, IsConverted=false, HasOptedOutOfEmail=false,
LastViewedDate=null, City=null, Longitude=null, LeadSource=External Referral,
CreatedByID=005R0000000J01RIAS, GeocodeAccuracy=null, State=null,
CreatedDate=2018-02-28 18:11:26, Country=null, Id=00QR0000001HqC4MAK,
LastName=Rigsby, AnnualRevenue=500000.0, Jigsaw=null, EmailBouncedDate=null,
Description=null, ConvertedDate=null, DoNotCall=false, Rating=null,
PostalCode=null, Website=null, LastReferencedDate=null, NumberOfEmployees=5,
Salutation=Ms., ConvertedContactId=null, OwnerId=005R0000000J01RIAS,
Phone=null, EmailBouncedReason=null, FirstName=Madison, IsUnreadByOwner=true,
Title=null, SystemModstamp=2018-02-28 18:11:26, LastActivityDate=null,
Fax=null, LastModifiedById=005R0000000J01RIAS,
LastTransferDate=2018-02-28 18:11:26, JigsawContactId=null}
10:11:26.750 (755116990)|FLOW_ELEMENT_BEGIN|
2416dcc6212273331b3d50a38a161dd464e3e-7fdd|
FlowAssignment|myVariable_waitStartTimeAssignment
10:11:26.750 (755457410)|FLOW_ASSIGNMENT_DETAIL|
2416dcc6212273331b3d50a38a161dd464e3e-7fdd|
myVariable_waitStartTimeVariable|ASSIGN|2/28/2018, 10:11 AM
10:11:26.750 (756105710)|FLOW_VALUE_ASSIGNMENT|

2416dcc6212273331b3d50a38a161dd464e3e-7fdd|myVariable_waitStartTimeVariable|2018-02-28T18:11:27Z
10:11:26.750 (756182849)|FLOW_ELEMENT_END|
2416dcc6212273331b3d50a38a161dd464e3e-7fdd|
FlowAssignment|myVariable_waitStartTimeAssignment

The process evaluates the first criteria.


In debug logs, a process criteria node is represented by a FLOW_RULE_DETAIL event. myRule_1 corresponds to the first
criteria node in the process. Because the result of myRule_1 is true, the process executes the actions associated with the first
criteria.
10:11:26.750 (757306870)|FLOW_ELEMENT_BEGIN|
2416dcc6212273331b3d50a38a161dd464e3e-7fdd|
FlowDecision|myDecision
10:11:26.750 (757582110)|FLOW_RULE_DETAIL|
2416dcc6212273331b3d50a38a161dd464e3e-7fdd|
myRule_1|true
10:11:26.750 (757616076)|FLOW_VALUE_ASSIGNMENT|
2416dcc6212273331b3d50a38a161dd464e3e-7fdd|
myRule_1|true
10:11:26.750 (757683580)|FLOW_ELEMENT_END|
2416dcc6212273331b3d50a38a161dd464e3e-7fdd|
FlowDecision|myDecision

91
Automate Your Business Processes Process Builder

In this snippet, the immediate actions for the first criteria are executed. In the name myRule_1_A1, “A1” indicates that this
element corresponds to the first action in the action group, which creates a task. The FLOW_BULK_ELEMENT_LIMIT_USAGE
events indicate that the action increased the transaction's usage count toward two limits: the number of DML statements issued
and the number DML rows processed.
10:11:26.750 (1898050716)|FLOW_ELEMENT_BEGIN|
68211d9d9f918ee32db47d21247161de215ce5-7d38|
FlowRecordCreate|myRule_1_A1
10:11:26.750 (1898121764)|FLOW_ELEMENT_DEFERRED|
FlowRecordCreate|myRule_1_A1
10:11:26.750 (1898261705)|FLOW_ELEMENT_END|
68211d9d9f918ee32db47d21247161de215ce5-7d38|
FlowRecordCreate|myRule_1_A1
10:11:26.750 (1345712687)|FLOW_START_INTERVIEW_END|
68211d9d9f918ee32db47d21247161de215ce5-7d38|Hello World
10:11:26.750 (1898350543)|FLOW_BULK_ELEMENT_BEGIN|
FlowRecordCreate|myRule_1_A1
10:11:26.750 (1928183118)|FLOW_BULK_ELEMENT_DETAIL|
FlowRecordCreate|myRule_1_A1|1
10:11:26.750 (2267557291)|FLOW_VALUE_ASSIGNMENT|
68211d9d9f918ee32db47d21247161de215ce5-7d38|
myRule_1_A1|true
10:11:26.750 (2267878414)|FLOW_BULK_ELEMENT_LIMIT_USAGE|
1 DML statements, total 1 out of 150
10:11:26.750 (2267929106)|FLOW_BULK_ELEMENT_LIMIT_USAGE|
1 DML rows, total 1 out of 10000
10:11:26.750 (2268002776)|FLOW_BULK_ELEMENT_END|
FlowRecordCreate|myRule_1_A1|1|370

Then the process finishes.


10:11:27.977 (1978733709)|FLOW_START_INTERVIEWS_END|1

10:11:27.989 (1989764561)|WF_FLOW_ACTION_END|09LR000000005Td
10:11:27.989 (1998560773)|WF_ACTIONS_END| Flow Trigger: 1;
10:11:27.989 (1998600044)|CODE_UNIT_FINISHED|Workflow:Lead
10:11:27.989 (2000437095)|EXECUTION_FINISHED

Example: Debugging Scheduled Actions


Scheduled actions are logged separately from immediate actions. After the scheduled time occurs, an automated process executes
the scheduled actions. However, the actions are still executed as the user who originally caused the process to run. The log uses
coordinated universal time (UTC) instead of the user’s time zone.
This example walks you through a debug log for a process with a scheduled Create a Record action.
Any events that start with FLOW_WAIT_ provide information about a process schedule. A schedule is always indicated by
myWait_myRule_int, where int identifies which criteria node the schedule is associated with.
In this snippet:
• The schedules that are associated with the first criteria node (myWait_myRule_1) are evaluated.
• The defined time for the first schedule has passed (myWaitEvent_myWait_myRule_1_event_0).
• FLOW_WAIT_RESUMING_DETAIL indicates that the interview is resumed so that the process can execute its scheduled
actions.

92
Automate Your Business Processes Process Builder

• The myVariable_current variable is updated with the latest values from the record that started the process originally.
10:21:35.461 (1461109547)|FLOW_BULK_ELEMENT_BEGIN|
WaitInfo|myWait_myRule_1
10:21:35.461 (1467206801)|FLOW_WAIT_EVENT_RESUMING_DETAIL|
2ef1ba5afce469a1e74b7b869161e25400a2-7f29|
myWait_myRule_1|myWaitEvent_myWait_myRule_1_event_0|DateRefAlarmEvent
10:21:35.461 (1467428864)|FLOW_WAIT_RESUMING_DETAIL|
2ef1ba5afce469a1e74b7b869161e25400a2-7f29|
myWait_myRule_1|0FoRM0000004C9I
10:21:35.461 (1503485017)|FLOW_VALUE_ASSIGNMENT|
2ef1ba5afce469a1e74b7b869161e25400a2-7f29|
myWaitEvent_myWait_myRule_1_event_0|true
10:21:35.461 (1509382975)|FLOW_VALUE_ASSIGNMENT|
2ef1ba5afce469a1e74b7b869161e25400a2-7f29|
myVariable_current|{Id=00QRM000003abIU2AY, IsDeleted=false,
MasterRecordId=null, Salutation=null, FirstName=Another, LastName=Lead,
Title=null, Company=Acme, Street=null, City=null, State=null, PostalCode=null,
Country=null, Latitude=null, Longitude=null, GeocodeAccuracy=null, Phone=null,
MobilePhone=null, Fax=null, Email=null, Website=null, PhotoUrl=null,
Description=null, LeadSource=Advertisement, Status=New, Industry=null,
Rating=null, AnnualRevenue=null, NumberOfEmployees=null, InternalSource=null,
OwnerId=005RM000001cEmFYAU, HasOptedOutOfEmail=false, IsConverted=false,
ConvertedDate=null, ConvertedAccountId=null, ConvertedContactId=null,
ConvertedOpportunityId=null, IsUnreadByOwner=false,
CreatedDate=2018-03-01 18:12:05, CreatedById=005RM000001cEmFYAU,
LastModifiedDate=2018-03-01 18:12:05, LastModifiedById=005RM000001cEmFYAU,
SystemModstamp=2018-03-01 18:12:05, LastActivityDate=null, DoNotCall=false,
CreatedByID=005RM000001cEmFYAU, LastModifiedByID=005RM000001cEmFYAU,
CampaignId=null, CampaignMemberStatus=null, HasOptedOutOfFax=false,
LastViewedDate=null, LastReferencedDate=null,
LastTransferDate=2018-03-01 18:12:05, Jigsaw=null, JigsawContactId=null,
ConnectionReceivedDate=null, ConnectionSentDate=null, EmailBouncedReason=null,
EmailBouncedDate=null}
10:21:35.461 (1512457819)|FLOW_BULK_ELEMENT_END|
WaitInfo|myWait_myRule_1|0|47

In this snippet, the process makes sure that the record's date field isn't null. Specifically, it checks the date field that's referenced
in the schedule.
10:21:35.461 (1514489368)|FLOW_ELEMENT_BEGIN|
2ef1ba5afce469a1e74b7b869161e25400a2-7f29|
FlowDecision|myPostWaitDecision_myWaitEvent_myWait_myRule_1_event_0
10:21:35.461 (1528928534)|FLOW_RULE_DETAIL|
2ef1ba5afce469a1e74b7b869161e25400a2-7f29|
myPostWaitRule_myWaitEvent_myWait_myRule_1_event_0|true
10:21:35.461 (1529027007)|FLOW_VALUE_ASSIGNMENT|
2ef1ba5afce469a1e74b7b869161e25400a2-7f29|
myPostWaitRule_myWaitEvent_myWait_myRule_1_event_0|true
10:21:35.461 (1529230456)|FLOW_ELEMENT_END|
2ef1ba5afce469a1e74b7b869161e25400a2-7f29|
FlowDecision|myPostWaitDecision_myWaitEvent_myWait_myRule_1_event_0

Now to execute the actions associated with the schedule. First up is ..._myRule_1_event_0_SA1.

93
Automate Your Business Processes Process Builder

• myRule_1 corresponds to the first criteria node


• event_0 corresponds to the first schedule associated with the criteria
• SA1 corresponds to the first action in the schedule.
The action creates a record. With the FLOW_BULK_ELEMENT_LIMIT_USAGE events, we see that action increased the
transaction's usage count toward two limits: the number of DML statements issued and the number DML rows processed.
10:21:35.461 (1529433132)|FLOW_ELEMENT_BEGIN|
2ef1ba5afce469a1e74b7b869161e25400a2-7f29|
FlowRecordCreate|myWaitEvent_myWait_myRule_1_event_0_SA1
10:21:35.461 (1529526210)|FLOW_ELEMENT_DEFERRED|
FlowRecordCreate|myWaitEvent_myWait_myRule_1_event_0_SA1
10:21:35.461 (1529619300)|FLOW_ELEMENT_END|
2ef1ba5afce469a1e74b7b869161e25400a2-7f29|
FlowRecordCreate|myWaitEvent_myWait_myRule_1_event_0_SA1
10:21:35.461 (1534801023)|FLOW_BULK_ELEMENT_BEGIN|
FlowRecordCreate|myWaitEvent_myWait_myRule_1_event_0_SA1
10:21:35.461 (1681358347)|FLOW_BULK_ELEMENT_DETAIL|
FlowRecordCreate|myWaitEvent_myWait_myRule_1_event_0_SA1|1
10:21:35.461 (1963485392)|FLOW_VALUE_ASSIGNMENT|
2ef1ba5afce469a1e74b7b869161e25400a2-7f29|
myWaitEvent_myWait_myRule_1_event_0_SA1|true
10:21:35.461 (1973349443)|FLOW_BULK_ELEMENT_LIMIT_USAGE|
1 DML statements, total 1 out of 150
10:21:35.461 (1973886332)|FLOW_BULK_ELEMENT_LIMIT_USAGE|
1 DML rows, total 1 out of 10000
10:21:35.461 (1974083134)|FLOW_BULK_ELEMENT_END|
FlowRecordCreate|myWaitEvent_myWait_myRule_1_event_0_SA1|1|429

This snippet displays some internal logic that Process Builder performs for you. The process uses a variable to note that it has
executed the action for this schedule, so that it doesn't accidentally duplicate the action.
10:21:41.527 (7529131090)|FLOW_ELEMENT_BEGIN|
2ef1ba5afce469a1e74b7b869161e25400a2-7f29|
FlowAssignment|myWaitEvent_myWait_myRule_1_event_0_postWaitExecutionAssignment
10:21:41.527 (7529875281)|FLOW_ASSIGNMENT_DETAIL|
2ef1ba5afce469a1e74b7b869161e25400a2-7f29|
myWaitEvent_myWait_myRule_1_event_0_postActionExecutionVariable|ASSIGN|true
10:21:41.527 (7529943822)|FLOW_VALUE_ASSIGNMENT|
2ef1ba5afce469a1e74b7b869161e25400a2-7f29|
myWaitEvent_myWait_myRule_1_event_0_postActionExecutionVariable|true
10:21:41.527 (7530040052)|FLOW_ELEMENT_END|
2ef1ba5afce469a1e74b7b869161e25400a2-7f29|
FlowAssignment|myWaitEvent_myWait_myRule_1_event_0_postWaitExecutionAssignment

Then the process evaluates whether to execute any of the other schedules. Notice that the conditions are no longer met for
..._event_0. Because of the variable assignment in the previous snippet, the process doesn't re-execute the actions associated
with that schedule.
There's only one schedule, so the process finishes.
10:21:41.527 (7530094566)|FLOW_ELEMENT_BEGIN|
2ef1ba5afce469a1e74b7b869161e25400a2-7f29|
WaitInfo|myWait_myRule_1
10:21:41.527 (7530148328)|FLOW_ELEMENT_DEFERRED|

94
Automate Your Business Processes Flows

WaitInfo|myWait_myRule_1
10:21:41.527 (7530225216)|FLOW_ELEMENT_END|
2ef1ba5afce469a1e74b7b869161e25400a2-7f29|
WaitInfo|myWait_myRule_1
10:21:41.527 (7530291079)|FLOW_BULK_ELEMENT_BEGIN|
WaitInfo|myWait_myRule_1
10:21:41.527 (7530832531)|FLOW_WAIT_EVENT_WAITING_DETAIL|
2ef1ba5afce469a1e74b7b869161e25400a2-7f29|
myWait_myRule_1|myWaitEvent_myWait_myRule_1_event_0|DateRefAlarmEvent|false
10:21:41.527 (7530895796)|FLOW_WAIT_WAITING_DETAIL|
2ef1ba5afce469a1e74b7b869161e25400a2-7f29|
myWait_myRule_1|0|
10:21:41.527 (7530968776)|FLOW_VALUE_ASSIGNMENT|
2ef1ba5afce469a1e74b7b869161e25400a2-7f29|
myWaitEvent_myWait_myRule_1_event_0|false
10:21:41.527 (7531068544)|FLOW_BULK_ELEMENT_END|
WaitInfo|myWait_myRule_1|0|1

SEE ALSO:
Troubleshoot Processes

Send Alerts When a Screen Flow Fails


To save time troubleshooting screen flows that fail, subscribe to the Flow Execution Error Event
EDITIONS
platform event. When a flow interview fails, Salesforce publishes a platform event message. In
Process Builder, you can subscribe to the platform event and perform actions, such as posting to Available in: both Salesforce
Chatter or sending custom notifications. Classic and Lightning
1. Define the process properties on page 43 to start when a platform event message is received. Experience

2. Configure a process trigger for a platform event on page 45. Available in: Essentials,
3. Add the process criteria on page 46. Professional, Enterprise,
Performance, Unlimited,
4. Create a Chatter post on page 53, or send a custom notification on page 73. and Developer Editions

SEE ALSO:
Create a Process
Troubleshoot Processes
Platform Events Developer Guide: FlowExecutionErrorEvent

Flows
A flow is the part of Salesforce Flow that collects data and performs actions in your Salesforce org or an external system. Salesforce Flow
provides two types of flows: screen flows and autolaunched flows.
To automate a business process that collects data from people, use a screen flow. For example, create a guided tutorial or wizard with
screens.
To launch a flow internally when a record changes or when a user clicks a button, use an autolaunched flow. For example, add automation
to your page or app to perform an action to a record when a user clicks a button.

95
Automate Your Business Processes Flows

Flow Builder
Get to know Flow Builder’s requirements and user interface.
Flow Concepts
If you’re new to flows, in need of a review, or just curious, dive in and learn about what a flow is made of and how it’s different from
workflow rules.
Flow Best Practices
Before you begin building and distributing flows, understand the best practices.
Build a Flow
After you model the process that you want to automate, design and build the flow in Flow Builder.
Test a Flow
Before you activate a flow, test it thoroughly to make sure that it works as expected.
Distribute a Flow
Once you’ve designed and tested your flow, it’s time to put it to work! Flows can be executed in several ways, depending on who
the flow is designed for. Internal users, external users, or systems can run a flow, or a flow can be deployed for another organization.
Flow Interviews
A flow interview is a running instance of a flow. A flow is an application built by your administrator that asks you for inputs and does
something in Salesforce based on those inputs.
Monitor Flows and Processes
Monitor your org’s usage of flows and processes. See a list of paused interviews and scheduled actions from processes. Control who
can view and how they view monitoring information for flows and processes.
Troubleshoot Flows
To troubleshoot a failed flow interview, use the flow fault email. To debug the flow and observe what happens as it runs, use the
debug option in Flow Builder. To view the failed flow interview in an interactive environment, click Flow Error: Click here to debug
the error in Flow Builder in the flow fault email.
Flow Limits and Considerations
When designing, managing, and running flows, consider the permissions, use limits, and data issues.
Flow Reference
Bookmark this page for quick access to information about flow elements, resources, events, and more.

SEE ALSO:
Which Automation Tool Do I Use?
Building Blocks of Flows
Browser Requirements

96
Automate Your Business Processes Flows

Flow Builder
Get to know Flow Builder’s requirements and user interface.
EDITIONS

Tour the Flow Builder User Interface Available in: both Salesforce
Classic and Lightning
Experience

Available in: Essentials,


Professional, Enterprise,
Performance, Unlimited,
and Developer Editions

USER PERMISSIONS

To open, edit, or create a


flow in Flow Builder:
• Manage Flow

Button Bar (1)


Manage your flow as you build it.
• In auto-layout, click Select Elements, then click on each element that you want to select. You can then click to copy all
selected elements to the clipboard.
• To access the flow version’s properties, such as context and API version, click .
• Choose between Auto-Layout or Free-Form. Auto-Layout is the default for all new flows.
• If the flow has warnings or errors, the Show Warnings icon ( ) or the Show Errors icon ( ) appears. To see details, click the
icon.
• To run the most recent save of the flow version that’s open, click Run. If the flow version contains Subflow elements, the active
version of its referenced flow is executed. If the referenced flow has no active version, then the Subflow element runs the latest
version of its referenced flow.
• To the left of the Run button, you can see the version’s active or inactive status and when it was last saved.
• To test the flow that’s open, click View Tests, and then click Create. Set test parameters and assertions.
• To debug the most recent save of the flow version that’s open, click Debug. Define values for input variables, roll back changes
so debugging doesn’t impact data, view debug details about how the flow runs, and use those details to troubleshoot errors.
• To make the current flow version available to your users, click Activate. Only one version of each flow can be active at a time.
• To save your flow, click Save, or to save it as a new version or a new flow, click Save As.

97
Automate Your Business Processes Flows

Canvas (2)
Build a flow on the canvas. As you add elements to the canvas and connect them, you can see a diagram of your flow. In auto-layout,
click on a connector to add an element, or click an element to see options for that element, such as Copy Element or Delete
Element.
Toolbox (3)
• In free-form, use the Elements tab to add new elements such as Screen and Create Records.
• In free-form and auto-layout, use the Manager tab to create variables, stages, choices, and other resources to use in your flow.
Or view a list of all elements and resources that you added.
Keyboard Shortcuts
Use these handy keyboard shortcuts for macOS and Windows to quickly navigate flows.

Action macOS Windows


Zoom in Cmd+Option+= Ctrl+Alt+=

Zoom out Cmd+Option+- Ctrl+Alt+-

Zoom to fit Cmd+Option+1 Ctrl+Alt+1

Zoom to view Cmd+Option+0 Ctrl+Alt+0

Select multiple elements on the canvas Shift+Click Shift+Click

Delete elements on the canvas Delete Backspace

Switch panel focus F6 F6

View available keyboard shortcuts Cmd+/ Ctrl+/

SEE ALSO:
Flow Elements
Flow Resources
Browser Requirements

Flow Concepts
If you’re new to flows, in need of a review, or just curious, dive in and learn about what a flow is made of and how it’s different from
workflow rules.

Building Blocks of Flows


Use combinations of elements, connectors, and resources to build flows.
Flow Types
A flow or flow version’s type determines which elements and resources are supported and the ways that the flow can be distributed.
Triggers for Autolaunched Flows
In the Start element of an autolaunched flow, you can specify a trigger that launches the flow. The flow trigger can be a schedule
or the new and changed records of a specified object. Without a trigger, you must set up other things to launch the flow, such as
custom buttons, processes, Apex classes, or even Einstein Bots.

98
Automate Your Business Processes Flows

What's the Difference Between Workflow Rules and Flows?


Salesforce offers several features that automate standard internal procedures and business processes to save time across your org.
Despite their similar names, workflow rules and flows are separate Salesforce features for automating business processes.
Advanced Flow Concepts
After you understand the basics, you’re ready for a closer look at what you can do after a flow finishes. Learn what happens when a
flow interacts with the Salesforce database, and how flows perform similar operations at the same time.

Building Blocks of Flows


Use combinations of elements, connectors, and resources to build flows.
EDITIONS

Available in: both Salesforce


Classic and Lightning
Experience

Available in: Essentials,


Professional, Enterprise,
Performance, Unlimited,
and Developer Editions

• Each element (1) represents an action that the flow can execute. Examples include reading or writing Salesforce data, displaying
information to and collecting data from flow users, executing logic, or manipulating data.
• Each connector (2) defines an available path that the flow can take at run time.
• Each resource (3) represents a value that you can reference throughout the flow.

SEE ALSO:
Flow Elements
Flow Resources
Flow Connectors

99
Automate Your Business Processes Flows

Flow Types
A flow or flow version’s type determines which elements and resources are supported and the ways
EDITIONS
that the flow can be distributed.
Available in: both Salesforce
Standard Flow Types Classic and Lightning
Experience
These flow types are supported in Flow Builder.
Available in: Essentials,
Type Description Available Distribution Supported Professional, Enterprise,
Methods in Performance, Unlimited,
Translation and Developer Editions
Workbench
Screen Flow Requires user interaction • Flow actions
because it includes screens, local
• Lightning pages
actions, steps, choices, or
dynamic choices. Screen flows • Experience Builder pages
don’t support Pause elements. • Custom Aura components
• Custom Lightning web
components
• Custom buttons or custom
links
• Flow Orchestrator (Beta)
• Web tabs
• Direct flow URLs
• Visualforce pages
• Lightning Out
• Embedded Service
deployments

Autolaunched Doesn’t require user interaction. • Processes


Flow with This flow type doesn’t support
• Custom Apex classes
No Flow screens, local actions, choices, or
Trigger choice sets. • REST API
• Flow Orchestrator (Beta)
• Web tabs
• Custom buttons or custom
links
• Visualforce pages

Autolaunched Runs only from a schedule. This A schedule-triggered flow runs


Flow with a flow type doesn’t support user only at the scheduled time and
Schedule interaction, screens, local actions, frequency.
Trigger choices, or choice sets.

100
Automate Your Business Processes Flows

Type Description Available Distribution Methods Supported in


Translation
Workbench
Autolaunched Makes before-save updates to the new or A record-triggered flow runs only when a
Flow with a Record changed record that launches the flow. Only record is created or updated.
Trigger these elements are supported: Assignment,
Decision, Get Records, and Loop.

Recommendation Builds a personalized list of recommendations • Einstein Next Best Action component on
Strategy for users. When a user responds to a Lightning pages
recommendation, that recommendation
• Suggested Actions component on
launches its assigned flow. Used by Einstein
Experience Cloud pages
Next Best Action.
• Visualforce pages

User Provisioning Provisions users for third-party services. A user provisioning flow can only be
Flow For example, use this flow type to customize implemented by associating it with a
the user provisioning configuration for a connected app when running the User
connected app to link Salesforce users with Provisioning Wizard.
their Google Apps accounts.

Field Service Requires user interaction because it has one Field Service mobile app
Mobile Flow or more screens.

Field Service Requires user interaction because it has one Embedded Appointment Booking
Embedded Flow or more screens.

Contact Request Requires user interaction because it has one Use one of these Experience Builder
Flow or more screens. components to add this flow.
• Contact Request Button & Flow—launch
the flow in a window
• Flow—embed the flow directly on the
page

Checkout Flow Used in Lightning B2B Commerce to create a Use the following Experience Builder
checkout for your store. Requires user component to add this flow to your store.
interaction because it has one or more screens.
• Checkout

Orchestrator (Beta) Used by Flow Orchestrator to create an • Autolaunched orchestrations


orchestration. An orchestration is a series of
stages made up of steps. Interactive steps – Custom Apex classes
contain a screen flow and require user – Custom buttons or custom links
interaction. Background steps contain an
• Record-triggered orchestrations run only
autolaunched flow and don’t require user
when a record is created or updated.
interaction.

Loyalty Used to create flows that are triggered by Loyalty Management app
Management Flow loyalty program processes. Doesn’t require

101
Automate Your Business Processes Flows

Type Description Available Distribution Methods Supported in


Translation
Workbench
user interaction. This flow type doesn’t support
screens, local actions, choices, or choice sets.

Other Flow Types


Not all flow types are supported in Flow Builder. Some flow types are used only in other parts of Salesforce, so they’re not listed in the
Flows page in Setup. However, the list of paused flow interviews can include these types.

Type Description
Invocable Process A process, created in Process Builder, that starts when it’s called from another process.

Platform Event A process, created in Process Builder, that starts when a particular platform event message is received.
Process

Record Change A process, created in Process Builder, that starts when a record is created or edited for a particular object.
Process

Transaction A flow used in the Transaction Security App.


Security Flow

SEE ALSO:
Flow Version Properties
User Provisioning for Connected Apps
Triggers for Autolaunched Flows

Triggers for Autolaunched Flows


In the Start element of an autolaunched flow, you can specify a trigger that launches the flow. The
EDITIONS
flow trigger can be a schedule or the new and changed records of a specified object. Without a
trigger, you must set up other things to launch the flow, such as custom buttons, processes, Apex Available in: both Salesforce
classes, or even Einstein Bots. Classic and Lightning
Experience
Manage Record-Triggered Flows Available in: Essentials,
See and manage your record-triggered flows with Flow Trigger Explorer. Flow Trigger Explorer Professional, Enterprise,
shows all of the flows that are associated with a specified object and that run when a record is Performance, Unlimited,
created, updated, or deleted. and Developer Editions
Schedule Triggers for Flows That Run for Batches of Records
A schedule-triggered flow starts at the specified time and frequency for a batch of records.
Configure the schedule trigger in the Start element of your autolaunched flow.
Record Triggers for Flows That Make Before-Save Updates
Creating or updating a record can trigger an autolaunched flow to make additional updates to that record before it's saved to the
database. A record-triggered flow can update a Salesforce record 10 times faster than a record-change process. Configure the record
trigger in the Start element of your autolaunched flow.

102
Automate Your Business Processes Flows

Define the Run Order of Record-Triggered Flows for an Object


Specify a trigger order value to determine the run order of before-save or after-save flows for the same object.

SEE ALSO:
Apex Developer Guide: Triggers and Order of Execution

Manage Record-Triggered Flows


See and manage your record-triggered flows with Flow Trigger Explorer. Flow Trigger Explorer
EDITIONS
shows all of the flows that are associated with a specified object and that run when a record is
created, updated, or deleted. Available in: both Salesforce
In Flow Trigger Explorer, you can navigate between an individual flow in Flow Builder and other Classic and Lightning
flows that run under the same circumstances. You can also create flows, reorder flows, see details Experience
about a flow, and manage flow versions.
Available in: Essentials,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions

In Flow Trigger Explorer, select an object (1) and a trigger (2) to see flows that run when a record for that object is created, updated, or
deleted. See all of the before-save (3) and after-save flows (4) that run for the same object and trigger. Click a flow label (5) to open the
flow in Flow Builder in a new tab. See any asynchronous paths (6) that are associated with flows that run for the same object and trigger.
Click a menu dropdown and select Flow Details and Versions (7) to see details and activate or deactivate versions of the flow (8).

103
Automate Your Business Processes Flows

Schedule Triggers for Flows That Run for Batches of Records


A schedule-triggered flow starts at the specified time and frequency for a batch of records. Configure
EDITIONS
the schedule trigger in the Start element of your autolaunched flow.
Schedule an autolaunched flow to start at a specific time and set it to run once, daily, or weekly. To Available in: both Salesforce
have the scheduled flow run for a batch of records, specify the object and the filter conditions that Classic and Lightning
each record must meet. Experience

A flow interview runs for each record in the batch and stores all of the record’s field values in the Available in: Essentials,
$Record global variable. As you build the scheduled flow, reference the $Record global Professional, Enterprise,
variable to access the record’s field values. Performance, Unlimited,
and Developer Editions
If you configure an Update Records element to use the ID and all field values from the $Record
global variable, enable Filter inaccessible fields from flow requests in
your org’s process automation settings. Otherwise, the flow fails because the Update Records
element tries to set the values for system fields and other read-only fields.
You can monitor scheduled flows from the Scheduled Jobs page in Setup.

SEE ALSO:
Schedule-Triggered Flow Considerations
Troubleshooting Considerations for Flows

Record Triggers for Flows That Make Before-Save Updates


Creating or updating a record can trigger an autolaunched flow to make additional updates to that
EDITIONS
record before it's saved to the database. A record-triggered flow can update a Salesforce record 10
times faster than a record-change process. Configure the record trigger in the Start element of your Available in: both Salesforce
autolaunched flow. Classic and Lightning
Perhaps you’re familiar with Process Builder and using a record-change process to make additional Experience
updates to each record that triggers the process. Before-save updates in flows accomplish that
Available in: Essentials,
same goal, but much more quickly because each record doesn’t get saved to the database again. Professional, Enterprise,
Avoiding that extra save procedure means skipping another round of assignment rules, auto-response Performance, Unlimited,
rules, workflow rules, and other customizations that take time to execute. and Developer Editions

104
Automate Your Business Processes Flows

Perhaps you’re familiar with Apex triggers. A flow that makes before-save updates is similar to a before trigger. The previously
described record-change process is similar to an after trigger. In a save procedure, before-save updates in flows are executed
immediately prior to Apex before triggers.
Because of their speed, we recommend that you use before-save updates in flows to update fields on new or changed records. However,
sometimes you must use a record-change process or an Apex after trigger to:
• Access field values that are set only after the record is saved, such as the Last Modified Date field or the ID of the new record.
• Create or update related records.
• Perform actions other than updating the record that launches the flow.
Flows that make before-save updates are typically simpler to build than other types of flows.
• The $Record global variable contains the values from the record that triggers the flow to run. As a result, there’s no need to add
a Get Records element to obtain the record data nor create flow variables to store the record data.
• When the flow changes the values in the $Record global variable, Salesforce automatically applies those new values to the record.
So there’s no need to add an Update Records element to save the new values to the database.
• Only these elements are supported: Assignment, Decision, Get Records, and Loop. These elements let you obtain data from other
Salesforce records, and use them to decide whether to update the triggering record’s fields and to what values.

SEE ALSO:
Record-Triggered Flow Considerations
Apex Developer Guide : Triggers and Order of Execution

Define the Run Order of Record-Triggered Flows for an Object


Specify a trigger order value to determine the run order of before-save or after-save flows for the
EDITIONS
same object.
Declaratively configure a flow to run before or after another flow. Order your flows to help ensure Available in: both Salesforce
consistent results without creating overly complex flows, letting you divide automation by teams Classic and Lightning
or logical owners. Experience

• When you save a before- or after-save record-triggered flow, specify a trigger order value from Available in: Essentials,
1 to 2,000. If a flow is already saved, specify a trigger order value in the flow’s version properties. Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
Guidelines for Defining the Run Order of Record-Triggered Flows for an Object
Learn guidelines for configuring a record-triggered flow to run before or after another
record-triggered flow.

105
Automate Your Business Processes Flows

Guidelines for Defining the Run Order of Record-Triggered Flows for an Object
Learn guidelines for configuring a record-triggered flow to run before or after another
EDITIONS
record-triggered flow.
• You can define a trigger order values only for before-save or after-save flows on an object. Available in: both Salesforce
Trigger order affects only the specified object's flows with the same trigger type. Classic and Lightning
Experience
• Trigger order values always respect order of execution rules. For example, you can make an
after-save flow run before other after-save flows, but you can’t make an after-save flow run Available in: Essentials,
before a before-save flow or an Apex trigger, even if the trigger order value is lower. Professional, Enterprise,
• Flows with the same trigger (before- or after-save) on the same object with trigger order values Performance, Unlimited,
from 1 to 1,000 run in ascending order (1, 2, 3, and so on). Multiple flows with the same trigger and Developer Editions
order value run in alphabetical order based on the flows’ API names.
• Flows without trigger order values run next and in the order of their created dates. Flows created
in Winter ’22 and earlier run in this order, unless you define a trigger order value for them.
• Flows with trigger order values from 1,001 to 2,000 run next and in ascending order. Multiple flows with the same trigger order value
run in alphabetical order based on the flows’ API names.
• When you order a large number of flows, a best practice is to evenly distribute the trigger order values, for example, 10, 20, 30, or
100, 200, 300. Then later, you can easily slot another flow in between, for example, between 10 and 20. This practice can help you
avoid changing the trigger order values for preexisting flows.
• Activating, deactivating, or changing the order for one flow can cause the order for other flows to automatically update. Ordering
record-triggered flows has no direct effect on any associated scheduled or asynchronous paths.

SEE ALSO:
Apex Developer Guide: Triggers and Order of Execution

What's the Difference Between Workflow Rules and Flows?


Salesforce offers several features that automate standard internal procedures and business processes to save time across your org. Despite
their similar names, workflow rules and flows are separate Salesforce features for automating business processes.
Workflow rule
A workflow rule is the main container for a set of workflow instructions, which can be broken into two main components.
1. Criteria: what must be true of the record for the workflow rule to execute the associated actions. A workflow rule’s criteria is
always tied to one object.
2. Actions: what to do when the record meets the criteria.
Flow
A flow is an application that automates a business process by collecting data and doing something in your Salesforce org or an
external system. Unlike workflow rules, which always execute behind the scenes, flows can provide screens to guide users through
your business process.
Flows aren’t tied to any one object. They can look up, create, update, and delete records for multiple objects. You build flows using
Flow Builder, which is a point-and-click tool.

106
Automate Your Business Processes Flows

Note: You may also have heard the term Visual Workflow. That’s a retired product name for designing, managing, and running
flows. Visual Workflow has been superseded by Salesforce Flow. Salesforce Flow is the product that encompasses building,
managing, and running flows and processes.

SEE ALSO:
Which Automation Tool Do I Use?
Workflow
Flows

Advanced Flow Concepts


After you understand the basics, you’re ready for a closer look at what you can do after a flow finishes. Learn what happens when a flow
interacts with the Salesforce database, and how flows perform similar operations at the same time.

Running User of a Flow


The running user of a flow is the user that launched the flow. The running user determines what a flow that runs in user context can
do with Salesforce data.
API Version for Running a Flow
Some run-time behavior improvements are delivered as versioned updates, so that you can control when each flow adopts those
updates. Test and upgrade your flows one by one and at your own pace. You can even opt to never adopt versioned updates for
one or all your flows.
Flow Environments
A flow environment specifies where a flow can run. For example, if a flow is associated with the Slack flow environment, you can
enable users to launch the flow from Slack.
What Happens When a Flow Finishes?
By default, when a flow interview that uses screens finishes, a new interview for that flow begins, and the user is redirected to the
first screen. To override the default behavior, you can add a local action to your flow. Some distribution methods also offer other
ways to override a flow’s finish behavior, such as by setting the retURL parameter in a flow URL.
Flows in Transactions
Each flow interview runs in the context of a transaction. A transaction represents a set of operations that are executed as a single
unit. For example, a transaction can execute Apex triggers and escalation rules in addition to a flow interview. If one interview in a
transaction fails, all the interviews in the transaction are rolled back, as well as anything else the transaction did. The transaction
doesn’t retry any of the operations—including the flow interview.
Flow Bulkification in Transactions
Programmers can design their code so that similar actions are performed together in one batch. For example, one operation to
create 50 records rather than 50 separate operations that each create one record. This process is called bulkification, and it helps
your transaction avoid governor limits. If you’re working with flows, you don’t even have to think about bulkification. Flow interviews
bulkify actions for you automatically.
Apex-Defined Data Type
With the Apex-defined data type, flows can manipulate the kinds of complex data objects that are typically returned from calls to
web services. Create Apex-defined variables in flows and directly process JSON returned from web calls.

107
Automate Your Business Processes Flows

Running User of a Flow


The running user of a flow is the user that launched the flow. The running user determines what a
EDITIONS
flow that runs in user context can do with Salesforce data.
For a flow running in user context, the running user’s profile and permission sets determine the Available in: both Salesforce
object permissions and field-level access of the flow. When a flow attempts to create, read, edit, or Classic and Lightning
delete Salesforce data, it enforces the running user’s permissions and field-level access. For example, Experience
if the running user doesn’t have the edit permission for the Account object, and the flow attempts
Available in: Essentials,
to update account records, an error occurs. If the running user doesn’t have permission to edit the Professional, Enterprise,
Rating field on the Account object, and the flow attempts to update that field, an error occurs. Performance, Unlimited,
Org-wide default settings, role hierarchies, sharing rules, manual sharing, teams, and territories also and Developer Editions
impact what data is accessible to flows that run in user context. If the org-wide default of the
Opportunity object is private, and no opportunity records have been shared with the running user,
the flow can’t read or edit any opportunity records.

SEE ALSO:
Which Context Do Flows Run In?
Always Run in System Context
Customize What Happens When a Flow Fails

API Version for Running a Flow


Some run-time behavior improvements are delivered as versioned updates, so that you can control
EDITIONS
when each flow adopts those updates. Test and upgrade your flows one by one and at your own
pace. You can even opt to never adopt versioned updates for one or all your flows. Available in: both Salesforce
By default, when you create a flow, it’s configured to run in the latest API version. That API version Classic and Lightning
doesn’t change as future Salesforce releases roll out. You decide when, if ever, to change the API Experience
version for running each flow.
Available in: Essentials,
Before you select a new API version, review all run-time improvements that were delivered between Professional, Enterprise,
the currently selected API version and the new API version. You can find all flow and process run-time Performance, Unlimited,
improvements for an API version in the Salesforce Release Notes. The API version for running a flow and Developer Editions
is specified in the flow version properties.
Sometimes, a release update is also available as a versioned update. Such a versioned update lets
you adopt the changes for individual flows or processes before the release update is enforced. After the release update is adopted or
enforced, all flows and processes in your org get the updated behavior regardless of their run-time API versions.

SEE ALSO:
Flow Version Properties

108
Automate Your Business Processes Flows

Flow Environments
A flow environment specifies where a flow can run. For example, if a flow is associated with the
EDITIONS
Slack flow environment, you can enable users to launch the flow from Slack.
Flows can have these environments. Available in: both Salesforce
Classic and Lightning
Default
Experience
The flow can run offline or from a Visualforce component, Lightning page, flow action, or custom
Aura component. Available in: Essentials,
Slack Professional, Enterprise,
Performance, Unlimited,
The flow can run in Slack and the default environment. You specify the Slack flow environment
and Developer Editions
when you save the flow. Then, you use the Slack Send Message to Launch Flow action in a
different flow to enable users to run the flow from Slack.
You can determine the current environment of a flow from the Flows page of Setup and from the detailed view of a flow. For example:

Make a Flow Available in Slack (Beta)


If a screen flow contains screen flow components supported in Slack, you can enable users to launch the flow from the Slack interface.
Slack supports the display text, picklist, and radio button screen components.

Make a Flow Available in Slack (Beta)


If a screen flow contains screen flow components supported in Slack, you can enable users to launch the flow from the Slack interface.
Slack supports the display text, picklist, and radio button screen components.

109
Automate Your Business Processes Flows

Note: This feature is a Beta Service. Customer may opt to try such Beta Service in its sole discretion. Any use of the Beta Service
is subject to the applicable Beta Services Terms provided at Agreements and Terms.
Slack does not support the address, checkbox, checkbox group, currency, date, date and time, dependent picklist, display image, email,
file upload, long text area, lookup, multi-select picklist, name, number, password, phone, slider, text, toggle, URL, or section screen
components.
1. Create a screen flow that contains only supported screen flow components, and click Save.
The Save the flow dialog box appears.

2. Select Make Available in Slack (Beta), fill in the fields, and click Save.
3. Create a different flow, and add the Slack Send Message to Launch Flow action to the flow.
There’s a Slack Send Message to Launch Flow action for each flow in the org that you can send to Slack.
The New Action dialog box appears.

110
Automate Your Business Processes Flows

4. Fill in the fields, and click Done.

5. Save and activate the flow.


When the second flow executes the Slack Send Message to Launch Flow action, it sends a message to a Slack conversation. The message
includes a button that a recipient can use to launch a screen flow.

SEE ALSO:
Flow Core Actions for Slack: Send Message to Launch Flow (Beta)
Flow Types
Build a Flow
Activate or Deactivate a Flow
Flow Environments

111
Automate Your Business Processes Flows

What Happens When a Flow Finishes?


By default, when a flow interview that uses screens finishes, a new interview for that flow begins,
EDITIONS
and the user is redirected to the first screen. To override the default behavior, you can add a local
action to your flow. Some distribution methods also offer other ways to override a flow’s finish Available in: both Salesforce
behavior, such as by setting the retURL parameter in a flow URL. Classic and Lightning
Experience
Distribution Method Default Finish Override Options
Behavior Available in: Essentials,
Professional, Enterprise,
URL (Direct URL, web tab, custom button, Starts new interview • Add a local action Performance, Unlimited,
custom link) to the flow and Developer Editions

• Set the retURL


parameter

Lightning page Starts new interview Add a local action to


the flow

Experience Builder page Starts new interview Add a local action to


the flow

Flow action Closes dialog Add a local action to


the flow

Utility bar Starts new interview Add a local action to


the flow

lightning:flow Aura component Starts new interview • Add a local action


to the flow
• Set the
onstatuschange
action

flow:interview Visualforce component Starts new interview • Add a local action


to the flow
• Set the
finishLocation
attribute

112
Automate Your Business Processes Flows

Redirect Flow Users with a Local Action


By default, when a flow finishes, a new interview starts and the user sees the first screen of the flow. To instead redirect the user to
another page, build or install a local action that does so. Then add the action to your flow with a Core Action element. For example,
a local action can open a record, list view, or URL or to show a toast message. Or it can use the Lightning Console JavaScript API to
close a console tab.

SEE ALSO:
Redirect Flow Users with a Local Action
Customize a Flow URL to Control Finish Behavior
Customize a Visualforce Component to Control the Flow's Finish Behavior

Redirect Flow Users with a Local Action


By default, when a flow finishes, a new interview starts and the user sees the first screen of the flow.
EDITIONS
To instead redirect the user to another page, build or install a local action that does so. Then add
the action to your flow with a Core Action element. For example, a local action can open a record, Available in: Lightning
list view, or URL or to show a toast message. Or it can use the Lightning Console JavaScript API to Experience
close a console tab.
Available in: Essentials,
Note: Local actions that fire force or lightning events might not work properly Professional, Enterprise,
when you run the flow from: Performance, Unlimited,
• Flow Builder and Developer Editions

• Flow detail pages or list views


• Web tabs
• Custom buttons and links
Instead, test and distribute the flow with a Lightning page, Experience Builder page, flow
action, or utility bar. Your developer can also add the appropriate event handlers directly to
the component.

Example: A flow creates a lead using information entered in the Lead Info screen. Then it executes the Open Lead local action,
which passes the lead ID into an Aura component by using the Record ID attribute. The component uses a Lightning event to
open the created lead.

113
Automate Your Business Processes Flows

Let’s look at the Aura component that the local action calls: c:navigateToRecord.
Component Markup
<aura:component implements="force:lightningQuickAction,
lightning:availableForFlowActions">
<aura:attribute name="recordId" type="String" />
</aura:component>

Design Resource
The recordId attribute is declared in the design resource so that it’s configurable in the local action.
<design:component>
<design:attribute name="recordId" label="Record ID" />
</design:component>

Client-Side Controller
When the local action is executed, the flow calls the invoke method, which uses the force:navigateToSObject event
to navigate to the created record.
({ invoke : function(component, event, helper) {
// Get the record ID attribute
var record = component.get("v.recordId");

// Get the Lightning event that opens a record in a new tab


var redirect = $A.get("e.force:navigateToSObject");

// Pass the record ID to the event


redirect.setParams({
"recordId": record
});

// Open the record


redirect.fire();
}})

SEE ALSO:
What Happens When a Flow Finishes?
Lightning Aura Components Developer Guide : Runtime Considerations for Flows That Include Aura Components

114
Automate Your Business Processes Flows

Flows in Transactions
Each flow interview runs in the context of a transaction. A transaction represents a set of operations that are executed as a single unit.
For example, a transaction can execute Apex triggers and escalation rules in addition to a flow interview. If one interview in a transaction
fails, all the interviews in the transaction are rolled back, as well as anything else the transaction did. The transaction doesn’t retry any
of the operations—including the flow interview.
In each transaction, Salesforce enforces governor limits to prevent shared resources from being depleted. Because multiple Salesforce
organizations share the same resources, Salesforce prevents one organization from depleting all the resources and leaving the other
organizations high and dry. It’s similar to an apartment building that uses one cache of water to service every tenant. If your neighbor
uses all the water, you can’t take a shower. (It’s trite, but hopefully you get the idea.) Per-transaction governor limits help prevent such
things from happening.

When Does a Flow’s Transaction Start?


Depending on how the flow was distributed, a transaction that runs an interview for that flow starts in different ways.
When Does a Flow’s Transaction End?
When a transaction ends depends on whether the flow contains certain elements and whether it originally started because a record
was changed.

SEE ALSO:
Flow Bulkification in Transactions
Per-Transaction Flow Limits
Process Limits

When Does a Flow’s Transaction Start?


Depending on how the flow was distributed, a transaction that runs an interview for that flow starts in different ways.

Distribution Method Transaction starts when...


Process Builder1 A record is created or updated.

Flow URL The URL is accessed.

Custom button or link The button or link is clicked.

Visualforce page The page is accessed.

Interview.start() method If the method starts via a before or after trigger, the
transaction starts when a record is created or updated.
Otherwise, the transaction starts when the method (or a parent
method) is invoked.
The start() method shares its limits with other operations in
the transaction and other methods in the class.

REST API (Custom Actions or Flows resource) When the REST call is made. Depending on how the REST call is
implemented, the limits can be shared with other operations.

115
Automate Your Business Processes Flows

1
The same also applies if the flow is distributed through a workflow rule. The pilot program for flow trigger workflow actions is closed.
If you've already enabled the pilot in your org, you can continue to create and edit flow trigger workflow actions. If you didn't enable
the pilot in your org, use Flow Builder to create a record-triggered flow, or use Process Builder to launch a flow from a process.

Note: When a Screen element, local action, or Pause element is executed, the existing transaction ends and a new one begins.

When Does a Flow’s Transaction End?


When a transaction ends depends on whether the flow contains certain elements and whether it originally started because a record
was changed.
The transaction ends when:
• A Screen, Local Action, or Pause element is executed
• The order of execution has completed—if the flow was triggered when a record was created or updated
• All the interviews in the transaction have finished

Tip: If you think that a flow’s interview is likely to hit governor limits within its transaction, consider adding a Screen, Local Action,
or Pause element.
If the interview is one of many things being done in a given transaction, that interview shares the transaction’s governor limits with the
other operations.

Example: You update 100 cases through Data Loader. Due to the order of execution in a transaction and the customizations in
your organization, here’s what happens.

Transaction Operation DML Statement SOQL Query


Used Used
1 Cases are saved to the database, but aren’t committed yet.

2 Case assignment rules are executed. Each case’s owner is updated.

3 Case escalation rules are executed. If any case has been open for 10 days, an
email is sent to the owner.

4 Process is started.

5 Process looks up the case’s account.

6 If the account is hot, process uses Chatter to notify the account owner that there’s
a new case associated with the account.

7 Process launches a flow interview.

8 Flow interview looks up the parent account and how many cases it has.

9 Flow interview checks whether the account has more than five open cases.

10 If it does, flow interview looks up the account’s division manager then posts on
the account’s Chatter feed to notify the division manager and account owner.

116
Automate Your Business Processes Flows

Transaction Operation DML Statement SOQL Query


Used Used
11 If it doesn’t, flow interview posts on the account’s Chatter feed to notify only the
account owner.

SEE ALSO:
Apex Developer Guide : Triggers and Order of Execution

Flow Bulkification in Transactions


Programmers can design their code so that similar actions are performed together in one batch. For example, one operation to create
50 records rather than 50 separate operations that each create one record. This process is called bulkification, and it helps your transaction
avoid governor limits. If you’re working with flows, you don’t even have to think about bulkification. Flow interviews bulkify actions for
you automatically.

How Does Flow Bulkification Work?


Interview operations are bulkified only when they execute the same element. That means that the interviews must all be associated
with the same flow.
Which Flow Elements Can Be Bulkified?
Flows can bulkify any element that performs a DML statement or SOQL query or does something else external to the flow, like
sending an email.
Example of Flow Bulkification
This example demonstrates how operations are bulkified for a flow when 100 cases are updated through Data Loader.

SEE ALSO:
Flows in Transactions

How Does Flow Bulkification Work?


Interview operations are bulkified only when they execute the same element. That means that the
EDITIONS
interviews must all be associated with the same flow.
When multiple interviews for the same flow run in one transaction, each interview runs until it Available in: both Salesforce
reaches a bulkifiable element. Salesforce takes all the interviews that stopped at the same element Classic and Lightning
and intelligently executes those operations together. If other interviews are at a different element, Experience
Salesforce then intelligently executes those operations together. Salesforce repeats this process
Available in: Essentials,
until all the interviews finish. Professional, Enterprise,
If, despite the bulkification, any interview hits a governor limit, all the interviews in the transaction Performance, Unlimited,
fail. Any operations that the interviews performed in the transaction are rolled back, and the and Developer Editions
transaction doesn’t try to perform the operations again. Any operations that access external data
aren’t rolled back.
If an error that isn’t due to a governor limit occurs while executing one of these elements, Salesforce attempts to save all successful
record changes in the bulk operation up to three times.

117
Automate Your Business Processes Flows

• Subflow (Create Records and Update Records elements only)


• Create Records
• Update Records

Example: When you upload 100 cases, the flow MyFlow_2 triggers one interview for each case.
• 50 interviews stop at Create Records element Create_Task_1.
• The other 50 interviews stop at Create Records element Create_Task_2.
The result? At least two groups of bulk operations to execute.
• One for the 50 interviews that execute Create_Task_1
• One for the 50 interviews that execute Create_Task_2

Which Flow Elements Can Be Bulkified?


Flows can bulkify any element that performs a DML statement or SOQL query or does something
EDITIONS
else external to the flow, like sending an email.
Elements that create, update, or delete records Available in: both Salesforce
When a record is created, updated, or deleted, the transaction performs a DML statement. Classic and Lightning
Experience
• Create Records elements
• Update Records elements Available in: Essentials,
Professional, Enterprise,
• Delete Records elements
Performance, Unlimited,
• Quick Action, Post to Chatter, or Submit for Approval core actions and Developer Editions
• Apex Action elements—depending on your org
Elements that look up records
When fields on a record are looked up, the transaction performs a SOQL query.
• Get Records elements
• Update Records elements
• Delete Records elements
• Apex Action elements—depending on your org
Elements that send emails
• Send Email core actions
• Email Alert elements
• Apex Action elements—depending on your org

Note:
• Unlike Apex actions, legacy Apex actions aren’t bulkified.
• Although Apex actions are bulkified, the flow has no way of knowing what the invoked methods’ operations are. If you want
those operations to also be bulkified, make sure the code follows bulkification best practices.

SEE ALSO:
Apex Developer Guide : Running Apex with Governor Execution Limits

118
Automate Your Business Processes Flows

Example of Flow Bulkification


This example demonstrates how operations are bulkified for a flow when 100 cases are updated
EDITIONS
through Data Loader.
Available in: both Salesforce
The Associated Flow Classic and Lightning
Experience
You’ll understand the concepts better if you understand the design of the associated flow.
Available in: Essentials,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions

The flow:
1. Looks up the case’s parent account and how many open cases that account has.
2. Checks whether the account has more than five cases open.
3. If the account has more than five open cases:
a. Looks up the division manager for the account.
b. Posts on the account’s Chatter feed to notify the division manager and the account owner.

4. If the account has five or fewer open cases, posts on the account’s Chatter feed to notify only the account owner.

The Bulkified Interviews


When you update the records, one flow interview is created for each case simultaneously. All of the interviews are associated with the
same flow. Each interview runs until it gets to a bulkifiable element.
The first interview goes through the Get Records element (1). Because Get Records can be bulkified, the interview waits there until all
the other interviews have done the same. Then, Salesforce executes all the Get Records operations together (because they’re all for the
same element in the same flow). Instead of 100 SOQL queries, the transaction issues one SOQL query.
The first interview is evaluated by the Decision element (2). The account has six cases, so the interview is routed down the “More than
5” path. The interview proceeds to the second Get Records element (3a). Because it’s a bulkifiable element, the interview waits there.

119
Automate Your Business Processes Flows

The second interview is evaluated by the Decision element (2). This account has one case, so the interview is routed down the “5 or
fewer” path. The interview proceeds to the Post to Chatter core action (4). This element is also bulkifiable, so the interview waits there.
After all the interviews have been processed, 30 are waiting to execute the second Get Records element (3a) and the remaining 70 are
waiting to execute the Post to Chatter core action (4).
Salesforce executes all the Get Records (3a) operations for the first 30 interviews together. Instead of 30 separate SOQL queries, the
transaction issues one.
Next, the transaction returns to the Post to Chatter core action (4), where the 70 interviews are ready to execute their Post to Chatter
operations. Remember, these are the interviews whose accounts don’t have more than five cases. Salesforce executes the Post to Chatter
operations together. Instead of 100 separate DML statements to create each Chatter post, the transaction issues one DML statement to
create all 100 posts at one time. Because the Post to Chatter core action isn’t connected to a subsequent element, those 70 interviews
finish.
The 30 interviews—which looked up the relevant division manager—proceed to the final Post to Chatter core action (3b). When all 30
interviews are ready, Salesforce executes all 30 Post to Chatter operations together. Instead of issuing 30 separate DML statements for
the individual Chatter posts, it issues one. Because the Post to Chatter core action isn’t connected to another element, those 30 interviews
finish.

Apex-Defined Data Type


With the Apex-defined data type, flows can manipulate the kinds of complex data objects that are
EDITIONS
typically returned from calls to web services. Create Apex-defined variables in flows and directly
process JSON returned from web calls. Available in: both Salesforce
A developer can define an Apex class to serve as a pattern for automatic conversion from web to Classic (not available in all
a flow, allowing full manipulation of the resulting objects to be carried out in flows using declarative orgs) and Lightning
approaches and no additional code. Apex-defined resources are useful for connecting flows to rich Experience
external web objects accessed via Mulesoft and REST calls. If a data type is not supported, flows can Available in: Enterprise,
pass the value to a Lightning component and you can use Apex to operate on it. Performance, Unlimited,
Example: A car dealership has a screen flow that lets customers search the dealership’s and Developer Editions
inventory data, which is stored in another database. The dealership creates an Apex class in
their org to define the Car data type. Then, the dealership creates a screen flow that includes
two Apex-defined variables. The flow passes the variables between the flow, an Apex action,
and a Lightning component.

SEE ALSO:
Considerations for the Apex-Defined Data Type

Flow Best Practices


Before you begin building and distributing flows, understand the best practices.
EDITIONS
Plan out your flow before you start building.
Write or draw out all the details of your business process. That way, you have a clear idea of Available in: both Salesforce
what information you need, where you’re getting that information from, and what logic and Classic and Lightning
actions to perform. Doing so makes building the corresponding flow much easier. Experience

Available in: Essentials,


Professional, Enterprise,
Performance, Unlimited,
and Developer Editions

120
Automate Your Business Processes Flows

Build your flows in a test environment—like a sandbox or Developer Edition org.


The last thing you want to do is accidentally change records in your company’s production org. Build your flows in a separate
environment. That way, you can enter fake data and test various permutations of your flow without worrying about changing or
deleting data that your users actually need.
Never hard-code Salesforce IDs.
IDs are org-specific, so don’t hard-code new or existing IDs. Instead, let Salesforce create the IDs, and pass them into variables when
the flow starts. You can do so, for example, by using merge fields in URL parameters or by using a Get Records element.
Wait until the end of the flow to make changes to the database.
Have you heard about flow limits? Because flows operate under Apex governor limits, the sky is not the limit. To avoid hitting those
limits, we recommend bunching all your database changes together at the end of the flow, whether those changes create, update,
or delete records. And avoid making the changes in a loop path.
Control when running users can navigate backward.
If the flow commits changes to the database or performs actions between two screens, don't let users navigate from the later screen
to the previous screen. Otherwise, the flow can make duplicate changes to the database.
Provide an error handler.
Sad to say, but sometimes a flow doesn’t perform an operation that you configured it to do. Perhaps the flow is missing crucial
information, or the running user doesn’t have the required permissions. By default, the flow shows an error message to the user and
emails the admin who created the flow. However, you can control that behavior. See Customize What Happens When a Flow Fails
for more information and recommendations.
Save early and often.
Sometimes Flow Builder falls victim to unexpected problems, like losing Internet access. Salesforce doesn’t save your changes
automatically, so it’s up to you to save your work. Save as often as possible, so that you don’t accidentally lose a few hours’ worth of
work.
Restrict data access via profiles and permission sets.
Make sure that only the right flow users can access data at the right time. To restrict access to enabled profiles or permission sets,
edit the access for a flow from the Flows list view.
Control data access with the Subflow element.
When a flow must respect user permissions for some actions and ignore user permissions for other actions, you can use the Subflow
element. To respect user permissions for actions, you create a flow that runs in user context. To ignore user permissions such as
object permissions and field-level access for other actions, you create a separate flow that runs in system context. To put it all together,
you can use the Subflow element in the flow that runs in user context to launch the flow that runs in system context.
Test as many permutations of your flow as you possibly can.
As with all customizations in Salesforce, it’s important to test your work. This is especially true if your flow uses branching or other
complex logic. Make sure that you test as many possibilities as you can think of before you distribute the flow to your users.
Avoid accessing external objects after DML operations in a transaction.
If Salesforce creates, updates, or deletes data in your org and then accesses external data in the same transaction, an error occurs.
In your flow, we recommend using a separate transaction to access data in an external system. To do so, end the prior transaction
by adding a screen or local action to a screen flow or a Pause element to an autolaunched flow. If you use a Pause element, don't
use a record-based resume time.
For example, a screen flow creates a contact and then displays a confirmation screen. Next, the flow updates the contact in the
external system. The flow doesn’t fail because it uses a separate transaction to access the external data.

121
Automate Your Business Processes Flows

Build a Flow
After you model the process that you want to automate, design and build the flow in Flow Builder.
EDITIONS
Tip: Before you start creating your flow, plan it out. It’s much easier to use a flow to automate
a business process when you understand all the details. Available in: both Salesforce
Classic and Lightning
If you’re new to Flow Builder or process automation, take a quick tour of the interface, and then Experience
check out our trails! They’re a great way to learn about these powerful tools and discover how they
work. Available in: Essentials,
Professional, Enterprise,
• Tour the Flow Builder User Interface Performance, Unlimited,
• Automate Your Business Processes with Salesforce Flow and Developer Editions
• Build Flows with Flow Builder
1. Open Flow Builder. From Setup, in the Quick Find box, enter Flows, select Flows, and then USER PERMISSIONS
click New Flow.
To open, edit, or create a
2. Select the flow type, then click Next. flow in Flow Builder:
3. Add the elements that you want to use to the canvas. • Manage Flow

4. If building in free-form, connect the elements to determine their order of execution. If building
in auto-layout, connectors are automatically created on the canvas for you.
5. Save your flow.
After you build a flow, make sure that it’s working as you expect it to by testing it. Then activate the flow. You’re now ready to distribute
the flow to users.

Add and Edit Elements


Use elements to define actions that the flow can execute. When they’re on the canvas, connect them to create an order of execution.
Define Conditions in a Flow
Control when a flow takes a specific decision outcome or waits for a specific resume event.
Create Formulas with Flow Formula Builder
You can use Flow Formula Builder to build an expression in the Start element of a Record-triggered Flow. You can select from a list
of functions and operators and then check the formula syntax for each expression to catch errors as you work.
Route a Flow
Identify which elements the flow executes and in what order by connecting the elements on your canvas together.
Customize What Happens When a Flow Fails
If your flow contains an element that interacts with the Salesforce database—such as an Update Records element or a Submit for
Approval core action—it can fail. Modify the default behavior by adding fault paths to all elements that can fail.
Working with Data in a Flow
The real power of a flow is that it can automate updates to your data, whether the data lives inside your Salesforce org or in an
external database. In a flow, you can look up values from records, connect to external systems, create records, update records, delete
records—the whole shebang!
Options for Sending Emails from a Flow
To send email from your flow, either call an email alert action or create the email in the flow.
Show Users Progress Through a Flow with Stages
Keep users informed about which stage they’re in or how far they’ve progressed in a flow. For example, show where in a purchasing
flow the user is with breadcrumbs or a progress indicator.

122
Automate Your Business Processes Flows

Extend Your Flow-Building Options


Sometimes your flow needs to do more than what Flow Builder provides out of the box. You can extend flows by calling Apex classes
or adding Lightning components.

SEE ALSO:
Flow Runtime Accessibility Considerations
Building Blocks of Flows

Add and Edit Elements


Use elements to define actions that the flow can execute. When they’re on the canvas, connect
EDITIONS
them to create an order of execution.
Available in: both Salesforce
Add and Edit Elements in Auto-Layout Classic and Lightning
Create a flow with a streamlined interface that keeps your canvas neat and tidy. Experience

Add and Edit Elements in Free-Form Available in: Essentials,


Create a flow with a drag-and-drop interface that allows you to place elements anywhere. Professional, Enterprise,
Performance, Unlimited,
and Developer Editions

Add and Edit Elements in Auto-Layout


Create a flow with a streamlined interface that keeps your canvas neat and tidy.
EDITIONS
To add an element in auto-layout, click where you want to place it, then select the element
that you want to add. The new element is automatically connected to the elements before and Available in: both Salesforce
after it on the path. Classic and Lightning
Experience
If you want to change an element’s configuration after you created it, click the element, then click
Edit Element. Make your changes, then click Done. Available in: Essentials,
Professional, Enterprise,
Performance, Unlimited,
SEE ALSO:
and Developer Editions
Flow Elements

Add and Edit Elements in Free-Form


Create a flow with a drag-and-drop interface that allows you to place elements anywhere.
EDITIONS
To add an element in free-form, drag the element that you want to use onto the canvas.
Available in: both Salesforce
After creating an element, connect the element to another element to determine the order in which
Classic and Lightning
they’re executed at run time. Don’t forget to connect the Start element to another element.
Experience
If you want to change an element’s configuration after you created it, double-click the element,
make your changes, then click Done. Available in: Essentials,
Professional, Enterprise,
Performance, Unlimited,
SEE ALSO: and Developer Editions
Flow Elements
Route a Flow

123
Automate Your Business Processes Flows

Define Conditions in a Flow


Control when a flow takes a specific decision outcome or waits for a specific resume event.
EDITIONS
Before you begin, create the Decision or Pause element to add conditions to.
Available in: both Salesforce
1. Set up the conditions.
Classic and Lightning
At run time, the conditions are evaluated in the order you specify. Experience

Column Header Description Available in: Essentials,


Professional, Enterprise,
Resource Flow resource whose value you want to evaluate. Performance, Unlimited,
and Developer Editions
Operator The available operators depend on the data type selected for
Resource.
USER PERMISSIONS
Value Resource and Value in the same row must have compatible data
types. To open, edit, or create a
flow in Flow Builder:
Options:
• Manage Flow
• Select an existing flow resource, such as a variable or screen
component.
• Create a resource.
• Manually enter a literal value or merge field.

Note: When you add or subtract a number from a date value,


the date adjusts in days, not hours.

2. Identify the logic between the conditions.

Option Behavior for Decision Outcomes Behavior for Pause Configurations


All Conditions If one of the conditions is false, the flow evaluates If one of the conditions is false, the flow doesn’t wait
Are Met the next outcome’s conditions. for the associated resume event.

Any Condition If one of the conditions is true, the flow immediately If one of the conditions is true, the flow waits for the
Is Met takes this outcome’s path. associated resume event.

Custom When you select this option, provide the condition logic by entering up to 1000 characters. Use:
Condition Logic • Numbers to refer to each condition
Is Met
• AND, OR, or NOT to identify which combination of conditions must true
• Parentheses to group parts of the string together

Tip: If you enter AND, it’s the same as if you selected All Conditions Are Met. If you enter OR,
it’s the same as if you selected Any Condition Is Met. If you enter any other logic, make sure that
you include a number for each condition.

124
Automate Your Business Processes Flows

Option Behavior for Decision Outcomes Behavior for Pause Configurations


For example, for 1 AND NOT(2 OR 3), the flow evaluates whether the first condition is true and
neither the second nor third condition is true.

SEE ALSO:
Flow Pause Conditions
Flow Element: Decision

Create Formulas with Flow Formula Builder


You can use Flow Formula Builder to build an expression in the Start element of a Record-triggered
EDITIONS
Flow. You can select from a list of functions and operators and then check the formula syntax for
each expression to catch errors as you work. Available in: Essentials,
Formula Builder is available only from the Start element in a Record-triggered Flow. If you add a Professional, Enterprise,
formula resource from the Toolbox or use the Collection Filter element, you see the previous version Performance, Unlimited,
of the formula editor. and Developer Editions

1. Edit the Start element in a Record-Triggered flow.


2. Select the object whose records trigger the flow. USER PERMISSIONS

3. Select when to trigger the flow. To open, edit, or create a


flow in Flow Builder:
4. In the Set Entry Conditions section, set Condition Requirements to Formula Evaluates to True
• Manage Flow
(New).
5. Insert a resource from the list of Global Variables. You can add more than one resource to an
expression.
6. Insert a function.
a. To see a list of functions, click Insert a function.
b. To filter functions by category, select the All Functions dropdown and choose the category.

7. Select an operator from the dropdown.


8. Complete the expression.
9. Click Check Syntax after you build each expression because the formula builder only shows one error at a time.
10. Complete the configuration for the Start element.
11. Click Done.
12. Save your work.

125
Automate Your Business Processes Flows

Example:
• Automate a process for records where the closed date changed for US-based accounts with more than 100 employees.
• Automate a process for new case records for Premier support accounts in AMER or EMEA with a revenue of over $1M.

SEE ALSO:
Flow Element: Start

126
Automate Your Business Processes Flows

Route a Flow
Identify which elements the flow executes and in what order by connecting the elements on your
EDITIONS
canvas together.
Available in: both Salesforce
Classic and Lightning
Experience

Available in: Essentials,


Professional, Enterprise,
Performance, Unlimited,
and Developer Editions

USER PERMISSIONS

To open, edit, or create a


flow in Flow Builder:
• Manage Flow

Route a Flow in Auto-Layout


In auto-layout, Flow Builder automatically creates connectors when an element is added, and it
EDITIONS
removes connectors when an element is deleted. Place elements in the desired order, and move
them to change the order of execution. Available in: both Salesforce
Classic and Lightning
Move a Single Element in Auto-Layout Experience

You can’t directly move elements in auto-layout, so to change an element’s location, copy the Available in: Essentials,
element, paste it to its new location, and then delete the original element. Professional, Enterprise,
Performance, Unlimited,
1. Click the element that you want to move.
and Developer Editions
2. Select Copy Element.
3. Click in the desired location for that element. USER PERMISSIONS
4. Select Paste Copied Elements.
To open, edit, or create a
5. Click the original copied element, then select Delete Element. flow in Flow Builder:
• Manage Flow
Move Multiple Elements in Auto-Layout
To move multiple elements, select all the elements that you want to move, copy them, paste them to their new location, and then delete
the original elements.
1. Click Select Elements.
2. Click on each element that you want to move.
3. To copy the selected elements, click .
4. Click in the desired location for the elements.
5. Select Paste Copied Elements.
6. For each copied element, click the element, then select Delete Element.

127
Automate Your Business Processes Flows

Route a Flow in Free-Form


In free-form, you create and remove connectors that determine the order of execution for the elements on the canvas.
1. On the canvas, find the node at the bottom of the source element.
2. Drag the node onto the target element.
3. If prompted, select which decision outcome or pause configuration to assign to the path.

Remove Connectors from a Flow


You can’t modify a connector’s target or source elements, so to change a path, delete the connector and then add a new one.
1. In your flow, select the connector to delete.
When you select a connector, its color changes from gray to blue.

2. Press the DELETE key.


If you delete a connector for a specific outcome, the outcome isn’t deleted from the source element. However, if you delete an outcome
from a decision element, the outcome’s connector is also deleted. The same applies to pause configurations.

SEE ALSO:
Flow Connectors
Customize What Happens When a Flow Fails

Customize What Happens When a Flow Fails


If your flow contains an element that interacts with the Salesforce database—such as an Update
EDITIONS
Records element or a Submit for Approval core action—it can fail. Modify the default behavior by
adding fault paths to all elements that can fail. Available in: both Salesforce
Classic and Lightning
What Happens When a Flow Fails? Experience
When you’re deciding whether to customize the error handling in your flow, consider how a Available in: Essentials,
failed flow behaves. Professional, Enterprise,
Configure Every Fault Path to Send You an Email (Best Practice) Performance, Unlimited,
As a best practice, we recommend configuring the fault connectors in your flow so that you and Developer Editions
always receive an email when a flow fails. In the email, include the current values of all your
flow’s resources. The resource values can give you insight into why the flow failed.
Customize the Error Message for Running Flow Users (Best Practice)
As a best practice, we recommend displaying a better message to your user than “An unhandled fault has occurred in this flow”. Do
this only if the distribution method you’re using supports flows that contain screens. In other words, don’t do it if your flow is
distributed through a process.
Other Examples of Error Handling in Flows
Examples of using fault connectors to handle flow errors include requesting corrections from the user and bypassing the error.

SEE ALSO:
Flow Connectors
Flow Elements
Route a Flow

128
Automate Your Business Processes Flows

What Happens When a Flow Fails?


When you’re deciding whether to customize the error handling in your flow, consider how a failed
EDITIONS
flow behaves.
When a flow fails, the user running the flow gets this error message. Available in: both Salesforce
Classic and Lightning
Experience

Available in: Essentials,


Professional, Enterprise,
Performance, Unlimited,
and Developer Editions

An unhandled fault has occurred in this flow


An unhandled fault has occurred while processing
the flow. Please contact your system administrator
for more information.

The running user can’t proceed with the flow or return to a previous part of the flow. The admin who created the flow receives a fault
email. The email details the element that failed, the error message from that element, and which elements were executed during the
failed interview. Here’s an example error message.
An error occurred at element Delete_1.
DELETE --- There is nothing in Salesforce matching your
delete criteria.

To view the debug details directly in Flow Builder, click Flow Error: Click here to debug the error in Flow Builder in the fault email.
This link appears only for certain flow types.
For screen flows, Salesforce publishes a Flow Execution Error Event platform event message.

SEE ALSO:
Send Alerts When a Screen Flow Fails
Customize What Happens When a Flow Fails
Emails About Flow Errors

129
Automate Your Business Processes Flows

Configure Every Fault Path to Send You an Email (Best Practice)


As a best practice, we recommend configuring the fault connectors in your flow so that you always
EDITIONS
receive an email when a flow fails. In the email, include the current values of all your flow’s resources.
The resource values can give you insight into why the flow failed. Available in: both Salesforce
1. Create a text template that includes the values of all the flow resources. Classic and Lightning
Experience
Doing so lets you see the exact values of flow variables when the interview failed. Also, if the
flow contains screens, you see exactly what the user entered and selected. Available in: Essentials,
Here’s an example text template for the Survey Customers flow from the Create a Satisfaction Professional, Enterprise,
Performance, Unlimited,
Survey project on Trailhead.
and Developer Editions

USER PERMISSIONS

To open, edit, or create a


flow in Flow Builder:
• Manage Flow

Error: {!$Flow.FaultMessage}

RESOURCE VALUES
Customer Response: {!Customer_Response}
Value of Decision's Yes outcome: {!Yes}
Company: {!Company_Name}
Satisfaction : {!Satisfaction}
Service: {!Service}
Other Comments:
{!OtherComments}

2. Configure a Send Email core action. Use the text template as the body and your email address as the recipient.
In this example, Body is set to the text template we created: {!allVariableValues}.

3. From each element that can fail, draw a fault connecter to the Send Email core action.
In this example, Create Records is the only element that supports fault connectors.

130
Automate Your Business Processes Flows

SEE ALSO:
Flow Resource: Text Template
Flow Core Action: Send Email
Customize What Happens When a Flow Fails

Customize the Error Message for Running Flow Users (Best Practice)
As a best practice, we recommend displaying a better message to your user than “An unhandled
EDITIONS
fault has occurred in this flow”. Do this only if the distribution method you’re using supports flows
that contain screens. In other words, don’t do it if your flow is distributed through a process. Available in: both Salesforce
1. Create a text template that contains a friendlier error message. Classic and Lightning
Experience

Available in: Essentials,


Professional, Enterprise,
Performance, Unlimited,
and Developer Editions

USER PERMISSIONS

To open, edit, or create a


flow in Flow Builder:
• Manage Flow

<p><b>Something went wrong with this flow.</b></p>


<p>Your admin has received an email about this error.</p>

2. Add a Screen element. In a Display Text screen component, reference the text template.

131
Automate Your Business Processes Flows

3. For every element that can fail, draw a fault connector to the Screen element.

SEE ALSO:
Flow Screen Output Component: Display Text
Flow Resource: Text Template
Customize What Happens When a Flow Fails

Other Examples of Error Handling in Flows


Examples of using fault connectors to handle flow errors include requesting corrections from the
EDITIONS
user and bypassing the error.
Request Corrections from Users Available in: both Salesforce
Draw a fault connector to a Screen element, where users can verify the values that they entered, Classic and Lightning
make corrections, and proceed. Experience

Display the Error Message Available in: Essentials,


If the flow is used only internally, such as at a call center, use the fault path to display the error Professional, Enterprise,
message to the running user. In the same Screen element, ask the user to report the error to Performance, Unlimited,
the IT department. To do so, draw the fault connector to a Screen element with this Display and Developer Editions
Text field.

Sorry, but you can’t read or update records at this time.


Please open a case with IT and include this error message:
{!$Flow.FaultMessage}

Create a Case
When an error occurs, automatically create a case that includes the error message and assign it to your IT department. Assign the
created case’s number to a Text variable ({!caseNumber}, for example). Then, in a Screen, display this message to the running
user.
Sorry, but you can’t read or update records at this time.
We filed case {!caseNumber} for you.

Ignore Errors
To bypass errors for a given element in your flow, draw the fault connector to the same element as the normal connector.

SEE ALSO:
Customize What Happens When a Flow Fails

132
Automate Your Business Processes Flows

Working with Data in a Flow


The real power of a flow is that it can automate updates to your data, whether the data lives inside
EDITIONS
your Salesforce org or in an external database. In a flow, you can look up values from records, connect
to external systems, create records, update records, delete records—the whole shebang! Available in: both Salesforce
Classic and Lightning
Integrate with External Systems from a Flow Experience
With Get Records elements, you can easily look up your Salesforce data in a flow. But what if Available in: Essentials,
you need data that lives outside of Salesforce? To connect your flow to an external database, Professional, Enterprise,
use platform events, external objects, Lightning components, Enhanced External Services, or Performance, Unlimited,
Apex. and Developer Editions
Create a Salesforce Record from a Flow
To create a Salesforce record, use either the Create Records or Quick Action element. The right
element depends on what the rest of your flow is doing.
Clone Records with a Create Records Element
A flow can clone records in your org. First, populate a record variable with an existing record’s values. Identify fields that the running
user can’t edit, and map all remaining fields to another record variable. Then use the second record variable in a Create Records
element to clone the record.
Update Salesforce Records from a Flow
To update field values on existing Salesforce records, use either the Update Records element or a Quick Action core action. The right
element depends on what the rest of your flow is doing.

Integrate with External Systems from a Flow


With Get Records elements, you can easily look up your Salesforce data in a flow. But what if you
EDITIONS
need data that lives outside of Salesforce? To connect your flow to an external database, use platform
events, external objects, Lightning components, Enhanced External Services, or Apex. Available in: both Salesforce
Platform Events Classic (not available in all
Deliver secure and scalable custom notifications within Salesforce or from external sources by orgs) and Lightning
using platform events. To publish event messages from your flow, add a Create Records element, Experience
where the specified object is the platform event. To subscribe to messages, add a Pause element. Platform events, External
External Objects Services, and Apex are
Reference data that’s stored outside your Salesforce org by using external objects. Once you’ve available in: Enterprise,
mapped the external system to an external object in your org, use flow data elements to get, Performance, Unlimited,
create, or update data in the external system. and Developer Editions

Custom Lightning Components Lightning components are


Connect to a database that’s behind your firewall without going through the Salesforce server available in: Essentials,
by calling a local action. All local actions appear in Flow Builder as Core Action elements. Professional, Enterprise,
Performance, Unlimited,
Enhanced External Services and Developer Editions
Connect to any external system without writing a line of code. You tell us which endpoint and
schema you want to use, and we generate Apex classes for you. The Apex classes appear in
Flow Builder as Apex actions. Enhanced External Services supports OpenAPI 2.0 JSON schema
format.
Apex
If you want more control, write your own Apex code to integrate with an external system. To make your Apex code available in the
Flow Builder, use either the @InvocableMethod annotation or the Process.Plugin interface.

133
Automate Your Business Processes Flows

Integration Option Declarative Server-Side Client-Side Synchronous Asynchronous


Platform events

External objects

Custom Lightning components

Enhanced External Services

Apex

Create a Salesforce Record from a Flow


To create a Salesforce record, use either the Create Records or Quick Action element. The right
EDITIONS
element depends on what the rest of your flow is doing.
If you want to use a combination of the values from a record variable and values from other resources Available in: both Salesforce
(like single-value variables or screen input fields), use either a Create Records or Quick Action Classic and Lightning
element. Those two elements differ in these ways. Experience

• Which fields are available in the elements Available in: Essentials,


• Whether the element provides any required fields for the object Professional, Enterprise,
Performance, Unlimited,
• Whether the element lets you store the new record’s ID
and Developer Editions
Storing the ID is useful, for example, if you create an account and then want to create a contact
that's associated with that account (which you obviously need the ID for).

Field Availability Required Fields New Record ID


Create Every field on the object. You manually Not indicated Lets you store the ID of the created
Records select the object and every field you record to use later in your flow.
want to have a value.

Quick Action Only fields that are included in the Quick Indicated Doesn’t let you store the created
(of type Action layout. Requiredness is based on what's record's ID for use later.
Create) If you supplied default values for certain marked required in the action
fields when you created the quick action, layout.
those values are used when the record
is created.

Tip: Use a Quick Action element when all these statements are true.
1. The action is of type Create.
2. The action’s layout includes all the fields that you want to update.
3. You don't need to reference the new record's ID later in the flow.
Otherwise, use the Create Records element.

134
Automate Your Business Processes Flows

Example: Here’s how you’d create a case when a customer’s satisfaction score is too low by using each of the create elements.

Create Records

You can set any field on the record, but the Create Records element doesn’t know which fields are required
for this object.

Quick Action (of


type Create)

These fields are the only fields that you can set for this element, because they’re the only ones available
from the action layout.

Clone Records with a Create Records Element


A flow can clone records in your org. First, populate a record variable with an existing record’s values.
EDITIONS
Identify fields that the running user can’t edit, and map all remaining fields to another record variable.
Then use the second record variable in a Create Records element to clone the record. Available in: both Salesforce
Before you begin, review Which Fields Are Inaccessible When a Flow Creates or Updates Records? Classic and Lightning
Experience
1. Populate a record variable with the values from the existing record.
For example: Available in: Essentials,
• Look up the record with a Get Records element. Professional, Enterprise,
Performance, Unlimited,
• Obtain the record from a Flows action in a process. and Developer Editions
2. In an Assignment element, copy the writable field values to a new record variable.
USER PERMISSIONS
Important: Make sure that Id isn’t set in the new variable.
To open, edit, or create a
flow in Flow Builder:
• Manage Flow

135
Automate Your Business Processes Flows

3. Add a Create Records element to your flow. Choose to create one record and set the record fields by using all the values from a
record variable. Select the second record variable to populate the values of the cloned record.

SEE ALSO:
Flow Element: Create Records

Update Salesforce Records from a Flow


To update field values on existing Salesforce records, use either the Update Records element or a
EDITIONS
Quick Action core action. The right element depends on what the rest of your flow is doing.

Example: On an opportunity record, when a user clicks the “Won” button, a flow updates Available in: both Salesforce
the opportunity’s stage. Classic and Lightning
Experience
To update fields on one or more existing Salesforce records, your flow:
Available in: Essentials,
1. Identifies the records to update.
Professional, Enterprise,
2. Identifies the new field values for those records. Performance, Unlimited,
and Developer Editions
3. Saves those changes to the Salesforce database. (In other words, until the changes are saved
to the database, the changes exist only within the flow.)

How do I choose between flow elements that update records?


The main difference between the elements is how it knows which records to update, how it knows the new field values to apply, and
how many records it can update.
Quick Action elements can update only one record at a time, while Update Records elements can update multiple records.

To identify records to update To identify new field values for the records Number of records
it updates
Update In the same element, use filter In the same element, map each field that should be At least one.
Records, where criteria. updated with a variable or other resource.
you chose to All resources are supported, so long as the resource’s
specify data type matches the selected field’s data type.
conditions and
set fields
individually

Update Populate a record variable or record In another element, such as an Assignment element, If an record variable:
Records, where collection variable in another update the values in the record variable or record one.
you chose to element. collection variable. If an record collection
use the IDs and variable: at least one.
field values
from a record
variable or
record
collection
variable

136
Automate Your Business Processes Flows

To identify records to update To identify new field values for the records Number of records
it updates
Quick Action Populate a single-value variable with In the same element, map each field that should be Exactly one.
the ID in another element. Use this updated with a variable or other resource.
ID for the Related Record ID All resources are supported, so long as the resource’s
parameter. data type matches the selected field’s data type.

If all the following statements are true, use a Quick Action element:
• You need to update exactly one record
• You’ve already populated a variable with the record’s ID
• The Quick Action’s layout includes all the fields you need to update
If any of those statements aren’t true, use an Update Records element.

Example: Here’s how you’d update an opportunity’s stage by using each of the update elements.

Update Records,
where you chose to
specify conditions
and set fields
individually

Update Records,
where you chose to
use the IDs and
Assumes {!svarOpportunity} is already populated with the right fields.
field values from a
record variable or
record collection
variable

137
Automate Your Business Processes Flows

Quick Action (of


type Update)

Two fields are required by the associated action layout, so they’re required in this element. Related Record
ID identifies which opportunity to update.

Options for Sending Emails from a Flow


To send email from your flow, either call an email alert action or create the email in the flow.
Email Alert element
Send an email by using a workflow email alert to specify the email template and recipients. The flow provides only the record ID.
Send Email element
Send an email by specifying the subject, body, and recipients in the flow.

SEE ALSO:
Flow Elements

Show Users Progress Through a Flow with Stages


Keep users informed about which stage they’re in or how far they’ve progressed in a flow. For
EDITIONS
example, show where in a purchasing flow the user is with breadcrumbs or a progress indicator.
First, define all the possible stages in your flow with stage resources. When you configure a stage, Available in: both Salesforce
you set the stage’s label, order, and whether it’s active by default. Then, throughout the flow identify Classic and Lightning
which of the stages are relevant to the flow user by setting flow global variables. Experience

• The $Flow.ActiveStages global variable identifies all the stages that are relevant to Available in: Essentials,
the flow’s current path. Professional, Enterprise,
• The $Flow.CurrentStage global variable identifies which stage the flow is at. Make sure Performance, Unlimited,
that this stage is included in $Flow.ActiveStages. and Developer Editions

138
Automate Your Business Processes Flows

Example: The Online Purchase flow includes stages for users to review their cart, enter shipping details, enter payment details,
and confirm their order. The stages display at run time using a custom screen component.
At this point, $Flow.ActiveStages contains the Review Cart, Shipping Details, Payment Details, and Order Confirmation
stages, and $Flow.CurrentStage is set to Review Cart.

Plan the Stages in Your Flow


Before you start adding stages to your flow, plan out all the possible stages for your flow. If your flow includes decisions, you might
want different stages for different branches of your flow.
Define the Stages in Your Flow
After you have identified the stages for each branch of your flow, configure the stages.
Identify the Relevant Stages in Your Flow
Throughout your flow, identify which stages are relevant to the user by assigning values to the stage global variables.
Represent Your Flow’s Stages Visually
The standard flow runtime doesn’t represent a flow’s stages. However, you can use a custom component to visually represent the
stages.

SEE ALSO:
Flow Stage Considerations

Plan the Stages in Your Flow


Before you start adding stages to your flow, plan out all the possible stages for your flow. If your
EDITIONS
flow includes decisions, you might want different stages for different branches of your flow.
1. List all the possible stages for your flow. Available in: both Salesforce
Classic and Lightning
2. Determine in which order the stages occur.
Experience
3. Identify which stages are active by default.
Available in: Essentials,
This step is optional, but when you identify the default active stages, you don’t have to populate
Professional, Enterprise,
$Flow.ActiveStages and $Flow.CurrentStage with an Assignment element
Performance, Unlimited,
at the beginning of your flow. and Developer Editions

Example: Your flow has five sections: Review Cart, Shipping Details, Billing Details, Payment
Details, and Order Confirmation. The corresponding stages are in the same order.
If the user’s billing details are the same as the shipping details, the flow skips the Billing Details
section. The other sections are required for every permutation of the flow. So configure Review
Cart, Shipping Details, Payment Details, and Order Confirmation to be active by default.

Stage Order Active by Default


Review Cart 1 Selected

Shipping Details 2 Selected

139
Automate Your Business Processes Flows

Stage Order Active by Default


Billing Details 3 Not selected

Payment Details 4 Selected

Order Confirmation 5 Selected

SEE ALSO:
Flow Stage Considerations

Define the Stages in Your Flow


After you have identified the stages for each branch of your flow, configure the stages.
EDITIONS
1. On the Resources tab, double-click Stage.
Available in: both Salesforce
2. Enter the stage’s label and order, and specify whether it’s active by default.
Classic and Lightning
Experience
SEE ALSO:
Available in: Essentials,
Flow Resource: Stage Professional, Enterprise,
Flow Stage Considerations Performance, Unlimited,
and Developer Editions

USER PERMISSIONS

To open, edit, or create a


flow in Flow Builder:
• Manage Flow

Identify the Relevant Stages in Your Flow


Throughout your flow, identify which stages are relevant to the user by assigning values to the
EDITIONS
stage global variables.
The $Flow.ActiveStages global variable identifies the stages that are relevant to the flow’s Available in: both Salesforce
current branch. $Flow.CurrentStage identifies which stage the flow is in. To update which Classic and Lightning
stages are referenced in the global variables, use an Assignment or Subflow element. Experience

• To add stages to $Flow.ActiveStages, use an Assignment element with one of these Available in: Essentials,
operators. Professional, Enterprise,
Performance, Unlimited,
Operator Description and Developer Editions

add Adds stages to the end of $Flow.ActiveStages.


USER PERMISSIONS
add at start Adds stages to the beginning of $Flow.ActiveStages.
To open, edit, or create a
flow in Flow Builder:
• Manage Flow

140
Automate Your Business Processes Flows

• To add a stage to $Flow.ActiveStages in between two other stages, define it as a default active stage in another flow. Then
use a Subflow element to call the second flow.
• To remove stages from $Flow.ActiveStages, use an Assignment element with one of these operators.

Operator Description
remove after first Removes all stages after the first instance of a specified stage.

remove all Removes all instances of the specified stages.

remove before first Removes all stages before the first instance of a specified stage.

remove first Removes the first instance of a specified stage.

remove position Removes the stage at a specified position.

• To change what’s selected as $Flow.CurrentStage, use an Assignment element with the equals operator. Make sure that
the selected stage is included in $Flow.ActiveStages.
• To count the number of active stages and assign that number to a variable, use an Assignment element with the equals count
operator.
To reference a stage in another flow, enter the fully qualified stage name: flowName:stageName or
namespace.flowName:stageName. At run time, the assignment works only if a Subflow element calls the stage’s flow.

SEE ALSO:
Flow Resource: $Flow Global Variables
Flow Element: Assignment
Flow Operators in Assignment Elements
Flow Stage Considerations

Represent Your Flow’s Stages Visually


The standard flow runtime doesn’t represent a flow’s stages. However, you can use a custom
EDITIONS
component to visually represent the stages.
To visually represent the stages, you can add a custom Aura component or custom Lightning web Available in: both Salesforce
component to your flow’s screens or add a lightning:flow component to your custom Aura Classic and Lightning
component. Experience

• Screen component—When you map a stage to a screen component attribute, the flow passes Available in: Essentials,
the stage’s label into the attribute. Professional, Enterprise,
• lightning:flow component—The onstatuschange attribute in the standard Performance, Unlimited,
lightning:flow component returns the names and labels for the flow’s active stages and current and Developer Editions
stage.

SEE ALSO:
Lightning Aura Components Developer Guide : Display Flow Stages with an Aura Component
Lightning Aura Components Developer Guide : Display Flow Stages By Adding a Progress Indicator to a Flow Screen

141
Automate Your Business Processes Flows

Extend Your Flow-Building Options


Sometimes your flow needs to do more than what Flow Builder provides out of the box. You can
EDITIONS
extend flows by calling Apex classes or adding Lightning components.
Available in: both Salesforce
Extend Flows with Apex Classic and Lightning
With Apex, create custom functionality in flows. Experience

Extend Flows with Lightning Components Available in: Essentials,


To build a richer flow screen, add Aura components or Lightning web components to your Professional, Enterprise,
flow. To perform an action without going through the server, add Aura components to your Performance, Unlimited,
flow. and Developer Editions

Extend Flows with Apex


With Apex, create custom functionality in flows.
EDITIONS

Let Flows Execute Apex Actions Available in: both Salesforce


Flow Builder comes with a lot of functionality, but sometimes your flow needs to do more than Classic (not available in all
the default elements allow. In that case, call an Apex class from your flow by using an Apex orgs) and Lightning
action. Experience

Extend Flows with the Apex-Defined Data Type Available in: Enterprise,
Using a combination of Apex, flow, and Lightning components, you can automate business Performance, Unlimited,
processes that involve complex data objects typically returned from calls to web services. For and Developer Editions
example, get external product data about a web product and then create records in Salesforce.

Let Flows Execute Apex Actions


Flow Builder comes with a lot of functionality, but sometimes your flow needs to do more than the
EDITIONS
default elements allow. In that case, call an Apex class from your flow by using an Apex action.
Developers have two options when they’re trying to make an Apex class available as an Action Available in: both Salesforce
element for a flow. Classic (not available in all
orgs) and Lightning
Tip: We recommend using the @InvocableMethod annotation instead of the Experience
Process.Plugin interface.
Available in: Enterprise,
While the Process.Plugin interface supports customizing how the class appears in the Performance, Unlimited,
palette, the @InvocableMethod annotation provides more functionality. The following table and Developer Editions
describes the features supported by each option.

Process.Plugin Interface @InvocableMethod Annotation

Apex data Doesn’t support: Doesn’t support:


type support • Blob • Generic Object
• Collection • Sets
• sObject • Maps
• Time • Enums

142
Automate Your Business Processes Flows

Process.Plugin Interface @InvocableMethod Annotation

Flow Builder doesn’t support mapping an Apex


method’s input or output parameters to a record
collection variable.

Bulk operations Not supported Supported

Custom icons Not supported Supported

Element type in Action Action


Flow Builder

Element name in Class name or the value of the name property. Class name
Flow Builder

Reusability Classes with this interface implemented are available Classes with this annotation implemented are available
in flows in:
• Flows
• Processes
• Rest API

More Details in Passing Data to a Flow Using the InvocableMethod Annotation and
Apex Developer Process.Plugin Interface InvocableVariable Annotation
Guide

Example: To illustrate the difference between these two implementation methods, here are two classes that do the same thing:
get an account name from a flow and return that account’s ID.
This class implements the @InvocableMethod annotation.

Note: If a flow invokes Apex, the running user must have the corresponding Apex class assignment in their profile or
permission set.
global class lookUpAccountAnnotation {
@InvocableMethod
public static List<String> getAccountIds(List<String> names) {
List<Id> accountIds = new List<Id>();
List<Account> accounts = [SELECT Id FROM Account WHERE Name in :names];
for (Account account : accounts) {
accountIds.add(account.Id);
}
return accountIds;
}
}

This class implements the Process.Plugin interface.


global class lookUpAccountPlugin implements Process.Plugin {

global Process.PluginResult invoke(Process.PluginRequest request) {


String name = (String) request.inputParameters.get('name');
Account account = [SELECT Id FROM Account WHERE Name = :name LIMIT 1][0];

143
Automate Your Business Processes Flows

Map<String,Object> result = new Map<String,Object>();


result.put('accountId', account.Id);
return new Process.PluginResult(result);
}

global Process.PluginDescribeResult describe() {


Process.PluginDescribeResult result = new Process.PluginDescribeResult();
result.Name = 'Look Up Account ID By Name';
result.Tag = 'Account Classes';
result.inputParameters = new
List<Process.PluginDescribeResult.InputParameter>{
new Process.PluginDescribeResult.InputParameter('name',
Process.PluginDescribeResult.ParameterType.STRING, true)
};
result.outputParameters = new
List<Process.PluginDescribeResult.OutputParameter>{
new Process.PluginDescribeResult.OutputParameter('accountId',
Process.PluginDescribeResult.ParameterType.STRING)
};
return result;
}
}

Notice that lookupAccountAnnotation is less than half the length (11 lines) of lookupAccountPlugin (28 lines).
In addition, because the annotation supports bulk operations, lookupAccountAnnotation performs one query per batch
of interviews. lookupAccountPlugin performs one query per interview.

SEE ALSO:
Flow Elements

Extend Flows with the Apex-Defined Data Type


Using a combination of Apex, flow, and Lightning components, you can automate business processes
EDITIONS
that involve complex data objects typically returned from calls to web services. For example, get
external product data about a web product and then create records in Salesforce. Available in: both Salesforce
A call to a REST endpoint returns a JSON response with product data. Classic (not available in all
orgs) and Lightning
Experience

Available in: Enterprise,


Performance, Unlimited,
and Developer Editions

{
"model": "Vintage Cruiser Jacket",
"brand": "Acme",
"identifiers": [
{
"SKU": "A-J001"
},

144
Automate Your Business Processes Flows

{
"SKU": "A-J002"
},
{
"SKU": "A-J003"
}
],
"price": {
"amount": {
"currencyValue": "500.00",
"name": "Amount",
"currency": "USD"
},
"salesUnit": {
"code": "EA",
"name": "Each"
}
}
}

Model JSON Objects with an Apex Class


Define a complex data object in an Apex class. For example, you could create a matching Apex class for a JSON object. The class acts
as a template and converts the JSON into objects that a flow can use.
Create an Apex Action
After you create a mechanism to translate JSON data into flow resources, you can create the Apex class that retrieves the JSON data.
Use the @InvocableMethod annotation to define the class as an Apex action for flows.
Configure an Apex Action
Create a screen flow and add an Apex action to it.

SEE ALSO:
Considerations for the Apex-Defined Data Type
Flow Resource: Variable
Apex Developer Guide : AuraEnabled Annotation
Apex Developer Guide : Invoking HTTP Callouts
Apex Developer Guide : JSON Parsing

Model JSON Objects with an Apex Class


Define a complex data object in an Apex class. For example, you could create a matching Apex
EDITIONS
class for a JSON object. The class acts as a template and converts the JSON into objects that a flow
can use. Available in: both Salesforce
After you define the Apex classes for a web product, you can create an Apex action to get the data Classic (not available in all
from a web service using a REST call. Store the returned data in flow variables that use the orgs) and Lightning
Apex-defined data type. Then operate on the data in flows, Apex, and Lightning components. Experience

Available in: Enterprise,


Performance, Unlimited,
and Developer Editions

145
Automate Your Business Processes Flows

Example: Here’s an example of a WebProduct Apex template. It contains the main WebProduct class and classes for Price
and Identifiers. WebProduct has three types of data.
• The model and brand fields use the primitive String data type.
• The price field references the Price class. Make sure that you save each class in separate class files because inner classes
aren’t supported in the Apex-defined data type for flows.
• The identifiers field is similar to price, but is represented as a List. The Identifiers class lets a flow access
JSON arrays to represent a list of three specific SKU numbers.
• The parse method carries out the conversion of the JSON to the flow-accessible Apex objects.
• Fields in an Apex class for flows require the @AuraEnabled annotation.
public class WebProduct {

@AuraEnabled
public String model;

@AuraEnabled
public String brand;

//Because the identifiers information is an array in the JSON schema, we create a


separate class called Identifiers and define a property that contains a List.
@AuraEnabled
public List<Identifiers> identifiers;

//This field has an Apex-defined data type in the Price Apex class.
@AuraEnabled
public Price price;

//This method is used as part of the Create Apex Action section.


public static WebProduct parse(String json) {
return (WebProduct) System.JSON.deserialize(json, WebProduct.class);
}

The Identifiers Apex class defines the SKU field.


public class Identifiers {

@AuraEnabled
public String SKU;

The Price Apex class defines the amount and salesUnit fields.
public class Price {

//This field has an Apex-defined data type in the Amount Apex class.
@AuraEnabled
public Amount amount;

//This field has an Apex-defined data type in the SalesUnit Apex class.
@AuraEnabled
public SalesUnit salesUnit;

146
Automate Your Business Processes Flows

The Amount Apex class defines the currencyValue, name, and currency fields.
public class Amount {

@AuraEnabled
public String currencyValue;

@AuraEnabled
public String name;

@AuraEnabled
public String currency;

The SalesUnit Apex class defines the code and name fields.
public class SalesUnit {

@AuraEnabled
public String code;

@AuraEnabled
public String name;

Tip: You can use third-party tools to convert JSON to Apex.

Create an Apex Action


After you create a mechanism to translate JSON data into flow resources, you can create the Apex
EDITIONS
class that retrieves the JSON data. Use the @InvocableMethod annotation to define the class
as an Apex action for flows. Available in: both Salesforce
The GetWebProduct Apex class defines an Apex action. It gets product data from a REST Classic (not available in all
endpoint and parses the JSON response into the WebProduct Apex object. orgs) and Lightning
Experience
Example:
Available in: Enterprise,
global with sharing class GetWebProduct { Performance, Unlimited,
and Developer Editions
@InvocableMethod
public static List<Results> GetWebProduct(List<Requests>
requests)
{
Http http = new Http();
HttpRequest request = new HttpRequest();
String endpoint = requests[0].endpoint;

147
Automate Your Business Processes Flows

String submittedId = requests[0].submittedId;


request.setEndpoint(endpoint + submittedId );
request.setMethod('GET');
HttpResponse response = http.send(request);

Results curResult = new Results();


String responseJSON = response.getBody();

WebProduct curProduct = WebProduct.parse(responseJSON);


curResult.WebProduct = curProduct;

List<Results> resultsList = new List<Results>();


resultsList.add(curResult);
return resultsList;
}

global class Requests {


@InvocableVariable
global String submittedId;

@InvocableVariable
global String endpoint;
}

global class Results {


@InvocableVariable
global WebProduct WebProduct;
}

Add a Custom Icon to an Apex-Defined Action


Add custom icons to your Apex-defined invocable actions to make them easier to find on the Flow Builder canvas.
Add a Custom Icon to an Apex-Defined Action
Add custom icons to your Apex-defined invocable actions to make them easier to find on the Flow
EDITIONS
Builder canvas.
The custom icon can be an SVG file or an existing Salesforce Lightning Design System (SLDS) icon. Available in: both Salesforce
Classic (not available in all
SVG files must meet these requirements.
orgs) and Lightning
• The <svg> element in the file includes the id, xmlns, and viewBox attributes. Experience
• The <svg> element in the file doesn’t include the style, height, and width attributes.
Available in: Enterprise,
• The file doesn’t include a <clipPath> element. Performance, Unlimited,
• Each <path> element in the file includes a fill attribute. and Developer Editions

148
Automate Your Business Processes Flows

For example, this SVG file is supported as a custom icon.


<svg id="top" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path fill="#673ab7"

d="M12,44c-1.657,0-3-1.343-3-3V7c0-1.657,1.343-3,3-3h16l11,11v26c0,1.657-1.343,3-3,3H12z"/><path
fill="#5e35b1" d="M39 15L28.883 14.125 39 24.124z"/><path fill="#b39ddb"
d="M39,15h-8c-1.657,0-3-1.343-3-3V4L39,15z"/><path fill="#f5f5f5" d="M22 23H32V25H22zM22
28H32V30H22zM22 33H32V35H22zM17.5 22.5A1.5 1.5 0 1 0 17.5 25.5 1.5 1.5 0 1 0 17.5 22.5zM17.5
27.5A1.5 1.5 0 1 0 17.5 30.5 1.5 1.5 0 1 0 17.5 27.5zM17.5 32.5A1.5 1.5 0 1 0 17.5 35.5
1.5 1.5 0 1 0 17.5 32.5z"/></svg>

Only Standard Object and Custom Object SLDS icons are supported as custom icons for Apex-defined invocable actions.
1. If you’re using an SVG file, upload the file as a static resource in your org.
2. Set the iconName attribute of the InvocableMethod annotation for the invocable action to the name of the icon.
• For SVG icons, specify the name as resource:namespace__iconName:svgID. For example:
public class CustomSvgIcon {

@InvocableMethod(iconName='resource:google:top')
public static void run() {}

public class CustomSvgIcon {

@InvocableMethod(label='myIcon' iconName='resource:myPackageNamespace__google:top')
global static List<Integer> myMethod(List<Integer> request) {
List<Integer> results = new List<Integer>();
results.add(1);
return results;

– iconName is the name that you specified when you uploaded the icon.

– svgID is the value of the id attribute of the <svg> element in the SVG file.

– namespace is the namespace of the package that includes the invocable action to customize. If the invocable action is
in a managed package, namespace__ is a required prefix . Otherwise, it’s optional. To use a custom icon for an invocable
action in a managed package, declare the method that defines the invocable action as global.

• For SLDS icons, specify the name as slds:category:name. For example:


public class CustomSldsIcon {

@InvocableMethod(iconName='slds:standard:choice')
public static void run() {}

category is the name of the category of the icon. name is the name of the file in SLDS.

149
Automate Your Business Processes Flows

When a user adds the invocable action in Flow Builder, the custom icon appears on the Flow Builder canvas to represent it.

SEE ALSO:
Defining Static Resources

Configure an Apex Action


Create a screen flow and add an Apex action to it.
EDITIONS
Example: The Get Web Product Apex action stores the web product data in
{!Get_Web_Product} automatically. Available in: both Salesforce
Classic (not available in all
orgs) and Lightning
Experience

Available in: Enterprise,


Performance, Unlimited,
Now you can operate on the data in flows, Apex, and Lightning components. For example, and Developer Editions
build a flow to generate the product data by looping over the identifiers and assembling a
collection of products. Save the collection of records to Salesforce, and display the data on a
flow screen component.

Extend Flows with Lightning Components


To build a richer flow screen, add Aura components or Lightning web components to your flow.
EDITIONS
To perform an action without going through the server, add Aura components to your flow.
Available in: both Salesforce
Build Rich Screens with Custom Screen Components Classic and Lightning
Use screen components to unlock the look, feel, and functionality of your flow screens. Experience

Let Flows Execute Local Browser Actions Available in: Essentials,


With local actions, you can perform actions in the browser rather than going through the Professional, Enterprise,
Salesforce server. Performance, Unlimited,
and Developer Editions

150
Automate Your Business Processes Flows

Build Rich Screens with Custom Screen Components


Use screen components to unlock the look, feel, and functionality of your flow screens.
EDITIONS
You can install screen components from AppExchange or have a developer build Lightning
components for you. With custom screen components, you can do the following and more: Available in: both Salesforce
Classic and Lightning
• Customize the navigation in your flow
Experience
• Display data in a table
Available in: Essentials,
• Use a branded header instead of the default flow header
Professional, Enterprise,
Note: Before you add custom screen components to a flow screen, make sure that: Performance, Unlimited,
and Developer Editions
• The flow’s type is Screen Flow.
• Users can run the flow only in Lightning runtime. For example, don’t distribute the flow
using a Visualforce component.
• Your org has My Domain enabled and deployed.

When you have the appropriate screen component in your org, add it to your flow screen.
1. In Flow Builder, open an existing screen, or add a Screen element to the canvas.
2. From the list of screen components, drag the appropriate component onto the screen canvas.
If a screen component is built from a Lightning component, it has a lightning bolt icon next to its name.

3. Use values from the flow to set the screen component’s attributes.
4. To use values from the screen component as resources later in the flow, start typing the API name of the screen component.
We automatically store all the attribute values in a variable with the same name as the screen component’s API name.
To store the action’s output values manually, select Manually assign variables (advanced).

Tip: By default, screen components that require Lightning runtime have no memory. If a user enters a value, navigates to another
screen, and returns to the component’s screen, the user-entered value is lost. To enable a flow to remember the value of an
attribute, set the attribute. The flow stores the value automatically. If you store values manually, store the attribute’s output value
in a variable.

SEE ALSO:
Available Screen Components
Lightning Web Components Dev Guide: Configure a Component for Flow Screens
Lightning Aura Components Developer Guide: Customize Flow Screens Using Aura Components
Extend Flows with Lightning Components

151
Automate Your Business Processes Flows

Let Flows Execute Local Browser Actions


With local actions, you can perform actions in the browser rather than going through the Salesforce
EDITIONS
server.
Either install a local action from an external library, such as Unofficial SF, or have a developer build Available in: both Salesforce
one for you. For example, with local actions, a flow can: Classic and Lightning
Experience
• Open a related article in another window or tab.
• When the flow creates a record, open the record in another browser tab. Available in: Essentials,
Professional, Enterprise,
• When the flow finishes, close the browser or console tab.
Performance, Unlimited,
• Get data from a database behind your firewall. and Developer Editions
Note: To add local actions to a flow, make sure that:
• The flow’s type is Screen Flow.
• Users can run the flow only in Lightning runtime. For example, don’t distribute the flow
using a Visualforce component.
• Your org has My Domain enabled and deployed.

To add a local action to a flow:


1. Add an Action element to the canvas.
2. In the Action field, search for and select the local action.
3. To pass data between the flow and the local action, set the action’s inputs and store its outputs.

SEE ALSO:
Lightning Aura Components Developer Guide: Create Flow Local Actions Using Aura Components
Extend Flows with Lightning Components
Add and Edit Elements

152
Automate Your Business Processes Flows

Test a Flow
Before you activate a flow, test it thoroughly to make sure that it works as expected.
EDITIONS
We recommend that you test all possible paths through the flow, so that you can find errors before
they affect your users. For example, if users or inputs don't provide all the data that your flow requires, Available in: both Salesforce
the flow can fail. Add fault connectors to provide paths for users or the flow logic to correct the Classic and Lightning
data so that the flow can successfully finish. Experience

Warning: If you debug a flow without choosing to run the flow in rollback mode, the flow Available in: Essentials,
performs its actions, including any DML operations and Apex code execution. Remember, Professional, Enterprise,
closing or restarting a running flow doesn’t roll back its previously executed actions, callouts, Performance, Unlimited,
and changes committed to the database. and Developer Editions

1. From Setup, enter Flows in the Quick Find box, then select Flows.
USER PERMISSIONS
2. Open the relevant version of the flow.
3. Save your changes. To run a flow in Flow Builder:
Unsaved changes aren't executed when you test the flow. To run a flow from the flow
detail page:
4. Choose one of these options. To open, edit, or create a
• To create and save a flow test for a record-triggered flow and see details of the test run, flow test in Flow Builder:
click View Tests (Beta), and then click Create. • Manage Flow
• To set input variables or see debug details as the flow runs, click Debug. To debug a flow or view test
run details in Flow Builder:
If you opt to view debug details, the flow is rendered in Lightning runtime even if Lightning
• View All Data
runtime isn't enabled for the org.
To create a test from the debug run, click Convert to Test.

• To use the runtime experience determined by your process automation settings, click the Run button.
You can't set input variables or see debug details. It runs the active version of each flow called by Subflow elements. If a referenced
flow has no active version, this option runs the latest version of the referenced flow.

Note: In Lightning runtime, flow users always run the active flow version. Flow admins with the Manage Flow permission
run the latest flow, so they can test the latest flow version without activating it for flow users. A flow admin also runs the latest
flow version that is referenced via a Subflow element.

When you’re confident that your flow is working as expected, activate the version that you tested and distribute the flow.

Debug a Flow in Flow Builder


If you're troubleshooting a flow that fails, the debug option in Flow Builder can be your best friend. See real-time details of what
your flow does, easily set input variables, and restart the flow anytime to debug a different branch.

SEE ALSO:
Debug a Flow in Flow Builder
Lightning Runtime vs. Classic Runtime for Flows
Customize What Happens When a Flow Fails
Flows in Transactions
Troubleshooting Considerations for Flows

153
Automate Your Business Processes Flows

Debug a Flow in Flow Builder


If you're troubleshooting a flow that fails, the debug option in Flow Builder can be your best friend.
EDITIONS
See real-time details of what your flow does, easily set input variables, and restart the flow anytime
to debug a different branch. Available in: both Salesforce
Warning: If you debug a flow without choosing to run the flow in rollback mode, the flow Classic and Lightning
Experience
performs its actions, including any DML operations and Apex code execution. Remember,
closing or restarting a running flow doesn’t roll back its previously executed actions, callouts, Available in: Essentials,
and changes committed to the database. Professional, Enterprise,
1. Open the flow in Flow Builder. Performance, Unlimited,
and Developer Editions
2. Click Debug.
3. Set the debug options and input variables.
USER PERMISSIONS

To debug a flow in Flow


Builder:
• Manage Flow

4. Click Run.
If you opt to show details, they appear in a panel on the right.

154
Automate Your Business Processes Flows

5. (Optional) To restart the flow using the same values for input variables that you entered earlier, click Run Again.
6. (Optional) To restart the flow with different values for input variables, finish the flow and click Change Inputs.

SEE ALSO:
Troubleshooting Considerations for Flows

Distribute a Flow
Once you’ve designed and tested your flow, it’s time to put it to work! Flows can be executed in several ways, depending on who the
flow is designed for. Internal users, external users, or systems can run a flow, or a flow can be deployed for another organization.

Activate or Deactivate a Flow


You can have multiple versions of a flow in Salesforce, but only one version of each flow can be active at a time. You can activate or
deactivate a flow right in Flow Builder or from the flow’s detail page in Setup.
Flow Distribution Concepts
Understand which users can run your flow, what data your flow can access, and how your flow looks in Classic and Lightning
Experience.

155
Automate Your Business Processes Flows

Distribute Flows to Users in Your Org


Enable your internal users to run your flow through a custom action, the flow URL, a Lightning page, a Visualforce page, or a custom
Aura component.
Distribute Flows to Users Outside Your Org
Let external users run your flow by adding the flow to an Experience Builder site, an external app or page, or an Embedded Service
deployment. For finer control over how your flow behaves in external contexts, use a custom Aura component or Visualforce page.
Flows in custom Aura components use Lightning runtime, and flows in Visualforce pages use Classic runtime.
Distribute Flows to Automated Systems
Some flows don’t require any user interaction to start. To enable a system to automatically launch a flow, use the start Apex
method, a process, or a workflow action.
Distribute Flows to Other Orgs
Flows can be included in Lightning Bolt Solutions, change sets, and packages. The recipient org of the solution, change set, or
package must have flows enabled.
Always Run in System Context
You can set a flow version to always run in system context, overriding the context it normally runs in. If you choose to run the flow
in system context with sharing, the flow respects org-wide default settings, role hierarchies, sharing rules, manual sharing, teams,
and territories. But it doesn’t respect object permissions, field-level access, or other permissions of the running user. If you choose
to run the flow in system context without sharing, the flow respects the permissions of the running user only for a limited set of
actions and operations. The flow can access all other data.

Activate or Deactivate a Flow


You can have multiple versions of a flow in Salesforce, but only one version of each flow can be
EDITIONS
active at a time. You can activate or deactivate a flow right in Flow Builder or from the flow’s detail
page in Setup. Available in: both Salesforce
When you activate a flow version, the previously activated version (if one exists) is deactivated. Any Classic and Lightning
running flow interview continues to run using the version that it started with. Experience

1. Open the flow version in Flow Builder. Available in: Essentials,


2. Click Activate or Deactivate in the button bar. Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
SEE ALSO:
Distribute a Flow
USER PERMISSIONS
Triggers for Autolaunched Flows
To activate or deactivate a
flow:
• Manage Flow
To activate an autolaunched
flow that has a trigger:
• View All Data

156
Automate Your Business Processes Flows

Flow Distribution Concepts


Understand which users can run your flow, what data your flow can access, and how your flow
EDITIONS
looks in Classic and Lightning Experience.
Available in: both Salesforce
How Does Flow Security Work? Classic and Lightning
Limit which users can execute all flows based on their user record, profile, or permission set. Experience
Apply more granular security to an individual flow by overriding the default behavior, then Available in: Essentials,
granting access to that specific flow based on user profile or permissions set. Professional, Enterprise,
Which Context Do Flows Run In? Performance, Unlimited,
Flows run in user context or system context. For a flow running in user context, the running and Developer Editions
user’s profile and permission sets determine the object permissions and field-level access of
the flow. For a flow that runs in system context, the flow access is determined by whether the
flow runs in system context with sharing or without sharing.
Lightning Runtime vs. Classic Runtime for Flows
Depending on how a flow is distributed, users see either the Classic runtime or Lightning runtime UI when they run the flow. Like
its name suggests, Lightning runtime looks and feels like Lightning Experience.

How Does Flow Security Work?


Limit which users can execute all flows based on their user record, profile, or permission set. Apply
EDITIONS
more granular security to an individual flow by overriding the default behavior, then granting access
to that specific flow based on user profile or permissions set. Available in: both Salesforce
Note: To use the Flow Builder, you must have the Manage Flow user permission. Classic and Lightning
Experience
Control user permission to run flows via:
Available in: Essentials,
• The Manage Flows permission Professional, Enterprise,
• The Run Flows permission Performance, Unlimited,
and Developer Editions
Note: The Run Flows permission is removed from new orgs starting in Winter ’21 for the
Guest User and Experience Cloud External User profiles. The permission will be removed
from the Guest User profile in all orgs starting in Spring ’23. To avoid future access issues,
we recommend updating your existing sites to the new permission structure before
Spring ’23. To update your flows, select Override default behavior and restrict access
to enabled profiles or permission sets and provide granular flow access for your guest
users.

• The Flow User field on their user detail page


• If Override default behavior and restrict access to enabled profiles or permission sets is selected for an individual flow, access
to that flow is given to users by profile or permission set

To override the default behavior, from the Flows node in setup, click the next to your flow, then click the new Edit Access link
to select the profiles for each flow.

157
Automate Your Business Processes Flows

You can also use the profile or permission set detail page to set access to flows. The Guest User profile must be updated this way.
Permission to access a flow is checked only at the entry points, when a flow starts or resumes.
Permission for a flow is checked only at the top level. For example, flow A calls flow B. User X has a profile that can access flow A but not
flow B. User X can execute flow B, but only through flow A; user X can’t execute flow B directly.
By default, the ability to resume a flow interview is restricted to the user that started the flow. To grant access to a flow interview beyond
the user that started it, use flow interview sharing rules. Remember, the resuming user must also have the appropriate permission. If
Override default behavior and restrict access to enabled profiles or permission sets is selected, the resuming user must have
access to the individual flow via their profile or a permission set.

SEE ALSO:
Sharing Rules

158
Automate Your Business Processes Flows

Which Context Do Flows Run In?


Flows run in user context or system context. For a flow running in user context, the running user’s
EDITIONS
profile and permission sets determine the object permissions and field-level access of the flow. For
a flow that runs in system context, the flow access is determined by whether the flow runs in system Available in: both Salesforce
context with sharing or without sharing. Classic and Lightning
The context that the flow runs in impacts what the following flow elements can do with Salesforce Experience
data:
Available in: Essentials,
• Action Professional, Enterprise,
• Create Records Performance, Unlimited,
and Developer Editions
• Delete Records
• Get Records
• Subflow
• Update Records
• Any other flow element that accesses fields from a record
By default, a flow runs in user context or system context, depending on how the flow is launched. When a flow runs in system context,
it runs in that context for all users, including users with the Guest User profile.

Flow Launch Method Default Context


Apex Depends on code

Experience Cloud site User

Embedded as a visual component inside a custom Aura component User

Embedded as a visual component inside a Visualforce page User

Custom button User

Custom link User

Direct link User

Flow action User

Lightning page User

Process built in Process Builder System context without sharing

Record-triggered System context without sharing

Rest API User

Run from an Apex method of a custom Aura component controller Depends on code

Run from an Apex method of a Visualforce controller Depends on code

Schedule-triggered System context without sharing

Web tab User

159
Automate Your Business Processes Flows

Lightning Components, Apex, and Processes


• Lightning components such as screen components and local actions always run in user context.
• If the context depends on code, Apex uses the with sharing and without sharing keywords to specify whether to
enforce org-wide default settings, role hierarchies, sharing rules, manual sharing, teams, and territories. A flow called by Apex always
ignores object and field-level access permissions.
• When a record-triggered flow, schedule-triggered flow, or process invokes an Apex invocable method from an Apex class with the
inherited sharing declaration, the invocable method runs in system context with sharing. The flows and process run in system context
without sharing.
• If a process triggers the flow to launch, the user that triggered the process sometimes requires other permissions. For example, if a
process launches a flow that attempts to save permission set license assignments, and the running user doesn’t have the Assign
Permission Sets permission, an error occurs.

SEE ALSO:
Running User of a Flow
Always Run in System Context

Lightning Runtime vs. Classic Runtime for Flows


Depending on how a flow is distributed, users see either the Classic runtime or Lightning runtime
EDITIONS
UI when they run the flow. Like its name suggests, Lightning runtime looks and feels like Lightning
Experience. Available in: both Salesforce
Here’s the same flow rendered in Classic runtime (left) and Lightning runtime (right). Classic and Lightning
Experience

Available in: Essentials,


Professional, Enterprise,
Performance, Unlimited,
and Developer Editions

160
Automate Your Business Processes Flows

Which Runtime Experience Do My Users See?


Flows that run from a Visualforce component always use Classic runtime. Flows that run from a Lightning page, flow action, or custom
Aura component always use Lightning runtime. All other methods depend on whether Lightning runtime has been enabled in your
org’s Process Automation settings.
This table summarizes which runtime experience your users see based on how you distribute the flow.

Flow Distribution Method When Lightning Runtime for Flows is


Not selected Selected
Visualforce component Classic runtime Classic runtime

Custom button Classic runtime Lightning runtime

Custom link Classic runtime Lightning runtime

Web tab Classic runtime Lightning runtime

Direct link Classic runtime Lightning runtime

Flow action Lightning runtime Lightning runtime

Lightning page Lightning runtime Lightning runtime

Custom Aura component Lightning runtime Lightning runtime

SEE ALSO:
Set the Runtime Experience for URL-Based Flows

Distribute Flows to Users in Your Org


Enable your internal users to run your flow through a custom action, the flow URL, a Lightning page,
EDITIONS
a Visualforce page, or a custom Aura component.
Available in: both Salesforce
Add a Flow to a Lightning Page Classic and Lightning
To easily distribute a flow to Lightning Experience or Salesforce app users, embed it in a Lightning Experience
page. Available in: Essentials,
Create an Object-Specific Quick Action That Launches a Flow Professional, Enterprise,
To easily distribute a flow to Lightning Experience or Salesforce app users, create a flow action Performance, Unlimited,
and add it to the appropriate page layout. Flows aren’t supported for global actions. and Developer Editions

Add a Flow to the Actions & Recommendations Component


Want to use your flow to guide users through complex business processes in Lightning console or standard navigation apps?
Associate the flow with records by using a process to create a RecordAction object, or by creating an Actions & Recommendations
deployment. Then add the Actions & Recommendations component to your Lightning pages using the Lightning App Builder.
Add a Flow to a Utility Bar
Want your flow to be accessible from any page in your app? Add it to the utility bar in your Lightning app. The utility bar gives your
users quick access to commonly used tools.

161
Automate Your Business Processes Flows

Share the Flow URL or Create a Custom Button, Link, or Web Tab
Users in your org who don’t need a customized look and feel can run the flow via its URL. Distribute a flow URL directly or through
a custom button, link, or Web tab.
Embed a Flow in a Custom Aura Component
To customize how your flow gets and receives data, add it to a custom Aura component. Then distribute that component through
a custom action, Lightning tab, or Lightning page.
Embed a Flow in a Visualforce Page
To customize your flow’s look and feel for internal users, add the flow to a Visualforce page. Then distribute that page through a
Visualforce tab, custom button, or custom link.
Prepare Your Org for Paused Flow Interviews
A flow interview is a running instance of a flow. Not every flow interview can be completed in one go. Add the Pause button to your
flows, so that users can pause flow interviews for later. Update the sharing model for flow interviews, so that other users can resume
a paused interviews. And make it easy for users to resume interviews by adding a component to their Home page.

Add a Flow to a Lightning Page


To easily distribute a flow to Lightning Experience or Salesforce app users, embed it in a Lightning
USER PERMISSIONS
page.
To create and save Lightning
Available in: Lightning Experience pages in the Lightning App
Builder:
Available in: Essentials, Professional, Enterprise, Performance, Unlimited, and Developer • Customize Application
Editions
To view Lightning pages in
the Lightning App Builder:
• View Setup and
If you’re not yet familiar with the types of Lightning pages you can customize, check out the Lightning Configuration
App Builder module in Trailhead. If your org uses the Outlook or Gmail integrations you can also
create custom email application panes.
1. Open a Lightning page in the Lightning App Builder.
2. From the Lightning Components pane on the left, drag the Flow component onto the Lightning page canvas.
3. Configure the component.
Flow
Only active screen flows are available. Flows built in the Desktop Flow Designer aren’t supported.
Layout
By default, flows display in one column.

Note:
• Starting in Winter ’23, two-column flow layouts are ignored. For a better layout option, add Section components to
your flow screens. Each Section component lets you organize record fields and screen components in up to four
adjustable-width columns.
• If a flow screen contains a Section component, that screen ignores the Layout property.

Input variables
If you see other properties, they’re the flow’s input variables. Variables appear only if they allow input access.

162
Automate Your Business Processes Flows

Pass record ID into this variable


This option is available only for Text input variables in Record pages. For simplicity, we recommend passing the ID to only one
variable.
For example, when this component is embedded in an Opportunity Record page, at run time the component passes the
opportunity’s ID into the selected input variable.

4. Save the page.


5. Hang on, you’re not done yet! To make your page available to your users, activate it. You can activate the page from the Save dialog
when you save it for the first time, or later using the Activation button.
6. Test that the flow is working correctly, and then roll the Lightning page out to your users.

SEE ALSO:
Two-Column Flow Considerations
Flow Screen Output Component: Section

Create an Object-Specific Quick Action That Launches a Flow


To easily distribute a flow to Lightning Experience or Salesforce app users, create a flow action and
USER PERMISSIONS
add it to the appropriate page layout. Flows aren’t supported for global actions.
To create actions:
Available in: Lightning Experience • Customize Application

Available in: Essentials, Professional, Enterprise, Performance, Unlimited, and Developer


Editions

1. From the management settings for the object for which you want to create an action, go to Buttons, Links, and Actions.
2. Click New Action.
3. For Action Type, select Flow.
4. Select the flow to use in your action.
The flow must be active and of type “Screen Flow” or “Field Service Mobile Flow”.

5. Enter a label for the action.


Users see this label, rather than the flow name, as the name of the action. We recommend entering the name of the flow as the
action label.

6. If necessary, change the name of the action.


This name is used in the API and managed packages. It must begin with a letter and use only alphanumeric characters and underscores,
and it can’t end with an underscore or have two consecutive underscores. Unless you’re familiar with working with the API, we
suggest not editing this field.
7. Type a description for the action.
The description appears on the detail page for the action and in the list on the Buttons, Links, and Actions page. The description isn’t
visible to your users. If you’re creating several actions on the same object, we recommend using a detailed description.
8. Optionally, change the action icon to a static resource in your org.
Custom images used for action icons must be less than 1 MB in size.

9. Save the action.

163
Automate Your Business Processes Flows

10. Hang on, you’re not done yet! To make your action available to your users, add it to a page layout.
Want the action to send the record’s ID to your flow? Make sure that the flow has a variable with these settings.

Variable Setting Value


API Name recordId (case sensitive)

Data Type Text

Available for input Selected

Note: If you delete an action, the action is removed from all layouts that it’s assigned to. If you deactivate a flow referenced in an
action, the action doesn’t appear at run time.

Add a Flow to the Actions & Recommendations Component


Want to use your flow to guide users through complex business processes in Lightning console or standard navigation apps? Associate
the flow with records by using a process to create a RecordAction object, or by creating an Actions & Recommendations deployment.
Then add the Actions & Recommendations component to your Lightning pages using the Lightning App Builder.
When users open a record with this component, they can launch flows and other actions from the list. The flows start in a subtab in a
console app, or in a popup window in a standard navigation app. The Actions & Recommendations component is great for call scripts
or chat interactions.

SEE ALSO:
Lightning Flow for Service Developer Guide (English only)

Add a Flow to a Utility Bar


Want your flow to be accessible from any page in your app? Add it to the utility bar in your Lightning app. The utility bar gives your users
quick access to commonly used tools.

Available in: Lightning Experience

Available in: Essentials, Professional, Enterprise, Performance, Unlimited, and Developer Editions

1. From Setup, in the Quick Find box, enter App, then select App Manager.
2. Edit an existing Lightning App or click New Lightning App. You can also upgrade a custom Classic App to a Lightning app.
3. Under App Settings, click Utility Items.
4. Click Add Utility Item, then select Flow.
5. Configure the utility item properties and the component properties.
Flow
Only active screen flows are available. Flows built in the Desktop Flow Designer aren’t supported.
Layout
By default, flows display in one column.

164
Automate Your Business Processes Flows

Note:
• Starting in Winter ’23, two-column flow layouts are ignored. For a better layout option, add Section components to
your flow screens. Each Section component lets you organize record fields and screen components in up to four
adjustable-width columns.
• If a flow screen contains a Section component, that screen ignores the Layout property.

Tip: If a Section component has three or more columns, give the flow’s utility item enough space to display the flow’s columns.
To do so, increase the value of the Panel Width property on the flow’s utility item.

6. Save your changes.


To verify your changes, from the App Launcher, find and open the app that you added the flow to.

SEE ALSO:
Two-Column Flow Considerations
Flow Screen Output Component: Section

Share the Flow URL or Create a Custom Button, Link, or Web Tab
Users in your org who don’t need a customized look and feel can run the flow via its URL. Distribute
EDITIONS
a flow URL directly or through a custom button, link, or Web tab.
1. From Setup, enter Flows in the Quick Find box, then select Flows. Available in: both Salesforce
Classic and Lightning
2. For the flow that you want to distribute, click and select View Details and Versions.
Experience
If isn’t available for each flow, click the name of the flow that you want to distribute.
Available in: Essentials,
3. Verify that the flow has an active version. Professional, Enterprise,
Only users with the Manage Flow permission can run inactive flows. If the flow contains subflow Performance, Unlimited,
elements, the referenced flows must also have an active version. and Developer Editions

4. Copy the flow URL, and append it to your instance.


For example: USER PERMISSIONS

To view flow detail pages:


• Manage Flow

https://yourDomain.my.salesforce.com/flow/MyFlowName

If the flow was installed from a managed package, include the namespace prefix in the flow URL. For example:

https://yourDomain.my.salesforce.com/flow/namespace/MyFlowName

5. To set the initial values of your flow’s variables, append ?variable1=value1&variable2=value2 to the URL.
6. Distribute the flow URL.
Here are some examples:
• Create a custom button or link, and add it to a page layout.
• Create a Web tab, and add it to the appropriate profiles.

165
Automate Your Business Processes Flows

Set the Runtime Experience for URL-Based Flows


Are you distributing a flow via a URL? That includes things like direct URLs, custom buttons, and links in Setup. You can flip one
switch to upgrade all those flows to Lightning runtime.
Customize a Flow URL to Control Finish Behavior
By default, when a flow interview that uses screens finishes, a new interview for that flow begins, and the user is redirected to the
first screen. If you want to redirect users to another page within Salesforce when they click Finish, use the retURL parameter in
the flow URL.
Customize a Flow URL to Set Variable Values
When you distribute a flow using a URL, you can set variables within that flow using parameters in the URL.
Customize a Flow URL to Render Two-Column Screens
When you distribute a flow using a URL, you can control whether to display the screens with one column or two. Two-column
screens are supported only for orgs that have enabled Lightning runtime.

Set the Runtime Experience for URL-Based Flows


Are you distributing a flow via a URL? That includes things like direct URLs, custom buttons, and
EDITIONS
links in Setup. You can flip one switch to upgrade all those flows to Lightning runtime.
Available in: both Salesforce
User Permissions Needed Classic and Lightning
To edit process automation settings: Customize Application Experience

Available in: Essentials,


Professional, Enterprise,
We have two flavors of runtime experience for your flow users. Classic runtime looks more like a Performance, Unlimited,
standard Visualforce page. Lightning runtime fits right in with Lightning Experience. To compare and Developer Editions
the two runtime experiences, check out Lightning Runtime vs. Classic Runtime for Flows.
To render all URL-based flows in Lightning runtime:
1. From Setup, enter Process Automation Settings in the Quick Find box, then select Process Automation Settings.
2. Select Enable Lightning runtime for flows.
3. Save your changes.
This setting also controls whether a flow appears in one or two columns when you distribute the flow via a URL or via a Lightning page.
When enabled, flows use Lightning runtime when they’re run from:
• A direct link
• A custom button or link
• Flow Builder
• Flow detail pages or list views

SEE ALSO:
Lightning Runtime vs. Classic Runtime for Flows
Customize a Flow URL to Render Two-Column Screens

166
Automate Your Business Processes Flows

Customize a Flow URL to Control Finish Behavior


By default, when a flow interview that uses screens finishes, a new interview for that flow begins,
EDITIONS
and the user is redirected to the first screen. If you want to redirect users to another page within
Salesforce when they click Finish, use the retURL parameter in the flow URL. Available in: both Salesforce
Classic and Lightning
Format Experience

To redirect users to a specific page in Salesforce after they click Finish: Available in: Essentials,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions

/flow/flowName?retURL=url

where url is a relative URL (the part of the URL that comes after https://MyDomainName.my.salesforce.com/ or
https://MyDomainName.lightning.force.com/).

URL Options
You can't redirect flow users to a URL that’s external to your Salesforce org.

Tip: Use Salesforce Classic URLs. Lightning Experience URLs always redirect to the home page in Lightning Experience.

• For Salesforce Classic URLs, Salesforce redirects your users to the right page in whichever Salesforce experience they’ve enabled —
Lightning Experience or Salesforce Classic. If the page doesn’t exist in Lightning Experience, Salesforce redirects the user to the page
in Salesforce Classic.
• For Lightning Experience URLs, Salesforce always redirects your users to the home page in Lightning Experience
(lightning/page/home), even if the user has Salesforce Classic enabled. Users who don’t have permission to access Lightning
Experience see an error message.
• If your URL redirects users to a web tab, Salesforce renders the web tab in Salesforce Classic.
• Web tabs in Lightning Experience can redirect only to Visualforce pages.

Redirect Destination Relative URL Example


Chatter _ui/core/chatter/ui/ChatterPage _ui/core/chatter/ui/ChatterPage

Home page home/home.jsp home/home.jsp

List view objectCode?fcf=listViewId 006?fcf=00BD0000005lwec

Object home page, such as Accounts home objectCode/o 001/o

Specific record, such as a contact, report, recordId 0D5B000000SKZ7V


dashboard, user, profile, or Chatter post

Visualforce page apex/pageName apex/myVisualforcePage

Web tab servlet/servlet.Integration?lid=webTabId servlet/servlet.Integration?lid=01rD0000000A88h

167
Automate Your Business Processes Flows

Limitations
• You can’t use a flow variable as the value for the retURL parameter. If you want to use a flow variable to redirect a user, such as
to a specific record, distribute the flow by using Visualforce.
• retURL can cause nested top and side navigation bars to render on the destination page.
• retURL is case-sensitive. If you use retUrl, the URL doesn’t redirect the user.

Examples
This flow URL redirects users to Accounts home, which exists in both Lightning Experience and Salesforce Classic.
/flow/myFlow?retURL=001/o

When Lightning Experience users finish the flow interview, Salesforce redirects them to
http://MyDomainName.lightning.force.com/lightning/o/Account/home. When Salesforce Classic users
finish the flow interview, Salesforce redirects them to http://MyDomainName.my.salesforce.com/001/o. Either way,
Salesforce redirects users to Accounts home in their respective experience.
This flow URL redirects users to a Visualforce page that exists only in Salesforce Classic.
/flow/myFlow?retURL=apex/myPage

When users finish the flow interview, Salesforce redirects them to


http://MyDomainName.my.salesforce.com/apex/myPage in Salesforce Classic. When they navigate away from the
Visualforce page, Salesforce reverts to their original experience.
For instance, after viewing the Visualforce page, users navigate to the home page. For Lightning Experience users, Salesforce renders
the Lightning Experience home page (http://MyDomainName.lightning.force.com/lightning). For Salesforce
Classic users, Salesforce renders the Salesforce Classic home page
(http://MyDomainName.my.salesforce.com/home/home.jsp).
This flow URL sets the varUserFirst and varUserLast variables (both of type Text) to the running user’s FirstName and
LastName field values. When the flow interview finishes, the user is redirected to the home page for whichever Salesforce experience
is enabled.
/flow/User_Info?varUserFirst={!$User.FirstName}
&varUserLast={!$User.LastName}&retURL=home/home.jsp

SEE ALSO:
Distribute a Flow
Troubleshoot Flow URLs
Customize a Flow URL to Set Variable Values

168
Automate Your Business Processes Flows

Customize a Flow URL to Set Variable Values


When you distribute a flow using a URL, you can set variables within that flow using parameters in
EDITIONS
the URL.
You can’t set the values for record variables and record collection variables using URL parameters. Available in: both Salesforce
The variable must allow input access. Classic and Lightning
Experience
These steps assume you’re using a relative URL in your org to direct users to the flow.
1. From Setup, enter Flows in the Quick Find box, then select Flows. Available in: Essentials,
Professional, Enterprise,
2. Click for the flow you want to customize and select View Details and Versions. Performance, Unlimited,
3. Copy the URL for the flow. and Developer Editions

4. At the end of the flow URL, append ?name=value, where name is the unique name of the
variable or collection variable in the flow that you want to set and value is the value you USER PERMISSIONS
want to set it to. If you want to set multiple variable values, append
To view a flow’s detail page:
?name1=value1&name2=value2 to the end of the flow URL. If you want to set the
• View Setup and
values for multiple items in the same collection variable, append
Configuration
?name=value1&name=value2.
For example: To create and edit custom
buttons, links, and Web tabs:
• Customize Application

/flow/MyFlow?varNumber=100&varString=Hello

Here are the valid values for each flow variable and collection variable based on its data type.

Variable Acceptable Values


Type
Boolean • Merge field of type Checkbox
• True values: true or 1
• False values: false or 0

Currency Merge field of type Number or a numeric value

Date Merge field of type Date or YYYY-MM-DD

DateTime Merge field of type Date/Time or YYYY-MM-DDThh:mm:ssZ

Multi-Select Merge field of any type or a string in this format: value1; value2
Picklist

Number Merge field of type Number or a numeric value

Picklist Merge field of any type or a string

Text Merge field of any type or a string

Note: When you distribute a flow, don’t pass a currency field value from a Salesforce record into a flow currency variable with
a URL parameter. When a currency field is referenced through a merge field (such as {!Account.AnnualRevenue}),
the value includes the unit of currency’s symbol (for example, $). Flow currency variables can accept only numeric values, so

169
Automate Your Business Processes Flows

the flow fails at run time. Instead, pass the record’s ID to a text variable with a URL parameter. Then in the flow, use the ID to
look up that record’s value for the currency field.

Example: The following example is a flow URL that is used in a custom button on a case page layout. When a user clicks that
button, the flow launches with the varID variable (of type Text) set to the case record’s CaseNumber field value.

/flow/Case_Management?varID={!Case.CaseNumber}

The following example sets the varUserFirst and varUserLast variables (both of type Text) to the running user’s FirstName and
LastName field values.

/flow/User_Info?varUserFirst={!$User.FirstName}&varUserLast={!$User.LastName}

The following example is a flow URL that is used in a custom button on a contact page layout. When a user clicks that button, the
flow launches and adds text values from the contact as items in the {!collNames} text collection variable.
/flow/Contact_Info?collNames={!Contact.FirstName}&collNames={!Contact.LastName}

SEE ALSO:
Customize a Flow URL to Control Finish Behavior
Distribute a Flow
Troubleshoot Flow URLs

Customize a Flow URL to Render Two-Column Screens


When you distribute a flow using a URL, you can control whether to display the screens with one
EDITIONS
column or two. Two-column screens are supported only for orgs that have enabled Lightning
runtime. Available in: both Salesforce
Note: Starting in Winter ’23, two-column flow layouts are ignored, including this URL Classic and Lightning
Experience
customization. For a better layout option, add Section components to your flow screens. Each
Section component lets you organize record fields and screen components in up to four Available in: Essentials,
adjustable-width columns. Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
Prerequisites
Enable Lightning runtime so that your flows respect the specified layout.
1. From Setup, go to Process Automation Settings.
2. Select Enable Lightning runtime for flows.

Format
To display a flow’s screens in two columns:

/flow/flowName?flowLayout=twoColumn

170
Automate Your Business Processes Flows

Examples
This example displays a “Case Management” flow in two columns.
/flow/Case_Management?flowLayout=twoColumn

This example displays a “User Info” flow in two columns and sets the varUserFirst and varUserLast variables (both of type Text) to the
running user’s FirstNameand LastName field values.
/flow/User_Info?varUserFirst={!$User.FirstName}&varUserLast={!$User.LastName}&flowLayout=twoColumn

SEE ALSO:
Set the Runtime Experience for URL-Based Flows
Two-Column Flow Considerations
Flow Screen Output Component: Section

Embed a Flow in a Custom Aura Component


To customize how your flow gets and receives data, add it to a custom Aura component. Then
EDITIONS
distribute that component through a custom action, Lightning tab, or Lightning page.
To embed a flow in your Aura component, add the lightning:flow component to it. In the Available in: both Salesforce
JavaScript controller, identify which flow to start. <aura:component> <aura:handler name="init" Classic and Lightning
value="{!this}" action="{!c.init}" /> <lightning:flow aura:id="flowData" /> </aura:component>({ Experience
init : function (component) { // Find the component whose aura:id is "flowData" var flow = Available in: Essentials,
component.find("flowData"); // In that component, start your flow. Reference the flow's API Name. Professional, Enterprise,
flow.startFlow("myFlow"); }, }) Performance, Unlimited,
and Developer Editions

Embed a Flow in a Visualforce Page


To customize your flow’s look and feel for internal users, add the flow to a Visualforce page. Then
EDITIONS
distribute that page through a Visualforce tab, custom button, or custom link.
1. Find the flow’s API name. Available in: both Salesforce
Classic and Lightning
a. From Setup, enter Flows in the Quick Find box, then select Flows.
Experience
b. Click the name of the flow.
Available in: Essentials,
c. Copy the API name of the flow. Professional, Enterprise,
Performance, Unlimited,
2. From Setup, enter Visualforce Pages in the Quick Find box, then select
and Developer Editions
Visualforce Pages.
3. Define a new Visualforce page, or open an existing one.
USER PERMISSIONS
4. Add the <flow:interview> component somewhere between the <apex:page>
tags. To create, edit, and set
version settings for
5. Set the name attribute to the API name of the flow. Visualforce pages:
• Customize Application

171
Automate Your Business Processes Flows

For example:
<apex:page>
<flow:interview name="flowAPIName"/>
</apex:page>

If the flow is from a managed package, the name attribute must be in this format: namespace.flowuniquename.

6. Click Save.
7. Restrict which users can access the Visualforce page.
a. Click Visualforce Pages.
b. Click Security next to your Visualforce page.
c. Move all the appropriate profiles from Available Profiles to Enabled Profiles by using the add and remove buttons.
d. Click Save.

8. Add the Visualforce page to your app by using a custom button, link, or Visualforce tab.

Customize a Visualforce Component to Control the Flow's Finish Behavior


By default, users who click Finish start a new interview and see the first screen of the flow. After you embed a flow in a Visualforce
page, configure the finishLocation attribute to route users to another page in Salesforce.

Customize a Visualforce Component to Control the Flow's Finish Behavior


By default, users who click Finish start a new interview and see the first screen of the flow. After you embed a flow in a Visualforce page,
configure the finishLocation attribute to route users to another page in Salesforce.

Set finishLocation with the URLFOR Function


Note:
• You can’t redirect flow users to a URL that’s external to your Salesforce org.
• Don’t call the Auth.SessionManagement.finishLoginFlow method and the finishLocation attribute
in the same flow. Auth.SessionManagement.finishLoginFlow indicates the end of a Visualforce page login
flow. If finishLocation is in the same flow, finishLocation executes when the flow starts, giving users full access
to the session.

To route users to a relative URL or a specific record or detail page, using its ID, use the URLFOR function.
This example routes users to the Salesforce home page.
<apex:page>
<flow:interview name="MyUniqueFlow" finishLocation="{!URLFOR('/home/home.jsp')}"/>
</apex:page>

This example routes users to a detail page with an ID of 001D000000IpE9X.


<apex:page>
<flow:interview name="MyUniqueFlow" finishLocation="{!URLFOR('/001D000000IpE9X')}"/>
</apex:page>

For details about URLFOR, see Functions in the Visualforce Developer’s Guide.

172
Automate Your Business Processes Flows

Set finishLocation with the $Page Variable


To route users to another Visualforce page without using URLFOR, set finishLocation to the name of the destination page with
the format {!$Page.pageName}.
<apex:page>
<flow:interview name="MyUniqueFlow" finishLocation="{!$Page.MyUniquePage}"/>
</apex:page>

For details about $Page, see Global Variables in the Visualforce Developer’s Guide.

Set finishLocation with a Controller


You can set finishLocation in a few ways with a custom controller.
This sample controller configures a flow’s finish behavior in three different ways.
• getPageA instantiates a new page reference by passing a string to define the location.
• getPageB returns a string that is treated like a PageReference.
• getPageC returns a string that gets translated into a PageReference.
public class myFlowController {

public PageReference getPageA() {


return new PageReference('/300');
}

public String getPageB() {


return '/300';
}

public String getPageC() {


return '/apex/my_finish_page';
}
}

Here’s a sample Visualforce page references that controller and sets the flow finish behavior to the first option.
<apex:page controller="myFlowController">
<h1>Congratulations!</h1> This is your new page.
<flow:interview name="flowname" finishLocation="{!pageA}"/>
</apex:page>

If you use a standard controller to display a record on the same page as the flow, users who click Finish start a new flow interview. They
see the first screen of the flow, without the record, because the id query string parameter isn’t preserved in the page URL. If needed,
configure the finishLocation to route users back to the record.

173
Automate Your Business Processes Flows

Prepare Your Org for Paused Flow Interviews


A flow interview is a running instance of a flow. Not every flow interview can be completed in one
EDITIONS
go. Add the Pause button to your flows, so that users can pause flow interviews for later. Update
the sharing model for flow interviews, so that other users can resume a paused interviews. And Available in: both Salesforce
make it easy for users to resume interviews by adding a component to their Home page. Classic and Lightning
Experience
Let Users Pause Flow Interviews Available in: Essentials,
When users can’t finish a flow interview, give them the option to pause it for later by customizing Professional, Enterprise,
your org’s process automation settings. For example, a customer service representative can Performance, Unlimited,
pause an interview when the customer doesn’t have all the necessary information. and Developer Editions
Add Record Context to Your Flows
All it takes to associate your org’s paused interviews with a record is setting the
$Flow.CurrentRecord global variable in your flow. That way, you can find all the paused flow interviews related to that record. For
example, in the Change Address flow, set $Flow.CurrentRecord to {!recordId} so that all Change Address interviews
are associated with the relevant contact.
Make It Easy for Users to Find Their Paused Flow Interviews
Give your users an instant view of their paused flow interviews by customizing the Home page or Salesforce mobile app navigation
menu.
Make It Easy for Users to Find Paused Flow Interviews for a Record
From a record page, display a list of all paused flow interviews that are associated with that record with this custom Aura component.
Customize Who Has Access to Paused Flow Interviews
By default, users can resume paused flow interviews as long as they have edit access. To control who has edit access, build a sharing
model for the Flow Interview object. Configure the org-wide default access level, and build sharing rules to override that default for
specific users or groups.
Restrict Who Can Resume Shared Flow Interviews
By default, users with the Run Flows permission or a Flow User feature license can resume any paused flow interview that they have
edit access to. You can set Salesforce to only allow each interview to be resumed by the interview owner, or by an admin with
Manage Flow permission and view access to the interview.
Delete a Paused Flow Interview
If you no longer need to wait for a long-running flow interview to finish or for a user to resume a paused interview, delete the
interview. For example, perhaps you’re updating or deleting the associated flow version.

Let Users Pause Flow Interviews


When users can’t finish a flow interview, give them the option to pause it for later by customizing
EDITIONS
your org’s process automation settings. For example, a customer service representative can pause
an interview when the customer doesn’t have all the necessary information. Available in: both Salesforce
Classic and Lightning
User Permissions Needed Experience
To edit process automation settings: Customize Application Available in: Essentials,
Professional, Enterprise,
Performance, Unlimited,
1. From Setup, enter Automation in the Quick Find box, then select Process Automation and Developer Editions
Settings.
2. Select Let users pause flows.

174
Automate Your Business Processes Flows

3. Click Save.
Screens don’t automatically display the Pause button once Let Users Pause Flows is enabled. If you want your users to be able to pause
at a given screen, select Allow Pause when you configure that screen.

SEE ALSO:
Flow Element: Screen

Add Record Context to Your Flows


All it takes to associate your org’s paused interviews with a record is setting the $Flow.CurrentRecord
EDITIONS
global variable in your flow. That way, you can find all the paused flow interviews related to that
record. For example, in the Change Address flow, set $Flow.CurrentRecord to Available in: both Salesforce
{!recordId} so that all Change Address interviews are associated with the relevant contact. Classic and Lightning
When a user pauses an interview or an interview executes a Pause element, the interview is Experience
associated with the record through the FlowRecordRelation object. Available in: Essentials,
1. At the beginning of your flow, add an Assignment element. Professional, Enterprise,
Performance, Unlimited,
2. For Variable, select $Flow.CurrentRecord.
and Developer Editions
3. For Operator, leave equals selected.
4. For Value, select a variable that contains the appropriate ID.
Make sure that the variable contains only one ID.

Make It Easy for Users to Find Their Paused Flow Interviews


Give your users an instant view of their paused flow interviews by customizing the Home page or
EDITIONS
Salesforce mobile app navigation menu.
Lightning Experience Available in: both Salesforce
Add the Paused Flow Interviews component to the appropriate Home pages. This component Classic and Lightning
is available only for Home pages in the Lightning App Builder. It displays paused interviews Experience
that the user has read access to.
Available in: Essentials,
Experience Builder Site Professional, Enterprise,
Add the Paused Flows component to a site page. This component is available for most pages Performance, Unlimited,
in Experience Builder, except ones like login pages and error pages. The component displays and Developer Editions
paused interviews that the user has read access to.
Salesforce mobile app
Add the Paused Flows item to the navigation items of any Lightning app.

175
Automate Your Business Processes Flows

Salesforce Classic
Add the Paused Flow Interviews related list to the appropriate home page layouts. This component displays only interviews that
the user paused.

SEE ALSO:
Set Up the Lightning Experience Home Page
Customize Salesforce Classic Home Tab Page Layouts

Make It Easy for Users to Find Paused Flow Interviews for a Record
From a record page, display a list of all paused flow interviews that are associated with that record with this custom Aura component.

Example: This example uses the Apex controller to get a list of interviews that are associated with the record. The component
then displays the interviews in a table. For each interview, the component displays an action menu from which the user can resume
or delete the interview.
When the user clicks Resume, the helper fires the navigateFlow action to resume the interview. When the user clicks Delete, the
Apex controller deletes the interview.
c:interviewsByRecord Component

<aura:component controller="interviewsByRecordController"
implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" >
<aura:attribute name="columns" type="List" default=""/>
<aura:attribute name="Interviews" type="Object" />
<aura:attribute name="recordId" type="Id" />
<aura:attribute name="ContextRecord" type="Object" />
<aura:attribute name="overlay" type="Aura.Component"/>
<aura:handler name="init" value="{!this}" action="{!c.init}" />
<aura:handler event="force:refreshView" action="{!c.init}" />

<force:recordData aura:id="contextRecord" recordId="{!v.recordId}"


targetFields="{!v.ContextRecord}" layoutType="FULL"/>

<lightning:overlayLibrary aura:id="overlayLib" />


<lightning:card iconName="standard:flow" class="slds-card_boundary">
<aura:set attribute="title">
<span class="slds-card__header-link">Paused Flow Interviews</span>
</aura:set>
<aura:set attribute="actions">
<lightning:buttonIcon iconName="utility:refresh" onclick="{!c.init}"
alternativeText="Refresh the list of interviews" />

</aura:set>
<table class="slds-table slds-table--bordered slds-table--cell-buffer
slds-table_fixed-layout">
<thead>
<tr class="slds-text-heading--label">
<th scope="col"><div class="slds-truncate">Interview Label</div></th>
<th scope="col"><div class="slds-truncate">Pause Reason</div></th>
<th scope="col"><div class="slds-truncate">Paused Date</div></th>
<th scope="col"><div class="slds-truncate">Current Element</div></th>
<th scope="col"><div class="slds-truncate">Owner</div></th>

176
Automate Your Business Processes Flows

<th scope="col" style="width: 3.25rem;"><div class="slds-truncate"/>


<div class="slds-th__action">
<span class="slds-assistive-text">Actions</span>
</div>
</th>
</tr>
</thead>
<tbody>
<!-- Use the Apex controller to fetch interviews associated
with this record -->
<aura:iteration items="{!v.Interviews}" var="interview">
<tr>
<th scope="row">
<div class="slds-truncate" title="{!interview.InterviewLabel}">
{!interview.InterviewLabel}
</div>
</th>
<td role="gridcell">
<div class="slds-truncate" title="{!interview.PauseLabel}">
{!interview.PauseLabel}
</div>
</td>
<td role="gridcell">
<div class="slds-truncate" title="{!interview.PausedDate}">
<ui:outputDateTime value="{!interview.PausedDate}"
format="M/d/y h:m a"/>
</div>
</td>
<td role="gridcell">
<div class="slds-truncate" title="{!interview.CurrentElement}">
{!interview.CurrentElement}
</div>
</td>
<td role="gridcell">
<div class="slds-truncate" title="{!interview.PausedBy}">
{!interview.PausedBy}
</div>
</td>
<td role="gridcell">
<!-- Display Resume and Delete actions in a menu at the
end of each row -->
<div class="slds-shrink-none">
<lightning:buttonMenu iconSize="x-small"
class="paused-interview-card-row-menu"
alternativeText="Actions for this interview"
onselect="{! c.handleMenuSelect }">
<lightning:menuItem aura:id="{!interview.Id + 'resume'}"

label="Resume" value="{!interview.Id + '.resume'}" />

<lightning:menuItem aura:id="{!interview.Id + 'delete'}"

label="Delete" value="{!interview.Id + '.delete'}"/>


</lightning:buttonMenu>

177
Automate Your Business Processes Flows

</div>
</td>
</tr>
</aura:iteration>
</tbody>
</table>
</lightning:card>
</aura:component>

Apex Controller
public class interviewsByRecordController {

@AuraEnabled
public static List<FlowRecordRelation> getInterviews(Id recordId) {
return [ SELECT
ParentId, Parent.InterviewLabel, Parent.PauseLabel,
Parent.CurrentElement, Parent.CreatedDate, Parent.Owner.Name
FROM FlowRecordRelation
WHERE RelatedRecordId = :recordId ];
}

@AuraEnabled
public static FlowInterview deleteInterview(Id interviewId) {
FlowInterview interview = [Select Id from FlowInterview Where Id = :interviewId];

delete interview;
return interview;
}
}

c:interviewsByRecord JavaScript Controller

({
init : function(component, event, helper) {
helper.populateTable(component, event, helper);
},

handleMenuSelect: function(component, event, helper) {


// Figure out which action was selected
var interviewAction = event.getParam("value").split(".");
if(interviewAction.includes("resume")) {
helper.handleShowModal(component, interviewAction[0]);
} else if(interviewAction.includes("delete")) {
helper.handleDelete(component, event, helper, interviewAction[0]);
}
},

statusChange: function(component, event) {


// When the interview finishes, close the overlay
if(event.getParam("status").includes("FINISHED")) {
component.get("v.overlay").close();
}
}
})

178
Automate Your Business Processes Flows

c:interviewsByRecord Helper

({
populateTable : function(component, event, helper) {
var action = component.get("c.getInterviews");
action.setParams({
recordId: component.get("v.recordId")
});
action.setCallback(this, $A.getCallback(function (response) {
var state = response.getState();
if (state === "SUCCESS") {
// Push interviews fetched by the Apex controller to the component
var recordRelations = response.getReturnValue();
var interviews = [];
for (var i = 0; i < recordRelations.length; i++) {
interviews.push(
{
Id: recordRelations[i].ParentId,
InterviewLabel: recordRelations[i].Parent.InterviewLabel,

PauseLabel: recordRelations[i].Parent.PauseLabel,
CurrentElement: recordRelations[i].Parent.CurrentElement,

PausedDate: recordRelations[i].Parent.CreatedDate,
PausedBy: recordRelations[i].Parent.Owner.Name
});
}
component.set('v.Interviews', interviews);
} else if (state === "ERROR") {
var errors = response.getError();
console.error(errors);
}
}));
$A.enqueueAction(action);
},

handleShowModal: function (component, id) {


// On resume, render the interview in a modal
$A.createComponent("lightning:flow", {"onstatuschange":
component.get("c.statusChange")},
function (content, status) {
if (status === "SUCCESS") {
component.find('overlayLib').showCustomModal({
body: content,
showCloseButton: true,
closeCallback: function () {
$A.get('e.force:refreshView').fire();
}
}).then(function(overlay) {
// Use to close the modal later
component.set("v.overlay", overlay);
});
content.resumeFlow(id);
}
});

179
Automate Your Business Processes Flows

},

handleDelete: function (component, event, helper, id) {


// On delete, pass the interview ID to the Apex controller
var action = component.get("c.deleteInterview");
action.setParams({
interviewId: id
});
action.setCallback(this, $A.getCallback(function (response) {
var state = response.getState();
if (state === "SUCCESS") {
// Automatically refresh the table
helper.populateTable(component, event, helper);
} else if (state === "ERROR") {
var errors = response.getError();
console.error(errors);
}
}));
$A.enqueueAction(action);
}
})

Customize Who Has Access to Paused Flow Interviews


By default, users can resume paused flow interviews as long as they have edit access. To control
EDITIONS
who has edit access, build a sharing model for the Flow Interview object. Configure the org-wide
default access level, and build sharing rules to override that default for specific users or groups. Available in: both Salesforce
Note: Classic (not available in all
orgs) and Lightning
• The default sharing model for interviews is Private, which means that users inherit edit Experience
access from users lower in the role hierarchy. If your org uses a role hierarchy, users can
resume all interviews that users lower in the hierarchy own or have edit access to. Available in: Professional,
Enterprise, Performance,
• Users with the CEO role have read/write access to all flow interviews in the org, even if
Unlimited, and Developer
the interview owner isn’t part of the hierarchy. Editions

Example: To let all agents in your org resume any interview:


1. Add all agents to the Agents public group.
2. For Flow Interview, leave the organization-wide default set to Private.
3. In a flow interview sharing rule, give read/write access (1) for interviews owned by internal
users (2) to the Agents public group (3).

180
Automate Your Business Processes Flows

SEE ALSO:
Restrict Who Can Resume Shared Flow Interviews
Sharing Considerations

Restrict Who Can Resume Shared Flow Interviews


By default, users with the Run Flows permission or a Flow User feature license can resume any
EDITIONS
paused flow interview that they have edit access to. You can set Salesforce to only allow each
interview to be resumed by the interview owner, or by an admin with Manage Flow permission Available in: both Salesforce
and view access to the interview. Classic and Lightning
Experience
User Permissions Needed
Available in: Essentials,
To edit process automation settings: Customize Application Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
Note: You can configure a flow to override default behavior and restrict access to enabled
profiles or permission sets. For such a flow, the resuming user must also have access to that
flow by a permission set or their profile.
To require the resuming user to be the interview owner, or an admin with the Manage Flow permission and view access to the interview,
complete these steps.
1. From Setup, enter Automation in the Quick Find box, then select Process Automation Settings.
2. Deselect Let users resume shared flow interviews.

181
Automate Your Business Processes Flows

3. Click Save.

SEE ALSO:
Customize Who Has Access to Paused Flow Interviews
How Does Flow Security Work?

Delete a Paused Flow Interview


If you no longer need to wait for a long-running flow interview to finish or for a user to resume a
EDITIONS
paused interview, delete the interview. For example, perhaps you’re updating or deleting the
associated flow version. Available in: both Salesforce
1. From Setup, enter Flow in the Quick Find box, then select Paused Flow Interviews. Classic and Lightning
If Paused Flow Interviews isn’t available as its own page, select Flows and scroll down to the Experience
list of paused interviews. Available in: Essentials,
Professional, Enterprise,
2. For each interview that you want to delete, click Del, or click and select Delete.
Performance, Unlimited,
and Developer Editions
Distribute Flows to Users Outside Your Org
Let external users run your flow by adding the flow to an Experience Builder site, an external app USER PERMISSIONS
or page, or an Embedded Service deployment. For finer control over how your flow behaves in
external contexts, use a custom Aura component or Visualforce page. Flows in custom Aura To open, edit, or create a
flow in Flow Builder:
components use Lightning runtime, and flows in Visualforce pages use Classic runtime.
• Manage Flow
For example, set up a self-service tool for your site to help visitors generate custom sales quotes.

Add a Flow to an Experience Builder Site


The easiest way to distribute a flow externally is with the Flow component in Experience Builder. Add the Flow component to a page
in your Experience Builder site.
Embed a Flow in a Visualforce Page for External Users
Let external users run your flow by adding the flow to a Visualforce page and distributing that page externally. For example, through
a community.
Add a Flow to Your Website Using Embedded Service
Embedded flows help your users complete simple, automated tasks from within your website. They're even guest user-friendly—no
login required. Simply create your flow using Flow Builder and add it to an Embedded Service deployment.

182
Automate Your Business Processes Flows

Add a Flow to an Experience Builder Site


The easiest way to distribute a flow externally is with the Flow component in Experience Builder.
EDITIONS
Add the Flow component to a page in your Experience Builder site.

Note: Available in: both Salesforce


Classic (not available in all
• Flows in Experience Builder sites are supported through the Flow and Suggested Actions orgs) and Lightning
components. Experience
• Flow creators can overwrite error messages with their own content.
Available in: Enterprise,
1. Open a site in the Experience Builder, then navigate to the page that you want to add the flow Performance, Unlimited,
to. and Developer Editions

2. From the Components panel, drag the Flow component onto the page.
USER PERMISSIONS
3. In the property editor, configure the component.
Flow To customize an Experience
Only active screen flows are available. Flows built in the Desktop Flow Designer aren’t Cloud site:
supported. • Be a member of the site
AND Create and Set Up
Layout Experiences
By default, flows display in one column.
OR
Note:
• Be a member of the site
• Starting in Winter ’23, two-column flow layouts are ignored. For a better layout AND View Setup and
option, add Section components to your flow screens. Each Section component Configuration AND an
lets you organize record fields and screen components in up to four experience admin,
publisher, or builder in
adjustable-width columns.
that site
• If a flow screen contains a Section component, that screen ignores the Layout
property. To publish an Experience
Cloud site:
Input variables • Be a member of the site
If you see other properties, they’re the flow’s input variables. Variables appear only if they AND Create and Set Up
allow input access. Experiences
Pass record ID into this variable OR
This option is available only for Text input variables in Record pages. For simplicity, we • Be a member of the site
recommend passing the ID to only one variable. AND an experience
For example, when this component is embedded in an Opportunity Record page, at run admin or publisher in
that site
time the component passes the opportunity’s ID into the selected input variable.

4. Save your page.

SEE ALSO:
Flow Screen Output Component: Section

183
Automate Your Business Processes Flows

Embed a Flow in a Visualforce Page for External Users


Let external users run your flow by adding the flow to a Visualforce page and distributing that page
USER PERMISSIONS
externally. For example, through a community.
For example, you can set up a self-service tool for your public Salesforce site to help visitors generate To create, edit, and set
custom sales quotes. Because the flow is embedded in a Visualforce page, you can customize the version settings for
Visualforce pages:
appearance of the flow so that it uses your company’s branding and style.
• Customize Application
Note: When you make a flow available to site or portal users, point them to the Visualforce
page that contains the embedded flow, not the flow itself. Site and portal users aren’t allowed
to run flows directly.
To add a flow to a Visualforce page, embed it by using the <flow:interview> component.
1. Find the flow’s API name.
a. From Setup, enter Flows in the Quick Find box, then select Flows.
b. Click the name of the flow.
c. Copy the API name of the flow.

2. From Setup, enter Visualforce Pages in the Quick Find box, then select Visualforce Pages.
3. Define a new Visualforce page, or open an existing one.
4. Add the <flow:interview> component somewhere between the <apex:page> tags.
5. Set the name attribute to the API name of the flow.
For example:
<apex:page>
<flow:interview name="flowAPIName"/>
</apex:page>

If the flow is from a managed package, the name attribute must be in this format: namespace.flowuniquename.

6. Click Save.
7. Restrict which users can access the Visualforce page.
Any external users with access to the Visualforce page can run the embedded flow.
a. Click Visualforce Pages.
b. Click Security next to your Visualforce page.
c. Move all the appropriate profiles from Available Profiles to Enabled Profiles by using the add and remove buttons.
d. Click Save.

8. Distribute your Visualforce page by taking one of these actions.


• Add the Visualforce page to your Salesforce site.
• Define a custom Visualforce tab by using the Visualforce page, and then add that tab to your portal or community.

SEE ALSO:
Lightning Aura Components Developer Guide : Configure Components for Experience Builder
Lightning Aura Components Developer Guide : Add Aura Components to Any App with Lightning Out (Beta)

184
Automate Your Business Processes Flows

Add a Flow to Your Website Using Embedded Service


Embedded flows help your users complete simple, automated tasks from within your website. They're even guest user-friendly—no
login required. Simply create your flow using Flow Builder and add it to an Embedded Service deployment.
Maybe you're an insurance company, and you want to let policyholders search for in-network medical providers without logging in. Or
you're an online retailer, and you want to streamline how new customers create accounts. No matter what type of business you run,
embedded flows are easily configured to support your customers' most important tasks.

SEE ALSO:
Flows

Distribute Flows to Automated Systems


Some flows don’t require any user interaction to start. To enable a system to automatically launch a flow, use the start Apex method,
a process, or a workflow action.
Most of these methods can be used only with an autolaunched flow. A flow can be launched without user interaction, such as from a
process or the Apex interview.start method. Autolaunched flows run in bulk and without user interaction. They can’t contain
steps, screens, choices, or dynamic choices in the active or latest flow version. When a flow user invokes an autolaunched flow, the active
flow version runs. If there’s no active version, the latest version runs. When a flow admin invokes a flow, the latest version always runs.

Launch a Flow from a Process


Just like workflow rules, processes start when a certain object’s records are created or edited. Add a flow action to give a process
even more functionality. For example, create a process that checks if a new feed item is a question. If it is, wait a day and then use a
flow to check whether a Best Comment has been selected or not. If it hasn’t, use that question to create a case.
Launch a Flow from a Workflow Action—Pilot
Create a flow trigger workflow action to launch a flow from workflow rules. With flow triggers, you can automate complex business
processes—create flows to perform logic, and have events trigger the flows via workflow rules—without writing code. For example,
your flow looks up and assigns the relevant entitlement for a case. Create a flow trigger to launch the flow whenever a case is created,
so that all new cases are automatically set with a default entitlement.
Launch a Flow from Apex
Use the start method in the Flow.Interview class to launch an autolaunched flow or user provisioning flow from Apex.
Launch a Flow from the REST API
Use the Custom Invocable Actions endpoint to invoke an autolaunched flow from the REST API.

Launch a Flow from a Process


Just like workflow rules, processes start when a certain object’s records are created or edited. Add
USER PERMISSIONS
a flow action to give a process even more functionality. For example, create a process that checks
if a new feed item is a question. If it is, wait a day and then use a flow to check whether a Best To create, edit, or view
Comment has been selected or not. If it hasn’t, use that question to create a case. processes:
• Manage Flow
1. Create and activate the autolaunched flow for the process to launch.
AND
2. Create the process that you plan to launch this flow from.
View All Data
For details, see “Create a Process” in the Salesforce Help.

3. Add a “Flows” action to the process.


a. For Flow, search for and select the flow that you created.

185
Automate Your Business Processes Flows

b. Optionally, click Add Row to set values for the flow’s variables.

4. Activate the process.

Launch a Flow from a Workflow Action—Pilot


Create a flow trigger workflow action to launch a flow from workflow rules. With flow triggers, you
EDITIONS
can automate complex business processes—create flows to perform logic, and have events trigger
the flows via workflow rules—without writing code. For example, your flow looks up and assigns Available in: Salesforce
the relevant entitlement for a case. Create a flow trigger to launch the flow whenever a case is Classic
created, so that all new cases are automatically set with a default entitlement.
Available in: Enterprise,
Note: The pilot program for flow trigger workflow actions is closed. If you've already enabled Performance, Unlimited,
the pilot in your org, you can continue to create and edit flow trigger workflow actions. If you and Developer Editions
didn't enable the pilot in your org, use Flow Builder to create a record-triggered flow, or use
Process Builder to launch a flow from a process.
USER PERMISSIONS
Before you begin, review the special behavior and limitations of flow triggers. See Flow Trigger
Considerations (Pilot). To view workflow rules and
actions:
To set up a workflow rule to launch a flow:
• View Setup and
1. Create and activate the autolaunched flow to launch from this workflow action. Configuration
2. Create the workflow rule that you plan to add this workflow action to. To create or change
workflow rules and actions:
3. Define the flow trigger.
• Customize Application
4. Associate the flow trigger to the workflow rule.

Associate the Flow Trigger with a Workflow Rule


Add the flow trigger as an immediate action on your workflow rule.
Define a Flow Trigger—Pilot
After you create an autolaunched flow, create a flow trigger to launch that flow as part of a workflow rule.

Associate the Flow Trigger with a Workflow Rule


Add the flow trigger as an immediate action on your workflow rule.
EDITIONS
Note: The pilot program for flow trigger workflow actions is closed. If you've already enabled
the pilot in your org, you can continue to create and edit flow trigger workflow actions. If you Available in: Salesforce
didn't enable the pilot in your org, use Flow Builder to create a record-triggered flow, or use Classic
Process Builder to launch a flow from a process. Available in: Enterprise,
Before you begin, create: Performance, Unlimited,
and Developer Editions
• An autolaunched flow
• A workflow rule
USER PERMISSIONS
• A flow trigger that launches the autolaunched flow
1. From Setup, enter Workflow Rules in the Quick Find box, then select Workflow To select existing actions:
Rules. • Customize Application

2. Select the workflow rule.


3. Click Edit in the Workflow Actions section.

186
Automate Your Business Processes Flows

4. In the Immediate Workflow Actions section, click Add Workflow Action > Select Existing Action.
Flow triggers aren’t available as time-dependent workflow actions. You can add flow triggers to workflow rules only as immediate
workflow actions.

5. In the Search drop-down list, select Flow Trigger.


The Available Actions box lists all existing flow triggers.

6. Select the flow trigger to associate with this workflow rule. Move the flow trigger to Selected Actions by using the right arrow.
7. Click Save.

Define a Flow Trigger—Pilot


After you create an autolaunched flow, create a flow trigger to launch that flow as part of a workflow
EDITIONS
rule.

Note: The pilot program for flow trigger workflow actions is closed. If you've already enabled Available in: Salesforce
the pilot in your org, you can continue to create and edit flow trigger workflow actions. If you Classic
didn't enable the pilot in your org, use Flow Builder to create a record-triggered flow, or use Available in: Enterprise,
Process Builder to launch a flow from a process. Performance, Unlimited,
1. From Setup, enter Flow Triggers in the Quick Find box, then select Flow Triggers. and Developer Editions

2. Click New Flow Trigger.


USER PERMISSIONS
3. Select the same object as the workflow rule, and then click Next.
4. Configure the flow trigger. To view workflow rules and
actions:
Field Description • View Setup and
Configuration
Name Name of the flow trigger. To create or change
Unique Name Enter a unique name to refer to this component in the API. The Unique workflow rules and actions:
• Customize Application
Name field can contain only underscores and alphanumeric characters.
It must be unique within the selected object type, begin with a letter,
not include spaces, not end with an underscore, and not contain two
consecutive underscores.

Protected Reserved for future use.


Component

Flow Unique name of the autolaunched flow that this workflow action
launches.

Set Flow Whether to pass values into the flow’s variables.


Variables

5. If you select Set Flow Variables, specify their names and values.
Click Set Another Value to set up to 25 variables.

6. To put the flow trigger in test mode, select Administrators run the latest flow version.
When selected and an admin triggers the workflow rule, the flow trigger launches the latest version of the flow. For all other users,
the flow trigger always launches the active version of the flow.

187
Automate Your Business Processes Flows

The same values are passed into the flow variables whether the flow trigger launches the active or latest flow version.

7. Click Save.
Don’t forget to associate the flow trigger to a workflow rule.

Launch a Flow from Apex


Use the start method in the Flow.Interview class to launch an autolaunched flow or user provisioning flow from Apex.

Example: The following includes a sample controller that starts a flow and the corresponding Visualforce page. The Visualforce
page contains an input box and a start button. When the user enters a number in the input box and clicks Start, the controller’s
start method is called. The button saves the user-entered value to the flow’s input variable and launches the flow using
the start method. The flow doubles the value of input and assigns it to the output variable, and the output label displays
the value for output by using the getVariableValue method.
public class FlowController {

//Instance of the Flow


public Flow.Interview.doubler myFlow {get; set;}
public Double value {get; set;}

public Double getOutput() {


if (myFlow == null) return null;
return (Double)(myFlow.getVariableValue('v1'));
}

public void start() {


Map<String, Object> myMap = new Map<String, Object>();
myMap.put('v1', input);
myFlow = new Flow.Interview.doubler(myMap);
myFlow.start();
}
}

The following is the Visualforce page that uses the sample flow controller.
<apex:page controller="FlowController">
<apex:outputLabel id="text">v1 = {!output}</apex:outputLabel>

<apex:form >
value : <apex:inputText value="{!output}"/>
<apex:commandButton action="{!start}" value="Start" reRender="text"/>
</apex:form>
</apex:page>

Launch a Flow from the REST API


Use the Custom Invocable Actions endpoint to invoke an autolaunched flow from the REST API.

Example: This example invokes the active version of the flow “Escalate_to_Case”.
POST /v33.0/actions/custom/flow/Escalate_to_Case

188
Automate Your Business Processes Flows

The request sets values for two of the flow’s input variables: CommentCount and FeedItemId. Once invoked, the flow
checks whether:
• A given feed item has more than five comments and
• A best comment hasn’t been selected yet
{
"inputs" : [ {
"CommentCount" : 6,
"FeedItemId" : "0D5D0000000cfMY"
} ]
}

Distribute Flows to Other Orgs


Flows can be included in Lightning Bolt Solutions, change sets, and packages. The recipient org of
EDITIONS
the solution, change set, or package must have flows enabled.
Available in: Lightning
Distribute Flows via Lightning Bolt Solutions Experience and Salesforce
To distribute automated business processes or bootstrap an Experience Builder site with a Classic
complete solution or new look, create a Lightning Bolt Solution. A Lightning Bolt Solution can Lightning Bolt Solutions are
include flows, custom Lightning apps, or Experience Builder templates or pages. Before you available in: Enterprise,
create a solution, group flows that you want to include in a flow category. Performance, Unlimited,
Considerations for Deploying Flows with Change Sets and Developer Editions
Before you use change sets to deploy a flow, understand the limits and unexpected behaviors Change sets are available
that are related to component dependencies, deployment, and flow triggers. in: Professional, Enterprise,
Performance, Unlimited,
Considerations for Deploying Flows with Packages
and Developer Editions
Flows can be included in both managed and unmanaged packages. Before you deploy one,
Packages are available in:
understand the limitations and behaviors of packages that contain flows.
Essentials, Professional,
Deploy Processes and Flows as Active Enterprise, Performance,
By default, active processes and flows are deployed as inactive. After deployment, you manually Unlimited, and Developer
reactivate the new versions. If you uses a continuous integration and continuous delivery model Editions
to deploy metadata changes, enable the option to deploy processes and flows as active. This
option applies to processes and autolaunched flows that are deployed via change sets and
Metadata API.

189
Automate Your Business Processes Flows

Distribute Flows via Lightning Bolt Solutions


To distribute automated business processes or bootstrap an Experience Builder site with a complete
EDITIONS
solution or new look, create a Lightning Bolt Solution. A Lightning Bolt Solution can include flows,
custom Lightning apps, or Experience Builder templates or pages. Before you create a solution, Available in: both Salesforce
group flows that you want to include in a flow category. Classic (not available in all
1. Add your flows to a flow category. You can only add active flows. orgs) and Lightning
Experience
2. Create your Lightning Bolt Solution. Add one or more flow categories, custom Lightning apps,
and Lightning Community templates or pages. Available in: Enterprise,
Performance, Unlimited,
3. Package the solution to distribute it to your own orgs, or share or sell it on AppExchange.
and Developer Editions

SEE ALSO:
USER PERMISSIONS
Add Flows to a Lightning Bolt Solution
Lightning Bolt for Salesforce: Build Once, Then Distribute and Reuse To create a flow category:
• Customize Application
To create a Lightning Bolt
Solution without an
Experience Builder template:
• Customize Application
AND View Setup and
Configuration
To create a Lightning Bolt
Solution with an Experience
Builder template:
• Customize Application
AND Create and Set Up
Experiences AND View
Setup and Configuration

Considerations for Deploying Flows with Change Sets


Before you use change sets to deploy a flow, understand the limits and unexpected behaviors that
EDITIONS
are related to component dependencies, deployment, and flow triggers.
Component Dependencies Available in: both Salesforce
Classic and Lightning
• If you plan to deploy a flow with change sets, consider limitations in migration support.
Experience
Make sure your flows reference only fields and components that are available in change
sets. Available in Enterprise,
• When you view the dependent components for the change set, the Component Performance, Professional,
Dependencies page lists the dependencies for all versions of the flow. Add all interdependent Unlimited, and
components for the relevant flow version to the outbound change set. Database.com Editions

• If a component is referenced by the following flow elements, the Component Dependencies


page doesn’t display that component. To deploy the flow successfully, manually add those referenced components to the change
set.
– Post to Chatter
– Send Email
– Submit for Approval

190
Automate Your Business Processes Flows

For example, if you deploy a flow that includes a Submit for Approval element, manually add the referenced approval process.
• If a flow references a Lightning component that depends on a CSP Trusted Site, the trusted site isn’t included in the package or
change set automatically.
Deployment
• You can include only one version of a flow in a change set.
• An active flow in a change set is deployed to its destination as inactive. Activate the flow manually after deployment.
• If the flow has no active version when you upload the outbound change set, the latest inactive version is used.
• Deploying or redeploying a flow with change sets creates a version of the flow in the destination org.
Flow Triggers
Flow triggers aren’t available in change sets.
The pilot program for flow trigger workflow actions is closed. If you've already enabled the pilot in your org, you can continue to
create and edit flow trigger workflow actions. If you didn't enable the pilot in your org, use Flow Builder to create a record-triggered
flow, or use Process Builder to launch a flow from a process.

SEE ALSO:
Change Sets

Considerations for Deploying Flows with Packages


Flows can be included in both managed and unmanaged packages. Before you deploy one,
EDITIONS
understand the limitations and behaviors of packages that contain flows.
Component Dependencies Available in: both Salesforce
Classic and Lightning
• If you plan to deploy a flow with packages, consider limitations in migration support. Make
Experience
sure your flows reference only packageable components and fields.
• Referential integrity works the same for flows as it does for other packaged elements. Available in: Essentials,
Professional, Enterprise,
• If any of the following elements are used in a flow, packageable components that they
Performance, Unlimited,
reference aren’t included in the package automatically. To deploy the package successfully,
and Developer Editions
manually add those referenced components to the package.
– Post to Chatter
– Send Email
– Submit for Approval
For example, if you deploy a flow that posts to a particular Chatter group, manually add the referenced Chatter group to the
package.
• If a flow references a Lightning component that depends on a CSP Trusted Site, the trusted site isn’t included in the package or
change set automatically.
Flow Status
When you upload a package or package version, the active flow version is included. If the flow has no active version, the latest version
is packaged.
Updating Packages
• To update a managed package with a different flow version, activate that version and upload the package again. Or deactivate
all versions of the flow, make sure the latest flow version is the one to distribute, and then upload the package.
• You can’t include flows in package patches.

191
Automate Your Business Processes Flows

Other Limitations
• If you register your namespace after you referenced a flow in a Visualforce page or Apex code, don’t forget to add the namespace
to the flow name. Otherwise, the package will fail to install.
• If someone installs a non-template flow from a managed package, error emails for that flow’s interviews don’t include any details
about the individual flow elements. The email is sent to either the user who installed the flow or the Apex exception email
recipients.
• Flow triggers aren’t packageable.
The pilot program for flow trigger workflow actions is closed. If you've already enabled the pilot in your org, you can continue
to create and edit flow trigger workflow actions. If you didn't enable the pilot in your org, use Flow Builder to create a
record-triggered flow, or use Process Builder to launch a flow from a process.

• In a development org, you can’t delete a flow after you upload it to a released or beta managed package.

SEE ALSO:
Considerations for Installed Flows
Create a Package
Control Who Receives Flow and Process Error Emails

Deploy Processes and Flows as Active


By default, active processes and flows are deployed as inactive. After deployment, you manually
EDITIONS
reactivate the new versions. If you uses a continuous integration and continuous delivery model
to deploy metadata changes, enable the option to deploy processes and flows as active. This option Available in: both Salesforce
applies to processes and autolaunched flows that are deployed via change sets and Metadata API. Classic (not available in all
orgs) and Lightning
User Permissions Needed Experience
To edit process automation settings: Customize Application Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
1. From Setup, in the Quick Find box, enter Automation, then select Process Automation
Settings.
2. Select Deploy processes and flows as active.
3. Enter the flow test coverage percentage.
4. Save your changes.
Before you can deploy a process or autolaunched flow as active, make sure to meet flow test coverage requirements. At least one Apex
test must cover the flow test coverage percentage of the active processes and autolaunched flows. Flow test coverage requirements
don’t apply to flows that have screens.
To calculate your flow test coverage, determine the number of all active versions with or without test coverage and all inactive versions
that are the latest versions and have test coverage. Here’s a sample query.
SELECT count_distinct(Id)
FROM Flow
WHERE Status = 'Active' AND Id NOT IN (
SELECT FlowVersionId
FROM FlowTestCoverage
)

192
Automate Your Business Processes Flows

+
SELECT count_distinct(FlowVersionId)
FROM FlowTestCoverage

Then run all tests, and use the FlowTestCoverage object in the Tooling API to determine the number of all latest flow versions that have
test coverage.. Here’s a sample query.
SELECT count_distinct(FlowVersionId)
FROM FlowTestCoverage

Divide the second number (number of all latest flow versions that have test coverage) by the first number (number of all active versions
with or without test coverage and all inactive versions that are the latest versions and have test coverage).
For example, you have a total of 10 flows. Flow A has two versions. The latest version is inactive with test coverage. The first version is
active without test coverage. Flows B-E each have only one version, and each version is inactive with test coverage. Flows F-J each have
only one version, and each version is active with test coverage. The flow test coverage is 90%.

Flow Label Version Status Test Coverage


Flow A 2 Inactive Yes

Flow A 1 Active No

Flow B 1 Inactive Yes

Flow C 1 Inactive Yes

Flow D 1 Inactive Yes

Flow E 1 Inactive Yes

Flow F 1 Active Yes

Flow G 1 Active Yes

Flow H 1 Active Yes

Flow I 1 Active Yes

Flow J 1 Active Yes

SELECT FlowVersion.Definition.DeveloperName
FROM FlowTestCoverage
GROUP BY FlowVersion.Definition.DeveloperName

Tip: To get the names of all active autolaunched flows and processes that don’t have test coverage, use this query.
SELECT Definition.DeveloperName
FROM Flow
WHERE Status = 'Active'
AND (ProcessType = 'AutolaunchedFlow'
OR ProcessType = 'Workflow'
OR ProcessType = 'CustomEvent'

193
Automate Your Business Processes Flows

OR ProcessType = 'InvocableProcess')
AND Id NOT IN (SELECT FlowVersionId FROM FlowTestCoverage)

SEE ALSO:
Tooling API : FlowTestCoverage

Always Run in System Context


You can set a flow version to always run in system context, overriding the context it normally runs
EDITIONS
in. If you choose to run the flow in system context with sharing, the flow respects org-wide default
settings, role hierarchies, sharing rules, manual sharing, teams, and territories. But it doesn’t respect Available in: both Salesforce
object permissions, field-level access, or other permissions of the running user. If you choose to run Classic and Lightning
the flow in system context without sharing, the flow respects the permissions of the running user Experience
only for a limited set of actions and operations. The flow can access all other data.
Available in: Essentials,
1. Open the flow in Flow Builder. Professional, Enterprise,
2. Click . Performance, Unlimited,
and Developer Editions
3. Click Show Advanced.
4. For How to Run the Flow, select a system context.
USER PERMISSIONS

SEE ALSO: To open, edit, or create a


flow in Flow Builder:
Which Context Do Flows Run In?
• Manage Flow
Running User of a Flow

Flow Interviews
A flow interview is a running instance of a flow. A flow is an application built by your administrator
EDITIONS
that asks you for inputs and does something in Salesforce based on those inputs.
For example, a flow could provide a call script for customer support calls and use the information Available in: both Salesforce
you provide to create a case. What the flow does with the information you provide is entirely up Classic and Lightning
to your administrator. Experience

When you run a flow interview, whether through a link, button, or tab, you're running a single Available in: Essentials,
instance of a flow. If the terminology is confusing, consider the difference between a record and Professional, Enterprise,
an object. You create an account record, which is a single instance of the Account object that your Performance, Unlimited,
administrator customized. and Developer Editions

Note: Keep these tips in mind when you run a flow.


• Don't use your browser's Back or Forward buttons to navigate through a flow. Doing so
can result in inconsistent data between the flow and Salesforce.
• A single flow can have up to 50 different versions. When you run a flow, you see the active
version, but your admin could have a more recent version.

Delete a Flow Interview


If you paused a flow interview and don’t plan to resume it, delete it. By removing unnecessary interviews, you make sure that your
pending list includes only interviews that you still plan to act on.

194
Automate Your Business Processes Flows

Pause a Flow Interview


If your administrator has configured a given flow to do so, you can pause its interviews. Pausing is useful, for example, when a call
with a customer drops or the customer can't find their account number and plans to call you back.
Resume a Flow Interview
If you paused a flow interview, resume it after you have all the necessary information.

SEE ALSO:
Flows

Delete a Flow Interview


If you paused a flow interview and don’t plan to resume it, delete it. By removing unnecessary
EDITIONS
interviews, you make sure that your pending list includes only interviews that you still plan to act
on. Available in: both Salesforce
1. Go to a place that lists all of your paused flow interviews. Classic and Lightning
Depending on your admin’s configurations, you can find all the flow interviews that you've Experience
paused in one of these places. Available in: Essentials,
• "Paused Flow Interviews" on the Home tab in Salesforce Classic Professional, Enterprise,
Performance, Unlimited,
• “Paused Flows” in the Salesforce mobile app navigation menu
and Developer Editions
If you paused a flow interview and can't find the place where you're supposed to resume the
interviews from, contact your admin.
USER PERMISSIONS
2. Delete the flow interview that’s unnecessary.
To delete a flow interview:
• Run Flows
SEE ALSO:
OR
Flow Interviews
Flow User field
Resume a Flow Interview enabled on the user
detail page

195
Automate Your Business Processes Flows

Pause a Flow Interview


If your administrator has configured a given flow to do so, you can pause its interviews. Pausing is
EDITIONS
useful, for example, when a call with a customer drops or the customer can't find their account
number and plans to call you back. Available in: both Salesforce
1. In an open flow interview, click Pause. Classic and Lightning
Experience
2. Explain why you had to pause the flow.
This step is optional, but it helps differentiate between the different flow interviews that you've Available in: Essentials,
paused, especially if you paused multiple interviews of the same flow. This explanation can be Professional, Enterprise,
up to 255 characters long. Performance, Unlimited,
and Developer Editions
3. Click OK.
The flow interview is saved until you resume or delete it later. Any valid values that you entered USER PERMISSIONS
before you paused are saved with the interview, so you don't have to reenter that information when
you resume. To pause a flow interview:
• Run Flows

SEE ALSO: OR

Flow Interviews Flow User field


enabled on the user
Resume a Flow Interview detail page

Resume a Flow Interview


If you paused a flow interview, resume it after you have all the necessary information.
EDITIONS
Note: If you pause an interview and the associated flow is updated before you resume, the
resumed interview doesn’t use the updated flow. Instead, it uses the version of the flow that Available in: both Salesforce
was active when you paused. Classic and Lightning
Experience
1. Go to a place that lists all of your paused flow interviews.
Available in: Essentials,
Depending on your administrator's configurations, you can find all the flow interviews that
Professional, Enterprise,
you've paused in one of these places.
Performance, Unlimited,
• "Paused Flows" on a page in an Experience Builder site and Developer Editions
• "Paused Flow Interviews" on the Home tab in the full Salesforce site
• “Paused Flows” in the Salesforce mobile app navigation menu USER PERMISSIONS
If you paused a flow interview and can't find the place where you're supposed to resume the
To resume a flow interview:
interviews from, contact your administrator.
• Run Flows
2. Resume the appropriate flow interview. OR
If you entered values before you paused, all valid values are restored to those fields when you Flow User field
resume. If you don’t see something that you entered before you paused, that value was invalid enabled on the user
and the flow didn’t save it. detail page
If you enter “Acme, Inc.” for a field that only accepts numbers and then pause, that field is blank
when you resume the flow interview.

Warning: When you resume a flow interview, that interview is removed from your Paused Flow Interviews list. If you resume an
interview and then change your mind, click Pause. If you close the interview before pausing, you can’t resume the interview later.

196
Automate Your Business Processes Flows

Monitor Flows and Processes


Monitor your org’s usage of flows and processes. See a list of paused interviews and scheduled
EDITIONS
actions from processes. Control who can view and how they view monitoring information for flows
and processes. Available in: both Salesforce
Classic and Lightning
Control Your Views of Flows, Paused Interviews, and Scheduled Actions Experience
You have two options for viewing flows, paused flow interviews, and scheduled actions from Available in: Essentials,
processes. We recommend using the enhanced option that you get by default. But you can Professional, Enterprise,
switch to the other option, for example, to use a custom list view that you haven’t recreated Performance, Unlimited,
with the enhanced option. and Developer Editions
Analyze Flows and Processes (Beta)
Get a quick view of your most commonly used automation types. See your org’s flow activity
in charts, such as total errors and total started automations. Learn how much time it’s taking users to complete screen flows, so that
you can make changes as needed.
Require Access to Automation Home Charts (Beta)
By default, all users with the View Setup and Configuration permission can view all charts in Automation Home. To limit access, you
can require that users have the Manage Flow permission to view all charts in Automation Home. Then users with View Setup and
Configuration permission can view only the Total Started Automations by Process Type chart.

Control Your Views of Flows, Paused Interviews, and Scheduled Actions


You have two options for viewing flows, paused flow interviews, and scheduled actions from
EDITIONS
processes. We recommend using the enhanced option that you get by default. But you can switch
to the other option, for example, to use a custom list view that you haven’t recreated with the Available in: both Salesforce
enhanced option. Classic and Lightning
Experience
User Permissions Needed
Available in: Essentials,
To edit process automation settings: Customize Application Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
Note: You can complete these steps in Salesforce Classic or Lightning Experience, but the
changes affect only the pages and list views in Lightning Experience.
1. From Setup, enter Automation Settings in the Quick Find box, then select Process Automation Settings.
2. Select or deselect In Lightning Experience, use the enhanced Flows page and separate Paused and Scheduled Automations
page.
This setting affects where lists appear and what they contain.

When the setting is... Selected Deselected


The Flows page in Setup... Lists both standard and custom flows Lists only custom flows

The list of flows... Can include the packages that flows are Never includes the packages that flows are
installed from installed from

197
Automate Your Business Processes Flows

When the setting is... Selected Deselected


The list of paused flow interviews and Appears on its own Paused Flow Interviews Appears as a related list on the Flows page
scheduled actions from processes... page in Setup in Setup

SEE ALSO:
Monitor Your Processes’ Pending Scheduled Actions

Analyze Flows and Processes (Beta)


Get a quick view of your most commonly used automation types. See your org’s flow activity in
EDITIONS
charts, such as total errors and total started automations. Learn how much time it’s taking users to
complete screen flows, so that you can make changes as needed. Available in: both Salesforce
Note: As a beta feature, Automation Home is a preview and isn’t part of the “Services” under Classic and Lightning
Experience
your Main Services Agreement with Salesforce. Use this feature at your sole discretion, and
make your purchase decisions only on the basis of generally available products and features. Available in: Essentials,
Salesforce doesn’t guarantee general availability of this feature within any particular time Professional, Enterprise,
frame or at all, and we can discontinue it at any time. This feature is for evaluation purposes Performance, Unlimited,
only, not for production use. It’s offered as is and isn’t supported, and Salesforce has no liability and Developer Editions
for any harm or damage arising out of or in connection with it. All restrictions, Salesforce
reservation of rights, obligations concerning the Services, and terms for related Non-Salesforce
USER PERMISSIONS
Applications and Content apply equally to your use of this feature. You can provide feedback
and suggestions for Automation Home in the Trailblazer Community. To view all charts in
To monitor and analyze your flows and processes in Automation Home, from Setup, enter Automation Home:
Automation in the Quick Find box, and select Automation Home (Beta). • View Setup and
Configuration

Require Access to Automation Home Charts (Beta)


By default, all users with the View Setup and Configuration permission can view all charts in
EDITIONS
Automation Home. To limit access, you can require that users have the Manage Flow permission
to view all charts in Automation Home. Then users with View Setup and Configuration permission Available in: both Salesforce
can view only the Total Started Automations by Process Type chart. Classic and Lightning
Experience
Note: As a beta feature, Automation Home is a preview and isn’t part of the “Services” under
your Main Services Agreement with Salesforce. Use this feature at your sole discretion, and Available in: Essentials,
make your purchase decisions only on the basis of generally available products and features. Professional, Enterprise,
Salesforce doesn’t guarantee general availability of this feature within any particular time Performance, Unlimited,
frame or at all, and we can discontinue it at any time. This feature is for evaluation purposes and Developer Editions
only, not for production use. It’s offered as is and isn’t supported, and Salesforce has no liability
for any harm or damage arising out of or in connection with it. All restrictions, Salesforce
USER PERMISSIONS
reservation of rights, obligations concerning the Services, and terms for related Non-Salesforce
Applications and Content apply equally to your use of this feature. You can provide feedback To view all charts in
and suggestions for Automation Home in the Trailblazer Community. Automation Home:
To require that users have the Manage Flow permission to view all flow activity charts: • View Setup and
Configuration

198
Automate Your Business Processes Flows

1. From Setup, enter Process Automation in the Quick Find box, and select Process Automation Settings.
2. Select Require the Manage Flow permission to view all Automation Home charts.

Troubleshoot Flows
To troubleshoot a failed flow interview, use the flow fault email. To debug the flow and observe
EDITIONS
what happens as it runs, use the debug option in Flow Builder. To view the failed flow interview in
an interactive environment, click Flow Error: Click here to debug the error in Flow Builder in Available in: both Salesforce
the flow fault email. Classic and Lightning
Experience
Emails About Flow Errors Available in: Essentials,
Every time a flow interview fails, Salesforce sends an error email in the default language of the Professional, Enterprise,
user who ran the flow. The email is sent to either the admin who last modified the associated Performance, Unlimited,
flow or the Apex exception email recipients. The email includes the error message from the and Developer Editions
failure, details about each flow element that the interview executed, and a link to show the
failed flow interview in Flow Builder.
Control Who Receives Flow and Process Error Emails
When a process or flow interview fails, a detailed error email is sent to the admin who last modified the process or flow. But perhaps
that admin isn’t the best person to read and act on the details of what was executed and what went wrong. Instead, you can choose
to send error emails to the Apex exception email recipients, which you specify and control in Setup.
Troubleshoot Flow URLs
If you’re distributing a flow and the custom button, custom link, or a direct flow URL isn’t working as expected, verify the referenced
flow. In addition, verify its variables if you’re passing values into a flow from the URL.

SEE ALSO:
Send Alerts When a Screen Flow Fails

Emails About Flow Errors


Every time a flow interview fails, Salesforce sends an error email in the default language of the user
EDITIONS
who ran the flow. The email is sent to either the admin who last modified the associated flow or
the Apex exception email recipients. The email includes the error message from the failure, details Available in: both Salesforce
about each flow element that the interview executed, and a link to show the failed flow interview Classic and Lightning
in Flow Builder. Experience
If the interview failed at multiple elements, or if failures occur in a batch of flow interviews, the
Available in: Essentials,
recipients receive multiple emails or an email with an error message for each failure. If a flow Professional, Enterprise,
interview encounters an error and takes a fault path, the flow executes the elements in the fault Performance, Unlimited,
path instead of sending a fault email. and Developer Editions
Note: Process and flow error emails include the data that's involved in the process or flow,
including user-entered data.

Example:
An error occurred at element Apex_Plug_in_1.
List index out of bounds: 0.

An error occurred at element Delete_1.

199
Automate Your Business Processes Flows

DELETE --- There is nothing in Salesforce matching your delete criteria.

An error occurred at element Email_Alert_1.


Missing required input parameter: SObjectRowId.

SEE ALSO:
Limitations of Emails About Flow Errors
Customize What Happens When a Flow Fails
Troubleshoot Flows
What Happens When an Apex Exception Occurs?
Control Who Receives Flow and Process Error Emails

Limitations of Emails About Flow Errors


The email about errors in flow interviews has some general limitations and has limitations for Screen
EDITIONS
and Subflow elements.
General Available in: both Salesforce
Classic and Lightning
• If the user who started the flow doesn’t have a first name, null replaces the user's first
Experience
name in the How the Interview Started section.
• Variable assignments display in this pattern: {!variable} (prior value) = Available in: Essentials,
field/variable (new value). If the variable had no prior value, the parentheses Professional, Enterprise,
display as empty. For example: {!varStatus} () = Status (Delivered) Performance, Unlimited,
and Developer Editions
• If you install a non-template flow from a managed package, error emails for that flow’s
interviews don’t include any details about the individual flow elements. The email is sent
to either the user who installed the flow or the Apex exception email recipients.
• Failed flow interviews for these flow types that are built with the free-form layout in Flow Builder are saved and available to open
in Flow Builder.
– Screen flows
– Record-triggered flows
– Schedule-triggered flows
– Autolaunched flows that aren’t triggered

• Failed flow interviews aren’t saved if:


– The flow is installed as part of a managed package and isn’t a template.
– The failure occurs after the flow interview is paused then resumed at least once.
– The error is handled because the element that encounters the error is connected to a fault connector.
– The failure occurs during an Apex test method.
– The flow is a standard flow.
– The value of the flow’s metadata field status is Draft or InvalidDraft.
– The failed flow interview exceeds 1 MB.
– The failed flow interviews already saved in the database exceeds 1 GB.

• Failed flow interviews don’t count toward data, file, or paused flow interview storage limits. When failed flow interviews are
saved, they’re available for up to 14 days, then they’re automatically deleted from the database.

200
Automate Your Business Processes Flows

• These limits apply when failed flow interviews are saved.


– For any specific flow, no more than 100 failed flow interviews are saved in a 24-hour period.
– For a batch of up to 200 failed flow interviews in the same transaction, one interview is saved.
– Across all the flows in an organization, no more than 3,000 failed flow interviews are saved in a 24-hour period.
– Failed flow interviews exceeding 1 MB aren’t saved.
– Failed flow interviews aren’t saved if more than 1 GB of failed flow interviews are already saved in the database.

Screen elements
Password fields display in plain text, just like if you reference a password field in a Display Text field.
Subflow elements
• The merge field annotation ({!variable} as opposed to just variable) is missing for variables in a referenced flow. For
example, when an interview enters a subflow and gives details about the inputs, the subflow's variable is subVariable
instead of {!subVariable}.
• If the error occurs in a referenced flow, the email gets sent to the author of the master flow, but the subject references the name
of the referenced flow.
• If you see multiple Entered flow ReferencedFlowName version ReferencedFlowVersion messages with no Exited
ReferencedFlowName version ReferencedFlowVersion messages in between them, the flow user navigated
backwards. To prevent this scenario, adjust the navigation options in the first screen of the referenced flow so that the user can’t
click Previous.

SEE ALSO:
Emails About Flow Errors
Troubleshoot Flows
Control Who Receives Flow and Process Error Emails

Control Who Receives Flow and Process Error Emails


When a process or flow interview fails, a detailed error email is sent to the admin who last modified
EDITIONS
the process or flow. But perhaps that admin isn’t the best person to read and act on the details of
what was executed and what went wrong. Instead, you can choose to send error emails to the Available in: both Salesforce
Apex exception email recipients, which you specify and control in Setup. Classic (not available in all
orgs) and Lightning
User Permissions Needed Experience
To edit process automation settings: Customize Application Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
Note: Process and flow error emails include the data that's involved in the process or flow,
including user-entered data.
1. From Setup, enter Automation in the Quick Find box, then select Process Automation Settings.
2. For Send Process or Flow Error Email to, select who gets the error emails.
• User Who Last Modified the Process or Flow (default)
• Apex Exception Email Recipients—Sends emails to the addresses set on the Apex Exception Email page in Setup. Choose this
option to control who receives process or flow error emails in your org.

201
Automate Your Business Processes Flows

3. Save your changes.

SEE ALSO:
Emails About Flow Errors
What Happens When an Apex Exception Occurs?
What Happens When a Process Fails?
Customize What Happens When a Flow Fails

Troubleshoot Flow URLs


If you’re distributing a flow and the custom button, custom link, or a direct flow URL isn’t working
EDITIONS
as expected, verify the referenced flow. In addition, verify its variables if you’re passing values into
a flow from the URL. Available in: both Salesforce
To make sure that the URL can find the right flow, verify that: Classic and Lightning
Experience
• The flow that the URL references hasn’t been deleted or deactivated.
• The flow name is spelled and capitalized correctly. It must be an exact, case-sensitive match to Available in: Essentials,
the flow’s API Name. Professional, Enterprise,
Performance, Unlimited,
If your flow URL references a specific flow version, verify that the version hasn’t been deleted or and Developer Editions
deactivated.
If you’re using the URL to pass values into the flow and the URL can’t access the variable, the
parameter that references the variable is ignored.
To make sure that the URL can find the right flow variable, verify that each variable you’re trying to pass values into:
• Is spelled and capitalized correctly. It must be an exact, case-sensitive match to the variable.
• Allows input access.
• Hasn’t been renamed in the flow.
• Hasn’t been removed from the flow.
• Doesn't have a data type of Record.
In addition, make sure the value that you’re trying to pass into the variable is compatible with the variable’s data type and is correctly
formatted.

SEE ALSO:
Customize a Flow URL to Control Finish Behavior
Customize a Flow URL to Set Variable Values
Troubleshoot Flows

202
Automate Your Business Processes Flows

Flow Limits and Considerations


When designing, managing, and running flows, consider the permissions, use limits, and data issues.
EDITIONS

Flow Usage-Based Entitlements Available in: both Salesforce


Like feature licenses, usage-based entitlements don’t limit what you can do in Salesforce; they Classic and Lightning
add to your functionality. If your usage exceeds the allowance, Salesforce will contact you to Experience
discuss additions to your contract. In the meantime, your flow interviews continue to run as Available in: Essentials,
usual. Professional, Enterprise,
General Flow Limits Performance, Unlimited,
When using flows, keep flow limits and Apex governor limits in mind. and Developer Editions

Per-Transaction Flow Limits


Salesforce strictly enforces limits to ensure that any runaway flows don’t monopolize shared resources in the multitenant environment.
Per-transaction limits, which Apex enforces, govern flows. If an element causes the transaction to exceed governor limits, the system
rolls back the entire transaction. The transaction rolls back even if the element has a defined fault connector path.
Flow Builder Considerations
When you create a flow in Flow Builder, familiarize yourself with its limitations and behaviors. For example, Flow Builder supports
only a few locales. Because of intellectual property protection, you can’t open flows installed from managed packages, unless the
flows are templates.
Salesforce Feature Considerations for Flows
When designing flows, consider these Salesforce features.
Salesforce Data Considerations for Flows
When designing flows, keep these Salesforce data considerations in mind.
Flow Feature Considerations
When designing flows, keep these flow feature considerations in mind. Also, some resources, elements, and screen components
have more considerations that are described in their reference topics.
Flow Data Considerations
When designing flows, keep these data considerations in mind.
Flow Lightning Runtime Considerations
When running flows, keep these considerations in mind.
Flow Management Considerations
When managing flows, consider the administration and activation limits.
Packaging Considerations for Flows
Keep these considerations in mind when you add a flow to a package.
Change Set Considerations for Flows
Keep these considerations in mind when you create or deploy a change set with flows.
Considerations for Installed Flows
Keep these considerations in mind when you distribute, upgrade, or remove a flow that you installed from a package.

203
Automate Your Business Processes Flows

Troubleshooting Considerations for Flows


Before you use the debug option in Flow Builder, understand its limitations and special behaviors.

SEE ALSO:
Flow Builder
Considerations for Translating Flows

Flow Usage-Based Entitlements


Like feature licenses, usage-based entitlements don’t limit what you can do in Salesforce; they add
EDITIONS
to your functionality. If your usage exceeds the allowance, Salesforce will contact you to discuss
additions to your contract. In the meantime, your flow interviews continue to run as usual. Available in: both Salesforce
For per-month entitlements, your contract determines the start and end of the month. You can Classic and Lightning
view the start and end dates for your org’s usage-based entitlements on the Company Information Experience
page in Setup.
Available in: Essentials,
Note: Professional, Enterprise,
Performance, Unlimited,
• Flows that are launched by another flow via a Subflow element don’t count toward your and Developer Editions
allocation of flow interviews.
• When a process built in Process Builder launches a flow, both the process and the flow
count toward your allocation of flow interviews.
• If you enable recursion for a process built in Process Builder, a separate flow interview
starts each time the process evaluates a record. Each flow interview counts toward your
allocation of flow interviews.

This table describes the free allocations that are granted based on your org’s edition.

Per-Org What’s Counted Essentials and Performance and Enterprise and


Usage-Based Professional Developer Editions Unlimited Editions
Entitlement Editions
Maximum paused and Paused flow interviews and groups 30,000 50,000 50,000
waiting flow interviews of scheduled actions from
processes

Maximum flow Interviews of flow types that can 2,000 20,000,000 20,000,000
interviews with UI per have screen elements, such as
month screen flows, user provisioning
flows, Field Service Snap-in flows,
contact request flows, and surveys
built in Survey Builder

Maximum flow Interviews of flow types that can’t 10,000,000 10,000,000,000 10,000,000,000
interviews without UI have screen elements, such as
per month autolaunched flows, transaction
security flows, and processes built
in Process Builder

204
Automate Your Business Processes Flows

This table describes additional allocations that are granted based on purchased user licenses. These allocations apply to the org. It doesn’t
matter which users run the flows.

Per-Org Usage-Based What’s Counted Enterprise Edition Unlimited Edition


Entitlement
Additional flow interviews Interviews of flow types that can have + 50 for each Service Cloud + 100 for each Service Cloud
with UI per month screen elements, such as screen flows, user User license User license
provisioning flows, Field Service Snap-in + 50 for each Salesforce CRM + 100 for each Salesforce
flows, contact request flows, and surveys Content User license CRM Content User license
built in Survey Builder

If you have questions about increasing your allocation, contact your Salesforce account executive.

SEE ALSO:
Usage-Based Entitlements
View Your Salesforce Org’s Usage-Based Entitlements
Flow Types
Reevaluate Records in the Process Builder
How Does Salesforce Process Scheduled Actions?

General Flow Limits


When using flows, keep flow limits and Apex governor limits in mind.
EDITIONS
Per-Org Limit Essentials or Enterprise, Available in: both Salesforce
Professional Unlimited, Classic and Lightning
Editions Performance, Experience
or
Developer Available in: Essentials,
Editions Professional, Enterprise,
Performance, Unlimited,
Versions per flow 50 50
and Developer Editions
Executed elements at runtime per flow 2,000 2,000

Active flows per flow type 5 2,000

Total flows per flow type 5 4,000

Flow interviews that are resumed per hour or groups of 1,000 1,000
scheduled actions from processes that are executed per hour
based on a specific time

Combined total of these automations that start or resume based 20,000 20,000
on a record’s field value.
• Resume events that are defined in active flows
• Groups of scheduled actions that are defined in active
processes

205
Automate Your Business Processes Flows

Per-Org Limit Essentials or Enterprise,


Professional Unlimited,
Editions Performance, or
Developer
Editions
• Time triggers that are defined in active workflow rules
• Inactive flow interviews that are resumed

Schedule-triggered flow interviews per 24 hours 250,000, or the number of user licenses in
your org multiplied by 200, whichever is
greater

SEE ALSO:
Flows
Flow Limits and Considerations

Per-Transaction Flow Limits


Salesforce strictly enforces limits to ensure that any runaway flows don’t monopolize shared resources
EDITIONS
in the multitenant environment. Per-transaction limits, which Apex enforces, govern flows. If an
element causes the transaction to exceed governor limits, the system rolls back the entire transaction. Available in: both Salesforce
The transaction rolls back even if the element has a defined fault connector path. Classic and Lightning
1 Experience
Per-Transaction Limit Value
Available in: Essentials,
Total number of SOQL queries issued 100 Professional, Enterprise,
(All executions of Get Records elements, and Performance, Unlimited,
executions of Update Records or Delete Records and Developer Editions
elements that use filter conditions)

Total number of records retrieved by SOQL 50,000


queries
(All executions of Get Records elements, and
executions of Update Records or Delete Records
elements that use filter conditions)

Total number of DML statements issued 150


(Create Records, Update Records, and Delete
Records executions)

Total number of records processed as a result 10,000


of DML statements

Maximum CPU time on the Salesforce servers 10,000 milliseconds

Total number of duplicate updates allowed in 12


one batch

206
Automate Your Business Processes Flows

1
Autolaunched flows are part of the larger transaction that they were launched through and share that transaction’s limits. For example,
flows launched from Apex or a process are executed with the Apex or process actions as part of the larger transaction. Flows with Screen
elements can span multiple transactions. A new transaction begins each time the user clicks Next in a screen. Flows with Pause elements
span multiple transactions. A transaction ends when a flow interview pauses for an event. When the flow interview resumes, a new
transaction begins. Everything after the Pause element is executed as part of a batch transaction that includes other resumed interviews.
The batch includes interviews executed by the same user ID, have the same execution time, and have the same flow version ID.

SEE ALSO:
Apex Developer Guide : Execution Governors and Limits
General Flow Limits

Flow Builder Considerations


When you create a flow in Flow Builder, familiarize yourself with its limitations and behaviors. For
EDITIONS
example, Flow Builder supports only a few locales. Because of intellectual property protection, you
can’t open flows installed from managed packages, unless the flows are templates. Available in: both Salesforce
Access to Salesforce Data Classic and Lightning
Experience
• Flow Builder uses the permissions and locale assigned to the current user.
• Flow Builder has access to information that exists when you open it. If you modify data or Available in: Essentials,
metadata in your org and must refer to it in a flow, close and reopen Flow Builder. For Professional, Enterprise,
example, if you add a custom field or modify an Apex class with Flow Builder open, close Performance, Unlimited,
and reopen Flow Builder. and Developer Editions

Opening Flows That were Saved in Cloud Flow Designer


When you open a flow version created with Cloud Flow Designer in Flow Builder, the Save button is disabled. To make changes to
that version in Flow Builder, save it as a new version in Flow Builder.
Text Formatting
If you open the Display Text screen component, Choice resource labels, help text, Pause confirmation screens, or input validation,
Flow Builder converts existing HTML to rich text. Unsupported HTML is removed. The following HTML tags are converted to rich text:
<a>, <b>, <br>, <font>, <i>, <li>, <p>, <span>, <u>, and <div>. HTML that is pasted into the rich text editor is not supported.
Rich Text
• Images uploaded with the rich text editor are stored in the Files tab, and are visible to everyone in your org.
• Images uploaded with the rich text editor aren’t visible in Experience Cloud sites.
• Toggle back to plain text when using a text template in a Post to Chatter action, Send Email action, or in a custom action that

expects plain text. Click and select Plain Text.


Date/Time Values
At run time, time zones for date/time values can differ from what you see in Flow Builder. During run time, date/time values reflect
the time zone settings of the user who’s running the flow. In Flow Builder, date/time values reflect the time zone settings of the
admin who configures the flow.
Text Values
• Flow Builder doesn't support UTF-8 encoding for text in user input fields.
• Flow Builder contains embedded fonts for all locales it supports. The supported locales are:
– Chinese (Traditional)
– Chinese (Simplified)

207
Automate Your Business Processes Flows

– English (US)
– French (France)
– German (Germany)
– Japanese (Japan)
– Spanish (Spain)
If you enter unsupported characters for a supported locale, they’re displayed using system fonts instead of the embedded fonts.
In unsupported locales, your system font settings are used to display all characters in Flow Builder.

• Don’t enter the string null as the value of a text field in Flow Builder.
Output Values
To store the same output value in multiple variables, assign the value to one variable. Then add an Assignment element after the
action, and set the other variables to the value of the first variable.
Managed Packages
Flow Builder can’t open flows that are installed from managed packages, unless they’re templates.
Step Elements
You can’t add or update steps to a flow in Flow Builder. You also can’t convert steps into screens. If you added a step in Cloud Flow
Designer, the step still appears on the canvas. We recommend that you remove all steps from your flows.
Action Elements
Legacy Apex actions aren’t organized by the tag in the plug-in code.
Flows Upgraded from Winter ’12 and Earlier
If you open a flow that was last opened in Winter ’12 or earlier, each Boolean decision is converted to a multi-outcome Decision
element that:
• Uses the same label as the old decision.
• Takes the API name of the old decision, appended with “_switch”.
• Has an outcome labeled “True”. This outcome’s API name matches that of the old decision, and its conditions are migrated from
the True outcome of the old decision.
• Has a default outcome labeled “False”.
Terminology
The terminology in some warnings, error messages, and debug details isn’t updated for Flow Builder or Cloud Flow Designer.

Salesforce Feature Considerations for Flows


When designing flows, consider these Salesforce features.
EDITIONS

Security Considerations for Flows Available in: both Salesforce


When designing flows, keep these security considerations in mind. Classic and Lightning
Experience
Translation Considerations for Flows
When you use Translation Workbench to translate flows, note these considerations. Available in: Essentials,
Professional, Enterprise,
External Object Considerations for Flows Performance, Unlimited,
Keep these considerations in mind when building flows that include external objects. and Developer Editions
Lightning Component Considerations for Flows
Keep these considerations in mind when building flows that include Lightning components.

208
Automate Your Business Processes Flows

Security Considerations for Flows


When designing flows, keep these security considerations in mind.
EDITIONS

Flow Interviews Available in: both Salesforce


Classic and Lightning
When a user session expires, in-progress flow interviews are interrupted and can’t be resumed. If
Experience
the flow executed actions, such as a Create Records or Post to Chatter element, those actions aren’t
rolled back. But other progress through the interview, such as what the user entered on the screen, Available in: Essentials,
is lost. Professional, Enterprise,
Performance, Unlimited,
Tip: and Developer Editions
• Set your session timeout settings to log out users after an appropriate period of time.
• Encourage your users to pay attention during interviews for alerts about their sessions
expiring soon.
• Remind users to avoid running flows during release upgrades. A typical upgrade takes
about 5 minutes.

Note: Paused or waiting flow interviews aren’t affected by expired user sessions.

Shield Platform Encryption


You can't filter or sort records by encrypted fields for the following elements and resources.
• Update Records element
• Delete Records element
• Get Records element
• Record Choice Set resource

SEE ALSO:
Modify Session Security Settings

Translation Considerations for Flows


When you use Translation Workbench to translate flows, note these considerations.
EDITIONS

Translating Flows Available in: both Salesforce


Classic and Lightning
• To check which flow types are translatable, see Flow Types in Salesforce Help. Experience
• A translation can only reference a merge field (like {!myVar}) if the field is referenced in the first
1,000 characters of the primary label. Available in: Essentials,
Professional, Enterprise,
• Translations for flow definition name and version name each have a maximum limit of 255 Performance, Unlimited,
characters. Other translations for flow labels have a maximum of 1,000 characters. and Developer Editions
• Text templates and merge field values aren’t supported for translation.
• Right-to-left languages aren’t supported.
• When a flow label isn’t translated for a language, Salesforce uses the translation for the appropriate fallback language. If the fallback
language has no translated label, the primary label is used.

209
Automate Your Business Processes Flows

Updating Flow Translations


When you change a flow that you translated, Salesforce copies as much information as it can when you create a new version or save
changes to the translated version.
For example, version 1 of the Survey Customers flow has a translation for the WelcomeMessage field. When you save another version
of the flow, Salesforce copies all the latest translations from version 1 to version 2. The same happens if you save it as a new flow.
When you remove a label from a flow, translations aren’t copied. Salesforce uses the label’s Unique Name to copy translations to another
version. When you change the label’s unique name, Salesforce treats it as a new label.
When you delete a flow, its translations are also deleted.
When you translate a flow from a managed package, the flow’s Master Definition Name doesn’t appear on the Translate page or the
Override page. To update the translation for the Master Definition Name, edit the flow label and then update the translation from the
Translate page.

Exporting and Importing Flow Translations


• You can export and import translation files to send to translators or to help you translate lengthy text.
• When you export translations, the primary labels are truncated after 1,000 characters.

Best Practices
• Keep your labels as short as possible. The translated label can’t exceed 1,000 characters (or 255 characters for definition name and
version name). If you have a long label for a display text field, consider breaking it up into multiple fields.
• When updating a primary label, check whether it has translations, and update as needed.
• Avoid text templates when translating an email body or other formatted block text.
• Avoid using logic that references translated values.

External Object Considerations for Flows


Keep these considerations in mind when building flows that include external objects.
EDITIONS
• When you create or update external object records, don’t set values for indirect lookup
relationships that map to a different data type on the external system. For example, don’t set Available in: both Salesforce
a value for a Text indirect lookup relationship that maps to a Date value on the external system. Classic and Lightning
Experience
• To find the Salesforce record linked to from an external object by an indirect lookup relationship,
match the parent object’s Id field to the ID in the indirect lookup relationship field. Select the Available in: Essentials,
indirect lookup relationship, and add .Id before the closing curly bracket. For example, an Professional, Enterprise,
indirect lookup relationship connects Contact (parent standard object) to Social Media post Performance, Unlimited,
(child external object). In a flow, the record variable {!socialMediaPost} contains field and Developer Editions
values for a social media post. To find the parent contact record, in a Get Records element, filter
by:
Id Equals {!socialMediaPost.indirectLookupRelationship_c__c.Id}

• To find the parent external object record linked to by an external lookup relationship, match the parent record’s external ID to the
external lookup relationship on the child record. For example, an external lookup relationship connects Product Catalog Item (parent
external object) to Case (child standard object). In a flow, the record variable {!case} contains field values for a support case. To
find the parent product catalog item record, in a Get Records element, filter by:
ExternalId Equals {!case.externalLookupRelationship_c__c}

210
Automate Your Business Processes Flows

• If Salesforce creates, updates, or deletes data in your org and then accesses external data in the same transaction, an error occurs.
In your flow, we recommend using a separate transaction to access data in an external system. To do so, end the prior transaction
by adding a screen or local action to a screen flow or a Pause element to an autolaunched flow. If you use a Pause element, don't
use a record-based resume time.
For example, a screen flow creates a contact and then displays a confirmation screen. Next, the flow updates the contact in the
external system. The flow doesn’t fail because it uses a separate transaction to access the external data.

• Don’t update the External ID and Display URL fields in a process or flow.
• Record-change processes aren’t supported.
• A process or flow must save or commit changes to a standard or a custom object before changing an external object within the
same transaction. To commit changes to a standard or custom object, you have different options depending on the tool. After an
action that changes a standard or custom object record:
– In Flow Builder, add a screen, local action, or Pause element that pauses until a flow-based time occurs.
– In Process Builder, add a scheduled action.

Lightning Component Considerations for Flows


Keep these considerations in mind when building flows that include Lightning components.
EDITIONS
Note: These topics are designed for developers that build Lightning components.
Available in: both Salesforce
• Lightning components in flows must comply with Lightning Locker restrictions. Classic and Lightning
• Flows that include Lightning components are supported only in Lightning runtime. Experience

Available in: Essentials,


Which Custom Lightning Component Attribute Types Are Supported in Flows? Professional, Enterprise,
Performance, Unlimited,
Not all Lightning component data types are supported in flows. You can map only these types
and Developer Editions
and their associated collection types between flows and Lightning components.
Design Attribute Considerations for Flow Screen and Action Components
To expose an attribute in Flow Builder, define a corresponding design:attribute in the component bundle's design resource.
Keep these guidelines in mind when defining design attributes for flows.
Runtime Considerations for Flows That Include Aura Components
Depending on where you run your flow, Aura components can look or behave differently than expected. The flow runtime app that's
used for some distribution methods doesn't include all the necessary resources from the Lightning Component framework. When
a flow is run from Flow Builder or a direct flow URL (https://yourDomain.my.salesforce.com/flow/MyFlowName), force and
lightning events aren’t handled.

211
Automate Your Business Processes Flows

Which Custom Lightning Component Attribute Types Are Supported in Flows?


Not all Lightning component data types are supported in flows. You can map only these types and
EDITIONS
their associated collection types between flows and Lightning components.
Available in: both Salesforce
Flow Data Lightning Valid Values Classic and Lightning
Type Component Experience
Attribute
Type Available in: Essentials,
Professional, Enterprise,
Apex Custom Apex Apex classes that define @AuraEnabled fields. Supported Performance, Unlimited,
Class data types in an Apex class are Boolean, Integer, Long, Decimal, and Developer Editions
Double, Date, DateTime, and String. Single values as well as Lists
are supported for each data type.

Boolean Boolean • True values: true, 1, or equivalent expression


• False values: false, 0, or equivalent expression

Currency Number Numeric value or equivalent expression

Date Date "YYYY-MM-DD" or equivalent expression

Date/Time DateTime "YYYY-MM-DDThh:mm:ssZ" or equivalent expression


(API name is
DateTime)

Number Number Numeric value or equivalent expression

Multi-Select String String value or equivalent expression using this format:


Picklist "Blue; Green; Yellow"
(API name is
Multi-Select
Picklist.)

Picklist String String value or equivalent expression

Record, with a The API name Map of key-value pairs or equivalent expression.
specified of the Flow record values map only to attributes whose type is the
object specified specific object. For example, an account record variable can be
(API name is object, such as mapped only to an attribute whose type is Account. Flow data
SObject.) Account or types aren’t compatible with attributes whose type is Object.
Case

Text String String value or equivalent expression


(API name is
Text.)

212
Automate Your Business Processes Flows

Design Attribute Considerations for Flow Screen and Action Components


To expose an attribute in Flow Builder, define a corresponding design:attribute in the
EDITIONS
component bundle's design resource. Keep these guidelines in mind when defining design attributes
for flows. Available in: both Salesforce
Supported Attributes on design:attribute Nodes Classic and Lightning
In a design:attribute node, Flow Builder supports only the name, label, Experience
description, and default attributes. The other attributes, like min and max, are Available in: Essentials,
ignored. Professional, Enterprise,
For example, for this design attribute definition, Flow Builder ignores required and placeholder. Performance, Unlimited,
and Developer Editions

<design:attribute name="greeting" label="Greeting" placeholder="Hello" required="true"/>

Calculating Minimum and Maximum Values for an Attribute


To validate min and max lengths for a component attribute, use a flow formula or the component's client-side controller.
Modifying or Deleting design:attribute Nodes
If a component’s attribute is referenced in a flow, you can’t change the attribute’s type or remove it from the design resource. This
limitation applies to all flow versions, not just active ones. Remove references to the attribute in all flow versions, and then edit or
delete the attribute in the design resource.

Runtime Considerations for Flows That Include Aura Components


Depending on where you run your flow, Aura components can look or behave differently than
EDITIONS
expected. The flow runtime app that's used for some distribution methods doesn't include all the
necessary resources from the Lightning Component framework. When a flow is run from Flow Available in: both Salesforce
Builder or a direct flow URL (https://yourDomain.my.salesforce.com/flow/MyFlowName), force Classic and Lightning
and lightning events aren’t handled. Experience
To verify the behavior of your Aura components, test your flow in a way that handles force and Available in: Essentials,
lightning events, such as force:showToast. You can also add the appropriate event Professional, Enterprise,
handlers directly to your component. Performance, Unlimited,
and Developer Editions
Distribution Method Handles force and
lightning Events

Direct flow URL

Run and Debug buttons in Flow Builder

Run links on flow detail pages and list views

Web tab

Custom button or link

Lightning page

Experience Builder site page Depends on the site. Aura sites


can handle all flows. LWR sites
have limitations, including not

213
Automate Your Business Processes Flows

Distribution Method Handles force and lightning


Events
being able to run flows that use Aura
components.

Flow action

Utility bar

flow:interview Visualforce component

lightning:flow Aura component Depends on where you embed the


component or whether your component
includes the appropriate event handlers

Salesforce Data Considerations for Flows


When designing flows, keep these Salesforce data considerations in mind.
EDITIONS

Setting the Record Type Available in: both Salesforce


Classic and Lightning
For example, use a Get Records element to find the Record Type record whose name is “Reduction
Experience
Order.” Then store that record type’s ID in a variable. You can then use the variable to set the Order
Record Type field on an order record. Available in: Essentials,
Professional, Enterprise,
To set the record type for a record, use the record type’s ID. Look up the record type by its name
Performance, Unlimited,
and then store its ID in the flow.
and Developer Editions

Working with Person Accounts


If your org uses person accounts, reference Contact.Salutation instead of Account.Salutation.

External Objects
• When you create or update external object records, don’t set values for indirect lookup relationships that map to a different data
type on the external system. For example, don’t set a value for a Text indirect lookup relationship that maps to a Date value on the
external system.
• To find the Salesforce record linked to from an external object by an indirect lookup relationship, match the parent object’s Id field
to the ID in the indirect lookup relationship field. Select the indirect lookup relationship, and add .Id before the closing curly
bracket. For example, an indirect lookup relationship connects Contact (parent standard object) to Social Media post (child external
object). In a flow, the record variable {!socialMediaPost} contains field values for a social media post. To find the parent
contact record, in a Get Records element, filter by:
Id Equals {!socialMediaPost.indirectLookupRelationship_c__c.Id}

• To find the parent external object record linked to by an external lookup relationship, match the parent record’s external ID to the
external lookup relationship on the child record. For example, an external lookup relationship connects Product Catalog Item (parent
external object) to Case (child standard object). In a flow, the record variable {!case} contains field values for a support case. To
find the parent product catalog item record, in a Get Records element, filter by:
ExternalId Equals {!case.externalLookupRelationship_c__c}

214
Automate Your Business Processes Flows

• If Salesforce creates, updates, or deletes data in your org and then accesses external data in the same transaction, an error occurs.
In your flow, we recommend using a separate transaction to access data in an external system. To do so, end the prior transaction
by adding a screen or local action to a screen flow or a Pause element to an autolaunched flow. If you use a Pause element, don't
use a record-based resume time.
For example, a screen flow creates a contact and then displays a confirmation screen. Next, the flow updates the contact in the
external system. The flow doesn’t fail because it uses a separate transaction to access the external data.

Null Values
A flow fails when a filter condition from a Get Records element or an Update Records element references a value that is null. Before you
reference a value in a filter condition, add a Decision element to check if the value is null.

Flow Operations and Read-Only Fields


Understand when flows have read-only access to field values. You can control the behavior when a flow tries to update a read-only
field and remove read-only field values from flow operations.
Considerations for the Apex-Defined Data Type
Understand these considerations when you’re building flows that include an Apex-defined data type.

Flow Operations and Read-Only Fields


Understand when flows have read-only access to field values. You can control the behavior when
EDITIONS
a flow tries to update a read-only field and remove read-only field values from flow operations.
Available in: both Salesforce
Which Fields Are Inaccessible When a Flow Creates or Updates Records? Classic and Lightning
A flow can perform an operation only if the running user has permission to do so. When a flow Experience
tries to create or update records, fields that the running user can’t edit are considered inaccessible, Available in: Essentials,
or read only. A field can be inaccessible because the user hasn’t been granted permission to Professional, Enterprise,
edit the field or because it’s a system field that’s always read only. Performance, Unlimited,
Control What Happens When a Flow Tries to Set Values for Read-Only Fields and Developer Editions
When a flow tries to perform an action, such as create or update records, it uses a flow request
to set values for specific fields. But what happens if the running user doesn’t have edit access
to all those fields? When you use a record variable or record collection variable in Create Records and Update Records elements,
that’s up to you. To control the behavior, select or deselect the Filter inaccessible fields from flow requests
preference.
Remove Read-Only Fields from a Record Variable
If a flow tries to update fields that the running user can’t edit and Filter inaccessible fields from flow
requests is not enabled for your org, the flow fails. If your record variable includes read-only fields and you can’t grant your
running users “Edit” permissions for those fields, remove the fields from the record variable. Set the field values individually in a
Create Records or Update Records element or copy the writable field values into a new record variable.

215
Automate Your Business Processes Flows

Which Fields Are Inaccessible When a Flow Creates or Updates Records?


A flow can perform an operation only if the running user has permission to do so. When a flow tries
EDITIONS
to create or update records, fields that the running user can’t edit are considered inaccessible, or
read only. A field can be inaccessible because the user hasn’t been granted permission to edit the Available in: both Salesforce
field or because it’s a system field that’s always read only. Classic and Lightning
To determine which fields are system fields, see the Object Reference for Salesforce and Lightning Experience
Platform. To determine which other fields aren’t editable, review the running user’s permissions.
Available in: Essentials,
Professional, Enterprise,
How Did Read-Only Fields Get in My Record Variable? Performance, Unlimited,
and Developer Editions
If the Variable Is The Variable Includes ...
Populated by ...
A Get Records element, Id and any other read-only fields that you choose to include.
where the field values are
stored together

An Assignment or Get Any read-only fields that you choose to include.


Records element, where field
values are stored in separate
variables

A process, workflow rule, or All the object’s system fields and any fields that the running user
Start element doesn’t have permission to edit. The variable includes every field
for the object by default.

What Do I Do When My Record Variable Includes Read-Only Fields?


For each read-only field that’s stored in your record variable:
1. Determine whether the flow uses that field anywhere. If it doesn’t, update the flow so that it doesn’t store a value for that field. This
suggestion applies only if the variable is populated by an element in the flow, like Get Records.
For example, a Get Records element stores CreatedByDate, but no other elements reference that field. You update the Get
Records element so that it’s no longer storing CreatedByDate.

2. If the read-only field is referenced in the flow, give the running users the permissions needed for the flow to execute its operations.
3. If you can’t give the running users the needed permissions for a field, update the flow so that it doesn’t try to update that field.

Example: Using an Update Records element, a flow updates several fields on an account. While your users can edit
Description and Account Rating, they can’t edit Owner ID or LastModifiedDate. To prevent the flow from
failing at run time:
• Give your users “Edit” permission for Owner ID.
• Copy only the writable field values (Description, Account Rating, and Owner ID) from the original record
variable into a new record variable. Reference the new record variable in the Update Records element.
Copying only the writable field values ensures that the flow doesn’t try to set a value for LastModifiedDate at run time.

216
Automate Your Business Processes Flows

SEE ALSO:
Remove Read-Only Fields from a Record Variable
Control What Happens When a Flow Tries to Set Values for Read-Only Fields
Object Reference for Salesforce and Lightning Platform : System Fields

Control What Happens When a Flow Tries to Set Values for Read-Only Fields
When a flow tries to perform an action, such as create or update records, it uses a flow request to
EDITIONS
set values for specific fields. But what happens if the running user doesn’t have edit access to all
those fields? When you use a record variable or record collection variable in Create Records and Available in: both Salesforce
Update Records elements, that’s up to you. To control the behavior, select or deselect the Filter Classic and Lightning
inaccessible fields from flow requests preference. Experience

User Permissions Needed Available in: Essentials,


Professional, Enterprise,
To edit process automation settings: Customize Application Performance, Unlimited,
and Developer Editions

When Filter inaccessible fields from flow


requests is

Selected Not Selected


(Recommended)
Result when the running The operation partially The operation fails.
user doesn’t have edit access succeeds. No fields in the operation are
to all fields The flow filters read-only fields updated. The flow executes the
out of the operation. The fields fault path if there is one.
that the user can edit are
updated. The fields that the
user can’t edit aren’t updated.
The flow doesn’t execute the
fault path.

Notification when one or No notification is sent to the The admin receives a flow error
more fields aren’t updated user or admin to indicate that email with full details.
some fields weren’t updated.

Compared to a Create Inconsistent Consistent


Records element where you
chose to use separate
variables, resources, and
literal values

Compared to an Update Inconsistent Consistent


Records element, where you
chose to set fields
individually

217
Automate Your Business Processes Flows

Tip: We recommend disabling this preference so that you always know when a flow doesn’t set all expected field values.

1. From Setup, enter Automation in the Quick Find box, then select Process Automation Settings.
2. Select or deselect Filter inaccessible fields from flow requests.
If your org was created in Winter ’17 or earlier, the preference is enabled by default. Otherwise, the preference is disabled by default.

Example: A flow updates several fields on an opportunity by using a record variable in an Update Records element. At run time,
the flow tries to update the Acme account on behalf of your user. The user can edit Stage and Close Date but not Amount.
As a result, the flow doesn’t have permission to update Amount.
• If Filter inaccessible fields from flow requests is selected, the flow successfully updates the account,
but it only updates Stage and Close Date. The flow doesn’t notify anybody that Amount wasn’t updated.
• If Filter inaccessible fields from flow requests is not selected, the flow fails to update the account.
The admin receives a flow error email. The email includes this error.
INVALID_FIELD_FOR_INSERT_UPDATE: Unable to create/update fields: Amount
That's API-speak for “The running user doesn’t have permission to edit the Amount field.”

Warning: If you change your org’s selection for this preference, use a sandbox to test how the change impacts your flows.
Consider following the same process as you would for a critical update.

SEE ALSO:
Which Fields Are Inaccessible When a Flow Creates or Updates Records?

Remove Read-Only Fields from a Record Variable


If a flow tries to update fields that the running user can’t edit and Filter inaccessible
EDITIONS
fields from flow requests is not enabled for your org, the flow fails. If your record
variable includes read-only fields and you can’t grant your running users “Edit” permissions for those Available in: both Salesforce
fields, remove the fields from the record variable. Set the field values individually in a Create Records Classic and Lightning
or Update Records element or copy the writable field values into a new record variable. Experience
Note: If the read-only fields in the record variable are populated by a Get Records or Available in: Essentials,
Assignment element, consider updating those elements so that they don’t populate that Professional, Enterprise,
field at all. Performance, Unlimited,
and Developer Editions
SEE ALSO:
Flow Element: Create Records
Flow Element: Update Records

218
Automate Your Business Processes Flows

Copy Field Values from One Record Variable to Another


Record variables and record collection variables can have values set for fields that the running user
EDITIONS
can’t edit. However, you can use the writable values to create or update records with Create Records
or Update Records elements. To do so, map the writable values from the original record variable Available in: both Salesforce
into a new record variable. Classic and Lightning
Experience
Note: With record collection variables, use loops to map the field values to a new collection.
Available in: Essentials,
1. Add an Assignment element to your flow. Make sure that the flow executes this element after
Professional, Enterprise,
the original record variable has been populated but before the Create or Update element. Performance, Unlimited,
2. For each writable field in the original record variable, add a row. and Developer Editions
• Variable—Select {!recordVar2.field}, where recordVar2 is the name of the
new variable and field is the field on that variable. USER PERMISSIONS
• Operator—Select equals.
To open, edit, or create a
• Value—Select {!recordVar1.field}, where recordVar1 is the name of the flow in Flow Builder:
original variable and field is the field on that variable. • Manage Flow

Note: If you plan to reference the variable in a Update Records element, include the
record’s ID in the new record variable. Although Id is read only, the flow uses the value
to determine which records to update.

Example: You have a case record variable called {!myCaseVar_all}. It stores values for some read-only fields, so you can’t
use it in a Update Records element. You copy the fields that you want to update to a new record variable: IsEscalated and
Status. You also copy Id, because it’s required for an update operation. Here’s what those assignment rules look like.

Variable Operator Value


{!myCaseVar_final.Id} equals {!myCaseVar_original.Id}

{!myCaseVar_final.IsEscalated} equals {!myCaseVar_original.IsEscalated}

{!myCaseVar_final.Status} equals {!myCaseVar_original.Status}

The same example works for an record collection variable. However, because you can’t directly change the values of a collection
variable, you use a loop.

219
Automate Your Business Processes Flows

1. Using a Loop element, the flow passes each item’s values into a loop variable ({!myCaseLoopVar_original}).
2. For each iteration, an Assignment element copies the Id, IsEscalated, and Status fields from the loop variable to
another record variable ({!myCaseLoopVar_final}).
3. The flow then adds the {!myCaseLoopVar_final} variable’s values to a new collection. The second Assignment
element includes this assignment rule.

Variable Operator Value


{!myCaseColl_updated} add {!myCaseLoopVar_final}

After the flow has iterated over every item in the original collection, it exits the loop.

220
Automate Your Business Processes Flows

Considerations for the Apex-Defined Data Type


Understand these considerations when you’re building flows that include an Apex-defined data
EDITIONS
type.
Available in: both Salesforce
Flows Classic (not available in all
orgs) and Lightning
• Only screen flows and autolaunched flows are supported. Experience
• Flow templates, standard flows, and flows in Experience Cloud sites aren’t supported.
Available in: Enterprise,
Performance, Unlimited,
Flow Builder and Developer Editions
• Cloud Flow Designer isn’t supported.
• A custom component that displays a value, like the Display Text screen component, can display all fields from an Apex-defined
variable. For example, the {!Car} variable stores all field values that are defined in the Car Apex class. If a Display Text screen component
has the {!Car} Apex-defined variable as the input attribute, the screen displays all the fields from the Car Apex class. If the Apex class
is from a managed package, only the Apex class ID is displayed.
• The first time you open an element or resource window in an org with over 200 Apex classes that have the @AuraEnabled annotation,
the window can take longer to load.
• Deprecated Apex classes in a managed package appear in Flow Builder.
• If a flow invokes Apex, the running user must have the corresponding Apex class assignment in their profile or permission set.

Apex
• Supported data types in an Apex class are Boolean, Integer, Long, Decimal, Double, Date, DateTime, and String. Single values and
lists are supported for each data type. Multiple Apex classes can be combined to represent complex web objects.
• The @AuraEnabled annotation for each field is required.
• A constructor with no arguments is required.
• Class methods aren’t supported.
• Getter methods for fields aren’t supported.
• Inner classes aren’t supported.
• An outer class that has the same name as an inner class isn’t supported.
• Referential integrity isn’t supported for Apex class fields. For example, a flow has an Apex-defined variable that represents the model
field in the Car Apex class. If the model field is modified or deleted in the class, the flow fails.

Input and Output Values


• An Apex-defined variable value can't be set or stored outside the flow. The value can't be passed to a Subflow element.

Local Actions
• An Aura component that’s used as a local action can’t set an Apex-defined attribute.

221
Automate Your Business Processes Flows

Flow Feature Considerations


When designing flows, keep these flow feature considerations in mind. Also, some resources,
EDITIONS
elements, and screen components have more considerations that are described in their reference
topics. Available in: both Salesforce
Classic and Lightning
Flow Conditional Visibility Considerations Experience
Before you set visibility for a screen component, understand the behavior of conditional visibility Available in: Essentials,
in flows. Professional, Enterprise,
Considerations for Flow Choice Components with Default Values Performance, Unlimited,
Understand how to set a default value using any flow resource for a screen flow’s choice and Developer Editions
component, such as Radio Buttons or a Multi-Select Picklist component.
Flow Variable Considerations
Before you create a variable resource, understand the behavior of variables in flows.
Flow Formula Considerations
When you create a formula resource or add validation to a screen input component, understand the behavior of formulas in flows.
Multi-Select Resource and Screen Field Considerations for Flows
Checkbox Group and Multi-Select Picklist screen components let flow users select multiple choices. Before you start using these
screen components, understand how they work in flows—both when you design the flow and when your users run it.
Paused Flow Interview Considerations
Before you design flows that contain one or more Pause elements, understand the behavior and guidelines.
Flow Stage Considerations
Before you add stages to your flow, understand how stage references and default active stages work, as well as considerations for
troubleshooting stages.
Two-Column Flow Considerations
If your org has Lightning runtime enabled, you can control whether a flow displays in one column or two columns. Before you use
this feature, understand how the flow layout currently behaves.
Schedule-Triggered Flow Considerations
A schedule-triggered flow starts at the specified time and frequency for a batch of records. Understand the considerations and special
behaviors of schedule-triggered flows, also known as scheduled flows.
Record-Triggered Flow Considerations
A record-triggered autolaunched flow makes additional updates to the triggering record before or after it's saved to the database.
Understand the considerations and special behaviors of flows that make before- and after-save updates.

SEE ALSO:
Flow Resources
Flow Elements
Provided Flow Screen Components

222
Automate Your Business Processes Flows

Flow Conditional Visibility Considerations


Before you set visibility for a screen component, understand the behavior of conditional visibility
EDITIONS
in flows.
Null and Empty Strings Available in: both Salesforce
A null value is evaluated the same way as a {!$GlobalConstant.EmptyString}. Classic and Lightning
Experience
Unsupported Data Types and Operators
• These operators aren’t supported in conditional visibility. Available in: Essentials,
Professional, Enterprise,
– Was Visited Performance, Unlimited,
– Was Set and Developer Editions

• These data types aren’t supported in conditional visibility, but you can reference attributes
and fields.
– Apex-defined data types
– Record variables

• Any screen input component with Manually assign variables (advanced) selected isn’t available as a resource for conditional
visibility on the same flow screen.
• Text that has merge fields included isn’t supported in values. Merge fields on their own are supported.
Text Templates and Formulas
• Initial values are evaluated in text templates and formulas.
• Changes based on user input aren’t evaluated.
Hidden Screen Input Components
• Screen input components hidden by conditional visibility aren’t required when a user runs the flow, even if Required is set
to {!$GlobalConstant.True}. When the component appears to the user, it’s treated as required.
• If a screen input component is hidden because it doesn’t meet conditional visibility requirements, its value is set to null. But
hidden picklists in a Dependent Picklists component aren’t set to null unless the entire Dependent Picklists component is hidden.
Sections and Conditional Field Visibility
If a section’s visibility conditions reference a component contained within the section, the entire section is hidden. However, if the
referenced component has a default value that’s evaluated by the visibility conditions and the visibility conditions evaluate as true,
the section is visible.
Focus
When screen components or their parts are rendered after the screen is initially displayed, they’re never focusable. For example, if
a component asynchronously fetches a list of tasks to display, the focus can’t be set to any of the tasks. If a screen component uses
conditional visibility and appears only after user input, the focus can’t be set to any part of the screen component.
Circular Logic
Avoid circular logic in your conditions, which can result in poor performance, strange behavior, or an error when your flow is run.

SEE ALSO:
Make Flow Screens Dynamic with Conditional Visibility

223
Automate Your Business Processes Flows

Considerations for Flow Choice Components with Default Values


Understand how to set a default value using any flow resource for a screen flow’s choice component,
EDITIONS
such as Radio Buttons or a Multi-Select Picklist component.
The Default Value field appears below the choice options list when you add at least one choice. For Available in: both Salesforce
the Default Value field, specify a picklist value or another flow resource (a variable, a field on a record Classic and Lightning
variable, a manually entered value, and so on). You can choose any compatible type reference for Experience
the flow. You can use a value from a record as the default value, which applies to picklist choices
Available in: Essentials,
or record choices. Professional, Enterprise,
When you save and run a flow, the default value determines which options are preselected. None Performance, Unlimited,
of the choice options are duplicated, and the order of the choices is retained. and Developer Editions
Flow run time behavior for a default choice option
At run time, Salesforce preselects a choice if its value matches the component's default value. When the default value references a
flow resource, Salesforce resolves that reference before matching. When you save and run the flow, the default value is preselected
in the resulting list of choices.

If your default value is... Then at run time Salesforce preselects choice options
based on...
A choice resource that’s included in the list of choice options for A match for the selected choice’s API name.
the component

A choice resource that's not included in the list of choice options The resolved value of the choice resource. If a given choice's
for the component value matches the resolved default value, then that choice is
selected.

Another resource in the flow such as a reference to a record The resolved value of the flow resource. If a given choice's value
variable from a Get Records element matches the resolved default value, then that choice is selected.

A manually entered value The manually entered value. If a given choice's value matches
the manually entered value, then that choice is selected.

For choice components that let the user select a single option, such as Picklists and Radio Buttons,, Salesforce preselects the first
choice that matches:

For choice components that let the user select multiple options, like Multi-Select Picklists and Checkbox Groups, Salesforce preselects
every choice that matches:

Multiple default values for a choice component


To specify multiple default values for choice components that let the user select multiple options, separate the values with semicolons.
If the resolved default value includes semicolons, like “Red;Blue”, Salesforce treats each value as a separate default. For example, to

224
Automate Your Business Processes Flows

set the default value to both “Red” and “Blue”, enter Red;Blue. At run time, Salesforce preselects every choice option whose value
is Red or Blue. Using values that contain semicolons can cause issues with multi-select value matching behavior. If a choice's value
is an exact match, like Red;Blue, then Salesforce doesn’t select it.
If you configure a choice component with multiple records, use a variable whose value resolves to the record ID for each record, and
separate the IDs with a semicolon.

Flow Variable Considerations


Before you create a variable resource, understand the behavior of variables in flows.
EDITIONS

Referring to Blank Fields or Resources Available in: both Salesforce


Classic and Lightning
• If you leave a field or resource value blank, the value is null at run time. To treat a text value Experience
as an empty string instead of null, set it to {!$GlobalConstant.EmptyString}.
Available in: Essentials,
Professional, Enterprise,
Boolean Variables Performance, Unlimited,
• Boolean Types Treat null Differently than false and Developer Editions
• A flow treats null as a different value than false. For example, if you try to find a record
whose checkbox field is set to null, no records are returned. Instead, look for records where
the checkbox field is set to false. If you’re using a variable (such as myCheckbox = {!varBoolean}), make sure that the
variable isn’t set to null before you reference it in your record filter or condition.

Percentage Variables
• If a flow uses record variables to manipulate percentage values, test the flow carefully. When you insert a value into a record variable’s
percentage field and then reference that field in a formula, the value is divided by 100.
For example, an opportunity’s Probability field is set to 100. If you assign that value to the {!Opportunity.Probability}
record variable, the value is still 100. But if you create a formula whose expression is {!Opportunity.Probability}, the
value is 1.

Available for Input/Output


• Disabling input or output access for an existing variable can break the functionality of applications and pages that call the flow and
access the variable. For example, you can access variables from URL parameters, subflows, and processes.

Setting Input Variables


• Process Builder: When a process or flow launches another flow, that flow’s input variables can be assigned values during the launch.
However, for a text, picklist, or multi-select picklist variable that isn’t a collection, a value of null is converted to an empty string
• Actions: Flow actions let you pass the value of the record's ID field into the flow, but that's it. If your flow has a Text input variable
called recordId, the action passes the record's ID into that variable at runtime. If not, it doesn't, and the flow tries to run anyway.
• Lightning App Builder: Collection variables, record variables, and record collection variables are not supported. The Flow component
supports only manually entered values for input variables. Text input variables accept a maximum length of 4,000 characters.

Distributing Flows
• When you distribute a flow, don’t pass a currency field value from a Salesforce record into a flow currency variable with a URL
parameter. When a currency field is referenced through a merge field (such as {!Account.AnnualRevenue}), the value

225
Automate Your Business Processes Flows

includes the unit of currency’s symbol (for example, $). Flow currency variables can accept only numeric values, so the flow fails at
run time. Instead, pass the record’s ID to a text variable with a URL parameter. Then in the flow, use the ID to look up that record’s
value for the currency field.

Flow Formula Considerations


When you create a formula resource or add validation to a screen input component, understand
EDITIONS
the behavior of formulas in flows.
Formula Functions Available in: both Salesforce
Classic and Lightning
• These functions aren’t supported in a flow formula.
Experience
– GETRECORDIDS
Available in: Essentials,
– IMAGE
Professional, Enterprise,
– INCLUDE Performance, Unlimited,
– ISCHANGED and Developer Editions
– ISNEW
– PARENTGROUPVAL
– PREVGROUPVAL
– PRIORVALUE
– REQUIRE SCRIPT
– TIMENOW
– TIMEVALUE
– VLOOKUP
For a complete list of operators and functions for building formulas in Salesforce, see Formula Operators and Functions by
Context.

• In a flow, the CONTAINS function checks all characters within its parentheses. For cross object field references, CONTAINS
works like it does in the rest of Salesforce. It checks only the first 250 characters in the reference.
Here’s an example. varContract refers to a record variable that contains the values of a contract record. This formula
expression checks only the first 250 characters.
CONTAINS({!varContract.Account.Description}, "description")

This formula expression checks all characters in the field.


CONTAINS({!varContract.Description}, "description")

Flow Data in Formulas


• References to global variables in formulas aren’t validated.
• To reference a platform event in a formula, pass the event data into a record variable in the Pause element. Then reference the
appropriate field in that record variable.
• To evaluate a null field value as a zero value, use the BLANKVALUE function. For example, to evaluate a null value for the
NumberOfEmployees field as a zero value, use BLANKVALUE(NumberOfEmployees, 0).
Gotchas
• A flow formula can contain up to 3,900 characters.

226
Automate Your Business Processes Flows

• When you paste a formula, make sure that the apostrophes and quotation marks are straight ('') and not curly (‘’). Otherwise,
you get a syntax error when you save the flow.
Errors
A formula returns null if an error occurs when the expression is evaluated, such as:
• The value that the formula returns doesn’t match its data type.
• The formula contains an unsupported function.
For example, if your formula resource has a data type of Number, the output must be numeric.

If a flow contains an invalid formula resource, you can’t activate the flow. If a Display Text screen component contains an invalid
formula resource, the flow displays an empty string at run time.

SEE ALSO:
Flow Resource: Formula
Flow Resources

Multi-Select Resource and Screen Field Considerations for Flows


Checkbox Group and Multi-Select Picklist screen components let flow users select multiple choices.
EDITIONS
Before you start using these screen components, understand how they work in flows—both when
you design the flow and when your users run it. Available in: both Salesforce
Configuring a Checkbox Group or Multi-Select Picklist Screen Component Classic and Lightning
Experience
• These screen components support only one default value. You can’t individually select
multiple default values. However, you can manually add a value in the default value field Available in: Essentials,
and separate each value with a semicolon. Professional, Enterprise,
• You can configure a record choice set resource to assign field values from a user-selected Performance, Unlimited,
record to variables in the flow. When a Checkbox Group or Multi-Select Picklist screen and Developer Editions
component uses a record choice set, only values from the last record that the user selects
are stored in the flow variables. If multiple Checkbox Group or Multi-Select Picklist
components on one screen use the same record choice set, the variable assignments come from the last record selected from
all of those components.
Using Values from a Checkbox Group or Multi-Select Picklist Screen Component
• At run time, the value of a Checkbox Group or Multi-Select Picklist screen component is a concatenation of the user-selected
choice values, separated by semicolons. If a selected choice’s value includes semicolons, the semicolons are removed.
• If you reference a Checkbox Group or Multi-Select Picklist screen component in a flow condition:
– Make sure that each choice in the screen component has a choice value configured.
– Don’t use the same choice in multiple Checkbox Group or Multi-Select Picklist screen components on the same screen.

• If a Checkbox Group or Multi-Select Picklist has at least one default value, at run time the choices are preselected if the choice’s
value matches the default value.

SEE ALSO:
Choice Resources for Flow Screen Components

227
Automate Your Business Processes Flows

Paused Flow Interview Considerations


Before you design flows that contain one or more Pause elements, understand the behavior and
EDITIONS
guidelines.
Available in: both Salesforce
General Considerations Classic (not available in all
orgs) and Lightning
• After you deactivate a flow version, its paused interviews continue to wait for the configured Experience
resume events. You can’t delete a flow version if it has paused interviews.
Time-based resume events
• An interview can execute only one connector per Pause element. After one of its resume events
are available in: Essentials,
is processed, the remaining resume events are removed from the queue.
Professional, Enterprise,
• An org can have up to 50,000 paused interviews. Performance, Unlimited,
• If the user who started the interview is deactivated when Salesforce tries to execute a pause and Developer Editions
connector, the interview fails to resume. Platform event-based
• If a flow is paused and the flow interview exceeds 1 MB, the interview fails to save and can’t be resume events are available
resumed. in: Enterprise, Performance,
Unlimited, and Developer
Editions
Transactions and Paused Interviews
A transaction ends as soon as a flow interview pauses for one or more resume events. When the
flow interview resumes, a new transaction begins. Everything after the Pause element is executed as part of a batch transaction that
includes other resumed interviews.
Interviews aren’t resumed independently. They’re grouped into a single batch that starts resuming within one hour after the first interview
enters the batch. Actions that execute as a result of the grouped interviews are also executed in that transaction. The batch can have
other interviews that resume at the same time, have the same flow version ID, and are executed by the same user ID. This behavior can
cause you to exceed your Apex governor limits if the resumed interview executes DML operations or SOQL queries through:
• Flow elements, such as Create Records or Apex Action (Legacy)
• Apex triggers
• Immediate workflow actions
For details, see Per-Transaction Flow Limits on page 206.
If a Pause element precedes a flow element that executes DML operations or SOQL queries:
• Ensure that your flows don’t let a single user execute DML operations or SOQL queries that can exceed limits between Pause elements.
• Consider using multiple Pause elements so that the DML operations and SOQL queries are performed in multiple transactions.
• Add fault paths for those elements so that the flow returns to the Pause element if the fault message contains: Too many SOQL
queries or Too many DML operations.
If an interview fails after it’s resumed:
• Prior interviews in that batch’s transaction are successful.
• Operations that the interview executed before it paused are successful.
• If a fault path handles the failure, operations that the interview executed between when it resumed and when it failed are successful.
The operation that caused the interview to fail isn’t successful.
• If a fault path doesn’t handle the failure, operations that the interview executed between when it resumed and when it failed are
rolled back. The operation that caused the interview to fail isn’t successful.
• The remaining interviews in that batch are tried.

228
Automate Your Business Processes Flows

Platform Events
Tip: Make sure to also review the considerations and allocations for platform events.

Supported Platform Events


Flows can subscribe to custom platform events and these standard platform events.
• AIPredictionEvent
• BatchApexErrorEvent
• FlowExecutionErrorEvent
• FOStatusChangedEvent
• OrderSummaryCreatedEvent
• OrderSumStatusChangedEvent
• PlatformStatusAlertEvent
Formulas
To reference a platform event in a formula, pass the event data into a record variable in the Pause element. Then reference the
appropriate field in that record variable.
Value Truncation
When you filter platform event messages, values for conditions can’t be more than 765 characters.
Subscriptions Related List
On the platform event’s detail page, the Subscriptions related list shows which entities are waiting to receive that platform event’s
messages. The related list includes a link to each subscribed process. If flow interviews are waiting for that platform event's messages,
one “Process” subscriber appears in the Subscriptions related list.
Uninstalling Events
Before you uninstall a package that includes a platform event, delete the interviews that are waiting for that platform event’s messages.
Einstein Predictions
A prediction event is sent for each Einstein prediction result, so use event condition filters if you want your flow to be triggered only
by predictions on a specific object. For example, if your flow uses a pause element that acts only on predictions written to Lead
records, add a resume event to check that the AIPredictionEvent.TargetId field equals the current record.
If your flow updates a field that is used by an Einstein prediction, Einstein runs the prediction again and writes back the new results.
The new results generate a new prediction event that could trigger your flow again, resulting in a loop. To avoid creating a loop,
only update fields that aren’t used in Einstein predictions.

Platform Cache
When a flow contains a Pause element, make sure that later elements in the flow don't invoke Apex code that stores or retrieves values
from the session cache. The session-cache restriction applies to Apex actions and to changes that the flow makes to the database that
cause Apex triggers to fire.

Time-Based Resume Events


• Time-based resume events don’t support minutes or seconds.
• If an interview is waiting for a time in the past, Salesforce resumes the interview as soon as possible. Depending on how many actions
Salesforce is processing at the time, actions are executed within one hour.
For example, a flow is configured to email an opportunity owner seven days before the close date. An interview starts for an opportunity
with the close date set to today. Salesforce resumes the interview within an hour.

229
Automate Your Business Processes Flows

• An org can process up to 1,000 time-based resume events per hour. When a resume event is processed, its associated interview
resumes and any other resume events for that interview are removed from the queue. If an org exceeds this limit, Salesforce defers
the remaining resume events to be processed in the next hour.
For example, an org has 1,200 resume events scheduled to be processed between 4:00 PM and 5:00 PM. Salesforce processes 1,000
resume events between 4:00 PM and 5:00 PM and the additional 200 resume events between 5:00 PM and 6:00 PM.

• You can’t archive a product or price book that’s referenced in a time-based resume event in a paused interview.

Flow-Based Time
For resume events based on a specific time, the resume time is evaluated using the time zone of the user who created the flow.

Record-Based Time
• For resume events based on a record field value, the resume time is evaluated using the org’s time zone.
• Resume events can’t reference:
– DATE or DATETIME fields that contain automatically derived functions, such as TODAY or NOW.
– Formula fields that include related-object merge fields.

• If you change a date field that’s referenced by an unexecuted resume event in a paused interview, Salesforce recalculates the resume
events associated with the interview.
For example, a flow is configured to email an opportunity owner seven days before the opportunity close date and the close date
is 2/20/2014. The following things could happen.
– The close date isn’t updated before the interview resumes. Result: Salesforce resumes the interview on 2/13/2014 and sends
the email.
– The close date is updated to 2/10/2014 before the interview resumes. Result: Salesforce reschedules the resume event and the
interview resumes on 2/3/2014.
– The close date is updated to a date in the past. Result: Salesforce recalculates the resume event and resumes the interview shortly
after you save the record.

• If a resume event references a null date field when the interview executes the Pause element, Salesforce resumes the interview as
soon as possible. Depending on how many actions Salesforce is processing at the time, actions are executed within one hour.
• If a resume event references a date field that has a non-null value when the flow interview executes the Pause element and it’s
updated to null before the resume event is processed, Salesforce resumes the interview within an hour after the date field is
updated.
• If a record or object that’s referenced by a resume event is deleted, the resume event is removed from the queue. If the interview
has no other resume events to wait for, the interview is deleted.
• Lead Convert Limitations
– You can’t convert a lead that’s referenced in a paused interview’s resume event.
– If Validation and Triggers from Lead Convert is enabled, existing operations on leads after a Pause element aren’t executed during
lead conversion.

230
Automate Your Business Processes Flows

– If a campaign member based on a lead is converted before a paused interview that’s associated with that record finishes,
Salesforce still executes the interview.

SEE ALSO:
Platform Events Developer Guide : Considerations for Defining and Publishing Platform Events
Flow Limits and Considerations
Flow Operators in Decision and Pause Elements
Flow Element: Pause
Platform Events Developer Guide : Subscribe to Platform Even Messages with Flows

Flow Stage Considerations


Before you add stages to your flow, understand how stage references and default active stages
EDITIONS
work, as well as considerations for troubleshooting stages.
Available in: both Salesforce
Stage References Classic and Lightning
Experience
When you reference a stage merge field in a display text field or other label, it resolves to the stage’s
label. Everywhere else, a stage merge field resolves to the stage’s fully qualified name: Available in: Essentials,
namespace.flowName:stageName or flowName:stageName. Professional, Enterprise,
Performance, Unlimited,
Whenever possible, use the stage merge field to refer to stages, such as {!myStage}. When you
and Developer Editions
reference a stage in a subflow, use the fully qualified name.

Default Active Stages


When you mark a stage resource Active by Default, the flow automatically sets values for the global variables. Use this setting when a
stage applies to every branch of the flow.
At run time, the default active stages are sorted in ascending order. How the flow uses the default active stages to update
$Flow.ActiveStages and $Flow.CurrentStage depends on whether the flow is a master flow or a referenced flow.
Master flows
The default active stages are added to $Flow.ActiveStages in ascending order. $Flow.CurrentStage is set to the
default active stage with the lowest order.
Referenced flows
The default active stages are inserted in $Flow.ActiveStages in ascending order. $Flow.CurrentStage isn’t
automatically updated.
• When $Flow.CurrentStage is included in $Flow.ActiveStages, the default active stages are inserted in
$Flow.ActiveStages after $Flow.CurrentStage.
For example, Flow1 sets $Flow.ActiveStages to “1, 2, 3, 4” and $Flow.CurrentStage to “3.” It then uses a Subflow
element to call Flow2. Flow2’s default active stages are “A, B, C.” When Flow2 starts, $Flow.ActiveStages becomes “1,
2, 3, A, B, C, 4.” $Flow.CurrentStage is still “3.”

• When $Flow.CurrentStage isn’t included in $Flow.ActiveStages, the default active stages are added to the end
of $Flow.ActiveStages.
For example, Flow1 sets $Flow.ActiveStages to “1, 2, 3, 4” and doesn’t set $Flow.CurrentStage. It then uses a
Subflow element to call Flow2. Flow2’s default active stages are “A, B, C.” When Flow2 starts, $Flow.ActiveStages
becomes “1, 2, 3, 4, A, B, C.” $Flow.CurrentStage remains unset.

231
Automate Your Business Processes Flows

• When $Flow.CurrentStage is duplicated in $Flow.ActiveStages, the default active stages are appended after
the first occurrence.
For example, Flow1 sets $Flow.ActiveStages to “1, 2, 2, 3, 4” and $Flow.CurrentStage to “2.” It then uses a
Subflow element to call Flow2. Flow2’s default active stages are “A, B, C.” When Flow2 starts, $Flow.ActiveStages
becomes “1, 2, A, B, C, 2, 3, 4.” $Flow.CurrentStage remains “2.”

Troubleshooting Stages
The flow error email doesn’t specify the values of $Flow.ActiveStages and $Flow.CurrentStage at the start of an
interview. To confirm what the initial values are, add temporary elements to display the initial values, such as in a screen display text
field.

SEE ALSO:
Show Users Progress Through a Flow with Stages
Flow Resource: Stage

Two-Column Flow Considerations


If your org has Lightning runtime enabled, you can control whether a flow displays in one column
EDITIONS
or two columns. Before you use this feature, understand how the flow layout currently behaves.

Note: Starting in Winter ’23, two-column flow layouts are ignored. For a better layout option, Available in: both Salesforce
add Section components to your flow screens. Each Section component lets you organize Classic and Lightning
Experience
record fields and screen components in up to four adjustable-width columns.
These considerations don’t apply to the Section component in flow screens. Available in: Essentials,
Professional, Enterprise,
Granularity Performance, Unlimited,
The layout setting is applied at the flow level. So you can’t control the layout at the screen or and Developer Editions
field level. If you set a flow to use two columns, every screen in that flow displays in two columns.
Order of Fields
You can’t manually control which fields go in which columns. If the flow is set to display two columns, the fields alternate in each
column. The odd fields (first, third, fifth, and so on) are placed in the left column. The even fields (second, fourth, sixth, and so on)
are placed in the right column.
If your users navigate screens with the Tab key, they tab through all the fields in the left column and then all the fields in the right
column. You can’t configure the fields to tab left-to-right.
Responsiveness
The flow layout isn’t responsive to the user’s screen dimensions. It uses the same layout whether the user’s screen is 1 inch wide or
20 inches wide.

Tip: If users run a flow from a phone or small tablet, don’t apply a two-column layout to the flow.

Compatibility with Section component


For flows that are distributed via Experience Builder, the Lightning App Builder, or the utility bar, the Layout property is ignored by
each flow screen that contains a Section component.

232
Automate Your Business Processes Flows

For flows that are distributed via URL, the flowLayout URL parameter is ignored by each flow screen that contains a Section
component.

SEE ALSO:
Flow Limits and Considerations
Flow Screen Output Component: Section
Customize a Flow URL to Render Two-Column Screens

Schedule-Triggered Flow Considerations


A schedule-triggered flow starts at the specified time and frequency for a batch of records.
EDITIONS
Understand the considerations and special behaviors of schedule-triggered flows, also known as
scheduled flows. Available in: both Salesforce
These considerations apply to schedule-triggered flows. Classic and Lightning
Experience
• A schedule-triggered flow starts at the specified time and frequency. You can’t launch a
schedule-triggered flow by any other means. Available in: Essentials,
• The Start Time field value is based on the Salesforce org’s default time zone. Professional, Enterprise,
Performance, Unlimited,
• The View All Data permission is required to activate an autolaunched flow that has a trigger.
and Developer Editions
• The maximum number of schedule-triggered flow interviews per 24 hours is 250,000, or the
number of user licenses in your org multiplied by 200, whichever is greater. One interview is
created for each record retrieved by the schedule-triggered flow’s query.
If you specify an object so that the flow runs for a batch of records, then set the time, frequency, and record conditions to avoid
reaching this limit. You can use debug logs to check how many records a schedule-triggered flow runs on. Track the number of
records with the FLOW_START_SCHEDULED_RECORDS event. If your org reaches the limit, Salesforce sends a flow error email.

• If you delete a schedule-triggered flow from the Scheduled Jobs page in Setup, all future recurrences of that flow are canceled. To
enable future runs, deactivate and reactivate the flow.
• If a flow is scheduled to run once with a date and time that already passed, the flow doesn’t run.
• The Automated Process user runs schedule-triggered flows.
• If you need a schedule-triggered flow to invoke Apex code, don’t enable the Require User Access to Apex Classes Invoked by Flow
update. When that release update is activated, schedule-triggered flows fail when they invoke Apex.
• A schedule-triggered flow can make callouts only after executing a Pause element. For example, without a Pause element, the flow
can't access external objects, execute Apex actions that make callouts, or execute actions that are generated from External Services
registrations.

Tip: You can insert a Pause element that pauses the flow for only a moment. Configure the resume event to pause until a
specified time, with a specific time as the time source. For the base time, specify the $Flow.CurrentDateTime global
variable. Then set the offset to 0 hours. At run time, a Pause element that's set up this way typically pauses the flow for less
than a minute.

• If you configure an Update Records element to use the ID and all field values from the $Record global variable, enable Filter
inaccessible fields from flow requests in your org’s process automation settings. Otherwise, the flow fails
because the Update Records element tries to set the values for system fields and other read-only fields.
• When you define multiple filters, the filter logic usually defaults to AND. However, if multiple filters have the same field selected and
use the equals operator, the filters are combined with OR.

233
Automate Your Business Processes Flows

For example, your filters check whether a case’s Type equals Problem (1), Type equals Feature Request (2), and Escalated equals true
(3). At run time, the filters are combined to (1 OR 2) AND 3.

• You can't reference a screen flow from an autolaunched flow.

SEE ALSO:
Schedule Triggers for Flows That Run for Batches of Records
Emails About Flow Errors
Flow Operations and Read-Only Fields
Troubleshooting Considerations for Flows

Record-Triggered Flow Considerations


A record-triggered autolaunched flow makes additional updates to the triggering record before or
EDITIONS
after it's saved to the database. Understand the considerations and special behaviors of flows that
make before- and after-save updates. Available in: both Salesforce
You can't reference a screen flow from an autolaunched flow. Classic and Lightning
Experience
These considerations apply to record-triggered flows that are optimized for fast field updates
(before-save). Available in: Essentials,
• The flow can’t perform actions other than updating the triggering record’s field values. Professional, Enterprise,
Performance, Unlimited,
• The flow can’t update values in records that are related to the triggering record. and Developer Editions
• Only these elements are supported: Assignment, Decision, Get Records, and Loop.
• The View All Data permission is required to activate an autolaunched flow that has a trigger.
• If an object has multiple active record-triggered flows that are configured to run before the record is saved, we can't guarantee the
order in which those flows are executed.

SEE ALSO:
Record Triggers for Flows That Make Before-Save Updates

Flow Data Considerations


When designing flows, keep these data considerations in mind.
EDITIONS
• If you delete a record variable or record collection variable, variable assignments that use the
deleted variable are set to null. Available in: both Salesforce
• At run time, time zones for date/time values can differ from what you see in Flow Builder. During Classic and Lightning
Experience
run time, date/time values reflect the time zone settings of the user who’s running the flow.
• For flows that interact with the Salesforce database, make sure that your users have permission Available in: Essentials,
to create, read, edit, and delete the relevant records and fields. Otherwise, users receive an Professional, Enterprise,
insufficient privileges error when they try to launch a flow. For example, a flow looks up and Performance, Unlimited,
updates a case record’s status. The flow users must have Read and Edit permissions on the and Developer Editions
Status field of the Case object.
• When a process or flow launches another flow, that flow’s input variables can be assigned values
during the launch. However, for a text, picklist, or multi-select picklist variable that isn’t a collection, a value of null is converted
to an empty string.
• Storing field values automatically in the Get Record element is available only for screen flows and autolaunched flows.

234
Automate Your Business Processes Flows

Flow Lightning Runtime Considerations


When running flows, keep these considerations in mind.
EDITIONS
Note: In Lightning runtime, flow users always run the active flow version. Flow admins with
the Manage Flow permission run the latest flow, so they can test the latest flow version Available in: both Salesforce
without activating it for flow users. A flow admin also runs the latest flow version that is Classic and Lightning
Experience
referenced via a Subflow element.
Available in: Essentials,
Professional, Enterprise,
Flow Interviews
Performance, Unlimited,
A flow interview is an instance of a flow, much like a record is an instance of an object. The flow and Developer Editions
interview can do many things, including look up and manipulate Salesforce data. In an interview,
you can pass data into variables and other resources. The data can come from a variety of sources,
such as Salesforce records that the flow queries, information that a user enters in a screen input field, or something that you manually
enter.
Interviews don’t perform actions—such as sending emails or creating, editing, or deleting records—until the associated transaction is
complete. Transactions are complete when the interview either finishes or executes a Screen, Local Action, or Pause element. In addition
to data elements, the Post to Chatter, Submit for Approval, and Quick Actions core actions also create and update records.
When an interview is in flight, the data in the interview isn’t saved to the Salesforce database. If the flow executes an element that creates
or updates records, such as Update Records or Post to Chatter, only the information configured in that element is saved to the Salesforce
database.
When an interview executes a Pause element or a user pauses it, all the interview data is serialized and saved to the database as a Paused
Flow Interview record. When the interview resumes, the Paused Flow Interview record is deleted.

Limitations of Lightning Runtime for Flows


When Lightning runtime is enabled for your Salesforce org, flows in Lightning Experience don’t load in:
• Web tabs
• List buttons that are set to display an existing window with or without a sidebar
When Lightning runtime is enabled for your org, flows in Salesforce Classic don’t load in custom buttons or links that are set to display
in an existing window with or without a sidebar.
In number input fields, users can enter up to 17 digits, including digits before and after a decimal point.

Flow Runtime Accessibility Considerations


We strive to make the run-time experience of screen flows follow the best practices in Section 508 of the Rehabilitation Act and the
Web Content Accessibility Guidelines (WCAG) 2.0 Level AA. But we have some exceptions.

SEE ALSO:
Lightning Runtime vs. Classic Runtime for Flows
Flow Element: Subflow

235
Automate Your Business Processes Flows

Flow Runtime Accessibility Considerations


We strive to make the run-time experience of screen flows follow the best practices in Section 508
EDITIONS
of the Rehabilitation Act and the Web Content Accessibility Guidelines (WCAG) 2.0 Level AA. But
we have some exceptions. Available in: both Salesforce
If you use screen readers or other assistive technology while running screen flows, consider these Classic and Lightning
known issues. Experience

• The title of the screen doesn’t change when you click Next or Previous, so it’s not always obvious Available in: Essentials,
that you’ve switched to a different page. Professional, Enterprise,
• Flow screen components that don’t have defined labels can’t be read properly by assistive Performance, Unlimited,
technology. and Developer Editions

• Unless you use the ARIA alert role or another method of identifying errors for assistive technology,
these types of custom error messages can’t be detected by assistive technology.
– Error messages that are text components with conditional visibility
– Error messages that are displayed for components when the associated Validate Input formula expression evaluates to false

• Screen readers base pronunciation on their language setting. When that language setting differs from the flow’s language, screen
readers can’t correctly read the flow screens. This limitation affects flows run from:
– Run and Debug buttons in Flow Builder
– URLs
– Custom buttons and links
– Web tabs

• Error messages for some Salesforce-provided components aren’t associated with their corresponding input fields. This limitation
means that screen readers can’t read error messages associated with them. Affected Salesforce-provided components:
– Dependent Picklists
– Email
– Lookup
– Phone
– Toggle
– URL

• When a user doesn’t complete a required field in a Dependent Picklists component, the resulting error messages can’t be read by
screen readers or other assistive technology. Sometimes, one of the error messages is announced one time, but later attempts to
focus on the field don’t cause the error message to be announced again.
• When a user clicks Finish in the Resume window from the Paused Flow Interviews Lightning component on a desktop (LEX), focus
isn’t set to the Refresh icon button.
• When a flow screen is initially displayed, the focus is set to the first visible screen field. Exceptions:
– If the flow screen contains an error, the focus is set to the first field with an error.
– If the flow screen contains only Display Text components, the focus is set to the first navigation button, such as Previous, Next,
or Finish.

236
Automate Your Business Processes Flows

• When screen components or their parts are rendered after the screen is initially displayed, they’re never focusable. For example, if
a component asynchronously fetches a list of tasks to display, the focus can’t be set to any of the tasks. If a screen component uses
conditional visibility and appears only after user input, the focus can’t be set to any part of the screen component.

SEE ALSO:
Flow Limits and Considerations
Flow Screen Input Component: Display Image

Flow Management Considerations


When managing flows, consider the administration and activation limits.
EDITIONS
Activating Flows
When you activate a new version of a flow, the previously activated version (if one exists) is Available in: both Salesforce
automatically deactivated. Any running flow interview continues to run using the version with Classic and Lightning
which it was initiated. Experience

Deleting Flows Available in: Essentials,


To delete an active flow version, first deactivate it. If a flow has paused interviews, it can’t be Professional, Enterprise,
deleted until those interviews are finished or deleted. You can delete flows that have never Performance, Unlimited,
been activated at any time. and Developer Editions
Flow Type
If a flow has versions with different types, the active (or latest) version determines the flow type.

SEE ALSO:
Flow Limits and Considerations

Packaging Considerations for Flows


Keep these considerations in mind when you add a flow to a package.
EDITIONS

Creating Packages Available in: both Salesforce


Classic and Lightning
• If you plan to deploy a flow with change sets, consider limitations in migration support. Make Experience
sure your flows reference only fields and components that are available in packages.
• Referential integrity works the same for flows as it does for other packaged elements. Available in: Essentials,
Professional, Enterprise,
• If any of the following elements are used in a flow, packageable components that they reference Performance, Unlimited,
aren’t included in the package automatically. To deploy the package successfully, manually add and Developer Editions
those referenced components to the package.
– Post to Chatter
– Send Email
– Submit for Approval
For example, if you deploy a flow that posts to a particular Chatter group, manually add the referenced Chatter group to the package.
• If a flow references a Lightning component that depends on a CSP Trusted Site, the trusted site isn’t included in the package
automatically.
• Salesforce determines the active version of the flow when you upload a package version. If none of the flow's versions are active,
Salesforce packages the latest version.

237
Automate Your Business Processes Flows

Updating Packages
• To update a managed package with a different flow version, activate that version and upload the package again. It isn’t necessary
to add the newly activated version to the package. However, if you activate a flow version by mistake and upload the package, that
flow version is distributed to everyone. Be sure to verify which version you really want to upload.
• Flow installed from an unlocked package with the same API name overrides the existing flow in the target org.
• You can’t include flows in package patches.

Other Limitations
• Flow Builder displays Apex actions from managed packages only if the associated method is marked global.
• Flow Builder displays email alerts from managed packages only if the email alert isn’t protected.
• If you register your namespace after you referenced a flow in a Visualforce page or Apex code, don’t forget to add the namespace
to the flow name. Otherwise, the package fails to install.
• If someone installs a flow from a managed package, error emails for that flow’s interviews don’t include any details about the individual
flow elements. The email is sent to either the user who installed the flow or the Apex exception email recipients.
• Flow triggers aren’t packageable.
The pilot program for flow trigger workflow actions is closed. If you've already enabled the pilot in your org, you can continue to
create and edit flow trigger workflow actions. If you didn't enable the pilot in your org, use the Flows action in Process Builder instead.

• In a development org, you can’t delete a flow after you upload it to a released or beta managed package.
• Images in rich text for screens are not supported in packages.

Change Set Considerations for Flows


Keep these considerations in mind when you create or deploy a change set with flows.
EDITIONS

Creating Change Sets Available in: both Salesforce


Classic and Lightning
• If you plan to deploy a flow with change sets, consider limitations in migration support. Make Experience
sure your flows reference only fields and components that are available in change sets.
• When you view the dependent components for the change set, the Component Dependencies Available in: Essentials,
Professional, Enterprise,
page lists the dependencies for all versions of the flow. Add all interdependent components
Performance, Unlimited,
for the relevant flow version to the outbound change set.
and Developer Editions
• If a component is referenced by the following flow elements, the Component Dependencies
page doesn’t display that component. To deploy the flow successfully, manually add those
referenced components to the change set.
– Post to Chatter
– Send Email
– Submit for Approval
For example, if you deploy a flow that includes a Submit for Approval element, manually add the referenced approval process.
• If a flow references a Lightning component that depends on a CSP Trusted Site, the trusted site isn’t included in the change set
automatically.

Deploying Change Sets


• You can include only one version of a flow in a change set.

238
Automate Your Business Processes Flows

• An active flow in a change set is deployed to its destination as inactive. Activate the flow manually after deployment.
• If the flow has no active version when you upload the outbound change set, the latest inactive version is used.
• Deploying or redeploying a flow with change sets creates a version of the flow in the destination organization.

Flow Triggers
• Flow triggers aren’t available in change sets.
• The pilot program for flow trigger workflow actions is closed. If you've already enabled the pilot in your org, you can continue to
create and edit flow trigger workflow actions. If you didn't enable the pilot in your org, use the Flows action in Process Builder instead.

SEE ALSO:
Deploy Processes and Flows as Active

Considerations for Installed Flows


Keep these considerations in mind when you distribute, upgrade, or remove a flow that you installed
EDITIONS
from a package.
• Flow Builder can’t open flows that are installed from managed packages, unless they’re templates. Available in: both Salesforce
• If you install a managed package that contains multiple flow versions in a fresh destination org, Classic and Lightning
only the latest flow version is deployed. Experience

• If you install a non-template flow from a managed package, error emails for that flow’s interviews Available in: Essentials,
don’t include any details about the individual flow elements. The email is sent to either the user Professional, Enterprise,
who installed the flow or the Apex exception email recipients. Performance, Unlimited,
and Developer Editions
• If you install a flow from an unmanaged package that has the same name but a different version
number as a flow in your org, the newly installed flow becomes the latest version of the existing
flow. However, if the packaged flow has the same name and version number as a flow already
in your org, the package install fails. You can’t overwrite a flow.
• If you install a flow from an unlocked package that has the same name as a flow in your org, the newly installed flow overrides the
existing flow.
Status
An active flow in a package is active after it’s installed. The previous active version of the flow in the destination org is deactivated
in favor of the newly installed version. Any in-progress flows based on the now-deactivated version continue to run without
interruption but reflect the previous version of the flow.
Distributing Installed Flows
• When you create a custom button, link, or web tab for a flow that’s installed from a managed package, include the namespace
in the URL. The URL format is /flow/namespace/flowuniquename.
• When you embed a flow that’s installed from a managed package in a Visualforce page, set the name attribute to this format:
namespace.flowuniquename.
Upgrading Installed Flows
Upgrading a managed package in your org installs a new flow version only if there’s a newer flow version from the developer. After
several upgrades, you can end up with multiple flow versions.
Removing Installed Flows
• You can’t delete a flow from an installed package. To remove a packaged flow from your org, deactivate it and then uninstall
the package.

239
Automate Your Business Processes Flows

• You can’t delete flows from Managed - Beta package installations in development org.
• If you have multiple versions of a flow installed from multiple unmanaged packages, you can’t remove only one version by
uninstalling its package. Uninstalling a package—managed or unmanaged—that contains a single version of the flow removes
the entire flow, including all versions.
• Delete flows from an unlocked package manually—you can’t delete them by removing them from the unlocked package.
Translating Installed Flows
You can translate flow definition names only on the Translate page.

SEE ALSO:
Considerations for Deploying Flows with Packages
ISVforce Guide: Installing a Package
Control Who Receives Flow and Process Error Emails

Troubleshooting Considerations for Flows


Before you use the debug option in Flow Builder, understand its limitations and special behaviors.
EDITIONS
Note: Be careful when debugging flows that contain delete elements. Even if the flow is
inactive, it triggers the delete operation. Available in: both Salesforce
Classic and Lightning
Experience
Debugging a Flow
Available in: Essentials,
• If you debug a flow without choosing to run the flow in rollback mode, the flow performs its Professional, Enterprise,
actions, including any DML operations and Apex code execution. Remember, closing or restarting Performance, Unlimited,
a running flow doesn’t roll back its previously executed actions, callouts, and changes committed and Developer Editions
to the database.
• You can’t pass values into input variables of type collection, record, and record collection.
• Clicking Pause or executing a Pause element closes the flow and ends debugging.
• When you click Finish in a flow, the debug details incorrectly state “Selected Navigation Button: NEXT.”
• When you debug a schedule-triggered flow, the flow starts only for one record.

Tracking More Information About a Flow Interview


• To store more information about an interview when it’s saved as a Salesforce record, build a custom object that references the
interview’s GUID. An interview is assigned an 18-character Salesforce ID only when it’s paused and saved as a Salesforce record. Each
interview, whether in-flight or paused, has a GUID.

Troubleshooting Stages
The flow error email doesn’t specify the values of $Flow.ActiveStages and $Flow.CurrentStage at the start of an
interview. To confirm what the initial values are, add temporary elements to display the initial values, such as in a screen display text
field.

240
Automate Your Business Processes Flows

Flow Reference
Bookmark this page for quick access to information about flow elements, resources, events, and
EDITIONS
more.
Available in: both Salesforce
Flow Resources Classic and Lightning
Each resource represents a value that you can reference throughout the flow. Experience

Flow Elements Available in: Essentials,


Each element represents an action that the flow can execute. Examples include reading or Professional, Enterprise,
writing Salesforce data, displaying information and collecting data from flow users, executing Performance, Unlimited,
business logic, or manipulating data. and Developer Editions

Provided Flow Screen Components


Salesforce provides several screen components that extend the types of input fields available in screens.
Flow Connectors
Connectors determine the available paths that a flow can take at run time. On the canvas in Flow Builder, a connector looks like an
arrow that points from one element to another.
Flow Operators
Operators behave differently, depending on what you’re configuring. In Assignment elements, operators let you change resource
values. In conditions and filters, operators let you evaluate information and narrow the scope of a flow operation.
Flow Version Properties
A flow version’s properties consist of its label, description, interview label, and type. These properties drive the field values that appear
on the flow’s detail page.

Flow Resources
Each resource represents a value that you can reference throughout the flow.
EDITIONS
In Flow Builder, the Manager panel displays the resources that are available in the flow.
Available in: both Salesforce
You can create some resources by clicking New Resource. Some resources, such as global constants
Classic and Lightning
and global variables, are provided by the system. Other resources are automatically created when
Experience
you add an element to a flow. For example, when you add a Decision element, a resource for each
decision outcome is automatically created. Available in: Essentials,
Professional, Enterprise,
Flow Description Creatable from Performance, Unlimited,
Resource the Resources Tab and Developer Editions

Actions Output values that are stored automatically from Action


elements.

Choice Create a choice option to use in a screen component, such as


a Radio Buttons or Multi-Select Picklist component.

Collection Generate a set of choices by using an existing collection of


Choice records.
Set

Constant Store a fixed value that can be used but not changed
throughout a flow.

241
Automate Your Business Processes Flows

Flow Description Creatable from the


Resource Resources Tab
Decision When you add a Decision element to a flow, its outcomes are available as Boolean
Outcome resources. If an outcome path has already been executed in the flow interview, the
resource’s value is True.

Element Any element that you add to a flow is available as a resource with the was visited
operator in decision outcome criteria. An element is considered visited when it’s
executed in the flow interview.
Any element that you add to a flow that supports a fault connector is available as a
Boolean resource. If the element is already successfully executed in the flow interview,
the resource’s value is True. If the element wasn’t executed or was executed and
resulted in an error, the resource’s value is False.

Formula Calculate a value when the formula is used in the flow.

Global Fixed, system-provided values, such as EmptyString, True, and False.


Constant

Global Variable System-provided variables that reference information about the Salesforce org or
running user, such as the user’s ID or the API session ID.

Pause When you add a Pause element to a flow, its configurations are available as Boolean
Configuration resources. If a configuration’s pause conditions are met, the resource’s value is True.
If the configuration has no pause conditions set, the resource’s value is always True.

Picklist Choice Generate a set of choices by using the values of a picklist or multi-select picklist field.
Set

Picklist Values System-provided values for picklist fields in record variables and record collection
variables. Available only for Assignment elements and conditions.

Record Choice Generate a set of choices by using a filtered list of records.


Set

Screen Any screen component that you add to a flow is available as a resource. The resource
Component value depends on the type of screen component. The value for a Text component is
what the user enters. The value for a Picklist component is the stored value of the
choice that the user selects. The value for a Display Text component is the text that’s
displayed to the user.

Stage Represent the user’s progress throughout the flow. To identify which stages are
relevant to the user throughout the flow, assign the stages to the stage system
variables.

Text Template Store text that can be changed and used throughout the flow.

Variable Store a value that can be used or changed throughout the flow.

SEE ALSO:
Flow Builder

242
Automate Your Business Processes Flows

Flow Resource: Choice


Create a choice option to use in a screen component, such as a Radio Buttons or Multi-Select Picklist
EDITIONS
component.
Available in: both Salesforce
Field Description Classic and Lightning
API Name An API name can include underscores and alphanumeric characters without Experience
spaces. It must begin with a letter and can’t end with an underscore. It also Available in: Essentials,
can’t have two consecutive underscores. Professional, Enterprise,
Performance, Unlimited,
Description Helps you differentiate this choice from other resources.
and Developer Editions
Choice Label A user-friendly label for the choice.

Data Type Controls which screen components this choice can be used in. For example,
you can’t use a Text choice in a Currency radio button. You can’t change the
data type of a previously saved choice.

Choice Value If the user selects this choice, the screen component is set to this value.
Exceptions:
• If no choice value is configured, the screen component is set to the
choice label.
• If the choice value references a formula resource, the screen component
is set to the choice label.

Display text Displays a text input component below the choice. This option isn’t available
input if the choice’s data type is Boolean.

Configure Text Input


These fields appear when you select Display text input.

Field Description
Input A user-friendly label for the text input component.
Label

Require Requires the user to enter a value in the text input component before progressing or finishing the flow.

Validate Evaluates whether the user entered an acceptable value.

Error If the user didn’t enter an acceptable value, this message displays under the text input component. Available only
Message when Validate is selected.

Formula Boolean formula expression that evaluates whether the user entered an acceptable value. Available only when
Validate is selected.

Example: To let users choose a particular service level, create choices for Gold, Silver, and Bronze. In a screen, display the choices
with a description of the features included. Then, in the same screen, let the user choose from a Radio Buttons screen component.

243
Automate Your Business Processes Flows

Formatting Choices
• Add rich text formatting using the toolbar.
• If you open the Display Text screen component, Choice resource labels, help text, Pause confirmation screens, or input validation,
Flow Builder converts existing HTML to rich text. Unsupported HTML is removed. The following HTML tags are converted to rich text:
<a>, <b>, <br>, <font>, <i>, <li>, <p>, <span>, <u>, and <div>. HTML that is pasted into the rich text editor is not supported.

SEE ALSO:
Flow Resources
Provided Flow Screen Components
Choice Resources for Flow Screen Components

Flow Resource: Collection Choice Set


Generate a set of choices by using an existing collection of records.
EDITIONS
Field Description Available in: both Salesforce
API Name The requirement for uniqueness applies only to elements within the Classic and Lightning
current flow. Two elements can have the same API name, provided they're Experience
used in different flows. An API name can include underscores and Available in: Essentials,
alphanumeric characters without spaces. It must begin with a letter and Professional, Enterprise,
can’t end with an underscore. It also can’t have two consecutive Performance, Unlimited,
underscores. and Developer Editions

Description Helps you differentiate this resource from other resources.

Record The record collection you want to use to generate the choices.
Collection

Configure Each Choice


For each record that meets the filter conditions, the flow creates a choice using values from the record. Identify which fields to use for
each choice’s label and value.

Field Description
Choice Label Determines which field to use as the label for each generated choice. Select a field that enables users
to differentiate between the generated choices.

Tip: Make sure to choose a field that contains data. If the selected field has no value for a given
record, the corresponding choice’s label is blank at run time.

Data Type Data type of the choice’s value. You can’t change the data type of a previously saved collection choice
set.

Choice Value Determines which field’s value to store when the user selects this choice at run time. The value is
determined by the most recent user selection of a choice within the generated set.
Data Type determines the available options. If you don’t select a field as the choice value, the
choice label is used instead.

244
Automate Your Business Processes Flows

Tip: In most cases, set the choice label to Name and the choice value to ID.

Example: Collection choice sets are useful when a flow reuses the same data set over multiple screens. For example, you're
designing a support flow for a company’s IT department that handles support requests related to employee hardware. The flow
references the same employee hardware data over several screens. To get the employee hardware information, use a Get Records
action, which populates a record collection. To define the conditions relevant to the support request, use a collection filter on the
record collection. Next, to display the user choices, add a collection choice set that uses the filtered collection. Create a relevant
collection filter and collection choice set for each branch of the support flow.
With collection choice sets, the server is queried only when the Get Records element is first executed. In comparison, record choice
sets require a server query with each use.

SEE ALSO:
Provided Flow Screen Components
Choice Resources for Flow Screen Components
Flow Resources

Flow Resource: Constant


Store a fixed value that can be used but not changed throughout a flow.
EDITIONS
Field Description Available in: both Salesforce
API Name The requirement for uniqueness applies only to elements within the Classic and Lightning
current flow. Two elements can have the same API name, provided they're Experience
used in different flows. An API name can include underscores and Available in: Essentials,
alphanumeric characters without spaces. It must begin with a letter and Professional, Enterprise,
can’t end with an underscore. It also can’t have two consecutive Performance, Unlimited,
underscores. and Developer Editions

Description Helps you differentiate this constant from other resources.

Data Type Determines the type of value that the constant can store. You can’t change
the data type of a previously saved constant.

Value The constant’s value. This value doesn’t change throughout the flow.

SEE ALSO:
Flow Resources

245
Automate Your Business Processes Flows

Flow Resource: Formula


Calculate a value when the formula is used in the flow.
EDITIONS
Field Description Available in: both Salesforce
API Name The requirement for uniqueness applies only to elements within Classic and Lightning
the current flow. Two elements can have the same API name, Experience
provided they're used in different flows. An API name can include Available in: Essentials,
underscores and alphanumeric characters without spaces. It must Professional, Enterprise,
begin with a letter and can’t end with an underscore. It also can’t Performance, Unlimited,
have two consecutive underscores. and Developer Editions

Description Helps you differentiate this formula from other resources.

Data Type The data type for the value returned by the formula. You can’t
change the data type of a previously saved variable.

Decimal Places Controls the number of digits to the right of the decimal point up
to 17 places. If you leave this field blank or set it to zero, only whole
numbers appear when your flow runs.
Available only when the data type is Number or Currency.

Formula The formula expression that the flow evaluates at run time. The
returned value must be compatible with Data Type.

Note: Some formula functions aren’t supported in Flow


Builder.

SEE ALSO:
Formula Operators and Functions by Context
Which Functions Aren’t Supported in Flow Formulas?
Flow Resources

Flow Resource: Global Variables


System-provided variables that reference information about the Salesforce org or running user,
EDITIONS
such as the user’s ID or the API session ID.

Example: Use {!$User.Id} to access the ID of the user who’s running the flow interview. Available in: both Salesforce
Classic and Lightning
Experience
Global Description
Variable Available in: Essentials,
Professional, Enterprise,
$Api References an API URL or the session ID. The following merge fields are Performance, Unlimited,
available. and Developer Editions
• Enterprise_Server_URL_xxx—The Enterprise WSDL SOAP
endpoint, where xxx represents the API version.
• Partner_Server_URL_xxx—The Partner WSDL SOAP endpoint,
where xxx represents the API version.

246
Automate Your Business Processes Flows

Global Variable Description

• Session_ID

$Client Available only in Lightning Scheduler flows and supported only in Decision elements.
$Client.FormFactor is automatically set to Large (desktop), Medium (tablet), or Small
(phone), depending on the device that’s running the flow. As you build a flow, use a Decision element to
create separate paths for large, medium, and small devices. In each path, use screens that are optimized for
that path’s device form factor.

$Flow References information about the running flow interview. For details, see Flow Resource: $Flow Global
Variables.

$Label References custom labels. This global variable appears only if your org has custom labels.
The returned value depends on the language setting of the contextual user. The value returned is one of
the following, in order of precedence:
1. The local translation’s text
2. The packaged translation’s text
3. The primary label’s text

$Organization References information about your company.

$Permission References information about the current user’s custom permission access.

$Profile References information from the current user’s profile, such as license type or name.

Tip:
• Use profile names to reference standard profiles in $Profile merge fields.
• Users don’t need access to their profile information to run a flow that references these merge
fields.

$Record Available only in autolaunched flows with triggers.


In a record-triggered flow, the $Record global variable contains the triggering record’s values. You can
reference and change $Record values throughout the flow.
• If the flow runs before the record is saved to the database, Salesforce automatically applies any changed
$Record values to the record in the database.
• If the flow runs after the record is saved to the database, use an Update Records element to apply changed
$Record values to the record in the database.
A schedule-triggered flow starts at the specified time and frequency for a batch of records. A flow interview
runs for each record in the batch and stores all of the record’s field values in the $Record global variable.
You can reference and change these values throughout the flow. If you configure an Update Records element
to use the ID and all field values from the $Record global variable, enable Filter inaccessible
fields from flow requests in your org’s process automation settings. Otherwise, the flow fails
because the Update Records element tries to set the values for system fields and other read-only fields.

247
Automate Your Business Processes Flows

Global Variable Description


$Record__Prior Available only in record-triggered flows that are configured to run when a record is updated or when a
record is created or updated.
The $Record__Prior global variable contains the values that the triggering record had immediately
before the flow started. You can’t change these values in the flow.
When the flow is triggered by a newly created record, all $Record__Prior values are null.

$Setup References custom settings of type hierarchy. This global variable appears only if your org has hierarchy
custom settings. You can access custom settings of type list only in Apex.
Hierarchical custom settings allow values at these levels.
• Organization—The default value for everyone
• Profile—Overrides the Organization value
• User—Overrides the Organization and Profile values
Salesforce determines the correct value for this custom setting field based on the running user’s current
context.

$System $System.OriginDateTime represents the literal value of 1900-01-01 00:00:00. Use this
merge field to perform date/time offset calculations.

$User References information about the user who’s running the flow interview. For example, reference the user’s
ID or title.

Tip:
• The current user is the person who caused the flow to start.
• When a flow is started because a Web-to-Case or Web-to-Lead process changed a record, the
current user is the Default Lead Owner or Default Case Owner.

$User.UITheme and $User.UIThemeDisplayed identify the look and feel that the running user
sees on a Salesforce page. The difference between the two variables is that $User.UITheme returns the
look and feel the user is supposed to see, while $User.UIThemeDisplayed returns the look and feel
the user actually sees. For example, a user can have the preference and permissions to see the Lightning
Experience look and feel, but if they’re using a browser that doesn’t support that look and feel, for example,
older versions of Internet Explorer, $User.UIThemeDisplayed returns a different value. These merge
fields return one of these values.
• Theme1—Obsolete Salesforce theme
• Theme2—Salesforce Classic 2005 user interface theme
• Theme3—Salesforce Classic 2010 user interface theme
• Theme4d—Modern “Lightning Experience” Salesforce theme
• Theme4t—Salesforce mobile app theme
• Theme4u—Lightning Console theme
• PortalDefault—Salesforce Customer Portal theme
• Webstore—AppExchange theme

248
Automate Your Business Processes Flows

Global Variable Description


$UserRole References information about the current user’s role, such as the role name or ID.

Tip:
• The current user is the person who caused the flow to start.
• When a flow is started because a Web-to-Case or Web-to-Lead process changed a record, the
current user is the Default Lead Owner or Default Case Owner.

Global Variable Considerations for Flows


• $Flow is the only global variable available in screen component visibility conditions.
• In a record-triggered flow, the $Record global variable doesn’t contain the triggering record’s values for fields whose values are
derived from other records. Examples of derived fields include Contact.Name and User.MediumPhotoUrl.
• Multi-select picklist, time, and location global variables are available only in formulas.
• If a field in the database has no value, the corresponding merge field returns a blank value. For example, if no value is set for your
org’s Country field, {!$Organization.Country} returns no value.
• $Label global variables take longer to load in the flow resource selection list. When selecting a $Label global variable, if the
$Label option isn’t visible in the flow resource selection list, close the window and try again in a few minutes.

SEE ALSO:
Flow Operations and Read-Only Fields
Salesforce Data Considerations for Flows

Flow Resource: $Flow Global Variables


A $Flow global variable provides information about the running interview. Some variables contain
EDITIONS
system-provided values. You can update the other variables throughout the flow by using
Assignments or by storing output values in the variables. Available in: both Salesforce
Classic and Lightning
Global Variable Supported Description Value Set By Experience
Resource
Types Available in: Essentials,
Professional, Enterprise,
$Flow.ActiveStages Stage A collection of stages that are Assignment Performance, Unlimited,
relevant to the current path of the and Developer Editions
flow.
For example, each item in a
progress indicator corresponds to
a stage in
$Flow.ActiveStages.

$Flow.CurrentDate Text, Date, and Date when the flow interview System
Date/Time executes the element that
references the global variable.

249
Automate Your Business Processes Flows

Global Variable Supported Description Value Set By


Resource Types
$Flow.CurrentRecord Text ID of a related record. The value must be a single Assignment
ID for a valid object. All custom objects and most
standard objects are valid.
When a user pauses the flow interview or the
interview executes a Wait element, the interview
is associated with this record by creating a
FlowRecordRelation record. If the ID isn’t valid,
the interview fails to pause.

$Flow.CurrentStage Stage The currently selected stage. Assignment


For example, the selected item in a progress
indicator corresponds to
$Flow.CurrentStage.

$Flow.CurrentDateTime Text, Date, and Date and time when the flow interview executes System
Date/Time the element that references the global variable.

$Flow.FaultMessage Text System fault message that can help flow System
administrators troubleshoot runtime issues.

$Flow.InterviewGuid Text Unique identifier for the interview. System

$Flow.InterviewStartTime Text, Date, and Date and time when the flow interview started. System
Date/Time For a flow launched by a Subflow element,
$Flow.InterviewStartTime indicates
when the initial master flow started.

Example: A flow is used internally by call center personnel. For each flow element that interacts with the Salesforce database, a
fault connector leads to a screen. A Display Text screen component displays the system fault message and instructs the flow user
to provide that message to the IT department.
Sorry, but you can’t read or update records at this time.
Please open a case with IT, and include the following error message:
{!$Flow.FaultMessage}

Example: If a customer asks to be forgotten, make sure to delete all references to information that could personally identify the
customer, including data in paused flow interviews. When an interview executes a Pause element or is paused by a user, all the
interview data is serialized and saved to the database as a Paused Flow Interview record. When the interview is resumed, the
Paused Flow Interview record is deleted.
To identify which paused interviews include personal data for a contact, lead, or user, build a custom object to track the interview’s
GUID and the affected contact, lead, or user. When an interview references personal data, such as a lead’s email or credit card
number, create a record of the custom object using the lead’s ID and {!$Flow.InterviewGuid}. Before the final screen,
delete all records of the custom object referencing the interview’s GUID. That way, the custom object tracks only interviews that
are saved to the database.

250
Automate Your Business Processes Flows

When a customer asks to be forgotten, create a report that lists all the custom object records where LeadId matches the customer’s
record. Then for each custom object record, delete the flow interview that corresponds to the provided GUID.

SEE ALSO:
Customize What Happens When a Flow Fails
Flow Resources

Flow Resource: Global Constant


Fixed, system-provided values, such as EmptyString, True, and False.
EDITIONS
Global Constant Supported Data Types Available in: both Salesforce
{!$GlobalConstant.True} Boolean Classic and Lightning
Experience
{!$GlobalConstant.False} Boolean
Available in: Essentials,
{!$GlobalConstant.EmptyString} Text Professional, Enterprise,
Performance, Unlimited,
and Developer Editions

Example: When you create a Boolean variable, $GlobalConstant.True and


$GlobalConstant.False are supported. When you create a Currency variable, no
global constants are supported.

Null Versus Empty String


At run time, {!$GlobalConstant.EmptyString} and null are treated as separate, distinct values. For example:
• When you leave a text field or resource value blank, the value is null at run time. If you want the value to be treated as an empty
string, set it to {!$GlobalConstant.EmptyString}.
• For a flow condition, use the is null operator to check whether a value is null. If the condition compares two text variables,
make sure that their default values are either correctly set to {!$GlobalConstant.EmptyString} or left blank (null).

SEE ALSO:
Flow Resources

Flow Resource: Picklist Choice Set


Generate a set of choices by using the values of a picklist or multi-select picklist field.
EDITIONS
Field Description Available in: both Salesforce
API Name The requirement for uniqueness applies only to elements within the Classic and Lightning
current flow. Two elements can have the same API name, provided they're Experience
used in different flows. An API name can include underscores and Available in: Essentials,
alphanumeric characters without spaces. It must begin with a letter and Professional, Enterprise,
can’t end with an underscore. It also can’t have two consecutive Performance, Unlimited,
underscores. and Developer Editions

Description Helps you differentiate this resource from other resources.

251
Automate Your Business Processes Flows

Field Description
Object The object whose fields you want to select from. You can’t change the object for a previously saved
picklist choice set.

Data Type Determines whether you can choose from picklist fields or multi-select picklist fields. You can’t change
the data type of a previously saved picklist choice set.

Field The picklist or multi-select picklist field to use to generate the list of choices.

Sort Order Controls the order that the choices appear in. The choices sort based on the translated picklist value
for the running user’s language.

Example: In a flow that simplifies the process of creating an account, users identify the company’s industry.
Rather than creating one choice for each industry, you add a picklist choice set to the flow and populate a Picklist screen component
with it. When a user runs the flow, the picklist choice set finds all the values in the database for the Industry field (1) on the Account
object (2).

In addition to being easier than the standalone choice resource to configure, a picklist choice set reduces maintenance. When
someone adds options to the Account Industry field, the flow automatically reflects the changes. You don’t have to manually
update the flow.

Considerations
You can’t do the following when using a picklist choice set.
Filter out values that come back from the database.
The flow always displays every picklist value for the field, even if you’re using record types to narrow down the picklist choices in
page layouts.

252
Automate Your Business Processes Flows

Customize the label for each option.


The flow always displays the label for each picklist value.
Customize the stored value for each option.
The flow always stores the API value for each picklist value.
Picklists for Knowledge Articles aren’t supported.

Labels and Values for Translated Fields


When a picklist field has been translated:
• Each choice’s label uses the version of the picklist value in the running user’s language.
• Each choice’s stored value uses the version of the picklist value in the org’s default language.

SEE ALSO:
Provided Flow Screen Components
Choice Resources for Flow Screen Components
Flow Resources

Flow Resource: Record Choice Set


Generate a set of choices by using a filtered list of records.
EDITIONS
Field Description Available in: both Salesforce
API Name The requirement for uniqueness applies only to elements within the Classic and Lightning
current flow. Two elements can have the same API name, provided they're Experience
used in different flows. An API name can include underscores and Available in: Essentials,
alphanumeric characters without spaces. It must begin with a letter and Professional, Enterprise,
can’t end with an underscore. It also can’t have two consecutive Performance, Unlimited,
underscores. and Developer Editions

Description Helps you differentiate this resource from other resources.

Object The object whose records you want to use to generate the choices. You
can’t change the object for a previously saved record choice set.

Filter Object Records


Determines which records are included in the choice set. For example, to generate a list of all accounts in San Francisco, use filters to
include only accounts whose Billing City is San Francisco.

Tip: Without filter conditions, a choice is generated for every record of the selected object. If you don’t apply filter conditions,
make sure to sort the records in ascending or descending order.

Sort Object Records


Determines how to sort the filtered list of records and how many records to include in the choice set.

253
Automate Your Business Processes Flows

Field Description
Sort Order Controls the order that the choices appear in.

Sort By When the sort order is ascending or descending, select the field to order the choices by.

Maximum Number of The maximum number of choices to display for the screen component that uses this record choice
Choices set. By default, the maximum is 200.

Configure Each Choice


For each record that meets the filter conditions, the flow creates a choice using values from the record. Identify which fields to use for
each choice’s label and value.

Field Description
Choice Label Determines which field to use as the label for each generated choice. Select a field that enables users
to differentiate between the generated choices.

Tip: Make sure to choose a field that contains data. If the selected field has no value for a given
record, the corresponding choice’s label is blank at run time.

Data Type Data type of the choice’s value. You can’t change the data type of a previously saved record choice
set.

Choice Value Determines which field’s value to store when the user selects this choice at run time. The value is
determined by the most recent user selection of a choice within the generated set.
Data Type determines the available options. If you don’t select a field as the choice value, the
choice label is used instead.

Store More Object Field Values


When a choice is selected, store field values from the associated record in flow variables that you can reference later.

Note: When a Checkbox Group or Multi-Select Picklist screen component uses a record choice set, only values from the last record
that the user selects are stored in the flow variables. If multiple Checkbox Group or Multi-Select Picklist components on one screen
use the same record choice set, the variable assignments come from the last record selected from all of those components.

Example: In a support flow for a computer hardware manufacturer, users identify a product to find its latest updates. You create
a record choice set that displays all products whose product ID starts with a specific string of characters. However, the flow users
are more likely to know the product’s name than its ID. So for Choice Label, select the field that contains the product name,
and for Choice Value, select the ID field. Elsewhere in the flow, you want to display the associated description. To do so, you
store the Description field value from the user-selected record in a variable.

SEE ALSO:
Flow Operators in Data Elements and Record Choice Sets
Provided Flow Screen Components
Choice Resources for Flow Screen Components
Flow Resources

254
Automate Your Business Processes Flows

Flow Resource: Stage


Represent the user’s progress throughout the flow. To identify which stages are relevant to the user
EDITIONS
throughout the flow, assign the stages to the stage system variables. You can reference stages in
flow logic or in the UI, such as with a progress indicator. For example, in a payment flow, the stages Available in: both Salesforce
are payment details, shipping details, billing details, and order confirmation. Classic and Lightning
Experience
Field Description
Available in: Essentials,
Label A user-friendly label for the stage. Merge fields aren’t supported. Professional, Enterprise,
Performance, Unlimited,
API Name The requirement for uniqueness applies only to elements within the
and Developer Editions
current flow. Two elements can have the same API name, provided they're
used in different flows. An API name can include underscores and
alphanumeric characters without spaces. It must begin with a letter and
can’t end with an underscore. It also can’t have two consecutive
underscores.

Description Helps you differentiate this stage from other resources.

Order Required. Determines how to sort this stage among the other stages in
the flow. The order must be unique among all other stages in the flow.

Active by Adds this stage to {!$Flow.ActiveStages} when an interview


default starts.

Usage
When ordering your stages, leave gaps between the numbers in case you later want to add a stage between two other stages. For
example, if you use 10, 20, and 30 as the order, you can insert a stage at order 15 without updating the original three stages.
Most of the time, stages resolve to the fully qualified name: namespace.flowName:stageName or flowName:stageName.
Stages resolve to the label in:
• Display contexts, such as choice labels and Display Text screen components
• Attributes in screen components that require Lightning runtime

SEE ALSO:
Plan the Stages in Your Flow
Identify the Relevant Stages in Your Flow
Flow Stage Considerations
Flow Resources

Sample Flows That Display Stages


These Online Purchase flows display stages as sections on a progress indicator. Each sample flow displays stages differently based on
how the flow is configured.

Sample Flow That Displays Stages as Breadcrumbs


This Online Purchase flow shows visitors what parts of the flow they have completed by displaying all stages up to the current stage.
This flow displays only the stages that the user has visited.

255
Automate Your Business Processes Flows

Sample Flow That Displays All the Active Stages


This Online Purchase flow shows visitors all active stages and the current stage so that they know what to expect throughout this
flow.

Sample Flow That Displays Stages as Breadcrumbs


This Online Purchase flow shows visitors what parts of the flow they have completed by displaying
EDITIONS
all stages up to the current stage. This flow displays only the stages that the user has visited.
Example Available in: both Salesforce
Classic and Lightning
This flow includes stages for users to review their cart, enter shipping details, enter billing details,
Experience
enter payment details, and confirm their order. Since we’re displaying the stages as breadcrumbs,
only the first stage is active by default. Available in: Essentials,
Professional, Enterprise,
Stage Label Unique Name Order Active by Default Performance, Unlimited,
and Developer Editions
Review Cart Review_Cart 0 Yes

Shipping Details Shipping_Details 1 No

Billing Details Billing_Details 2 No

Payment Details Payment_Details 3 No

Order Confirmation Order_Confirmation 4 No

When the flow starts, Review Cart is automatically set to $Flow.CurrentStage and is the only stage in $Flow.ActiveStages.
Each time the flow moves to a different stage, an Assignment element resets the current stage and adds the new stage to the active
stages.

256
Automate Your Business Processes Flows

Note: This sample uses an Aura component to display the flow’s stages. For details, see Represent Your Flow’s Stages Visually.

The first screen displays only one active stage, which is also the user’s current stage: Review Cart.

Next, the flow moves to a new stage: Shipping Details. To make sure that the active stages and current stage respect the change, the
flow updates the global variables with an assignment.

$Flow.ActiveStages now contains the Review Cart and Shipping Details stages, and $Flow.CurrentStage is set to the
Shipping Details stage.

257
Automate Your Business Processes Flows

Often, a user’s shipping details and billing details are the same. On the Shipping Details screen, the user can indicate that the billing
address is different.

The flow uses the value of the Different Billing Address checkbox to determine where to go next. If the shipping and billing details are
the same, the flow continues to the Payment Details assignment. If the billing and shipping details are different, the flow moves to the
Billing Details assignment.
To make sure that the active stages and current stage respect the change, the flow updates the global variables with an assignment.

Now $Flow.ActiveStages contains the Review Cart, Shipping Details, and Billing Details stages, and $Flow.CurrentStage
is set to the Billing Details stage.

After the shipping and billing details are complete, the flow moves to the Payment Details stage. To make sure that the active stages
and current stage respect that change, the flow updates the global variables with an assignment.

258
Automate Your Business Processes Flows

$Flow.ActiveStages contains the Review Cart, Shipping Details, Billing Details (if the billing and shipping details are different),
and Payment Details stages. The $Flow.CurrentStage global variable is set to the Payment Details stage.

Finally, the flow moves to the last stage: Order Confirmation. To make sure that the active stages and current stage respect the change,
the flow updates the global variables with an assignment.

$Flow.ActiveStages now contains the Review Cart, Shipping Details, Billing Details (if the billing and shipping details are different),
Payment Details, and Order Confirmation stages. The $Flow.CurrentStage global variable is set to the Order Confirmation stage.

Sample Flow That Displays All the Active Stages


This Online Purchase flow shows visitors all active stages and the current stage so that they know
EDITIONS
what to expect throughout this flow.
Example Available in: both Salesforce
Classic and Lightning
This flow includes stages for users to review their cart, enter shipping details, enter billing details,
Experience
enter payment details, and confirm their order. To give users an idea of the steps they’ll go through
in the flow, we’re displaying all the applicable stages when the flow starts. Every user goes through Available in: Essentials,
the Review Cart, Shipping Details, Payment Details, and Order Confirmation stages, so those are all Professional, Enterprise,
active by default. Performance, Unlimited,
and Developer Editions
Not all users enter billing details, because a user's shipping and billing details might be the same.
To insert an optional stage in the flow's active stages, we'll create another flow and reference it by
using a Subflow element

Stage Label Unique Name Order Active by Default


Review Cart Review_Cart 0 Yes

Shipping Details Shipping_Details 1 Yes

259
Automate Your Business Processes Flows

Stage Label Unique Name Order Active by Default


Payment Details Payment_Details 2 Yes

Order Confirmation Order_Confirmation 3 Yes

When the flow starts, Review Cart is automatically set to $Flow.CurrentStage, and $Flow.ActiveStages contains Review
Cart, Shipping Details, Payment Details, and Order Confirmation.
Each time the flow moves to a different stage, an Assignment element resets the current stage.

Note: This sample uses an Aura component to display the flow’s stages. For details, see Represent Your Flow’s Stages Visually.

The first screen displays all active stages and the user’s current stage: Review Cart.

Next, the flow moves to a new stage: Shipping Details. To make sure that the current stage respects the change, the flow updates the
global variable with an assignment. $Flow.CurrentStage is set to the Shipping Details stage.

260
Automate Your Business Processes Flows

Often, a user’s shipping details and billing details are the same. On the Shipping Details screen, the user can indicate that the billing
address is different.

The flow uses the value of the Different Billing Address checkbox to determine where to go next. If the shipping and billing details are
the same, the flow continues to the Payment Details assignment. If the billing and shipping details are different, the flow uses a Subflow
element to reference the Billing Details flow.
The Billing Details flow includes an optional stage for users to enter billing details between shipping and payment details.

Stage Label Unique Name Order Active by Default


Billing Details Billing_Details 1 Yes

When a referenced flow starts, its default active stages are automatically inserted in $Flow.ActiveStages after the current stage.
When the Billing Details flow starts, $Flow.CurrentStage is Shipping Details. The Billing Details stage is inserted into
$Flow.ActiveStages immediately after the current stage. Now $Flow.ActiveStages contains the Review Cart, Shipping
Details, Billing Details, Payment Details, and Order Confirmation stages.
The flow uses an assignment to set the current stage to Billing Details.

261
Automate Your Business Processes Flows

The $Flow.CurrentStage global variable is set to the Billing Details stage.

After the shipping and billing details are complete, the flow moves to the Payment Details stage. To make sure that the current stage
respects that change, the flow updates the system variable with an assignment.

The $Flow.CurrentStage global variable is set to the Payment Details stage.

Finally, the flow moves to the last stage: Order Confirmation. To make sure that the current stage respects the change, the flow updates
the global variable with an assignment.

$Flow.ActiveStages now contains the Review Cart, Shipping Details, Billing Details (if the billing and shipping details are different),
Payment Details, and Order Confirmation stages. The $Flow.CurrentStage global variable is set to the Order Confirmation stage.

262
Automate Your Business Processes Flows

Flow Resource: Text Template


Store text that can be changed and used throughout the flow.
EDITIONS
Field Description Available in: both Salesforce
API Name The requirement for uniqueness applies only to elements within the current Classic and Lightning
flow. Two elements can have the same API name, provided they're used Experience
in different flows. An API name can include underscores and alphanumeric Available in: Essentials,
characters without spaces. It must begin with a letter and can’t end with Professional, Enterprise,
an underscore. It also can’t have two consecutive underscores. Performance, Unlimited,
and Developer Editions
Description Helps you differentiate this text template from other resources.

Text Template The text for the template. To reference information from other resources,
use merge fields.

Rich Text Control the font, size, color, and alignment of text. Add merge fields, HTML
links, bullet points, or numbered lists. Rich text is on by default. Click

to change to Rich Text.

Plain Text Send email core actions use plain text. Some custom actions from
AppExchange or built by Salesforce developers also expect plain text. Click

to change to Plain Text.

Example: You’re designing a flow that registers people for an event. You create a text template that includes a registrant's name,
address, and other information. Then you use the template in an email confirmation that the flow sends when it finishes.

SEE ALSO:
Flow Resources

Flow Resource: Variable


Store a value that can be used or changed throughout the flow.
EDITIONS
Field Description Available in: both Salesforce
Apex Class The Apex class that defines fields for the Apex-defined data type. Only Classic and Lightning
fields with the @AuraEnabled annotation are available in a flow. Experience

Available in: Essentials,


API Name The requirement for uniqueness applies only to elements within the
Professional, Enterprise,
current flow. Two elements can have the same API name, provided they're
Performance, Unlimited,
used in different flows. An API name can include underscores and
and Developer Editions
alphanumeric characters without spaces. It must begin with a letter and
can’t end with an underscore. It also can’t have two consecutive
underscores.

Description Helps you differentiate this variable from other resources.

263
Automate Your Business Processes Flows

Field Description
Data Type Determines the types of values that the variable can store. You can’t change the data type of a previously
saved variable.
The Record data type can store multiple field values for one record. The Apex-defined data type can
store multiple field values for one Apex class.

Tip: Looking for sObject? In Flow Builder, that data type changed to Record.

Allow multiple When selected, the resource is a collection variable. You can store a list of values in collection variables.
values (collection) Collection variables can store only values that are compatible with its data type. When the data type
is Record, the collection variable can only store values for the associated object’s records.
For example, store multiple email addresses in a collection variable, and reference the collection
variable to send an email.

Object The object whose field values you can store in the variable. You can’t change the object of a previously
saved variable.
Available only when the data type is Record.

Decimal Places Controls the number of digits to the right of the decimal point up to 17 places. If you leave this field
blank or set it to zero, only whole numbers appear when your flow runs.
Available only when the data type is Number or Currency.

Availability Outside When a variable is available for input, it can be set at the start of the flow, such as when a flow is started
the Flow from a Lightning page, a process, or another flow. When a variable is available for output, it can be
accessed throughout the flow, such as by a Lightning web component or another flow.
The default value of the field depends on the release or API version in which the variable is created.
• If the variable was created in Summer ’12 or later, or in API version 25.0 or later, by default the
variable isn’t available for input or output.
• If the variable was created in Spring ’12 or earlier, or in API version 24.0 or earlier, by default the
variable is available for both input and output.

Warning: Disabling input or output access for an existing variable can break the functionality
of applications and pages that call the flow and access the variable. For example, you can access
variables from URL parameters, processes, and other flows.
This field doesn’t affect how variables are assigned or used within the same flow, for example, through
these types of elements: Assignment, Create Records, Get Records, and Apex Action.

264
Automate Your Business Processes Flows

Field Description
Default Value Determines the variable value when the flow starts. If you leave this field blank, the value is null.
Not available for Picklist and Multi-Select Picklist variables.

SEE ALSO:
Sample Flow That Loops Through a Collection
Flow Element: Loop
Flow Operators in Assignment Elements
Flow Resources

Add Values to a Collection Variable


After you create a collection variable, populate it with values to reference throughout your flow.
EDITIONS
You can’t use a Get Records element to populate a collection variable, but there are some
workarounds. Available in: both Salesforce
To use values from outside the flow, make sure that the collection variable is available for input. Classic and Lightning
When the values come from outside the flow, the values can be set only when the flow interview Experience
starts.
Available in: Essentials,
Professional, Enterprise,
To add values that are Do this... For more information Performance, Unlimited,
stored in a... and Developer Editions
Screen component Add the field’s entered or • Screen components
stored value to a collection
• Assignments
variable by using an
Assignment element.

Variable Add the variable’s stored value • Variables


to a collection variable by using
• Assignments
an Assignment element.

Record variable Add one of the record variable’s • Variables


stored field values to a
• Assignments
collection variable by using an
Assignment element.

Record collection variable Loop through the record • Variables


collection variable. Within the
• Loops
loop, add one of the loop
variable’s stored field values to • Assignments
a collection variable by using
an Assignment element.

265
Automate Your Business Processes Flows

Sample Flow That Populates a Collection Variable


Populate a collection variable by populating a record collection variable. Then individually assign
EDITIONS
the record collection variable’s values to the collection variable.
Scenario Available in: both Salesforce
Classic and Lightning
In this scenario, you’re designing a flow to send an email to every employee who lives in San
Experience
Francisco.
The Send Email core action lets you easily send emails from a flow. However, the Recipients parameter Available in: Essentials,
only accepts text variables and text collection variables. Since multiple users live in San Francisco, Professional, Enterprise,
Performance, Unlimited,
use a collection variable (rather than entering the email address for each individual user).
and Developer Editions
You can't use a Get Records element to populate collection variables. First populate a User-based
record collection variable with field values, including Email, from the employees who live in San
Francisco. Then add those emails to the collection variable.
Once the collection variable is populated, you simply use the collection variable as the value for the Send Email element’s Email
Addresses (collection) parameter.

Example: This flow already contains these resources.


• A User-based record collection variable called employeesInSF
• A User-based record variable called loopVariable
• A Text-based collection variable called emails_employeesInSF

266
Automate Your Business Processes Flows

The example flow:


1. Finds all user records whose City is "San Francisco" and populates employeesInSF with those records’ Email.
2. Loops through the record collection variable so that it can look at each individual user record. The loop copies the values of
each item in employeesInSF to loopVariable.
3. For each iteration, assigns the user's Email to a collection variable that has a Data Type of Text.
4. When the loop ends, the flow sends an email to the users whose emails are now stored in emails_employeesInSF.

SEE ALSO:
Add Values to a Collection Variable

Flow Elements
Each element represents an action that the flow can execute. Examples include reading or writing
EDITIONS
Salesforce data, displaying information and collecting data from flow users, executing business
logic, or manipulating data. Available in: both Salesforce
Flow Builder gives you the option of building flows in free-form or in auto-layout. In free-form, the Classic and Lightning
Elements tab shows the types of elements that you can add to the flow by dragging them onto Experience
the canvas. In auto-layout, click to display the types of elements that you can add. For a list of Available in: Essentials,
all elements that were already added to the flow, see the Elements section of the Manager tab. Professional, Enterprise,
Performance, Unlimited,
Flow Element: Apex Action and Developer Editions
Call an Apex class. Apex classes are available as Apex actions only if one of the methods is
annotated with @InvocableMethod.
Flow Element: Apex Action (Legacy)
Call an Apex class that uses a legacy Apex interface. Apex classes are available as legacy Apex actions only if the Process.Plugin
interface has been implemented.
Flow Element: Assignment
Set values in variables, collection variables, record variables, record collection variables, and global variables.
Flow Element: Collection Filter
Apply criteria to a collection, and output only the items that meet the criteria.
Flow Element: Collection Sort
Reorder the items within a collection. Set the maximum number of items that remain in the collection after the sort.
Flow Element: Core Action
Perform an action outside of the flow. Choose from standard actions, like Post to Chatter or Send Email, and your org’s quick actions
and local actions.
Flow Element: Create Records
Create multiple Salesforce records by using a record collection variable. Create exactly one Salesforce record by using a record variable
or other values from the flow.
Flow Element: Get Records
Find Salesforce records that meet filter conditions, and store values from the records in variables.

267
Automate Your Business Processes Flows

Flow Element: Decision


Evaluate a set of conditions, and route users through the flow based on the outcomes of those conditions. This element performs
the equivalent of an if-then statement.
Flow Element: Delete Records
Identify Salesforce records to delete by using the IDs stored in a record variable or record collection variable, or by specifying conditions.
Flow Element: Email Alert
Send an email by using a workflow email alert to specify the email template and recipients. The flow provides only the record ID.
Flow Element: Loop
Start a loop path for iterating over items in a collection variable. For each iteration, the flow temporarily stores the item in the loop
variable. To execute actions on each item’s field values, use other elements in the loop.
Flow Element: Pause
If pause conditions are met, pause the flow interview. Resume when a specified time occurs or when the flow interview receives a
platform event message.
Flow Element: Recommendation Assignment
Generate Einstein Next Best Action recommendations by combining data from records in the recommendation object, records in
other objects, values in collections, and manually entered values.
Flow Element: Screen
Collect information from users who run the flow or show them some information.
Flow Element: Start
Connect the Start element to the flow element that you want to execute first at run time. In an autolaunched flow, you can open
the Start element to add a trigger that launches the flow. Without a trigger, you must set up other things to invoke the autolaunched
flow, such as custom buttons, processes, Apex classes, or Einstein Bots.
Flow Element: Subflow
Launch another flow that’s available in your org. A flow that is launched by another flow is called the referenced flow.
Flow Element: Update Records
Identify Salesforce records to update, and set the values to change in those records. To do so, use the IDs and field values stored in
a record variable or record collection variable, or use specify conditions to identify the records and set the field values individually.

SEE ALSO:
Flow Resources
Flow Builder
Add and Edit Elements

268
Automate Your Business Processes Flows

Flow Element: Apex Action


Call an Apex class. Apex classes are available as Apex actions only if one of the methods is annotated
EDITIONS
with @InvocableMethod.
Add an Action element to the flow. In the Action field, select the Apex action that you want to Available in: both Salesforce
configure. For details about creating Apex actions, see “InvocableMethod Annotation” in the Classic (not available in all
Apex Developer Guide. orgs) and Lightning
Experience

Set Input Values Available in: Enterprise,


Performance, Unlimited,
Use values from earlier in the flow to set the inputs for the Apex action.
and Developer Editions
Apex actions don’t support lookup fields in record variables as input values.

Store Output Values


To reference output values that are stored automatically, specify the API name of the Action element. To store the action’s output values
manually, select Manually assign variables (advanced). The values are assigned when the code is executed.

Usage
If a flow invokes Apex, the running user must have the corresponding Apex class assignment in their profile or permission set.
If the invoked method creates, updates, or deletes a record, that action isn’t performed until the interview’s transaction completes.
Transactions are complete when the interview either finishes or executes a Screen, Local Action, or Pause element.
Flow Builder doesn’t display descriptions for input and output values. For details about each parameter, ask the Apex developer for more
information.
Flow Builder displays Apex actions from managed packages only if the associated method is marked global.

SEE ALSO:
Add and Edit Elements
Let Flows Execute Apex Actions
Customize What Happens When a Flow Fails
Route a Flow

Flow Element: Apex Action (Legacy)


Call an Apex class that uses a legacy Apex interface. Apex classes are available as legacy Apex actions
EDITIONS
only if the Process.Plugin interface has been implemented.
Add an Action element to your flow. In the Action field, select the legacy Apex action that you want Available in: both Salesforce
to configure. Classic (not available in all
orgs) and Lightning
Tip: If your developer hasn’t already implemented the Process.Plugin interface on Experience
the desired class, we recommend using the @InvocableMethod annotation instead.
Unlike the Process.Plugin interface, the @InvocableMethod annotation supports Available in: Enterprise,
sObject, Collection, Blob, and Time data types and bulkification. It’s also easier to implement. Performance, Unlimited,
and Developer Editions
To compare the interface and the annotation, see Let Flows Execute Apex Actions on page
142.

269
Automate Your Business Processes Flows

Set Input Values


Use values from earlier in the flow to set the inputs for the legacy Apex action.

Store Output Values


To use the legacy Apex action’s outputs later in the flow, store them in variables. The values are assigned when the code is executed.

Usage & Limitations


If the Apex class creates, updates, or deletes a record, the action isn’t performed until the interview’s transaction is completed. Transactions
are complete when the interview either finishes or executes a Screen, Local Action, or Pause element.
Flow Builder doesn’t display descriptions for input and output values. For details about each parameter, ask the Apex developer for more
information.
Legacy Apex actions aren’t organized by the tag in the plug-in code.
Cloud Flow Designer lets you save an Apex Plug-in element without setting values for its required input parameters. If you open the
corresponding legacy Apex action in Flow Builder, you can’t save changes to the element unless you set values for the required input
parameters.

SEE ALSO:
Add and Edit Elements
Let Flows Execute Apex Actions
Customize What Happens When a Flow Fails
Route a Flow
Apex Reference Guide : Process Namespace

Flow Element: Assignment


Set values in variables, collection variables, record variables, record collection variables, and global
EDITIONS
variables.
Each variable is modified by the operator and value combination. At run time, the variable Available in: both Salesforce
assignments occur in the order you specify. Classic and Lightning
Experience
Column Header Description Available in: Essentials,
Variable Variable whose value you want to change. Select an existing variable, or Professional, Enterprise,
create a new one. Performance, Unlimited,
and Developer Editions
Operator The available operators depend on the data type selected for Variable.

Value Variable and Value in the same row must have compatible data
types.
Options:
• Select an existing flow resource, such as a variable or screen
component.
• Create a resource.
• Manually enter a literal value or merge field.

270
Automate Your Business Processes Flows

Example: Change the value of a customer’s credit score based on how the customer answered questions earlier in the flow.

SEE ALSO:
Flow Elements
Flow Operators in Assignment Elements
Route a Flow
Flow Resources

Flow Element: Collection Filter


Apply criteria to a collection, and output only the items that meet the criteria.
EDITIONS
Field Description Available in: both Salesforce
Collection The collection variable that is filtered. This field accepts any collection variable Classic and Lightning
within the same flow. Experience

Available in: Essentials,


Condition Determines the logic that evaluates conditions.
Professional, Enterprise,
Requirements • Choose All Conditions Are Met to include values that meet all
Performance, Unlimited,
the specified criteria. and Developer Editions
• Choose Any Condition Is Met to include values that meet any of
the specified criteria.
• Choose Custom Condition Logic Is Met to include values
that meet the logic entered in Condition Logic.
• Choose Formula Evaluates to True to include values where
Formula is true for that value.

Condition Only appears if Condition Requirements is set to Custom


Logic Condition Logic Is Met. Enter logic such as 1 AND (2 OR 3).

Formula Only appears if Condition Requirements is set to Formula


Evaluates to True. Enter a formula that can evaluate to TRUE or FALSE,
such as {!currentItemFromSourceCollection.Id} ==
{!varContactID}.

Field The field evaluated by this condition. Doesn’t appear if Condition


Requirements is set to Custom Condition Logic is Met.

Operator The available operators depend on the data type of the selected Field.

Value Field and Value in the same row must have compatible data types.
Options:
• Select an existing flow resource, such as a variable or screen component.
• Create a resource.
• Manually enter a literal value or merge field.

271
Automate Your Business Processes Flows

Usage
You can filter any collection found in Flow Builder, including collection variables that contain single values, collection variables that
contain records, and Apex-defined collection variables.
Collection Filter outputs a collection with the filtered results and doesn’t change the contents of the source collection. The output
collection is null until its corresponding Collection Filter runs.

Note: A Collection Filter’s output collection is named after its API name. For example, if a Collection Filter element is named
FilterLeads, its output collection is called CurrentItem_FilterLeads.
If you filter your collection with a formula, the formula must evaluate to a boolean (true or false) value. For more formula considerations,
see Flow Formula Considerations in Salesforce Help.
If you delete a Collection Filter element, its output collection remains in the flow. You can safely delete this collection variable afterwards.

Considerations for Defining Filter Criteria


• When you define multiple filter criteria, the filter logic usually defaults to AND. However, if multiple filters have the same field selected
and use the equals operator, the filters are combined with OR.
For example, your filters check whether a case’s Type equals Problem (1), Type equals Feature Request (2), and Escalated equals true
(3). At run time, the filters are combined to (1 OR 2) AND 3.

• The available filter operators depend on the data type of the selected fields. For details, see Flow Operators in Data Elements and
Record Choice Sets.

SEE ALSO:
Flow Formula Considerations
Flow Operators in Data Elements and Record Choice Sets

Flow Element: Collection Sort


Reorder the items within a collection. Set the maximum number of items that remain in the collection
EDITIONS
after the sort.
Available in: both Salesforce
Field Description Classic and Lightning
Collection The collection variable that is sorted. This field accepts any collection variable Experience
Variable within the same flow. Available in: Essentials,
Professional, Enterprise,
Sort By The field that the collection is sorted by. This field is only shown if the collection
Performance, Unlimited,
variable contains more than one field.
and Developer Editions
Sort Order Sort the collection in ascending or descending order.

Put empty When selected, this element sorts records with an empty or null value in the
string and Sort By field at the start of the collection. Otherwise, they’re placed at the end.
null
values
first

How Many Select Set the maximum number of items to determine the
Items to number of items that remain in the collection after the sort.

272
Automate Your Business Processes Flows

Field Description
Keep After
Sorting

Usage
When the Collection Sort element removes values or changes their order, it makes those changes directly in the selected collection
variable.
If the collection variable contains more than one field, click Add Sort Option to sort by additional fields in order of greater to
lesser priority. You can sort by up to 3 fields at a time.

Flow Element: Core Action


Perform an action outside of the flow. Choose from standard actions, like Post to Chatter or Send
EDITIONS
Email, and your org’s quick actions and local actions.
Available in: both Salesforce
Provided Flow Core Actions Classic and Lightning
Salesforce provides several core actions in every org, such as Post to Chatter or Send Email. To Experience
add one of these actions to your flow, add an Action element. Then, in the Action field, search Available in: Essentials,
for the appropriate action. Professional, Enterprise,
Performance, Unlimited,
and Developer Editions

Provided Flow Core Actions


Salesforce provides several core actions in every org, such as Post to Chatter or Send Email. To add one of these actions to your flow,
add an Action element. Then, in the Action field, search for the appropriate action.

Flow Core Action: Activate Session-Based Permission Set


Activate a session-based permission set for the running user.
Flow Core Action: Deactivate Session-Based Permission Set
Deactivate a session-based permission set for the running user.
Flow Core Action: Einstein Discovery
Get predictive and prescriptive intelligence directly in your flows with Einstein Discovery-powered models. Select the row or fields
to use for your predictions and let Einstein Discovery generate predictions, suggested ways to improve predicted outcomes, and
other details.
Flow Core Action: Post to Chatter
Post a message to a specified feed, such as a Chatter group or a case record. The message can contain mentions and topics, but only
text posts are supported.
Flow Core Action: Global or Object-Specific Action
Call an object-specific or global action that’s already been configured in your org. Only Create, Update, and Log a Call actions are
available.

273
Automate Your Business Processes Flows

Quip Flow Core Actions


Quip provides several core actions for organizing, creating, and copying your Quip content in flows. To add one of these actions to
your flow, add an Action element. Then select the Quip category, and search for the appropriate action.
B2B Commerce Checkout Flow Core Actions
The B2B Commerce Checkout Flow provides several core actions for implementing a successful checkout process within your
Commerce org. To add one of these actions to your flow, add an Action element. Then select the B2B Commerce category, and
search for the appropriate action.
Commerce Checkout Flow Core Actions
The Commerce Checkout Flow provides several core actions for implementing a successful checkout process within your Commerce
org. To add one of these actions to your flow, add an Action element. Then select the Commerce category, and search for the
appropriate action.
Salesforce Order Management Flow Core Actions
Salesforce Order Management provides several core actions for implementing order management functionality in flows. To add one
of these actions to your flow, add an Action element. Then select the Order Management category, and search for the appropriate
action.
Salesforce Omnichannel Inventory Flow Core Actions
Salesforce Omnichannel Inventory provides several core actions for implementing inventory functionality in flows. To add one of
these actions to your flow, add an Action element. Then select the Omnichannel Inventory Service category, and search for the
appropriate action.
Flow Core Action: Send Custom Notification
Add the Send Custom Notification action to a flow, then add recipients and content.
Flow Core Action: Send Email
Send an email by specifying the subject, body, and recipients in the flow.
Flow Core Action: Send Surveys
Create an action to send an active survey by specifying the name, subject, recipients, and invitation link options in the flow.
Slack Flow Core Actions
Manage Slack channels, channel members, and messages from flows. As your Salesforce records change, a flow can trigger changes
in Slack.
Flow Core Action: Submit for Approval
Submit one Salesforce record for approval.
Salesforce Anywhere Core Flow Actions (Beta)
Salesforce Anywhere provides several core actions for implementing Salesforce Anywhere functionality in flows. To add one of these
actions to your flow, add an Action element. Then select the Salesforce Anywhere category, and search for the appropriate action.

SEE ALSO:
Add and Edit Elements

274
Automate Your Business Processes Flows

Flow Core Action: Activate Session-Based Permission Set


Activate a session-based permission set for the running user.
EDITIONS
In Flow Builder, add an Action element to your flow. In the Action field, enter Permission Set,
and select Activate Session-Based Permission Set. Available in: both Salesforce
Classic and Lightning
Set Input Values
Experience
Use values from earlier in the flow to identify the permission set to activate.
Available in: Essentials,
Important: You can run queries, but don’t modify Salesforce data in flows that also activate Professional, Enterprise,
session-based permission sets. Performance, Unlimited,
and Developer Editions
Field Description
Permission Set The developer name of the permission set.
Name This parameter accepts single-value resources of any type. That value is
treated as text.

Permission Set Optional. The permission set’s namespace.


Namespace This parameter accepts single-value resources of any type. That value is
treated as text.

Example: A junior buyer in your org occasionally requires access to your Contracts object. Create a session-based permission set
with access to the object. Then create a flow that uses the Activate Session-Based Permission Set core action. Configure the action
to activate the permission set.
The junior buyer runs the flow to access contracts during the current user session. The action activates the permission set for the
junior buyer during the current session.

SEE ALSO:
Flow Core Action: Deactivate Session-Based Permission Set
Create a Flow That Can Activate or Deactivate a Session-Based Permission Set
Add and Edit Elements

Flow Core Action: Deactivate Session-Based Permission Set


Deactivate a session-based permission set for the running user.
EDITIONS
In Flow Builder, add an Action element to your flow. In the Action field, enter Permission Set,
and select Deactivate Session-Based Permission Set. Available in: both Salesforce
Classic and Lightning
Set Input Values
Experience
Use values from earlier in the flow to identify the permission set to deactivate.
Available in: Essentials,
Field Description Professional, Enterprise,
Performance, Unlimited,
Permission Set The developer name of the permission set. and Developer Editions
Name This parameter accepts single-value resources of any type. That value is
treated as text.

275
Automate Your Business Processes Flows

Field Description
Permission Set The permission set’s namespace.
Namespace This parameter accepts single-value resources of any type. That value is treated as text.

SEE ALSO:
Flow Core Action: Activate Session-Based Permission Set
Create a Flow That Can Activate or Deactivate a Session-Based Permission Set
Add and Edit Elements

Flow Core Action: Einstein Discovery


Get predictive and prescriptive intelligence directly in your flows with Einstein Discovery-powered
EDITIONS
models. Select the row or fields to use for your predictions and let Einstein Discovery generate
predictions, suggested ways to improve predicted outcomes, and other details. Available in: Lightning
Set Input Values Experience

Note: To view Einstein Discovery predictions, improvements, and other details, users must Available in: Enterprise,
have the View Einstein Discovery Recommendations system permission. To learn more, Performance, Professional,
see Assign Einstein Discovery Permission Sets to Users . Developer, and Unlimited
Editions
Use values from an Einstein Discovery model to set the inputs for the action.

Field Description
Action Search for the deployed models to which you have access.

Label Descriptive label for the action.

API Name API name for the action.

Description Description for the action.

What to Store

Predictions Enable output from a predictive model to be stored in a flow


resource.

Top Predictors Enable top predictors to be stored in a flow resource.

Top Improvements Enable suggested actions to be stored in a flow resource.


Applies only to numeric and binary classification models.

Select Object Record Generate predictions based on a Salesforce object record.


ID Field

Map Fields Generate predictions using flow resources.

Record ID Field ID of the record to use for the prediction.

Model Variable Map the prediction model variables to flow resources.

Advanced Optionally, for predictions associated with multiclass


classification models, expand Advanced, select Manually

276
Automate Your Business Processes Flows

Field Description
assign variables, and selectively store output values (class probabilities, the
prediction, and top predictors).

SEE ALSO:
About Models
Add and Edit Elements

Flow Core Action: Post to Chatter


Post a message to a specified feed, such as a Chatter group or a case record. The message can
EDITIONS
contain mentions and topics, but only text posts are supported.
In Flow Builder, add an Action element to your flow. In the Action field, enter Chatter, and select Available in: both Salesforce
Post to Chatter. Classic and Lightning
Experience
Set Input Values
Use values from earlier in the flow to set the inputs for the Chatter post. Available in: Essentials,
Professional, Enterprise,
Input Description Performance, Unlimited,
Parameter and Developer Editions

Message The text that you want to post.


• To mention a user or group, enter @[reference], where reference
is the ID for the user or group that you want to mention. The reference can
be a literal value, a merge field, or a flow resource. For example:
@[{!UserId}].
• To add a topic, enter #[string], where string is the topic that you
want to add. For example: #[Action Required].
This parameter accepts single-value resources of any type. That value is treated
as text and is limited to 10,000 characters.

Target Reference to the user, Chatter group, or record whose feed you want to post to.
Name or • To post to a user’s feed, enter the user’s ID or username. For example:
ID jsmith@salesforce.com
• To post to a Chatter group, enter the group’s name or ID. For example:
Entire Organization
• To post to a record, enter the record’s ID. For example: 001D000000JWBDx
This parameter accepts single-value resources of any type. That value is treated
as text.

Community ID of an Experience Cloud site to post to.


ID Valid only if Digital Experiences is enabled. Required if posting to a user or Chatter
group that belongs to an Experience Cloud site.
This parameter accepts single-value resources of any type. That value is treated
as text.

277
Automate Your Business Processes Flows

Input Parameter Description


Target Type Required only if Target Name or ID is set to a username or a Chatter group name.
The type of feed that you want to post to. Valid values are:
• User—If Target Name or ID is set to a user’s username, enter this value.
• Group—If Target Name or ID is set to a Chatter group’s name, enter this value.

Visibility Specifies whether this feed item is available to Experience Cloud site users. To display this feed item only to
internal users, set it to internalUsers.
Valid only if Digital Experiences is enabled. Valid values are:
• allUsers
• internalUsers

Store Output Values


To use the Chatter post’s ID later in the flow, store it in a variable. The values are assigned when the Chatter post is created.

Output Parameter Description


Feed Item ID Assigns the created post’s ID to a resource in the flow.
This parameter accepts any single-value variables of type Text, Picklist, or Multi-Select Picklist.

Usage
At run time, the Chatter post isn’t created until the interview’s transaction completes. Transactions are complete when the interview
either finishes or executes a Screen, Local Action, or Pause element.

SEE ALSO:
Flow Elements
Add and Edit Elements
Customize What Happens When a Flow Fails
Route a Flow

Flow Core Action: Global or Object-Specific Action


Call an object-specific or global action that’s already been configured in your org. Only Create,
EDITIONS
Update, and Log a Call actions are available.
In Flow Builder, add an Action element to your flow. In the Action field, select the object-specific Available in: both Salesforce
or global action to configure. Classic and Lightning
Experience
The API name for each object-specific action is prefixed with the object it’s associated with, such
as quickAction-Task.UpdatePriority. The API name for each global action has no Available in: Essentials,
prefix, such as quickAction-NewAccount. Professional, Enterprise,
Performance, Unlimited,
Set Input Values
and Developer Editions
Use values from earlier in the flow to set the inputs for the action.

278
Automate Your Business Processes Flows

Field Description
Related Record Only for object-specific actions. The ID of the record from which the action executes.
ID For example, the action creates a case that’s associated with a given account. Assign the ID for that account
to Related Record ID.
This parameter accepts single-value resources of any type. That value is treated as text.

Input Varies for each action.


Parameter The action layout determines which parameters are required. Required parameters appear by default and can’t
be removed. If a required field has a default or predefined value, that field is optional in object-specific and
global actions in the flow. If you later remove the field’s default or predefined value and you didn’t set a value
in the flow, the interview fails at run time.
The value must be compatible with the parameter.

Example: Your org has an object-specific action that creates a case record on an account. The flow calls that action at run time
and uses values from earlier in the flow to identify the account ID.

Note: At run time, the record isn’t created or updated until the interview’s transaction completes. Transactions are complete
when the interview either finishes or executes a Screen, Local Action, or Pause element.

SEE ALSO:
Add and Edit Elements
Flow Elements
Customize What Happens When a Flow Fails
Route a Flow

Quip Flow Core Actions


Quip provides several core actions for organizing, creating, and copying your Quip content in flows.
EDITIONS
To add one of these actions to your flow, add an Action element. Then select the Quip category,
and search for the appropriate action. Available in: Lightning
Important: Quip core actions don’t support system-run flows or automated process users. Experience
Quip core actions execute in the context of the user, who is also referred to as the context
user. The flow has access to whatever the context user has access to.

Flow Core Actions for Quip: Create Quip Document


Create a document, spreadsheet, or slide deck, and add content to it.
Flow Core Action for Quip: Create Quip Chat
Create a chat room, and send a message to its members.
Flow Core Action for Quip: Create Quip Folder
Create a private folder, or add it to existing folders.
Flow Core Action for Quip: Copy Quip Document
To use a document as a template, create a copy. By default, copied documents are added to the running user’s Private folder in Quip.

279
Automate Your Business Processes Flows

Flow Core Action for Quip: Copy Quip Content (Retired)


Copy content from a source slide deck, and paste it in a target slide.
Flow Core Action for Quip: Copy with Live Paste
Copy content from a source document, and paste it with Live Paste in a new document. When the source content is updated,
documents with the live pasted content stay up to date.
Flow Core Action for Quip: Attach Quip Document to Record
Attach a document to a Salesforce record. Linked documents show up in the Quip Associated Documents component.
Flow Core Action for Quip: Edit Quip Document
Edit content in a document, spreadsheet, or slide. Add or replace content based on a document section.
Flow Core Action for Quip: Lock Quip Document
To mark a document as complete, lock document edits.
Flow Core Action for Quip: Lock Quip Section
To mark sections of a document as complete or to keep them safe from accidental edits, lock them.
Flow Core Action for Quip: Export Quip Document to PDF
To mark a document as complete and to keep a copy for your records, export it as a PDF. You can attach the exported PDF to a
document or to a Salesforce record.
Flow Core Action for Quip: Send Message in Quip Chat
Send a message in a chat room.
Flow Core Action for Quip: Send a Message in a Document
Add a message to the conversations pane of a document.
Flow Core Action for Quip: Add Quip Document to Folder
Add a document to a folder to organize and share your documents.
Flow Core Action for Quip: Add Members to Document
Add members with different levels of access to a document.
Flow Core Action for Quip: Add Members to Quip Chat
Add users to a chat room.
Flow Core Action for Quip: Remove Quip Document from Folder
Remove a document from a folder. Make a shared document private again.
Flow Core Action for Quip: Remove Members from Quip Document
To rescind access to a document for certain users, remove them from the document.
Flow Core Action for Quip: Remove Members from Quip Chat
Remove users from a chat room.

SEE ALSO:
Add and Edit Elements
Flow Core Actions for Quip: Create Quip Document
Create a document, spreadsheet, or slide deck, and add content to it.
EDITIONS
Warning: Quip is retiring slides on January 31, 2021. After this date, the Copy Content action
in Process Builder and Flow Builder no longer works, and Slides isn’t a valid document type Available in: Lightning
for the Edit Document and Create Document actions. Tell Me More Experience

280
Automate Your Business Processes Flows

In Flow Builder, add an Action element to your flow. In the Action field, enter Quip, and select Create Quip Document.
Set Input Values
Use values from earlier in the flow to set the inputs for the action.

Input Parameter Description


Document Title The title of the new document. Only string values are supported.

Add Members by Email Address Optional. A list of user emails separated by commas to add to the new document. Valid
values are:
• person1@quip.com, person2@quip.com, person3@quip.com
• person1@quip.com

Company Link Address Optional. Link sharing settings for the new document. By default, new documents are
set to edit-access. Valid values are:
• view–To let users view the document, enter this value.
• edit–To let users view and edit the document, enter this value.
• none–To block user access to the document, enter this value.

Content Type Optional. Format of content added to the document. By default, content format is set to
html. Valid values are:
• html–To format text added to Document Content with html, enter this value.
• liveapp–To add a live app to your document, enter this value. Only valid if
Document Type is set to document.

Document Content Optional. Content added to the new document. Valid only when Content Type is
set to html. By default, the document title is used for the document’s content. Valid values
are:
• String values
• @[Salesforce user ID]–To @mention a Salesforce user in the document,
enter the Salesforce ID. If the user’s Salesforce email is connected to Quip, the user
ID is replaced with a Quip user @mention. If not, the Salesforce ID is replaced with
the user’s Salesforce email.
• @[person1@quip.com]–To @mention a user by email, enter this value.
• @Everyone–To send a notification to all users added to document, enter this value.

Document Type Optional. Type of document created including documents and spreadsheets. By default,
new documents are created as documents. Valid values are:
• document–To create a document, enter this value.
• spreadsheet–To create a spreadsheet, enter this value.

Live App Type Type of live app added to the document. Required if Content Type is set to
liveapp. Only documents support live apps. Valid values are:
• salesforce_record–To add the Salesforce Record live app to the document,
enter this value.

281
Automate Your Business Processes Flows

Input Parameter Description


• salesforce_list–To add the Salesforce List live app to the document, enter
this value.

Object Type Type of object used by the Salesforce List live app. Required if Live App Type is set
to salesforce_list. Only string values are supported. For example: Account,
Opportunity, or CustomObject__c.

Parent Folder URL Optional. A list of Quip folder URLs separated by commas to add the new document to.
By default, the document is added to the user’s Private folder in Quip. Valid values are:
• https://[quip_site_url]/folder/[folder1_name],
https://[quip_site_url]/folder/[folder2_name]
• https://[quip_site_url]/folder/[folder_name]
For example: https://salesforce.quip.com/folder/account-plans

Record Name Optional. Name of the record added to the document through the Salesforce Record live
app. Valid only if the Live App Type is set to salesforce_record. Only string
values are supported.

Record Type Optional. Type of object used by the Salesforce Record live app. Valid only if Live App
Type is set to salesforce_record. Only string values are supported. For example:
Account, Opportunity, or CustomObject__c.

Salesforce List View ID ID of the Salesforce list view added to the document. Required if Live App Type is
set to salesforce_list.

Salesforce Org Name Optional. Salesforce org name used in the live app. Valid only if Content Type is set
to liveapp. Only string values are supported. For example: Acme.

Salesforce Record ID ID of the Salesforce record added to the document. Required if Live App Type is
set to salesforce_record.

Store Output Values

Output Parameter Description


Document Title Title of the new document

Document ID ID of the new document

Document Link URL of the new document

Example: A sales manager wants to create a document at the end of each quarter to identify which accounts are at risk of attrition.
You can create a flow that uses the Create Quip Document core action to create a document called Red Accounts. Add a Salesforce
list view through the Salesforce List live app that shows all accounts in the red. Then add the document a Red Accounts folder.

282
Automate Your Business Processes Flows

SEE ALSO:
Flow Elements
Flow Core Action for Quip: Create Quip Chat
Create a chat room, and send a message to its members.
EDITIONS
In Flow Builder, add an Action element to your flow. In the Action field, enter Quip, and select
Create Quip Chat. Available in: Lightning
Experience
Set Input Values
Use values from earlier in the flow to set the inputs for the action.

Input Parameter Description


Message Chat message to get the chat room started. Valid values are:
• String values
• @[Salesforce user ID]–To @mention a Salesforce user in the chat room,
enter the Salesforce ID. If the user’s Salesforce email is connected to Quip, the user
ID is replaced with a Quip user @mention. If not, the Salesforce ID is replaced with
the user’s Salesforce email.
• @[person1@quip.com]–To @mention a user by email, enter this value.
• @Everyone–To send a notification to all chat room members, enter this value.

283
Automate Your Business Processes Flows

Input Parameter Description


Add Members by Email Address Optional. A list of user emails separated by commas to add to the new chat room. Valid
values are:
• person1@quip.com, person2@quip.com, person3@quip.com
• person1@quip.com

Chat Title The title of the chat room. Only string values are supported.

Store Output Values

Output Parameter Description


Chat ID ID of the new chat room

Chat Link URL of the new chat room

Chat Title Title of the new chat room

SEE ALSO:
Add and Edit Elements
Flow Core Action for Quip: Create Quip Folder
Create a private folder, or add it to existing folders.
EDITIONS
In Flow Builder, add an Action element to your flow. In the Action field, enter Quip, and select
Create Quip Folder. Available in: Lightning
Experience
Set Input Values
Use values from earlier in the flow to set the inputs for the action.

Input Parameter Description


Folder Name Name of the new folder. Only string values are supported.

Folder Color Optional. Color of the new folder. Valid values are:
• yellow
• red
• orange
• green
• blue
• purple
• manila
• light red
• light orange
• light green
• light blue

284
Automate Your Business Processes Flows

Input Parameter Description


• light purple

Parent Folder URL Optional. A list of folder URLs separated by commas to add the new folder to. By default,
the folder is added to the user’s Private folder in Quip. Valid values are:
• https://[quip_site_url]/folder/[folder1_name],
https://[quip_site_url]/folder/[folder2_name]
• https://[quip_site_url]/folder/[folder_name]
For example: https://salesforce.quip.com/folder/account-plans

Store Output Values

Output Parameter Description


Created Folder Title Title of the new folder

Folder ID ID of the new folder

SEE ALSO:
Add and Edit Elements
Flow Core Action for Quip: Copy Quip Document
To use a document as a template, create a copy. By default, copied documents are added to the
EDITIONS
running user’s Private folder in Quip.
In Flow Builder, add an Action element to your flow. In the Action field, enter Quip, and select Available in: Lightning
Copy Quip Document. Experience

Important: Newly copied documents aren’t automatically attached to the record. To attach
the newly created document to the record and use Synced Sharing, use the Attach Document
to Record action after the Copy Quip Document action and set the Salesforce Record ID to
be the ID of the variable.
Set Input Values
Use values from earlier in the flow to set the inputs for the action.

Input Parameter Description


Document URL The URL of the document that you want to copy. For example:
https://salesforce.quip.com/GVnGbtEasAGa

Company Link Access Optional. Link sharing settings for the copied document. By default, copied documents
are set to edit-access. Valid values are:
• view–To let users view the copied document, enter this value.
• edit–To let users view and edit the copied document, enter this value.
• none–To block user access to the copied document, enter this value.

285
Automate Your Business Processes Flows

Input Parameter Description


Context Record ID Optional. ID of the record that you want to update with the copied document’s URL.
Including the Context Record ID doesn’t attach the document to a record.
Valid only if the Quip Document component is set up on the record layout. The Target
Record URL Field is required to use Context Record ID.

Copy comments to new Optional. This input determines whether to copy comments from the source document
document to the copied document. Valid values are:
• true–To copy the source document’s comments and annotations, enter this value.
• false–To copy the source document’s content without comments, enter this value.

Member Emails Optional. A list of user emails separated by commas to add to the copied document. Valid
values are:
• person1@quip.com, person2@quip.com, person3@quip.com
• person1@quip.com

Member Folder URLs Optional. A list of folder URLs separated by commas to add the copied document to. Valid
values are:
• https://[quip_site_url]/folder/[folder1_name],
https://[quip_site_url]/folder/[folder2_name]
• https://[quip_site_url]/folder/[folder_name]
For example: https://salesforce.quip.com/folder/account-plans

Source Record ID Optional. ID of the record that you want to use in the place of mail merge syntax. For
example, to replace the copied document’s [[Account.Name] merge field with the record’s
account name, enter the record ID.

Target Record URL Field Optional. Reference to the URL field on a record used by the Context Record ID.
This field is updated with the copied document URL and adds the copied document to
the record’s Quip Document component. Valid values are:
• API name of the field–For example: QuipDocumentURL__c
The Context Record ID is required to use the Target Record URL Field.
Including the Target Record URL Field doesn’t attach the newly created document to the
record.

Title Optional. The title of the copied document. Only string values are supported.

Store Output Values

Output Parameter Description


Created Document Title The title of the copied document.

Document ID ID of the copied document.

Document Link The URL of the copied document.

286
Automate Your Business Processes Flows

Example: Watch an Account Plan Automation Demo (2 minutes)


A sales rep wants to create an Account Plan and share it with the regional sales managers to close a large opportunity. You can
create a flow that uses the Copy Quip Document core action to copy an Account Plan template when the Opportunity stage is
set to Proposal/Quote. Configure the action to replace merge fields with data from the account, add the Account Plan to a folder,
and share the folder with the regional sales managers.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Quip: Copy Quip Content (Retired)
Copy content from a source slide deck, and paste it in a target slide.
EDITIONS
Warning: Quip is retiring slides on January 31, 2021. After this date, the Copy Content action
in Process Builder and Flow Builder no longer works, and Slides isn’t a valid document type Available in: Lightning
for the Edit Document and Create Document actions. Tell Me More Experience

Drag a Core Action element onto the canvas. In the Core Action field, enter Quip, and select Copy
Quip Content.
Set Input Values
Use values from earlier in the flow to set the inputs for the action.

Input Parameter Description


Document Type Type of document you want to copy. Valid values are:
• slides–To copy slides to another slide deck, enter this value.

Source Document URL URL of the slide deck you want to copy content from.

Target Document URL URL of the slide deck where you want to add copied content.

Slide Count Range Optional. Number of slides to copy from the source slide deck. By default, Slide Count
Range is set to 1.

287
Automate Your Business Processes Flows

Input Parameter Description


Source Section Anchor Link URL of a section in the source slide deck that you want to copy content from.

Source Slide Number Optional. The slide index to copy content from. For example, to copy content from the
first slide of a deck, enter 1.

Target Record ID Optional. ID of the record you want to use in the place of mail merge syntax. For example,
to replace the copied document’s [[Account.Name] merge field with the record’s account
name, enter the record ID.

Target Section Anchor Link URL of a section in the target slide deck where you want to paste copied content.

Target Slide Number Optional. The slide index to copy content to. For example, to paste copied content to the
first slide of a deck, enter 1.

Store Output Values

Output Parameter Description


Document ID ID of the target slide deck content was copied to.

Document Link URL of the target slide deck content was copied to.

Created Document Title The title of the slide deck content was copied to. Only string values are supported.

Example: A sales rep wants to update a slide deck with the latest sales numbers to prepare for a customer pitch. The sales rep
wants to use the slides from another deck that their manager keeps up to date with the latest numbers. You can create a flow that
uses the Copy Quip Content core action to copy content slides 1 and 2 from their manager’s slide deck and replace the content
in slides 3 and 4 of the customer-facing slide deck.

288
Automate Your Business Processes Flows

Flow Core Action for Quip: Copy with Live Paste


Copy content from a source document, and paste it with Live Paste in a new document. When the
EDITIONS
source content is updated, documents with the live pasted content stay up to date.
In Flow Builder, add an Action element to your flow. In the Action field, enter Quip, and select Available in: Lightning
Copy with Live Paste. Experience
Set Input Values
Use values from earlier in the flow to set the inputs for the action.

Input Parameter Description


Source Section Anchor Links URLs of the sections in the source document that you want to copy content from. Anchor
links must be from the same document and separated with commas. Valid only if
Content Type is set to anchor link.

Content Location Optional. Location in the document where you want to live paste your copied content.
Valid values are:
• append–To live paste content to the end of the document, enter this value.
• prepend–To live paste content to the beginning of the document, enter this value.
• after_section–To live paste content after a designated section, enter this value.
Valid only if Target Section Anchor Link is specified.
• before_section–To live paste content before a designated section, enter this
value. Valid only if Target Section Anchor Link is specified.
• replace_section–To replace an existing section with live pasted content, enter
this value. Valid only if Target Section Anchor Link is specified.
• after_document_range–To live paste content after a named document range,
enter this value. Valid only if Target Document Range Heading Text
is specified.
• before_document_range–To live paste content before a named document
range, enter this value. Valid only if Target Document Range Heading
Text is specified.
• replace_document_range–To replace a named document range with live
pasted content, enter this value. Valid only if Target Document Range
Heading Text is specified.
By default, Content Location is set to append.

Content Type Type of content that you want to copy. Valid values are:
• anchor_link–To copy content based on a section anchor link URL, enter this
value.
• document_range–To copy content from a template based on a document range
name, enter this value.

Source Document Range Heading text from the document range that you want to copy. Valid only if Content
Heading Type is set to document_range.

Target Document URL URL of the document that you want to copy live pasted content to.

289
Automate Your Business Processes Flows

Input Parameter Description


Target Section Anchor Link Optional. URL of the section in the target document where you want to copy live pasted
content to.

Target Document Range Heading text from the document range where you want to live paste your copied content.
Heading Text

Update Automatically Optional. Automatically update the target document when the source content is updated
and Live Paste is on. Valid values are:
• true
• false
By default, Update Automatically is set to false.

Store Output Values

Output Parameter Description


Document ID ID of the document where live pasted content was added.

Document Link URL of the document where live pasted content was added.

Document Title Title of the document where live pasted content was added.

Example: A sales manager wants to add instructions to all Account Plans to teach their sales reps what to do next. But the sales
manager doesn’t want to update each one individually. You can create a flow that uses the Copy with Live Paste core action to
add the updated instructions to the end of the Account Plan.

290
Automate Your Business Processes Flows

SEE ALSO:
Add and Edit Elements
Flow Core Action for Quip: Attach Quip Document to Record
Attach a document to a Salesforce record. Linked documents show up in the Quip Associated
EDITIONS
Documents component.
In Flow Builder, add an Action element to your flow. In the Action field, enter Quip, and select Available in: Lightning
Attach Quip Document to Record. Experience
Set Input Values
Use values from earlier in the flow to set the inputs for the action.

Input Parameter Description


Document URL The URL of the document that you want to attach to a Salesforce record. For example:
https://salesforce.quip.com/GVnGbtEasAGa

Salesforce Record ID ID of the Salesforce record that you want to attach your document to.

Store Output Values

Output Parameter Description


Content Document Link ID The ID of the link between the document and the record where it’s attached. The Attach
Quip Document to Record flow action creates a Content Document object that references
the document. It also creates a Content Document Link object that maps the record to
the Content Document object.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Quip: Edit Quip Document
Edit content in a document, spreadsheet, or slide. Add or replace content based on a document
EDITIONS
section.
In Flow Builder, add an Action element to your flow. In the Action field, enter Quip, and select Available in: Lightning
Edit Quip Document. Experience

Warning: Quip is retiring slides on January 31, 2021. After this date, the Copy Content action
in Process Builder and Flow Builder no longer works, and Slides isn’t a valid document type
for the Edit Document and Create Document actions. Tell Me More
Set Input Values
Use values from earlier in the flow to set the inputs for the action.

Input Parameter Description


Content Location Location in the document where you want to add content. Valid values are:
• append–To add content to the end of the document, enter this value.

291
Automate Your Business Processes Flows

Input Parameter Description


• prepend–To add content to the beginning of the document, enter this value.
• after_section–To add content after a designated section, enter this value. Valid
only if Section Anchor Link is specified.
• before_section–To add content before a designated section, enter this value.
Valid only if Section Anchor Link or Section Match Type is specified.
• replace_section–To replace an existing section with new content, enter this
value. Valid only if Section Anchor Link or Section Match Type is
specified.
• after_document_range–To add content to a template after a document
range, enter this value. Valid only if Document Range Heading is specified.
• before_document_range–To add content to a template before a document
range, enter this value. Valid only if Document Range Heading is specified.
• replace_document_range–To replace existing content based on a document
range, enter this value. Valid only if Document Range Heading is specified.

Document URL URL of the document that you want to edit. For example:
https://salesforce.quip.com/GVnGbtEasAGa

Edit Document Type Type of document that you want to edit. Valid values are:
• document–To edit a document, enter this value.
• spreadsheet–To edit a spreadsheet, enter this value.

Content Optional. Content added to the document that you want to edit. Valid only if Content
Format is set to html. Valid values are:
• String values
• @[Salesforce user ID]–To @mention a Salesforce user in the document,
enter the Salesforce ID. If the user’s Salesforce email is connected to Quip, the user
ID is replaced with a Quip user @mention. If not, the Salesforce ID is replaced with
the user’s Salesforce email.
• @[person1@quip.com]–To @mention a user by email, enter this value.
• @Everyone–To send a notification to everyone in the document, enter this value.

Content Format Optional. Format of content added to the document. By default, content format is set to
html. Valid values are:
• html–To format text added to Document Content with html, enter this value.
• liveapp–To add a live app to your document, enter this value. Only valid if
Document Type is set to document.

Disable Extra Lines in Quip Optional. Boolean parameter that prevents Quip from inserting an extra line between
paragraphs. The default is false, meaning that by default extra lines are inserted.

Document Range Heading Optional. Heading text that marks the start of the document range.

292
Automate Your Business Processes Flows

Input Parameter Description


Element Type Optional. The type of spreadsheet element to edit. Only valid if Document Type is
set to spreadsheet. Valid values are:
• row–To edit a spreadsheet row, enter this value.
• column–To edit a spreadsheet column, enter this value.

Image Number
Warning: Quip is retiring slides on January 31, 2021. After this date, the Copy
Content action in Process Builder and Flow Builder no longer works, and Slides
isn’t a valid document type for the Edit Document and Create Document actions.
Tell Me More
Optional. Image index of an image on a slide. Only valid if Document Type is set to
slides. Valid values are:
• Image integers–Integers represent an image index on a slide. Images are
ordered from top to bottom. Images closer to the top of a slide have an image integer
of 1. Images closer to the bottom have the biggest integers. If there are multiple
images on a slide with the same vertical positions, the image numbers are ordered
from left to right. If there are multiple images on a slide with the same horizontal and
vertical positions, the image that is behind the other one has an image number of
1. The image in front has an image number of 2.

Image URL
Warning: Quip is retiring slides on January 31, 2021. After this date, the Copy
Content action in Process Builder and Flow Builder no longer works, and Slides
isn’t a valid document type for the Edit Document and Create Document actions.
Tell Me More
Optional. The URL of an image in a slide deck. Only valid if Document Type is set to
slides.

Live App Type Type of live app added to the document. Required if Content Format is set to
liveapp. Only documents support live apps. Valid values are:
• salesforce_record–To add the Salesforce Record live app to the document,
enter this value.
• salesforce_list–To add the Salesforce List live app to the document, enter
this value.

Object Type Type of object used by the Salesforce List live app. Required if Live App Type is set
to salesforce_list. Only string values are supported. For example: Account,
Opportunity, or CustomObject__c.

Record Name Optional. Name of the record added to the document through the Salesforce Record live
app. Valid only if the Live App Type is set to salesforce_record. Only string
values are supported.

Record Type Optional. Type of object used by the Salesforce Record live app. Valid only if Live App
Type is set to salesforce_record. Only string values are supported. For example:
Account, Opportunity, or CustomObject__c.

293
Automate Your Business Processes Flows

Input Parameter Description


Salesforce List View ID Optional. ID of the Salesforce list view added to the document. Valid only if Live App
Type is set to salesforce_list.

Salesforce Org Name Optional. Salesforce org name used in the live app. Valid only if Content Format is
set to liveapp. Only string values are supported. For example: Acme.

Salesforce Record ID Optional. ID of the Salesforce record added to the document. Valid only if Live App
Type is set to salesforce_record.

Section Anchor Link URL of a section in the document where you want to add or replace content. Valid only
if Content Location is set to before_section, after_section, or
replace_section. For example:
https://[quip_site_url]/GVnGAtEawAGh/Source-Slide#JUJACAuc0ps,
where Source-Slide#JUJACAuc0ps is a specific slide in the slide deck.

Section Match Type Placement of keywords used to identify the section where you want to add or replace
content. Valid only if Content Location is set to before_section,
after_section, or replace_section, and the Document Type is
document. Keywords aren’t case-sensitive and ignore HTML tags. Valid values are:
• prefix–To find a keyword in a document based on the first part of a word, enter
this value. For example, hello is the prefix for helloworld.
• suffix–To find a keyword in a document based on the end of a word, enter this
value. For example, world is the suffix for helloworld.

Section Style Format of the document section where you want to add or replace content. Required if
Section Type is set to textmatch. Valid values are:
• paragraph–To find a keyword in a paragraph, enter this value.
• heading–To find a keyword in a heading, enter this value.
• list–To find a keyword in a list, enter this value.

Section Text Keywords to identify the section where you want to add or replace content. Required if
Section Match Type is specified. Only string values are supported.

Section Type Optional. Determines how a section is edited. Valid values are:
• anchorlink–To edit a document section based on its anchorlink, enter this value.
Valid only if Section Anchor Link is set up.
• textmatch–To edit a document section based on a keyword, enter this value.

Slide Layout
Warning: Quip is retiring slides on January 31, 2021. After this date, the Copy
Content action in Process Builder and Flow Builder no longer works, and Slides
isn’t a valid document type for the Edit Document and Create Document actions.
Tell Me More
Optional. The slide element to edit. Only valid if Document Type is set to slides.
Valid values are:
• single_column–To edit a slide column, enter this value.
• image–To edit a slide image, enter this value.

294
Automate Your Business Processes Flows

Input Parameter Description


Slide Number
Warning: Quip is retiring slides on January 31, 2021. After this date, the Copy
Content action in Process Builder and Flow Builder no longer works, and Slides
isn’t a valid document type for the Edit Document and Create Document actions.
Tell Me More
Optional. The slide index to edit. Only valid if Document Type is set to slides. For
example, to edit the first slide of a deck, enter 1.

Store Output Values

Output Parameter Description


Document ID ID of the edited document

Document Link URL of the edited document

Document Title Title of the edited document

Example: A sales rep wants to update their Account Plan and add a list view of open opportunities related to the account. You
can create a flow that uses the Edit Document core action to add the Salesforce List live app to the end of the Account Plan.

Example: A service manager wants to update an Account Plan with an account history. The account is up for renewal and the
service manager wants to make sure that the sales rep has the necessary background on past cases before contacting the customer.
You can create a flow that uses the Edit Document core action to add an account history to an Account Plan and place it before
the placeholder lorem.

295
Automate Your Business Processes Flows

SEE ALSO:
Add and Edit Elements
Flow Core Action for Quip: Lock Quip Document
To mark a document as complete, lock document edits.
EDITIONS
In Flow Builder, add an Action element to your flow. In the Action field, enter Quip, and select
Lock Quip Document. Available in: Lightning
Experience
Set Input Values
Use values from earlier in the flow to set the inputs for the action.

Input Parameter Description


Document URL URL of the document that you want to lock.

Lock Operation Action of locking or unlocking the document. Only a user with full access to the document
can lock or unlock it. Valid values are:
• lock—To lock edits to the document, enter this value.
• unlock—To let users edit a locked document, enter this value.

Store Output Values

296
Automate Your Business Processes Flows

Output Parameter Description


Document Lock Operation Success marker of whether the document was locked or unlocked. Possible results are
Result true or false.

Example: A sales manager wants to lock edits to their reps’ Account Plans after a deal is closed. You can create a flow that uses
the Lock Quip Document core action to lock edits to Account Plans when the Opportunity stage is set to Closed Won.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Quip: Lock Quip Section
To mark sections of a document as complete or to keep them safe from accidental edits, lock them.
EDITIONS
In Flow Builder, add an Action element to your flow. In the Action field, enter Quip, and select
Lock Quip Section. Available in: Lightning
Experience
Set Input Values
Use values from earlier in the flow to set the inputs for the action.

Input Parameter Description


Section Anchor Link Anchor link URL of the document section that you want to lock.

Lock Operation Action of locking or unlocking a document section. Only a user with full access to the
document can lock or unlock its sections. Valid values are:
• lock—To lock edits to the document, enter this value.
• unlock—To let users edit a locked document, enter this value.

Store Output Values

Output Parameter Description


Section Lock Operation Success marker of whether the section was locked or unlocked. Possible results are true
Result or false.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Quip: Export Quip Document to PDF
To mark a document as complete and to keep a copy for your records, export it as a PDF. You can
EDITIONS
attach the exported PDF to a document or to a Salesforce record.
Set Input Values Available in: Lightning
Use values from earlier in the flow to set the inputs for the action. Experience

297
Automate Your Business Processes Flows

Input Parameter Description


Source Document URL URL of the document you want to export to PDF. Valid values are:
• String values
• Field references—To pull a document housed in a custom URL field, enter the field
API name.

Sheet Name Name of the sheet in a spreadsheet that you want to export to a PDF. Valid only for
spreadsheet files. If no sheet name is entered, defaults to the first sheet.

Target Document URL Optional. URL of the document where you want to attach the created PDF. The PDF is
added to the end of the document.

Salesforce Organization ID ID of the Salesforce org where you want to attach your new PDF. You can use the same
Salesforce org ID of the triggering record, or attach the PDF to a different org. Valid only
if Target Record ID is specified.

Target Record ID Optional. ID of the Salesforce record you want to attach your document to. PDFs attached
to a record are added to the record’s Files component and Notes and Attachments
component, and are visible to any user with access to the record. Valid values are:
• Alphanumeric series of numbers and letters for a specific Salesforce record.
• {!$Record.Id}To attach the PDF to the same record that triggered the flow,
enter this value.

Store Output Values

Output Parameter Description


Request ID ID to check the status of the PDF export.

Status message Error message that explains why the document wasn’t exported to a PDF.

Status of the request Success marker of whether the document was exported to a PDF. Can be success,
failure, or pending.

SEE ALSO:
Flow Elements
Flow Core Action for Quip: Send Message in Quip Chat
Send a message in a chat room.
EDITIONS
In Flow Builder, add an Action element to your flow. In the Action field, enter Quip, and select
Send Message in Quip Chat. Available in: Lightning
Experience
Set Input Values
Use values from earlier in the flow to set the inputs for the action.

Input Parameter Description


Chat URL URL of the chat room where you want your message to appear.

298
Automate Your Business Processes Flows

Input Parameter Description


Message Chat message sent to the chat room. Valid values are:
• String values
• @[Salesforce user ID]–To @mention a Salesforce user in the chat room,
enter the Salesforce ID. If the user’s Salesforce email is connected to Quip, the user
ID is replaced with a Quip user @mention. If not, the Salesforce ID is replaced with
the user’s Salesforce email.
• @[person1@quip.com]–To @mention a user by email, enter this value.
• @Everyone–To send a notification to all chat room members, enter this value.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Quip: Send a Message in a Document
Add a message to the conversations pane of a document.
EDITIONS
In Flow Builder, add an Action element to your flow. In the Action field, enter Quip, and select
Send Message in Document. Available in: Lightning
Experience
Set Input Values
Use values from earlier in the flow to set the inputs for the action.

Input Parameter Description


Document URL URL of the document where you want to add a comment.

Message Message added to the document. Valid values are:


• String values
• @[Salesforce user ID]–To @mention a Salesforce user in the document,
enter the Salesforce ID. If the user’s Salesforce email is connected to Quip, the user
ID is replaced with a Quip user @mention. If not, the Salesforce ID is replaced with
the user’s Salesforce email.
• @[person1@quip.com]–To @mention a user by email, enter this value.
• @Everyone–To send a notification to everyone in the document, enter this value.

Section Anchor Link Optional. URL of a section in the document where you want the message to appear.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Quip: Add Quip Document to Folder
Add a document to a folder to organize and share your documents.
EDITIONS
In Flow Builder, add an Action element to your flow. In the Action field, enter Quip, and select
Add Quip Document to Folder. Available in: Lightning
Experience
Set Input Values
Use values from earlier in the flow to set the inputs for the action.

299
Automate Your Business Processes Flows

Input Parameter Description


Document URL URL of the document that you want to add to a folder.

Folder URL URL of the folder where you want to add the document.

Store Output Values

Output Parameter Description


Document ID ID of the added document

Document Link URL of the document added to the folder

Document Title Title of the added document

Example: Watch an Account Plan Automation Demo (2 minutes)

SEE ALSO:
Add and Edit Elements
Flow Core Action for Quip: Add Members to Document
Add members with different levels of access to a document.
EDITIONS
In Flow Builder, add an Action element to your flow. In the Action field, enter Quip, and select
Add Members to Document. Available in: Lightning
Experience
Set Input Values
Use values from earlier in the flow to set the inputs for the action.

Input Parameter Description


Document URL URL of the document that you want to add members to.

Add Comment-Access Members Optional. A list of user emails separated by commas that can view and comment on the
by Email Address document. Valid values are:
• person1@quip.com, person2@quip.com, person3@quip.com
• person1@quip.com

Add Edit-Access Member by Optional. A list of user emails separated by commas that can view, comment on, and edit
Email Address the document. Valid values are:
• person1@quip.com, person2@quip.com, person3@quip.com
• person1@quip.com

Add Full-Access Members by Optional. A list of user emails separated by commas that can view, comment on, edit,
Email Address and share the document. Valid values are:
• person1@quip.com, person2@quip.com, person3@quip.com
• person1@quip.com

300
Automate Your Business Processes Flows

Input Parameter Description


Add View-Access Members by Optional. A list of user emails separated by commas that can view the document. Valid
Email Address values are:
• person1@quip.com, person2@quip.com, person3@quip.com
• person1@quip.com

Store Output Values

Output Parameter Description


Document ID ID of the document

Document Link URL of the document

Document Title Title of the document

Example: A service manager wants to add Tier 3 service reps to a Case Swarm document to solve a customer case. The service
manager also wants to keep sales reps with open opportunities related to the account up to date. You can create a flow that uses
the Add Members to Document core action to add Tier 3 reps to the Case Swarm document and grant the service reps edit-access
to the document. Then you can add the sales reps with open opportunities to the document with comment-access so that they
can see what’s happening and ask questions.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Quip: Add Members to Quip Chat
Add users to a chat room.
EDITIONS
In Flow Builder, add an Action element to your flow. In the Action field, enter Quip, and select
Add Members to Quip Chat. Available in: Lightning
Experience
Set Input Values
Use values from earlier in the flow to set the inputs for the action.

Input Parameter Description


Add Members by Email Address A list of user emails separated by commas to add to the chat room. Valid values are:
• person1@quip.com, person2@quip.com, person3@quip.com
• person1@quip.com

Chat URL URL of the chat room that you want to add members to.

Store Output Values

Output Parameter Description


Chat ID ID of the chat room

301
Automate Your Business Processes Flows

Output Parameter Description


Chat Link URL of the chat room

Chat Title Title of the chat room

SEE ALSO:
Add and Edit Elements
Flow Core Action for Quip: Remove Quip Document from Folder
Remove a document from a folder. Make a shared document private again.
EDITIONS
In Flow Builder, add an Action element to your flow. In the Action field, enter Quip, and select
Remove Quip Document from Folder. Available in: Lightning
Experience
Set Input Values
Use values from earlier in the flow to set the inputs for the action.

Input Parameter Description


Document URL URL of the document that you want to remove from a folder.

Folder URL URL of the folder that you want to remove the document from.

Store Output Values

Output Parameter Description


Document ID ID of the removed document

Document Link URL of the removed document

Document Title Title of the removed document

SEE ALSO:
Add and Edit Elements
Flow Core Action for Quip: Remove Members from Quip Document
To rescind access to a document for certain users, remove them from the document.
EDITIONS
In Flow Builder, add an Action element to your flow. In the Action field, enter Quip, and select
Remove Members from Quip Document. Available in: Lightning
Experience
Set Input Values
Use values from earlier in the flow to set the inputs for the action.

Input Parameter Description


Document URL URL of the document that you want to remove members from.

Remove Members by Email A list of user emails separated by commas to remove from the document. Valid values
Address are:
• person1@quip.com, person2@quip.com, person3@quip.com

302
Automate Your Business Processes Flows

Input Parameter Description


• person1@quip.com

Store Output Values

Output Parameter Description


Document ID ID of the document

Document Link URL of the document

Document Title Title of the document

Example: A service manager previously added Tier 3 service reps and sales reps to a Case Swarm document to solve a customer
case. Now that the case is closed, the service manager wants to remove user access to the document to preserve its integrity. You
can create a flow that uses the Remove Members from Quip Document core action to remove Tier 3 reps and sales reps from the
document.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Quip: Remove Members from Quip Chat
Remove users from a chat room.
EDITIONS
In Flow Builder, add an Action element to your flow. In the Action field, enter Quip, and select
Remove Members from Quip Chat. Available in: Lightning
Experience
Set Input Values
Use values from earlier in the flow to set the inputs for the action.

Input Parameter Description


Remove Members by Email A list of user emails separated by commas to remove from the chat room. Valid values
Address are:
• person1@quip.com, person2@quip.com, person3@quip.com
• person1@quip.com

Chat URL URL of the chat room that you want to remove members from.

Store Output Values

Output Parameter Description


Chat ID ID of the chat room

Chat Link URL of the chat room

303
Automate Your Business Processes Flows

Output Parameter Description


Chat Title Title of the chat room

SEE ALSO:
Add and Edit Elements

B2B Commerce Checkout Flow Core Actions


The B2B Commerce Checkout Flow provides several core actions for implementing a successful
EDITIONS
checkout process within your Commerce org. To add one of these actions to your flow, add an
Action element. Then select the B2B Commerce category, and search for the appropriate action. Available in: Lightning
These actions use Apex-defined input and output variables that map to input and output classes Experience
in the Apex ConnectApi namespace. For more information on using Apex-defined variables in
Available in: Performance,
flows, see Considerations for the Apex-Defined Data Type on page 221. Professional, and Unlimited
Editions with B2B Commerce
Flow Core Action for Checkout Flow: Activate Order
Activates a Salesforce standard draft order.
Flow Core Action for Checkout Flow: Calculate Cart Promotions
Request a full calculation of all line items in the cart that have a promotion.
Flow Core Action for Checkout Flow: Calculate Cart Shipment Costs
Request the shipping costs of all line items within the cart.
Flow Core Action for Checkout Flow: Calculate Cart Taxes
Request a tax cost calculation for all line items within the cart.
Flow Core Action for Checkout Flow: Cancel Cart Async Operation
Cancel the current checkout so the user can return to an unlocked cart. This operation automatically executes when cart changes
are invoked, such as add to cart.
Flow Core Action for Checkout Flow: Cart to Order
Create a Salesforce standard order in draft mode.
Flow Core Action for Checkout Flow: Check Cart Inventory
Request a full inventory availability check of all line items in the cart.
Flow Core Action for Checkout Flow: Checkout Session Action
Get or create a checkout session, and return the ID of the session to the caller.
Flow Core Action for Checkout Flow: Price Cart
Request a reprice of all line items in a cart.
Flow Core Action for Checkout Flow: Update Checkout Session Action
The Update Checkout Session action updates the checkout session state if the current state matches the expected state. This action
provides consistency during checkout handling and guarantees that if two browsers attempt to update the state, one succeeds and
the other fails validation.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Checkout Flow: Activate Order

304
Automate Your Business Processes Flows

Activates a Salesforce standard draft order.


EDITIONS
In Flow Builder, add an Action element to your flow. Select the B2B Commerce category, and
search for Activate Order. To access this action from the API, use the name Available in: Lightning
activateOrderAction. Experience
Set Input Values Available in: Performance,
Use values from earlier in the flow to set the inputs. Professional, and Unlimited
Editions with B2B Commerce
Input Description
Parameter
cartId The ID of the cart that transitions into a checkout.

orderStatus A DynamicEnum with the OrderTypeEnum value.

Store Output Values

Output Parameter Description


backgroundOperationId The ID of the background operation that processes the total price of all items in the cart.

Error Conditions

Error Condition Description


Invalid CartId Input The cart ID value isn’t accepted.
Error Code: UNKNOWN_EXCEPTION
HTTP Status Code: 500

User Can’t Invoke The caller doesn’t have the appropriate permissions to call the action, including the MAD or B2B Commerce
Action Integrator user perms.
Error Code: BAD_REQUEST
HTTP Status Code: 400

User Doesn’t Have The buyer doesn’t own the cart, doesn’t have read access to the cart, or the cart isn’t shared with the buyer.
Access to the Cart
Error Code: BAD_REQUEST
HTTP Status Code: 400

The Cart Isn’t in the The cart status isn’t in the Checkout state and can’t continue.
Checkout State
Error Code: INVALID_OPERATION
HTTP Status Code: 403

Integration Is Already Only one integration can be processed at a time. This error indicates when an integration is already running.
in Progress
Error Code: ALREADY_IN_PROCESS

305
Automate Your Business Processes Flows

Error Condition Description


HTTP Status Code: 400

Account Associated The effective account listed isn’t valid.


With the Cart Isn’t
Valid or Accessible Error Code: INSUFFICIENT_ACCESS_OR_READONLY
HTTP Status Code: 500

User Isn’t a Member of The user isn’t a member of the store.


the Store
Error Code: INSUFFICIENT_ACCESS_OR_READONLY
HTTP Status Code: 500

CartValidationOutput The CartValidationOutput object has errors that are related to the cart and must be cleared before order
Object Has Errors activation.
Error Code: INVALID_INPUT
HTTP Status Code: 403

CheckoutSession Isn’t Checkout Session state must be in the Activate state for the order activation to go forward.
in the Activate State
Error Code: INVALID_INPUT
HTTP Status Code: 403

CheckoutSession Is in CheckoutSession can’t be in the Processing state. Processing indicates a separate integration is already running.
the Processing State Error Code: INVALID_INPUT

HTTP Status Code: 403

Invalid Order Status The Order status input that is passed to the API must be the ACTIVATE status code.
Input
Error Code: UNKNOWN_EXCEPTION
HTTP Status Code: 500

OrderSummary The OrderSummary wasn’t created due to an internal error.


Wasn’t Created
Error Code: UNKNOWN_EXCEPTION
HTTP Status Code: 403

Usage
To use the B2B Commerce Activate Order action, these requirements apply.
1. The user has the appropriate permissions to invoke the action.
2. The effective account is valid.
3. The buyer account is a member of the store.
4. The buyer has edit access to the cart.
5. An order in Draft status is generated from the cartToOrder action, and the orderId is in CartCheckoutSession.

306
Automate Your Business Processes Flows

6. The cart status is CartStatusEnum.CHECKOUT.


7. Session.IsProcessing isn’t set to False.
8. Session.NextState is set to activateOrder.
9. Session.State can’t be empty.
10. backgroundOperationId can’t be New or Running.
When the Activate Order action runs, these API interactions occur.
1. The order item is activated, making it read-only.
2. The order summary is generated asynchronously.
3. The CheckoutSession is archived.
4. The cart is archived.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Checkout Flow: Calculate Cart Promotions
Request a full calculation of all line items in the cart that have a promotion.
EDITIONS
In Flow Builder, add an Action element to your flow. Select the B2B Commerce category, and
search for Calculate Cart Promotions. To access this action from the API, use the name Available in: Lightning
calcCartPromotionsAction. Experience
Set Input Values Available in: Performance,
Use values from earlier in the flow to set the inputs. Professional, and Unlimited
Editions with B2B Commerce
Input Description
Parameter
cartId The ID of the cart that you want to reprice.

Store Output Values

Output Parameter Description


backgroundOperationId The ID of the background operation that processes the total price of all items in the cart.

Error Conditions

Error Condition Description


Invalid CartId Input The cart ID value isn’t accepted.
Error Code: UNKNOWN_EXCEPTION
HTTP Status Code: 500

User Can’t Invoke The caller doesn’t have the appropriate permissions to call the action, including the MAD or B2B Commerce
Action Integrator user perms.

307
Automate Your Business Processes Flows

Error Condition Description


Error Code: BAD_REQUEST
HTTP Status Code: 400

User Doesn’t Have The buyer doesn’t own the cart, doesn’t have read access to the cart, or the cart isn’t shared with the buyer.
Access to the Cart
Error Code: BAD_REQUEST
HTTP Status Code: 400

Cart Isn’t in the The cart status isn’t in the Checkout state and can’t continue.
Checkout State
Error Code: INVALID_OPERATION
HTTP Status Code: 403

Integration Is Already Only one integration can be processed at a time. This error indicates when an integration is already running.
in Progress
Error Code: ALREADY_IN_PROCESS
HTTP Status Code: 400

Account Associated The effective account listed isn’t valid.


With the Cart Isn’t
Valid or Accessible Error Code: INSUFFICIENT_ACCESS_OR_READONLY
HTTP Status Code: 500

User Isn’t a Member of The user isn’t a member of the store.


the Store
Error Code: INSUFFICIENT_ACCESS_OR_READONLY
HTTP Status Code: 500

Usage
This action is executed asynchronously using the pricing service configured in StoreIntegratedService.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Checkout Flow: Calculate Cart Shipment Costs
Request the shipping costs of all line items within the cart.
EDITIONS
In Flow Builder, add an Action element to your flow. Select the B2B Commerce category, and
search for Calculate Cart Shipment Costs. To access this action from the API, use the name Available in: Lightning
calcCartShipmentAction. Experience
Set Input Values Available in: Performance,
Use values from earlier in the flow to set the inputs. Professional, and Unlimited
Editions with B2B Commerce

308
Automate Your Business Processes Flows

Input Parameter Description


cartId The ID of the cart that transitions into a checkout.

Store Output Values

Output Parameter Description


backgroundOperationId The ID of the background operation that processes the total price of all items in the cart.

Error Conditions

Error Condition Description


Invalid CartId Input The cart ID value isn’t accepted.
Error Code: UNKNOWN_EXCEPTION
HTTP Status Code: 500

User Can’t Invoke The caller doesn’t have the appropriate permissions to call the action, including the MAD or B2B Commerce
Action Integrator user perms.
Error Code: BAD_REQUEST
HTTP Status Code: 400

User Doesn’t Have The buyer doesn’t own the cart, doesn’t have read access to the cart, or the cart isn’t shared with the buyer.
Access to the Cart
Error Code: BAD_REQUEST
HTTP Status Code: 400

Cart Isn’t in the The cart status isn’t in the Checkout state and can’t continue.
Checkout State
Error Code: INVALID_OPERATION
HTTP Status Code: 403

Integration Is Already Only one integration can be processed at a time. This error indicates when an integration is already running.
in Progress
Error Code: ALREADY_IN_PROCESS
HTTP Status Code: 400

Account Associated The effective account listed isn’t valid.


With the Cart Isn’t
Valid or Accessible Error Code: INSUFFICIENT_ACCESS_OR_READONLY
HTTP Status Code: 500

User Isn’t a Member of The user isn’t a member of the store.


the Store
Error Code: INSUFFICIENT_ACCESS_OR_READONLY

309
Automate Your Business Processes Flows

Error Condition Description


HTTP Status Code: 500

Usage
This action is executed asynchronously using the pricing service configured in StoreIntegratedService.
To use the B2B Commerce Check Cart Shipment Cost action, these requirements apply.
1. The user has the appropriate permissions to invoke the action.
2. The effective account is valid.
3. The buyer account is a member of the store.
4. The buyer has edit access to the cart.
5. The cart status isn’t Closed.
6. Session.IsProcessing isn’t set to False.
7. Session.NextState is set to DeliveryMethod.
8. Session.State can’t be empty.
9. backgroundOperationId can’t be New or Running.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Checkout Flow: Calculate Cart Taxes
Request a tax cost calculation for all line items within the cart.
EDITIONS
In Flow Builder, add an Action element to your flow. Select the B2B Commerce category, and
search for Calculate Cart Taxes. To access this action from the API, use the name Available in: Lightning
calcCartTaxesAction. Experience
Set Input Values Available in: Performance,
Use values from earlier in the flow to set the inputs. Professional, and Unlimited
Editions with B2B Commerce
Input Description
Parameter
cartId The ID of the cart that transitions into a checkout.

Store Output Values

Output Parameter Description


backgroundOperationId The ID of the background operation that processes the total price of all items in the cart.

Error Conditions

310
Automate Your Business Processes Flows

Error Condition Description


Invalid CartId Input The cart ID value isn’t accepted.
Error Code: UNKNOWN_EXCEPTION
HTTP Status Code: 500

User Can’t Invoke The caller doesn’t have the appropriate permissions to call the action, including the MAD or B2B Commerce
Action Integrator user perms.
Error Code: BAD_REQUEST
HTTP Status Code: 400

User Doesn’t Have The buyer doesn’t own the cart, doesn’t have read access to the cart, or the cart isn’t shared with the buyer.
Access to the Cart
Error Code: BAD_REQUEST
HTTP Status Code: 400

Cart Isn’t in the The cart status isn’t in the Checkout state and can’t continue.
Checkout State
Error Code: INVALID_OPERATION
HTTP Status Code: 403

Integration Is Already Only one integration can be processed at a time. This error indicates when an integration is already running.
in Progress
Error Code: ALREADY_IN_PROCESS
HTTP Status Code: 400

Account Associated The effective account listed isn’t valid.


With the Cart Isn’t
Valid or Accessible Error Code: INSUFFICIENT_ACCESS_OR_READONLY
HTTP Status Code: 500

User Isn’t a Member of The user isn’t a member of the store.


the Store
Error Code: INSUFFICIENT_ACCESS_OR_READONLY
HTTP Status Code: 500

Usage
This action is executed asynchronously using the pricing service configured in StoreIntegratedService.
To use the B2B Commerce Calculate Cart Taxes action, these requirements apply.
1. The user has the appropriate permissions to invoke the action.
2. The effective account is valid.
3. The buyer account is a member of the store.
4. The buyer has edit access to the cart.
5. The cart status isn’t Closed.

311
Automate Your Business Processes Flows

6. Session.IsProcessing isn’t set to False.


7. Session.NextState is set to ComputeTaxes.
8. Session.State can’t be empty.
9. backgroundOperationId can’t be New or Running.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Checkout Flow: Cancel Cart Async Operation
Cancel the current checkout so the user can return to an unlocked cart. This operation automatically
EDITIONS
executes when cart changes are invoked, such as add to cart.
In Flow Builder, add an Action element to your flow. Select the B2B Commerce category, and Available in: Lightning
search for Cancel Cart Async Operation. To access this action from the API, use the name Experience
cancelCartAsyncOperation.
Available in: Performance,
Set Input Values Professional, and Unlimited
Use values from earlier in the flow to set the inputs. Editions with B2B Commerce

Input Description
Parameter
cartId The ID of the cart that transitions into a checkout.

Error Conditions

Error Condition Description


Cancel a Closed Cart A cart can’t be canceled after it’s closed.
Error Code: INVALID_OPERATION
HTTP Status Code: 403

Usage
To use the B2B Commerce Cancel Cart Async Operation, these requirements apply.
1. The user has the appropriate permissions to invoke the action.
2. The effective account is valid.
3. The buyer account is a member of the store.
4. The cart status can’t be Closed.
5. There’s an active CartCheckoutSession associated with the cart.
6. There’s a valid BackgroundOperationId.
When the Cancel Cart Async Operation runs, these API interactions occur.
1. The background operation is marked as canceled.
2. The cart transitions to the Active state, unlocking the cart for more updates.

312
Automate Your Business Processes Flows

3. If it exists, the CartCheckoutSession object is archived.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Checkout Flow: Cart to Order
Create a Salesforce standard order in draft mode.
EDITIONS
In Flow Builder, add an Action element to your flow. Select the B2B Commerce category, and
search for Cart To Order . To access this action from the API, use the name Available in: Lightning
cartToOrderAction. Experience
Set Input Values Available in: Performance,
Use values from earlier in the flow to set the inputs. Professional, and Unlimited
Editions with B2B Commerce
Input Description
Parameter
cartId The ID of the cart that transitions into a checkout.

runAsync Execute the Cart to Order action asynchronously.

Store Output Values

Output Parameter Description


backgroundOperationId The ID of the background operation that processes the total price of all items in the cart.

Error Conditions

Error Condition Description


Invalid CartId Input The cart ID value isn’t accepted.
Error Code: UNKNOWN_EXCEPTION
HTTP Status Code: 500

User Can’t Invoke The caller doesn’t have the appropriate permissions to call the action, including the MAD or
Action B2BCommerceIntegrator user perms.
Error Code: BAD_REQUEST
HTTP Status Code: 400

User Doesn’t Have The buyer doesn’t own the cart, doesn’t have read access to the cart, or the cart isn’t shared with the buyer.
Access to the Cart
Error Code: BAD_REQUEST
HTTP Status Code: 400

Cart Isn’t in the The cart status isn’t in the Checkout state and can’t continue.
Checkout State
Error Code: INVALID_OPERATION

313
Automate Your Business Processes Flows

Error Condition Description


HTTP Status Code: 403

Integration Is Already Only one integration can be processed at a time. This error indicates when an integration is already running.
in Progress
Error Code: ALREADY_IN_PROCESS
HTTP Status Code: 400

Account Associated The effective account listed isn’t valid.


With the Cart Isn’t
Valid or Accessible Error Code: INSUFFICIENT_ACCESS_OR_READONLY
HTTP Status Code: 500

User Isn’t a Member of The user isn’t a member of the store.


the Store
Error Code: INSUFFICIENT_ACCESS_OR_READONLY
HTTP Status Code: 500

Usage
To use the B2B Commerce Cart to Order action, these requirements apply.
1. The user has the appropriate permissions to invoke the action.
2. The effective account is valid.
3. The buyer account is a member of the store.
4. The buyer has edit access to the cart.
5. The cart status is CartStatusEnum.CHECKOUT.
6. Session.IsProcessing isn’t set to False.
7. Session.NextState is set to cartToOrder.
8. Session.State can’t be empty.
9. backgroundOperationId can’t be New or Running.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Checkout Flow: Check Cart Inventory
Request a full inventory availability check of all line items in the cart.
EDITIONS
In Flow Builder, add an Action element to your flow. Select the B2B Commerce category, and
search for Check Cart Inventory. To access this action from the API, use the name Available in: Lightning
checkCartInventoryAction. Experience
Set Input Values Available in: Performance,
Use values from earlier in the flow to set the inputs. Professional, and Unlimited
Editions with B2B Commerce

314
Automate Your Business Processes Flows

Input Parameter Description


cartId The ID of the cart that transitions into a checkout.

Store Output Values

Output Parameter Description


backgroundOperationId The ID of the background operation that processes the total price of all items in the cart.

Error Conditions

Error Condition Description


Invalid CartId Input The cart ID value isn’t accepted.
Error Code: UNKNOWN_EXCEPTION
HTTP Status Code: 500

User Can’t Invoke The caller doesn’t have the appropriate permissions to call the action, including the MAD or B2B Commerce
Action Integrator user perms.
Error Code: BAD_REQUEST
HTTP Status Code: 400

User Doesn’t Have The buyer doesn’t own the cart, doesn’t have read access to the cart, or the cart isn’t shared with the buyer.
Access to the Cart
Error Code: BAD_REQUEST
HTTP Status Code: 400

The Cart Isn’t in the The cart status isn’t in the Checkout state and can’t continue.
Checkout State
Error Code: INVALID_OPERATION
HTTP Status Code: 403

Integration Is Already Only one integration can be processed at a time. This error indicates when an integration is already running.
in Progress
Error Code: ALREADY_IN_PROCESS
HTTP Status Code: 400

Account Associated The effective account listed isn’t valid.


With the Cart Isn’t
Valid or Accessible Error Code: INSUFFICIENT_ACCESS_OR_READONLY
HTTP Status Code: 500

User Isn’t a Member of The user isn’t a member of the store.


the Store
Error Code: INSUFFICIENT_ACCESS_OR_READONLY

315
Automate Your Business Processes Flows

Error Condition Description


HTTP Status Code: 500

Usage
This action is executed asynchronously using the pricing service configured in StoreIntegratedService.
To use the B2B Commerce Check Cart Inventory action, these requirements apply.
1. The user has the appropriate permissions to invoke the action.
2. The effective account is valid.
3. The buyer account is a member of the store.
4. The buyer has edit access to the cart.
5. The cart status isn’t Closed.
6. Session.IsProcessing isn’t set to False.
7. Session.NextState is set to CheckInventory.
8. Session.State can’t be empty.
9. backgroundOperationId can’t be New or Running.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Checkout Flow: Checkout Session Action
Get or create a checkout session, and return the ID of the session to the caller.
EDITIONS
In Flow Builder, add an Action element to your flow. Select the B2B Commerce category, and
search for Checkout Session Action. To access this action from the API, use the name Available in: Lightning
checkoutSessionAction. Experience
Set Input Values Available in: Performance,
Use values from earlier in the flow to set the inputs. Professional, and Unlimited
Editions with B2B Commerce
Input Description
Parameter
cartId The ID of the cart that transitions into a checkout.

Store Output Values

Output Parameter Description


requestId The ID of the request that processes and then either creates or returns the Checkout Session.

Error Conditions

316
Automate Your Business Processes Flows

Error Condition Description


Invalid CartId Input The cart ID value isn’t accepted.
Error Code: UNKNOWN_EXCEPTION
HTTP Status Code: 500

User Can’t Invoke The caller doesn’t have the appropriate permissions to call the action, including the MAD or B2B Commerce
Action Integrator user perms.
Error Code: BAD_REQUEST
HTTP Status Code: 400

User Doesn’t Have The user doesn’t have access to the effective account either because it isn’t a buyer account or they don’t have
Access to the Effective permission to buy for the account.
Account
Error Code: BAD_REQUEST
HTTP Status Code: 400

User Account Isn’t The current logged-in buyer account isn’t associated with the store and therefore isn’t a store member.
Associated With the
Store Error Code: BAD_REQUEST
HTTP Status Code: 400

Cart Is Already in The requested cart is already being processed.


Progress
Error Code: BAD_REQUEST
HTTP Status Code: 400

The Session Wasn’t The session wasn’t created due to an internal service error.
Created
Error Code: UNKNOWN_EXCEPTION
HTTP Status Code: 500

Usage
To use the B2B Commerce Checkout Session Action, these requirements apply.
1. The user has the appropriate permissions to invoke the action.
2. The effective account is valid.
3. The buyer account is a member of the store.
4. The cart status is set to Active or Checkout.
5. The cart must not have any current, active session.
When the Checkout Session Action runs, these API interactions occur.
1. The cart transitions to the Checkout state, preventing more updates to the cart.
2. If it doesn’t exist already, the CartCheckoutSession object is created.

317
Automate Your Business Processes Flows

3. All errors that are mapped to the input cartId, on the CartValidationOutput object, are cleared.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Checkout Flow: Price Cart
Request a reprice of all line items in a cart.
EDITIONS
In Flow Builder, add an Action element to your flow. Select the B2B Commerce category, and
search for Price Cart. To access this action from the API, use the name priceCart. Available in: Lightning
Experience
Set Input Values
Use values from earlier in the flow to set the inputs. Available in: Performance,
Professional, and Unlimited
Input Description Editions with B2B Commerce
Parameter
cartId The ID of the cart containing the items that you want to reprice.

Store Output Values

Output Parameter Description


backgroundOperationId The ID of the background operation that processes the total price of all items in the cart.

Error Conditions

Error Condition Description


Invalid CartId Input The cart ID value isn’t accepted.
Error Code: UNKNOWN_EXCEPTION
HTTP Status Code: 500

User Can’t Invoke The caller doesn’t have the appropriate permissions to call the action, including the MAD or B2B Commerce
Action Integrator user perms.
Error Code: BAD_REQUEST
HTTP Status Code: 400

User Doesn’t Have The buyer doesn’t own the cart, doesn’t have read access to the cart, or the cart isn’t shared with the buyer.
Access to the Cart
Error Code: BAD_REQUEST
HTTP Status Code: 400

Cart Isn’t in the The cart status isn’t in the Checkout state and can’t continue.
Checkout State
Error Code: INVALID_OPERATION
HTTP Status Code: 403

318
Automate Your Business Processes Flows

Error Condition Description


Integration Is Already Only one integration can be processed at a time. This error indicates when an integration is already running.
in Progress
Error Code: ALREADY_IN_PROCESS
HTTP Status Code: 400

Account Associated The effective account listed isn’t valid.


With the Cart Isn’t
Valid or Accessible Error Code: INSUFFICIENT_ACCESS_OR_READONLY
HTTP Status Code: 500

User Isn’t a Member of The user isn’t a member of the store.


the Store
Error Code: INSUFFICIENT_ACCESS_OR_READONLY
HTTP Status Code: 500

Usage
This action is executed asynchronously using the pricing service configured in StoreIntegratedService.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Checkout Flow: Update Checkout Session Action
The Update Checkout Session action updates the checkout session state if the current state matches
EDITIONS
the expected state. This action provides consistency during checkout handling and guarantees that
if two browsers attempt to update the state, one succeeds and the other fails validation. Available in: Lightning
In Flow Builder, add an Action element to your flow. Select the B2B Commerce category, and Experience
search for Update Checkout Session Action. To access this action from the API, use the name
Available in: Performance,
updateCheckoutSessionAction.
Professional, and Unlimited
Set Input Values Editions with B2B Commerce
Use values from earlier in the flow to set the inputs.

Input Parameter Description


checkoutSessionId The ID of the checkout session.

nextState The state the session moves to after it completes the tasks included in the current state.
This input is an Apex-defined variable of enum CheckoutStateEnum.

expCurrentState The current state of the session.


This input is an Apex-defined variable of enum CheckoutStateEnum.

Store Output Values

319
Automate Your Business Processes Flows

Output Parameter Description


requestId The ID of the request that processes and then either creates or returns the Checkout Session.

Error Conditions

Error Condition Description


Expected Validation The current state of the checkout session, identified by checkoutSessionId parameter, doesn’t match
Error the expectedState parameter, so the validation fails.
HTTP Status Code: 4XX

Invalid Checkout Invalid input for the Checkout Session ID.


Session ID
Error Code: UNKNOWN_EXCEPTION
HTTP Status Code: 403

Invalid Session or Either the session doesn’t exist or the user doesn’t have the required permissions.
Inadequate User
Access Error Code: INSUFFICIENT_ACCESS_OR_READONLY
HTTP Status Code: 400

User Can’t Invoke The caller doesn’t have the appropriate permissions to call the action, including the MAD or B2B Commerce
Action Integrator user perms.
Error Code: BAD_REQUEST
HTTP Status Code: 400

Account Associated The effective account associated with the cart isn’t a valid account.
With Cart Is Invalid or
Inaccessible Error Code: INSUFFICIENT_ACCESS_OR_READONLY
HTTP Status Code: 400

User Isn’t a Member of The buyer user isn’t a member of the store.
the Store
Error Code: INSUFFICIENT_ACCESS_OR_READONLY
HTTP Status Code: 400

Usage
To use the B2B Commerce Update Checkout Session Action, these requirements apply.
1. The user has the appropriate permissions to invoke the action.
2. The effective account is valid.
3. The buyer account is a member of the store.
4. The cart status isn’t set to Closed or Processing.

320
Automate Your Business Processes Flows

5. The CartcheckoutSession.IsProcessing field is False.

SEE ALSO:
Add and Edit Elements

Commerce Checkout Flow Core Actions


The Commerce Checkout Flow provides several core actions for implementing a successful checkout
EDITIONS
process within your Commerce org. To add one of these actions to your flow, add an Action element.
Then select the Commerce category, and search for the appropriate action. Available in: Lightning
These actions use Apex-defined input and output variables that map to input and output classes Experience
in the Apex ConnectApi namespace. For more information on using Apex-defined variables in
Available in: Performance,
flows, see Considerations for the Apex-Defined Data Type on page 221. Professional, and Unlimited
Editions with Repricing
Flow Core Action for Commerce Checkout Flow: Add Cart Item
Add an item to a cart.
Flow Core Action for Commerce Checkout Flow: Create Cart
Create a cart.
Flow Core Action for Commerce Checkout Flow: Delete Cart
Delete a cart.
Flow Core Action for Commerce Checkout Flow: Add Cart Item
Add an item to a cart.
EDITIONS
In Flow Builder, add an Action element to your flow. Select the Commerce category, and search
for Add Cart Item. To access this action from REST API, use the name addCartItem. Available in: Lightning
Experience
Note: This action is available with the Order Entry and Pricing API.
Available in: Enterprise,
Set Input Values Unlimited, and Developer
Use values from earlier in the flow to set the inputs. Editions

Input Description
Parameter
Cart ID of the cart or state of the cart to add an item to. Valid state values are: active
State or and current. A current cart is neither closed nor pending deletion.
ID

effectiveAccountId (Optional) ID of the buyer account or guest buyer profile for which the request
is made. If unspecified, the default value is determined from context.

Web Store The ID of the web store.


ID

Cart Item This input is an Apex-defined variable of class ConnectApi.CartItemInput, which


Input includes these fields:
• productId — ID of the product.
• quantity — Quantity of the cart item. Use a value that can be converted
to BigDecimal.

321
Automate Your Business Processes Flows

Input Parameter Description


• type — Type of the cart item. The only valid value is Product.

Store Output Values


Use output values later in the flow. The values are assigned when the item is created.

Output Parameter Description


Added Cart This output is an Apex-defined variable of class ConnectApi.CartItem, which includes these fields:
Item • itemizedAdjustmentAmount — Total itemized adjustment amount for the item, including
promotions and excluding taxes.
• listPrice — List price for the item.
• salesPrice — Sales price for the item.
• totalAdjustmentAmount — Adjustments made to the unit price for the item. This value is
informational only and isn’t used in pricing calculations.
• totalAmount — Total amount for the item.
• totalListPrice — Total list price for the item.
• totalPrice — Total price for the item including adjustments but excluding taxes.
• totalTax — Total tax for the item.
• unitAdjustedPrice — Unit price, including adjustments, for the item. This value is informational
only and isn’t used in pricing calculations.
• unitAdjustmentAmount — Total amount including discounts, but excluding shipping and tax, for
product items in the cart.

Error Conditions

Error Condition Description

The user doesn’t have Error Message: You don't have access to this cart. If possible, contact the admin for this web store.
access to the cart. Error Code: INSUFFICIENT_ACCESS_OR_READONLY
HTTP Status Code: 400

Flow Core Action for Commerce Checkout Flow: Create Cart


Create a cart.
EDITIONS
In Flow Builder, add an Action element to your flow. Select the Commerce category, and search
for Create Cart. To access this action from REST API, use the name createCart. Available in: Lightning
Experience
Note: This action is available with the Order Entry and Pricing API.
Available in: Enterprise,
Set Input Values Unlimited, and Developer
Use values from earlier in the flow to set the inputs. Editions

322
Automate Your Business Processes Flows

Input Parameter Description


Web Store ID The ID of the web store.

Cart Input This input is an Apex-defined variable of class ConnectApi.CartInput, which includes these fields:
• effectiveAccountId — (Optional) ID of the buyer account or guest buyer profile for which the
request is made. If unspecified, the default value is determined from context.
• isSecondary — (Optional) Specifies whether the cart is secondary (true) or not (false). If
unspecified, defaults to false.
• name — (Optional) Name of the cart. The name can have up to 250 Unicode characters. If unspecified,
defaults to the generated name.
• type — (Optional) Type of cart. The only valid value is Cart. If unspecified, defaults to Cart.

Store Output Values


Use output values later in the flow. The values are assigned when the cart is created.

Output Parameter Description


Cart Summary This output is an Apex-defined variable of class ConnectApi.CartSummary, which includes these fields:
• accountId — ID of the account for the cart.
• cartId — ID of the cart.
• currencyIsoCode — Three-letter ISO 4217 currency code associated with the cart.
• grandTotalAmount — Grand total amount including shipping and tax for items in the cart, in the
currency of the cart.
• isSecondary — Specifies whether the cart is secondary (true) or not (false).
• name — Name of the cart.
• purchaseOrderNumber — Purchase order for the cart.
• status — Status of the cart. Possible values are:
– Active— Cart is active.
– Checkout— Cart is in checkout.
– Closed— Cart is closed.
– PendingDelete— Cart is pending deletion; for example, a user deleted the cart but the job hasn’t
completed yet.
– Processing— Cart is processing.

• totalChargeAmount — Total amount for shipping and other charges in the currency of the cart.
• totalListPrice — Total list price for the cart.
• totalProductAmount — Total amount including discounts, but excluding shipping and tax, for
product items in the cart.
• totalProductAmountAfterAdjustments — Total product amount, including promotions.
• totalProductCount — Total count of items in the cart.
• totalPromotionalAdjustmentAmount — Total promotional adjustment amount for items in
the cart.

323
Automate Your Business Processes Flows

Output Parameter Description


• totalTaxAmount — Total tax amount for the cart, including tax on shipping, if applicable.
• type — Type of cart. Value is always Cart.
• uniqueProductCount — Total count of unique items, or SKUs, in the cart.
• webstoreId — ID of the web store of the cart.

Error Conditions

Error Condition Description

The user doesn’t have Error Message: You don't have access to this cart. If possible, contact the admin for this web store.
access to create a cart. Error Code: INSUFFICIENT_ACCESS_OR_READONLY

HTTP Status Code: 400

Flow Core Action for Commerce Checkout Flow: Delete Cart


Delete a cart.
EDITIONS
In Flow Builder, add an Action element to your flow. Select the Commerce category, and search
for Delete Cart. To access this action from REST API, use the name deleteCart. Available in: Lightning
Experience
Note: This action is available with the Order Entry and Pricing API.
Available in: Enterprise,
Set Input Values Unlimited, and Developer
Use values from earlier in the flow to set the inputs. Editions

Input Description
Parameter
Cart ID of the cart or state of the cart to delete. Valid state values are: active and
State or current. A current cart is neither closed nor pending deletion.
ID

effectiveAccountId (Optional) ID of the buyer account or guest buyer profile for which the request
is made. If unspecified, the default value is determined from context.

Web Store ID of the web store associated with the cart.


ID

Store Output Values


Output values aren’t available for this action.
Error Conditions

Error Condition Description

The user doesn’t have Error Message: You don't have access to this cart. If possible, contact the admin for this web store.
access to the cart.

324
Automate Your Business Processes Flows

Error Condition Description


Error Code: INSUFFICIENT_ACCESS_OR_READONLY
HTTP Status Code: 400

Salesforce Order Management Flow Core Actions


Salesforce Order Management provides several core actions for implementing order management
EDITIONS
functionality in flows. To add one of these actions to your flow, add an Action element. Then select
the Order Management category, and search for the appropriate action. Available in: Lightning
These actions use Apex-defined input and output variables that map to input and output classes Experience
in the Apex ConnectApi namespace. For more information on using Apex-defined variables in flows,
Available in: Enterprise,
see Considerations for the Apex-Defined Data Type on page 221.
Unlimited, and Developer
Editions with Salesforce
Flow Core Action for Order Management: Add Order Item Summary Order Management
Add one or more order product summaries to an order summary. This action creates a change
order record.
Flow Core Action for Order Management: Adjust Order Item Summaries Preview
Preview the expected results of adjusting the price of one or more order product summaries on an order summary, without executing
the adjustment. You can only apply a discount, not an increase. The output of this action contains the values that would be set on
the change orders created by submitting the proposed adjustment.
Flow Core Action for Order Management: Adjust Order Item Summaries Submit
Adjust the price of one or more order product summaries on an order summary. You can only apply a discount, not an increase. This
action creates one or more change order records.
Flow Core Action for Order Management: Authorize Payment
Authorize a payment on a credit card. You can include details for a new credit card or reference an existing PaymentMethod.
Flow Core Action for Order Management: Cancel Fulfillment Order Item
Cancel fulfillment order products from a fulfillment order. You can cancel more than one product and specify a quantity to cancel
for each of them. This action doesn’t cancel the associated order product summaries, it only reduces their allocated quantities.
Usually, you reallocate the canceled quantities to a new fulfillment order.
Flow Core Action for Order Management: Cancel Order Item Summaries Preview
Preview the expected results of canceling one or more order product summaries from an order summary without executing the
cancel. The output of this action contains the values that would be set on the change order created by submitting the proposed
cancel.
Flow Core Action for Order Management: Cancel Order Item Summaries Submit
Cancel one or more order product summaries from an order summary. This action creates a change order record.
Flow Core Action for Order Management: Confirm Held Fulfillment Order Capacity
Confirm held fulfillment order capacity at one or more locations. This action decreases a location’s held capacity and increases its
assigned fulfillment order count. Confirm held capacity when you assign a fulfillment order to a location.
Flow Core Action for Order Management: Create Credit Memo
Create a credit memo to represent the refund for one or more change orders associated with an order summary.

325
Automate Your Business Processes Flows

Flow Core Action for Order Management: Create Fulfillment Order


Create one or more fulfillment orders and fulfillment order products for an order delivery group summary, which defines a recipient
and delivery method. You specify the order product summaries to fulfill and the fulfillment locations to handle them. If you specify
multiple fulfillment locations, a fulfillment order is created for each one.
Flow Core Action for Order Management: Create Fulfillment Orders
Create fulfillment orders and fulfillment order products for multiple order delivery group summaries, each of which defines a recipient
and delivery method. You specify the order product summaries to fulfill and the fulfillment locations to handle them. If you specify
multiple fulfillment locations for one order delivery group summary, a fulfillment order is created for each one.
Flow Core Action for Order Management: Create an Invoice from Fulfillment Order
Create an invoice for a fulfillment order that doesn’t have one.
Flow Core Action for Order Management: Create Order Payment Summary
Create an order payment summary for a payment authorization or payments that use the same payment method and are attached
to the same order summary.
Flow Core Action for Order Management: Create Order Summary
Create an order summary based on an order. That order is considered the original order for the order summary. Subsequent change
orders that apply to the order summary are also represented as order records.
Flow Core Action for Order Management: Create Return Order
Create a return order and return order items for order items belonging to an order summary.
Flow Core Action for Order Management: Ensure Funds Async
Ensure funds for an invoice, and apply them to it. If needed, capture authorized funds by sending a request to a payment provider.
This action inserts a background operation into an asynchronous job queue and returns the ID of that operation so you can track its
status. Payment gateway responses appear in the payment gateway log and don’t affect the background operation status.
Flow Core Action for Order Management: Ensure Refunds Async
Ensure refunds for a credit memo or excess funds by sending a request to a payment provider. This action inserts a background
operation into an asynchronous job queue and returns the ID of that operation so you can track its status. Payment gateway responses
appear in the payment gateway log and don’t affect the background operation status.
Flow Core Action for Order Management: Find Routes with Fewest Splits
Evaluate ordered product quantities against available inventory to determine the smallest combination of locations that can fulfill
the order. If multiple combinations of the minimum number of locations can fulfill the order, the action returns multiple options.
Optionally, you can specify a maximum allowable number of locations.
Flow Core Action for Order Management: Find Routes with Fewest Splits Using OCI
Evaluate ordered product quantities against available inventory to determine the smallest combination of locations that can fulfill
the order. If multiple combinations of the minimum number of locations can fulfill the order, the action returns multiple options.
Optionally, you can specify a maximum allowable number of locations and a list of locations to exclude from the calculation. This
action combines the Omnichannel Inventory Get Availability action and the Order Management Find Routes with Fewest Splits
actions. Instead of calling Get Availability and including the output in the Find Routes with Fewest Splits input, call this action and
specify a location or location group to fulfill each ordered product. This action handles the inventory check.
Flow Core Action for Order Management: Get Fulfillment Order Capacity Values
Get information about the current fulfillment order capacity of one or more locations.
Flow Core Action for Order Management: Hold Fulfillment Order Capacity
Hold capacity to process fulfillment orders at one or more locations. This action increases a location’s held capacity. Hold capacity
when you plan to assign a fulfillment order to a location.

326
Automate Your Business Processes Flows

Flow Core Action for Order Management: Order Routing Rank by Average Distance
Calculate the average distance from sets of inventory locations to an order recipient, and return the sets sorted by that average
distance. Use this action to compare the average shipping distances for different sets of locations that can fulfill an order.
Flow Core Action for Order Management: Release Held Fulfillment Order Capacity
Release held fulfillment order capacity at one or more locations. This action decreases a location’s held capacity without increasing
its assigned fulfillment order count. Release held capacity when you cancel assigning a fulfillment order to a location.
Flow Core Action for Order Management: Return Order Item Summaries Preview
Preview the expected results of a simple return of one or more order product summaries from an order summary without executing
the return. The output of this action contains the values that would be set on the change order created by submitting the proposed
return.
Flow Core Action for Order Management: Return Order Item Summaries Submit
Return one or more order product summaries from an order summary. This action is a simple return that creates a change order but
not a return order.
Flow Core Action for Order Management: Return Return Order Items
Process one or more return order line items belonging to a return order. This action creates a change order record and makes the
processed return order line items read-only. If a processed return order line item has any remaining expected quantity, then the
action creates a separate return order line item representing that quantity.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Order Management: Add Order Item Summary
Add one or more order product summaries to an order summary. This action creates a change order
EDITIONS
record.
In Flow Builder, add an Action element to your flow. Select the Order Management category, and Available in: Lightning
search for Add Order Item Summary. Experience

Important: Don’t call this action via the REST API. Use it only in flows. Available in: Enterprise,
Unlimited, and Developer
Set Input Values Editions with Salesforce
Use values from earlier in the flow to set the inputs. Order Management

Note: For this action’s input values, use records, not record IDs.

Input Parameter Description


Order Item This input is an Apex-defined variable of class runtime_commerce_oms.AddOrderItemSummaries.
Summary Input
Note: For information on setting up the input data, see the Usage section of this topic.

The variable has one field, newItems. This field is a list of Apex-defined variables of class
runtime_commerce_oms.AddItem. Each of the variables includes these fields:
• orderItemSummary — The order product summary record to add.
• reasonCode — Reason for the addition. The value must match one of the picklist values on the Reason
field of the Order Product Summary Change object.
• orderItemTaxLineItemSummaries — A list of order product tax line item records associated
with the order product summary.

327
Automate Your Business Processes Flows

Input Parameter Description


• orderItemAdjustmentLineSummaries — A list of Apex-defined variables of class
runtime_commerce_oms.AddItemAdjustment. Each of the variables includes these fields:
– orderItemAdjustmentLineSummary — An order product adjustment line summary record
associated with the order product summary.
– orderItemTaxLineItemSummaries — A list of order product tax line item records associated
with the order product adjustment line summary.

Store Output Values

Output Parameter Description


Order Item This output is an Apex-defined variable of class ConnectApi.AddOrderItemSummaryOutputRepresentation. It
Summary Output includes these fields:

Note: The sign of a value in the changeBalances field is the opposite of the corresponding value
on a change order record. For example, a discount is a positive value in changeBalances and a
negative value on a change order record.
• changeBalances — An Apex-defined variable of class ConnectApi.ChangeItemOutputRepresentation,
which includes these fields:
– grandTotalAmount — Change to the total with tax.
– totalAdjDeliveryAmtWithTax — Change to the adjusted delivery subtotal, including tax.
– totalAdjDistAmountWithTax — Change to the total order adjustments, including tax.
– totalAdjProductAmtWithTax — Change to the adjusted product subtotal, including tax.
– totalAdjustedDeliveryAmount — Change to the adjusted delivery subtotal.
– totalAdjustedDeliveryTaxAmount — Change to the adjusted delivery subtotal tax.
– totalAdjustedProductAmount — Change to the adjusted product subtotal.
– totalAdjustedProductTaxAmount — Change to the adjusted product subtotal tax.
– totalAdjustmentDistributedAmount — Change to the total order adjustments.
– totalAdjustmentDistributedTaxAmount — Change to the total order adjustments tax.
– totalAmount — Change to the pretax total.
– totalExcessFundsAmount — The amount of excess funds available on the order payment
summaries related to the order summary. It’s equal to the captured amount that is owed as a refund
but isn’t associated with an invoice or credit memo. Excess funds normally occur when order products
are canceled before fulfillment but after payment has been captured. This situation isn’t common in
the US, where funds are normally authorized but not captured until the fulfillment process begins. This
value includes all excess funds related to the order summary, not only the funds related to the current
action.
– totalRefundableAmount — The total amount available to be refunded. It’s the sum of the
excess funds and any outstanding change order grand total amounts that apply to post-fulfillment
changes. This value includes all refundable amounts related to the order summary, not only the amount
related to the current action.

328
Automate Your Business Processes Flows

Output Parameter Description


– totalRequiredFundsAmount — The total amount associated with the order products added
in the current action.

Note: This amount isn’t necessarily an amount that needs to be captured. For example, in an
even exchange flow, the order amount reduction from canceling the exchanged products
offsets the required funds amount of the replacement products.

– totalTaxAmount — Change to the total tax.

• changeOrderId — ID of the change order generated by the action.


• newItems — A list of Apex-defined variables of class ConnectApi.AddItemOutputRepresentation, each
of which represents an added order product, and includes these fields:
– id — ID of the added order product summary.
– name — Name of the added order product summary.
– orderItemAdjustmentLineSummaries — A list of Apex-defined variables of class
ConnectApi.AddItemAdjustmentOutputRepresentation, each of which represents an order product
adjustment line summary associated with the added order product summary. Each of the variables
includes these fields:
• id — ID of the added order product adjustment line summary.
• name — Name of the added order product adjustment line summary.
• orderItemTaxLineItemSummaries — A list of Apex-defined variables of class
ConnectApi.AddItemTaxOutputRepresentation, each of which represents an order product tax line
item summary associated with the order product adjustment line summary. Each of the variables
includes these fields:
– id — ID of the order product tax line item summary.
– name — Name of the order product tax line item summary.

– orderItemTaxLineItemSummaries — A list of Apex-defined variables of class


ConnectApi.AddItemTaxOutputRepresentation, each of which represents an order product tax line
item summary associated with the added order product summary. Each of the variables includes these
fields:
• id — ID of the order product tax line item summary.
• name — Name of the order product tax line item summary.

• orderSummaryId — ID of the order summary specified in the input.

Usage
To set up the Order Item Summary Input:
1. Use create elements to create an order product summary and any associated order product adjustment line summaries and order
product tax line item summaries.

Important: For this action, create summary records. The action generates underlying order product, order adjustment line,
and order product tax line item records.
• Required fields for the order product summary:

329
Automate Your Business Processes Flows

– Id
– OrderSummaryId
– AdjustedLineAmount
– PricebookEntryId
– AdjustedLineAmtWithTax
– Product2Id
– Name
– OrderDevlieryGroupSummaryId
– Quantity
– TotalLineAmount
– UnitPrice
– Type

• Required fields for the order product adjustment line summaries:


– Id
– Amount
– Name
– TotalTaxAmount

• Required fields for the order product tax line item summaries:
– Id
– Amount
– Name
– Type
– TaxEffectiveDate

2. Use an assignment element to set the orderItemSummary field on a runtime_commerce_oms.AddItem variable to the order
product summary record.
3. For each adjustment to include for the product being added, use an assignment element to set the
orderItemAdjustmentLineSummary field on a runtime_commerce_oms.AddItemAdjustment variable to the order
product adjustment line summary. Use assignment elements to add the order product tax line summary records associated with it
to the orderItemTaxLineItemSummaries field on the same runtime_commerce_oms.AddItemAdjustment variable.
4. Use an assignment element to add the runtime_commerce_oms.AddItemAdjustment variables to the
orderItemAdjustmentLineSummaries field on the runtime_commerce_oms.AddItem variable.
5. For each tax to include for the product being added, use an assignment elements to add the order product tax line summary record
to the orderItemTaxLineItemSummaries field on the runtime_commerce_oms.AddItem variable.
6. Use an assignment element to set the reasonCode field on the runtime_commerce_oms.AddItem variable to a valid reason.
7. Use an assignment element to add the runtime_commerce_oms.AddItem variable to the newItems field on a
runtime_commerce_oms.AddOrderItemSummaries variable.
8. Repeat steps 1-6 for each order product that you want to include in the action, adding the inputs to the same
runtime_commerce_oms.AddOrderItemSummaries variable.
9. Use the runtime_commerce_oms.AddOrderItemSummaries variable in the action input.

330
Automate Your Business Processes Flows

Flow Core Action for Order Management: Adjust Order Item Summaries Preview
Preview the expected results of adjusting the price of one or more order product summaries on an
EDITIONS
order summary, without executing the adjustment. You can only apply a discount, not an increase.
The output of this action contains the values that would be set on the change orders created by Available in: Lightning
submitting the proposed adjustment. Experience
In Flow Builder, add an Action element to your flow. Select the Order Management category, and
Available in: Enterprise,
search for Adjust Order Item Summaries Preview.
Unlimited, and Developer
Set Input Values Editions with Salesforce
Use values from earlier in the flow to set the inputs. Order Management

Input Description
Parameter
Order ID of the order summary associated with the order product summaries that you
Summary want to preview adjusting the prices of.
Id

Adjust This input is an Apex-defined variable of class


Order ConnectApi.AdjustOrderItemSummaryInputRepresentation, which includes these
Product fields:
Summaries • adjustItems —This field is a list of Apex-defined variables of class
Input ConnectApi.AdjustItemInputRepresentation. Each of the variables includes
these fields:
– orderItemSummaryId —ID of an order product summary to
preview a price adjustment for.
– description —Optional description of the adjustment.
– adjustmentType —Specifies how to calculate the adjustment
amount from the discountValue field. It can have one of these
values:
• AmountWithTax—The value of discountValue is the
adjustment, including tax.
• AmountWithoutTax—The value of discountValue is the
adjustment, not including tax. Tax is calculated on the value and
added.
• Percentage—The value of discountValue is a percentage
discount. It’s divided by 100, and then multiplied by the total price
and total tax amount of the order product summary to determine
the adjustment amount.

– discountValue —The value used to calculate the adjustment


amount, as specified by the adjustmentType. It must be a negative
value.
– reason —Adjustment reason. The value must match one of the picklist
values on the Reason field of the Order Product Summary Change object.

• allocatedItemsChangeOrderType —Specifies how change orders


would be created for order product summary quantities that are currently

331
Automate Your Business Processes Flows

Input Parameter Description


being fulfilled, defined as QuantityAllocated - QuantityFulfilled. It can have one of these values:
– Disallowed—When distributing the adjustment, ignore any quantities being fulfilled. If an order
product summary’s entire quantity is being fulfilled, return an error. This is the default value.
– InFulfillment—When distributing the adjustment, include quantities being fulfilled. Submitting
the adjustment would create a separate change order for the adjustments made to those quantities.
– PreFulfillment—When distributing the adjustment, include quantities being fulfilled. Submitting
the adjustment would include the adjustments made to those quantities in the change order for
pre-fulfillment quantity adjustments.

Store Output Values


Use output values later in the flow.

Output Parameter Description


Adjust Order This output is an Apex-defined variable of class ConnectApi.AdjustOrderSummaryOutputRepresentation, which
Product contains the financial changes that would result from the proposed adjustment. Most of the values represent
Summary Output the deltas of the values on the associated order summary.

Note: The sign of a value in the changeBalances field is the opposite of the corresponding value
on a change order record. For example, a discount is a positive value in changeBalances and a
negative value on a change order record.
The orderSummaryId field is the ID of the order summary specified in the input.
The changeBalances field is an Apex-defined variable of class
ConnectApi.ChangeItemOutputRepresentation, which includes these fields:
• grandTotalAmount —Change to the total with tax.
• totalAdjDeliveryAmtWithTax —Change to the adjusted delivery subtotal, including tax.
• totalAdjDistAmountWithTax —Change to the total order adjustments, including tax.
• totalAdjProductAmtWithTax —Change to the adjusted product subtotal, including tax.
• totalAdjustedDeliveryAmount —Change to the adjusted delivery subtotal.
• totalAdjustedDeliveryTaxAmount —Change to the adjusted delivery subtotal tax.
• totalAdjustedProductAmount —Change to the adjusted product subtotal.
• totalAdjustedProductTaxAmount —Change to the adjusted product subtotal tax.
• totalAdjustmentDistributedAmount —Change to the total order adjustments.
• totalAdjustmentDistributedTaxAmount —Change to the total order adjustments tax.
• totalAmount —Change to the pretax total.
• totalExcessFundsAmount —The amount of excess funds available on the order payment summaries
related to the order summary. It’s equal to the captured amount that is owed as a refund but isn’t associated
with an invoice or credit memo. Excess funds normally occur when order products are canceled before
fulfillment but after payment has been captured. This situation isn’t common in the US, where funds are
normally authorized but not captured until the fulfillment process begins. This value includes all excess
funds related to the order summary, not only the funds related to the current action.

332
Automate Your Business Processes Flows

Output Parameter Description


• totalRefundableAmount —The total amount available to be refunded. It’s the sum of the excess
funds and any outstanding change order grand total amounts that apply to post-fulfillment changes. This
value includes all refundable amounts related to the order summary, not only the amount related to the
current action.
• totalTaxAmount —Change to the total tax.
The postFulfillmentChangeOrderId field is always null for a preview action.
The preFulfillmentChangeOrderId field is always null for a preview action.
The inFulfillmentChangeOrderId field is always null for a preview action.

Usage
When a price adjustment is applied to an order product summary, its quantities are considered in three groups:
Pre-fulfillment
QuantityAvailableToFulfill, which is equal to QuantityOrdered - QuantityCanceled - QuantityAllocated
In-fulfillment
QuantityAllocated - QuantityFulfilled
Post-fulfillment
QuantityAvailableToReturn, which is equal to QuantityFulfilled - QuantityReturnInitiated
You can apply adjustments to these groups in three different ways, controlled by the allocatedItemsChangeOrderType
input property:
• Distribute the adjustment evenly between pre-fulfillment and post-fulfillment quantities. Ignore in-fulfillment quantities. Submitting
the adjustment would create one change order for the adjustments to pre-fulfillment quantities and one change order for the
adjustments to post-fulfillment quantities.
• Distribute the adjustment evenly between pre-fulfillment, in-fulfillment, and post-fulfillment quantities. Submitting the adjustment
would create one change order for the adjustments to both pre-fulfillment and in-fulfillment quantities, and one change order for
the adjustments to post-fulfillment quantities.
• Distribute the adjustment evenly between pre-fulfillment, in-fulfillment, and post-fulfillment quantities. Submitting the adjustment
would create one change order for the adjustments to pre-fulfillment quantities, one change order for the adjustments to in-fulfillment
quantities, and one change order for the adjustments to post-fulfillment quantities.
To set up the Adjust Order Product Summaries Input:
1. Use Assignment elements to set the orderItemSummaryId, description, adjustmentType, discountValue,
and reason field values on one or more ConnectApi.AdjustItemInputRepresentation variables.
2. Use an Assignment element to add the ConnectApi.AdjustItemInputRepresentation variables to the
changeItems field on a ConnectApi.AdjustOrderItemSummaryInputRepresentation variable.
3. Use an Assignment element to set the allocatedItemsChangeOrderType field on the
ConnectApi.AdjustOrderItemSummaryInputRepresentation variable.
4. Use the ConnectApi.AdjustOrderItemSummaryInputRepresentation variable and the order summary ID in
the action input.

333
Automate Your Business Processes Flows

In a flow for adjusting the prices of order product summaries, display the output of this action for the user to review before executing
the adjustment. When the user verifies the expected results, pass the same input to an Adjust Order Item Summaries Submit action.

SEE ALSO:
Flow Core Action for Order Management: Adjust Order Item Summaries Submit
Add and Edit Elements
Flow Core Action for Order Management: Adjust Order Item Summaries Submit
Adjust the price of one or more order product summaries on an order summary. You can only apply
EDITIONS
a discount, not an increase. This action creates one or more change order records.
In Flow Builder, add an Action element to your flow. Select the Order Management category, and Available in: Lightning
search for Adjust Order Item Summaries Submit. Experience
Set Input Values Available in: Enterprise,
Use values from earlier in the flow to set the inputs. Unlimited, and Developer
Editions with Salesforce
Input Description Order Management
Parameter
Order ID of the order summary associated with the order product summaries that you
Summary want to adjust the prices of.
Id

Adjust This input is an Apex-defined variable of class


Order ConnectApi.AdjustOrderItemSummaryInputRepresentation, which includes these
Product fields:
Summaries • adjustItems —This field is a list of Apex-defined variables of class
Input ConnectApi.AdjustItemInputRepresentation. Each of the variables includes
these fields:
– orderItemSummaryId —ID of an order product summary to adjust
the price of.
– description —Optional description of the adjustment.
– adjustmentType —Specifies how to calculate the adjustment
amount from the discountValue field. It can have one of these
values:
• AmountWithTax—The value of discountValue is the
adjustment, including tax.
• AmountWithoutTax—The value of discountValue is the
adjustment, not including tax. Tax is calculated on the value and
added.
• Percentage—The value of discountValue is a percentage
discount. It’s divided by 100, and then multiplied by the total price
and total tax amount of the order product summary to determine
the adjustment amount.

– discountValue —The value used to calculate the adjustment


amount, as specified by the adjustmentType. It must be a negative
value.

334
Automate Your Business Processes Flows

Input Parameter Description


– reason — Adjustment reason.The value must match one of the picklist values on the Reason field
of the Order Product Summary Change object.

• allocatedItemsChangeOrderType —Specifies how to create change orders for order product


summary quantities that are currently being fulfilled, defined as QuantityAllocated - QuantityFulfilled. It can
have one of these values:
– Disallowed—When distributing the adjustment, ignore any quantities being fulfilled. If an order
product summary’s entire quantity is being fulfilled, return an error. This is the default value.
– InFulfillment—When distributing the adjustment, include quantities being fulfilled. Create a
separate change order for the adjustments made to those quantities.
– PreFulfillment—When distributing the adjustment, include quantities being fulfilled. Include
the adjustments made to those quantities in the change order for pre-fulfillment quantity adjustments.

Store Output Values


Use output values later in the flow. The values are assigned when the change orders are created.

Output Parameter Description


Adjust Order This output is an Apex-defined variable of class ConnectApi.AdjustOrderSummaryOutputRepresentation.
Product Depending on the order product summaries included in the adjustment, one or more change orders are
Summary Output generated. If multiple change orders are generated, then the changeBalances values combine the values
from both of them.

Note: The sign of a value in the changeBalances field is the opposite of the corresponding value
on a change order record. For example, a discount is a positive value in changeBalances and a
negative value on a change order record.
The orderSummaryId field is the ID of the order summary specified in the input.
The changeBalances field is an Apex-defined variable of class
ConnectApi.ChangeItemOutputRepresentation, which includes these fields:
• grandTotalAmount —Change to the total with tax.
• totalAdjDeliveryAmtWithTax —Change to the adjusted delivery subtotal, including tax.
• totalAdjDistAmountWithTax —Change to the total order adjustments, including tax.
• totalAdjProductAmtWithTax —Change to the adjusted product subtotal, including tax.
• totalAdjustedDeliveryAmount —Change to the adjusted delivery subtotal.
• totalAdjustedDeliveryTaxAmount —Change to the adjusted delivery subtotal tax.
• totalAdjustedProductAmount —Change to the adjusted product subtotal.
• totalAdjustedProductTaxAmount —Change to the adjusted product subtotal tax.
• totalAdjustmentDistributedAmount —Change to the total order adjustments.
• totalAdjustmentDistributedTaxAmount —Change to the total order adjustments tax.
• totalAmount —Change to the pretax total.
• totalExcessFundsAmount —The amount of excess funds available on the order payment summaries
related to the order summary. It’s equal to the captured amount that is owed as a refund but isn’t associated

335
Automate Your Business Processes Flows

Output Parameter Description


with an invoice or credit memo. Excess funds normally occur when order products are canceled before
fulfillment but after payment has been captured. This situation isn’t common in the US, where funds are
normally authorized but not captured until the fulfillment process begins. This value includes all excess
funds related to the order summary, not only the funds related to the current action.
• totalRefundableAmount —The total amount available to be refunded. It’s the sum of the excess
funds and any outstanding change order grand total amounts that apply to post-fulfillment changes. This
value includes all refundable amounts related to the order summary, not only the amount related to the
current action.
• totalTaxAmount —Change to the total tax.
The postFulfillmentChangeOrderId is the ID of the change order representing the portion of the
adjustment that was applied to order product summary quantities that have been fulfilled.
The preFulfillmentChangeOrderId is the ID of the change order representing the portion of the
adjustment that was applied to order product summary quantities that haven’t been fulfilled. If the input
specified an allocatedItemsChangeOrderType of PreFulfillment, this change order also
includes the changes applicable to order product summary quantities that are in the process of being fulfilled.
The inFulfillmentChangeOrderId is the ID of the change order representing the portion of the
adjustment that was applied to order product summary quantities that are in the process of being fulfilled.
This change order is only created for an input that specified an allocatedItemsChangeOrderType
of InFulfillment.

Usage
When a price adjustment is applied to an order product summary, its quantities are considered in three groups:
Pre-fulfillment
QuantityAvailableToFulfill, which is equal to QuantityOrdered - QuantityCanceled - QuantityAllocated
In-fulfillment
QuantityAllocated - QuantityFulfilled
Post-fulfillment
QuantityAvailableToReturn, which is equal to QuantityFulfilled - QuantityReturnInitiated
You can apply adjustments to these groups in three different ways, controlled by the allocatedItemsChangeOrderType
input property:
• Distribute the adjustment evenly between pre-fulfillment and post-fulfillment quantities. Ignore in-fulfillment quantities. Create one
change order for the adjustments to pre-fulfillment quantities and one change order for the adjustments to post-fulfillment quantities.
• Distribute the adjustment evenly between pre-fulfillment, in-fulfillment, and post-fulfillment quantities. Create one change order
for the adjustments to both pre-fulfillment and in-fulfillment quantities, and one change order for the adjustments to post-fulfillment
quantities.
• Distribute the adjustment evenly between pre-fulfillment, in-fulfillment, and post-fulfillment quantities. Create one change order
for the adjustments to pre-fulfillment quantities, one change order for the adjustments to in-fulfillment quantities, and one change
order for the adjustments to post-fulfillment quantities.
To set up the Adjust Order Product Summaries Input:
1. Use Assignment elements to set the orderItemSummaryId, description, adjustmentType, discountValue,
and reason field values on one or more ConnectApi.AdjustItemInputRepresentation variables.

336
Automate Your Business Processes Flows

2. Use an Assignment element to add the ConnectApi.AdjustItemInputRepresentation variables to the


changeItems field on a ConnectApi.AdjustOrderItemSummaryInputRepresentation variable.
3. Use an Assignment element to set the allocatedItemsChangeOrderType field on the
ConnectApi.AdjustOrderItemSummaryInputRepresentation variable.
4. Use the ConnectApi.AdjustOrderItemSummaryInputRepresentation variable and the order summary ID in
the action input.
In a flow for adjusting the prices of order product summaries, run an Adjust Order Item Summaries Preview action before running this
action. Then display its output for the user to review. When the user verifies the expected results, pass the same input to this action.
After submitting a price adjustment, process refunds as appropriate:
• If the discount only applied to order product summaries for which payment hasn’t been captured, it doesn’t require a refund. This
situation normally applies to order products in the US that haven’t been fulfilled.
• If the discount applied to order product summaries that haven’t been fulfilled and for which payment has been captured, process
a refund. In this case, pass the totalExcessFundsAmount from changeBalances to the Ensure Refunds Async action.
• If the discount applied to order product summaries that have been fulfilled, process a refund. Pass the
postFulfillmentChangeOrderId to the Create Credit Memo action, then pass the credit memo to the Ensure Refunds
Async action.
• If the discount applied to both fulfilled and unfulfilled order product summaries for which payment has been captured, process both
refunds. Pass the postFulfillmentChangeOrderId to the Create Credit Memo action, then pass the credit memo and
the totalExcessFundsAmount from changeBalances to the Ensure Refunds Async action.

Important: Excess funds aren’t reduced until the payment processor issues a refund. If you don’t process refunds promptly,
subsequent refunds can be inaccurate. Consider the following example.
1. An order with a total amount of $100 is placed, and the amount is captured immediately.
2. A product is canceled from the order, resulting in $20 of excess funds.
3. Before the excess funds are sent to the payment provider in an ensure refunds action, another product is canceled. This
cancellation adds another $20 of excess funds. However, because the original $20 hasn’t been refunded yet, the cancel action
returns a total excess funds amount of $40.
4. The first excess funds amount ($20) is sent to the payment provider in an ensure refunds request.
5. The second excess funds amount ($40) is sent to the payment provider in an ensure refunds request.
6. The payment provider receives requests for $60 of refunds, when the correct refund total is $40. Because the total refund
amount is less than the total captured amount of $100, the payment provider issues $60 in refunds.

SEE ALSO:
Flow Core Action for Order Management: Adjust Order Item Summaries Preview
Add and Edit Elements
Flow Core Action for Order Management: Authorize Payment

337
Automate Your Business Processes Flows

Authorize a payment on a credit card. You can include details for a new credit card or reference an
EDITIONS
existing PaymentMethod.
In Flow Builder, add an Action element to your flow. Select the Order Management category, and Available in: Lightning
search for Authorize Payment. To access this action from REST API, use the name Experience
authorizePayment.
Available in: Enterprise,
Note: This action is available with the PaymentsAPIUser user permission. Unlimited, and Developer
Editions with Salesforce
Set Input Values Order Management
Use values from earlier in the flow to set the inputs.

Input Parameter Description


Payment This input is an Apex-defined variable of class ConnectApi.AuthorizationRequest, which includes these fields:
Authorization • accountId —ID of the account that contains the payment transaction being authorized.
Request
• amount —Authorization amount.
• comments —(Optional) Comments for the payment authorization.
• currencyIsoCode —Three-letter ISO 4217 currency code associated with the payment group record.
• effectiveDate —Date that the authorization is applied to the transaction.
• paymentGatewayId —Payment gateway that processes the authorization.
• paymentGroup —(Optional) Payment group for the authorization. The payload must reference either
a paymentGroup or a paymentGroupId, but not both. This field is an Apex-defined variable of class
ConnectApi.PaymentGroupRequest, which includes these fields:
– createPaymentGroup—(Optional) Specifies whether to create a payment group (true) or not
(false).
– currencyIsoCode —(Optional) Three-letter ISO 4217 currency code associated with the payment
group record.
– id—(Optional) ID of the payment group record.
– sourceObjectId—(Optional) Source object ID of the payment group record. Supports only OrderId.

• paymentMethod —Payment method for the authorization. The payload must either reference an
existing payment method or include details for a new payment method, but not both. This field is an
Apex-defined variable of class ConnectApi.AuthApiPaymentMethodRequest, which includes these fields:

Note: This input includes the fields from the parent class,
ConnectApi.BaseApiPaymentMethodRequest.
– address—Address for the payment method. This field is an Apex-defined variable of class
ConnectApi.AddressRequest. It includes these fields, all of which are optional:
• city
• companyName
• country
• postalCode
• state
• street

338
Automate Your Business Processes Flows

Input Parameter Description


– cardPaymentMethod —(Optional) When using a new payment method, the details of that method.
This field is an Apex-defined variable of class ConnectApi.CardPaymentMethodRequest, which includes
these fields:
• accountId—Salesforce account to which this payment method is linked.
• cardCategory —Valid values are CreditCard and DebitCard.
• cardHolderFirstName—First name of the card holder.
• cardHolderLastName—Last name of the card holder.
• cardHolderName—Full name of the card holder.
• cardNumber—Card number.
• cardType—Valid values are:
– AmericanExpress
– DinersClub
– JCB
– Maestro
– MasterCard
– Visa

• comments —(Optional) Comments for the payment method.


• cvv—CVV.
• email—Email of the card holder.
• expiryMonth—Card expiration month.
• expiryYear—Card expiration year.
• nickName—(Optional) Nickname for the payment method.
• startMonth—(Optional) Start month of the card.
• startYear—(Optional) Start year of the card.

– id—(Optional) When using an existing payment method, the ID of that method.


– saveForFuture—Whether to save the payment method for future use.

Store Output Values


Use output values later in the flow. The values are assigned when a response is received from the payment gateway.

Output Parameter Description


Payment This output is an Apex-defined variable of class ConnectApi.AuthorizationResponse, which includes these
Authorization fields:
Response • error —If an error is returned, details about that error. This field is an Apex-defined variable of class
ConnectApi.ErrorResponse, which includes these fields:
– errorCode—Error code.
– message—More detail, if available.

339
Automate Your Business Processes Flows

Output Parameter Description


• gatewayResponse —Response from the payment gateway. This field is an Apex-defined variable of
class ConnectApi.AuthorizationGatewayResponse, which includes this field:
– gatewayAuthorizationCode—Payment authorization code.

• paymentAuthorization —Details about the payment authorization. This field is an Apex-defined


variable of class ConnectApi.PaymentAuthorizationResponse, which includes these fields:
– accountId —ID of the account that contains the payment transaction being authorized.
– amount —Amount that the gateway authorized for the payment transaction.
– currencyIsoCode —Three-letter ISO 4217 currency code associated with the payment group
record.
– effectiveDate—Date that the authorization becomes effective.
– expirationDate—Date that the authorization expires.
– id—ID of the payment authorization record.
– paymentAuthorizationNumber—System-defined number for the payment authorization
record.
– requestDate—Date that the authorization occurred.
– status—Status of the payment authorization as returned by the gateway.

• paymentGatewayLogs —Payment gateway log information about the authorization transaction.


This field is a list of Apex-defined variables of class ConnectApi.GatewayLogResponse, each of which
includes these fields:
– createdDate—Date when the gateway log was created.
– gatewayResultCode—Result codes that show the status of a transaction as it is passed to the
financial institution and then returned to the client.
– id—ID of the gateway log record.
– interactionStatus—Gateway interaction status. It can be SUCCESS, FAILED, or TIMEOUT.

• paymentGroup —Details about the payment group. This field is an Apex-defined variable of class
ConnectApi.PaymentGroupResponse, which includes these fields:
– currencyIsoCode —Three-letter ISO 4217 currency code associated with the payment group
record.
– id—ID of the payment group record.
– sourceObjectId—Source object ID of the payment group record.

• paymentMethod —Details about the payment method. This field is an Apex-defined variable of class
ConnectApi.PaymentMethodResponse, which includes these fields:
– accountId —ID of the account for the payment method.
– id—ID of the payment method.
– status—Status of the payment method.

Usage

340
Automate Your Business Processes Flows

Use this action in custom flows that require payment authorization, such as adding an item to an order or an uneven exchange. Before
using it, verify with your payment provider that it supports payment authorization calls from Salesforce Order Management.
Flow Core Action for Order Management: Cancel Fulfillment Order Item
Cancel fulfillment order products from a fulfillment order. You can cancel more than one product
EDITIONS
and specify a quantity to cancel for each of them. This action doesn’t cancel the associated order
product summaries, it only reduces their allocated quantities. Usually, you reallocate the canceled Available in: Lightning
quantities to a new fulfillment order. Experience
In Flow Builder, add an Action element to your flow. Select the Order Management category, and
Available in: Enterprise,
search for Cancel Fulfillment Order Item.
Unlimited, and Developer
Set Input Values Editions with Salesforce
Use values from earlier in the flow to set the inputs. Order Management

Input Description
Parameter
Cancel This input is an Apex-defined variable of class
Fulfillment ConnectApi.FulfillmentOrderLineItemsToCancelInputRepresentation.
Order The variable has one field, fulfillmentOrderLineItemsToCancel,
Items which is a list of Apex-defined variables of class
Input ConnectApi.FulfillmentOrderLineItemInputRepresentation. Each of those variables
includes these fields:
• fulfillmentOrderLineItemId — Reference to the fulfillment
order product to cancel.
• quantity — Quantity to cancel.

Fulfillment Reference to the fulfillment order that you want to cancel fulfillment order items
Order Id from.

Store Output Values

Output Parameter Description


Cancel This value is an Apex-defined variable of class
Fulfillment ConnectApi.FulfillmentOrderCancelLineItemsOutputRepresentation.
Order Items This action doesn’t return any data.
Output

Usage
To set up the Cancel Fulfillment Order Items Input, first use Assignment elements to set the fulfillmentOrderLineItemId
and quantity field values on one or more ConnectApi.FulfillmentOrderLineItemInputRepresentation
variables. Then use an Assignment element to add those variables to the FulfillmentOrderLineItemsToCancel field on

341
Automate Your Business Processes Flows

a ConnectApi.FulfillmentOrderLineItemsToCancelInputRepresentation variable. Use that variable in the


action input.

SEE ALSO:
Add and Edit Elements
Add and Edit Elements
Flow Core Action for Order Management: Cancel Order Item Summaries Preview
Preview the expected results of canceling one or more order product summaries from an order
EDITIONS
summary without executing the cancel. The output of this action contains the values that would
be set on the change order created by submitting the proposed cancel. Available in: Lightning
In Flow Builder, add an Action element to your flow. Select the Order Management category, and Experience
search for Cancel Order Item Summaries Preview.
Available in: Enterprise,
Set Input Values Unlimited, and Developer
Use values from earlier in the flow to set the inputs. Editions with Salesforce
Order Management
Input Description
Parameter
Cancel This input is an Apex-defined variable of class
Order ConnectApi.ChangeInputRepresentation.
Product The variable has one field, changeItems. This field is a list of Apex-defined
Summary variables of class ConnectApi.ChangeItemInputRepresentation. Each of the
Items variables includes these fields:
Input
• orderItemSummaryId — ID of an order product summary to cancel.
It can’t be a shipping charge product.
• quantity — Quantity to cancel.
• reason — Cancel reason. The value must match one of the picklist values
on the Reason field of the Order Product Summary Change object.
• shippingReductionFlag — Boolean flag that specifies whether to
prorate any related delivery charge based on the price change.

Order Reference to the order summary that you want to preview canceling order
Summary product summaries from.
Id

Store Output Values

Output Parameter Description


Cancel Order This output is an Apex-defined variable of class ConnectApi.PreviewCancelOutputRepresentation, which
Product contains the values that would populate a change order record for the proposed cancel.
Summary Output
Note: The sign of a value in the changeBalances field is the opposite of the corresponding value
on a change order record. For example, a discount is a positive value in changeBalances and a
negative value on a change order record.
The orderSummaryId field is the ID of the order summary specified in the input.

342
Automate Your Business Processes Flows

Output Parameter Description


The changeBalances field is an Apex-defined variable of class
ConnectApi.ChangeItemOutputRepresentation, which includes these fields:
• grandTotalAmount — Change to the total with tax.
• totalAdjDeliveryAmtWithTax — Change to the adjusted delivery subtotal, including tax.
• totalAdjDistAmountWithTax — Change to the total order adjustments, including tax.
• totalAdjProductAmtWithTax — Change to the adjusted product subtotal, including tax.
• totalAdjustedDeliveryAmount — Change to the adjusted delivery subtotal.
• totalAdjustedDeliveryTaxAmount — Change to the adjusted delivery subtotal tax.
• totalAdjustedProductAmount — Change to the adjusted product subtotal.
• totalAdjustedProductTaxAmount — Change to the adjusted product subtotal tax.
• totalAdjustmentDistributedAmount — Change to the total order adjustments.
• totalAdjustmentDistributedTaxAmount — Change to the total order adjustments tax.
• totalAmount — Change to the pretax total.
• totalExcessFundsAmount — The amount of excess funds available on the order payment
summaries related to the order summary. It’s equal to the captured amount that is owed as a refund but
isn’t associated with an invoice or credit memo. Excess funds normally occur when order products are
canceled before fulfillment but after payment is captured. This situation isn’t common in the US, where
funds are normally authorized but not captured until the fulfillment process begins. This value includes all
excess funds related to the order summary, not only the funds related to the current action.
• totalRefundableAmount — The total amount available to be refunded. It’s the sum of the excess
funds and any outstanding change order grand total amounts that apply to post-fulfillment changes. This
value includes all refundable amounts related to the order summary, not only the amount related to the
current action.
• totalTaxAmount — Change to the total tax.

Usage
To set up the Cancel Order Product Summary Items Input:
1. Use Assignment elements to set the orderItemSummaryId, quantity, reason, and shippingReductionFlag
field values on one or more ConnectApi.ChangeItemInputRepresentation variables.
2. Use an Assignment element to add the ConnectApi.ChangeItemInputRepresentation variables to the
changeItems field on a ConnectApi.ChangeInputRepresentation variable.
3. Use the ConnectApi.ChangeInputRepresentation variable and the order summary ID in the action input.
In a flow for canceling order product summaries, display the output of this action for the user to review before executing the cancel.
When the user verifies the expected results, pass the same input to a Cancel Order Item Summaries Submit action.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Order Management: Cancel Order Item Summaries Submit

343
Automate Your Business Processes Flows

Cancel one or more order product summaries from an order summary. This action creates a change
EDITIONS
order record.
In Flow Builder, add an Action element to your flow. Select the Order Management category, and Available in: Lightning
search for Cancel Order Item Summaries Submit. Experience
Set Input Values Available in: Enterprise,
Use values from earlier in the flow to set the inputs. Unlimited, and Developer
Editions with Salesforce
Input Description Order Management
Parameter
Cancel This input is an Apex-defined variable of class
Order ConnectApi.ChangeInputRepresentation.
Product The variable has one field, changeItems. This field is a list of Apex-defined
Summary variables of class ConnectApi.ChangeItemInputRepresentation. Each of the
Items variables includes these fields:
Input
• orderItemSummaryId — ID of an order product summary to cancel.
It can’t be a shipping charge product.
• quantity — Quantity to cancel.
• reason — Cancel reason. The value must match one of the picklist values
on the Reason field of the Order Product Summary Change object.
• shippingReductionFlag — Boolean flag that specifies whether to
prorate any related delivery charge based on the price change.

Order Reference to the order summary that you want to cancel order product summaries
Summary from.
Id

Store Output Values

Output Parameter Description


Cancel Order This output is an Apex-defined variable of class ConnectApi.SubmitCancelOutputRepresentation.
Product
Note: The sign of a value in the changeBalances field is the opposite of the corresponding value
Summary Output
on a change order record. For example, a discount is a positive value in changeBalances and a
negative value on a change order record.
The changeOrderId field is the ID of the change order record created for the cancel.
The changeBalances field is an Apex-defined variable of class
ConnectApi.ChangeItemOutputRepresentation, which includes these fields:
• grandTotalAmount — Change to the total with tax.
• totalAdjDeliveryAmtWithTax — Change to the adjusted delivery subtotal, including tax.
• totalAdjDistAmountWithTax — Change to the total order adjustments, including tax.
• totalAdjProductAmtWithTax — Change to the adjusted product subtotal, including tax.
• totalAdjustedDeliveryAmount — Change to the adjusted delivery subtotal.
• totalAdjustedDeliveryTaxAmount — Change to the adjusted delivery subtotal tax.

344
Automate Your Business Processes Flows

Output Parameter Description


• totalAdjustedProductAmount — Change to the adjusted product subtotal.
• totalAdjustedProductTaxAmount — Change to the adjusted product subtotal tax.
• totalAdjustmentDistributedAmount — Change to the total order adjustments.
• totalAdjustmentDistributedTaxAmount — Change to the total order adjustments tax.
• totalAmount — Change to the pretax total.
• totalExcessFundsAmount — The amount of excess funds available on the order payment
summaries related to the order summary. It’s equal to the captured amount that is owed as a refund but
isn’t associated with an invoice or credit memo. Excess funds normally occur when order products are
canceled before fulfillment but after payment is captured. This situation isn’t common in the US, where
funds are normally authorized but not captured until the fulfillment process begins. This value includes all
excess funds related to the order summary, not only the funds related to the current action.
• totalRefundableAmount — The total amount available to be refunded. It’s the sum of the excess
funds and any outstanding change order grand total amounts that apply to post-fulfillment changes. This
value includes all refundable amounts related to the order summary, not only the amount related to the
current action.
• totalTaxAmount — Change to the total tax.

Usage
To set up the Cancel Order Product Summary Items Input:
1. Use Assignment elements to set the orderItemSummaryId, quantity, reason, and shippingReductionFlag
field values on one or more ConnectApi.ChangeItemInputRepresentation variables.
2. Use an Assignment element to add the ConnectApi.ChangeItemInputRepresentation variables to the
changeItems field on a ConnectApi.ChangeInputRepresentation variable.
3. Use the ConnectApi.ChangeInputRepresentation variable and the order summary ID in the action input.
In a flow for canceling order product summaries, run a Cancel Order Item Summaries Preview action before running the action. Then
display its output for the user to review. When the user verifies the expected results, pass the same input to this action.

SEE ALSO:
Flow Core Action for Order Management: Cancel Order Item Summaries Preview
Add and Edit Elements
Flow Core Action for Order Management: Confirm Held Fulfillment Order Capacity
Confirm held fulfillment order capacity at one or more locations. This action decreases a location’s
EDITIONS
held capacity and increases its assigned fulfillment order count. Confirm held capacity when you
assign a fulfillment order to a location. Available in: Lightning
In Flow Builder, add an Action element to your flow. Select the Order Management category, and Experience
search for Confirm Held Fulfillment Order Capacity.
Available in: Enterprise,
Set Input Values Unlimited, and Developer
Use values from earlier in the flow to set the inputs. Editions with Salesforce
Order Management

345
Automate Your Business Processes Flows

Input Parameter Description


Confirm Held This input is an Apex-defined variable of class ConnectApi.ConfirmHeldFOCapacityRequestInputRepresentation,
Fulfillment which includes these fields:
Order • allOrNothing —(Optional) Controls whether a single failed request cancels all other requests in the
Capacity list (true) or whether some requests can succeed if others fail (false). The default value is false.
Input
• capacityRequests —This field is a list of Apex-defined variables of class
ConnectApi.CapacityRequestInputRepresentation. Each of the variables represents a request to confirm
one fulfillment order assigned to one location, and includes these fields:
– actionRequestId —Unique string that identifies the request. Can be a UUID. Use the action
request IDs in response data to identify which requests succeeded or failed.
– locationId —ID of the location associated with the request.

Store Output Values


Use output values later in the flow. The values are assigned when the capacity properties are updated.

Output Parameter Description


Confirm Held This output is an Apex-defined variable of class
Fulfillment ConnectApi.ConfirmHeldFOCapacityResponseOutputRepresentation, which includes this field:
Order Capacity • capacityResponses —This field is a list of Apex-defined variables of class
Output ConnectApi.CapacityResponseOutputRepresentation, each of which includes these fields:
– actionRequestId —Unique string that identifies the original capacity request.
– error —This field is an Apex-defined variable of class ConnectApi.ErrorResponse, which includes
these fields:
• errorCode —Error code, if the request returned an error.
• message —More error detail, if available.

– success —Indicates whether the request was successful (true) or not (false).

Flow Core Action for Order Management: Create Credit Memo


Create a credit memo to represent the refund for one or more change orders associated with an
EDITIONS
order summary.
In Flow Builder, add an Action element to your flow. Select the Order Management category, and Available in: Lightning
search for Create Credit Memo. Experience
Set Input Values Available in: Enterprise,
Use values from earlier in the flow to set the inputs. Unlimited, and Developer
Editions with Salesforce
Order Management

346
Automate Your Business Processes Flows

Input Parameter Description


Credit Memo This input is an Apex-defined variable of class ConnectApi.CreateCreditMemoInputRepresentation.
Input The variable has one field, changeOrderIds, which is a list of IDs of the change orders to create a credit
memo for.

Order Summary Reference to the order summary associated with the change orders.
Id

Store Output Values

Output Parameter Description


Credit Memo This value is an Apex-defined variable of class ConnectApi.CreateCreditMemoOutputRepresentation.
Output The creditMemoId field contains the ID of the created credit memo.

Usage
To set up the Credit Memo Input, first use Assignment elements to add the change order IDs to a list of strings variable. Then use that
variable in the action input.

SEE ALSO:
Flow Core Action for Order Management: Ensure Refunds Async
Add and Edit Elements
Flow Core Action for Order Management: Create Fulfillment Order
Create one or more fulfillment orders and fulfillment order products for an order delivery group
EDITIONS
summary, which defines a recipient and delivery method. You specify the order product summaries
to fulfill and the fulfillment locations to handle them. If you specify multiple fulfillment locations, a Available in: Lightning
fulfillment order is created for each one. Experience
In Flow Builder, add an Action element to your flow. Select the Order Management category, and
Available in: Enterprise,
search for Create Fulfillment Order.
Unlimited, and Developer
Set Input Values Editions with Salesforce
Use values from earlier in the flow to set the inputs. Order Management

Input Description
Parameter
Fulfillment This input is an Apex-defined variable of class
Order ConnectApi.FulfillmentOrderInputRepresentation.
Input The variable has three fields:
• fulfillmentGroups — A list of Apex-defined variables of class
ConnectApi.FulfillmentGroupInputRepresentation. A fulfillment order is
created for each fulfillment group. A group represents a set of order product
summaries to fulfill from a single location, using the same fulfillment type.
Each fulfillment group variable has these fields:

347
Automate Your Business Processes Flows

Input Parameter Description


– fulfilledFromLocationId — Reference to the fulfillment location.
– fulfillmentType — The fulfillment type. Specify one of the values that you defined for the
Type field picklist on the Fulfillment Order object.
– orderItemSummaries — A list of Apex-defined variables of class
ConnectApi.OrderItemSummaryInputRepresentation. Each variable has these fields:
• orderItemSummaryId — Reference to an order product summary.
• quantity — The quantity of the order product summary to allocate to the fulfillment order.

– referenceId — Reference to the fulfillment group input. This action doesn’t use this value.

• orderDeliveryGroupSummaryId — Reference to the order delivery group summary associated


with the order product summaries.
• orderSummaryId — Reference to the order summary associated with the order product summaries.

Store Output Values

Output Parameter Description


Fulfillment This value is an Apex-defined variable of class ConnectApi.FulfillmentOrderOutputRepresentation.
Order Output The fulfillmentOrderIds field is a list of IDs of the created fulfillment orders.

Usage
To set up the Fulfillment Order Input:
1. Use Assignment elements to set the orderItemSummaryId and quantity field values on one or more
ConnectApi.OrderItemSummaryInputRepresentation variables for each fulfillment group.
2. Use Assignment elements to add the ConnectApi.OrderItemSummaryInputRepresentation variables to the
orderItemSummaries fields on one or more ConnectApi.FulfillmentGroupInputRepresentation variables,
one for each fulfillment group.
3. Use Assignment elements to set the fulfilledFromLocationId and fulfillmentType field values on the fulfillment
group variables.
4. Use Assignment elements to add the fulfillment group variables to the fulfillmentGroups field on a
ConnectApi.FulfillmentOrderInputRepresentation variable.
5. Use Assignment elements to set the orderDeliveryGroupSummaryId and orderSummaryId field values on the
ConnectApi.FulfillmentOrderInputRepresentation variable.
6. Use the ConnectApi.FulfillmentOrderInputRepresentation variable in the action input.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Order Management: Create Fulfillment Orders

348
Automate Your Business Processes Flows

Create fulfillment orders and fulfillment order products for multiple order delivery group summaries,
EDITIONS
each of which defines a recipient and delivery method. You specify the order product summaries
to fulfill and the fulfillment locations to handle them. If you specify multiple fulfillment locations Available in: Lightning
for one order delivery group summary, a fulfillment order is created for each one. Experience
In Flow Builder, add an Action element to your flow. Select the Order Management category, and
Available in: Enterprise,
search for Create Fulfillment Orders.
Unlimited, and Developer
Set Input Values Editions with Salesforce
Use values from earlier in the flow to set the inputs. Order Management

Input Description
Parameter
Fulfillment This input is an Apex-defined variable of class
Orders ConnectApi.MultipleFulfillmentOrderInputRepresentation.
Input The variable has one field, fulfillmentOrders. This field is a list of
Apex-defined variables of class ConnectApi.FulfillmentOrderInputRepresentation.
Each variable has three fields:
• fulfillmentGroups — A list of Apex-defined variables of class
ConnectApi.FulfillmentGroupInputRepresentation. A fulfillment order is
created for each fulfillment group. A group represents a set of order product
summaries to fulfill from a single location using the same fulfillment type.
Each fulfillment group variable has these fields:
– fulfilledFromLocationId — Reference to the fulfillment
location.
– fulfillmentType — The fulfillment type. Specify one of the values
that you defined for the Type field picklist on the Fulfillment Order
object.
– orderItemSummaries — A list of Apex-defined variables of class
ConnectApi.OrderItemSummaryInputRepresentation. Each variable has
these fields:
• orderItemSummaryId — Reference to an order product
summary.
• quantity — The quantity of the order product summary to
allocate to the fulfillment order.

– referenceId — Reference to the fulfillment group input. Use this


value to troubleshoot a failure.

• orderDeliveryGroupSummaryId — Reference to the order delivery


group summary associated with the order product summaries.
• orderSummaryId — Reference to the order summary associated with
the order product summaries.

Store Output Values

349
Automate Your Business Processes Flows

Output Parameter Description


Fulfillment This value is an Apex-defined variable of class ConnectApi.MultipleFulfillmentOrderOutputRepresentation.
Orders Output The variable has one field, fulfillmentOrders. This field is a list of Apex-defined variables of class
ConnectApi.FulfillmentGroupOutputRepresentation. Each variable has these fields:
• fulfilledFromLocationId — Reference to the fulfillment location. This value is included so that
you can resubmit the creation if it fails.
• fulfillmentOrderId — Reference to the created fulfillment order.
• fulfillmentType — The fulfillment type. This value is included if the creation failed, so you can
resubmit it.
• orderDeliveryGroupSummaryId — Reference to the order delivery group summary associated
with the order product summaries. This value is included if the creation failed, so you can resubmit it.
• orderItemSummaries — A list of Apex-defined variables of class
ConnectApi.OrderItemSummaryInputRepresentation. This value is included if the creation failed, so you
can resubmit it. Each variable has these fields:
– orderItemSummaryId — Reference to an order product summary.
– quantity — The quantity of the order product summary to allocate to the fulfillment order.

• orderSummaryId — Reference to the order summary associated with the order product summaries.
This value is included if the creation failed, so you can resubmit it.
• referenceId — Reference to the fulfillment group input. Use this value to troubleshoot a failure.

Usage
To set up the Fulfillment Orders Input:
1. For each order delivery group:
a. Use Assignment elements to set the orderItemSummaryId and quantity field values on one or more
ConnectApi.OrderItemSummaryInputRepresentation variables.
b. Use Assignment elements to add the ConnectApi.OrderItemSummaryInputRepresentation variables to the
orderItemSummaries fields on one or more ConnectApi.FulfillmentGroupInputRepresentation
variables, one for each fulfillment group.
c. Use Assignment elements to set the fulfilledFromLocationId, fulfillmentType, and referenceId field
values on the ConnectApi.FulfillmentGroupInputRepresentation variables.
d. Use Assignment elements to add the ConnectApi.FulfillmentGroupInputRepresentation variables to the
fulfillmentGroups field on a ConnectApi.FulfillmentOrderInputRepresentation variable.
e. Use Assignment elements to set the orderDeliveryGroupSummaryId and orderSummaryId field values on the
ConnectApi.FulfillmentOrderInputRepresentation variable.

2. Use Assignment elements to add the ConnectApi.FulfillmentOrderInputRepresentation variables to the


fulfillmentOrders field on a ConnectApi.MultipleFulfillmentOrderInputRepresentation variable.
3. Use the ConnectApi.MultipleFulfillmentOrderInputRepresentation variable in the action input.

SEE ALSO:
Add and Edit Elements

350
Automate Your Business Processes Flows

Flow Core Action for Order Management: Create an Invoice from Fulfillment Order
Create an invoice for a fulfillment order that doesn’t have one.
EDITIONS
In Flow Builder, add an Action element to your flow. Select the Order Management category, and
search for Create an Invoice from Fulfillment Order. Available in: Lightning
Experience
Set Input Values
Use values from earlier in the flow to set the inputs. Available in: Enterprise,
Unlimited, and Developer
Input Description Editions with Salesforce
Parameter Order Management

Fulfillment Reference to the fulfillment order that needs an invoice.


Order Id

Store Output Values

Output Parameter Description


Invoice This value is an Apex-defined variable of class ConnectApi.FulfillmentOrderInvoiceOutputRepresentation.
creation The invoiceId field contains the ID of the created invoice.
output

SEE ALSO:
Flow Core Action for Order Management: Ensure Funds Async
Add and Edit Elements
Flow Core Action for Order Management: Create Order Payment Summary
Create an order payment summary for a payment authorization or payments that use the same
EDITIONS
payment method and are attached to the same order summary.
In Flow Builder, add an Action element to your flow. Select the Order Management category, and Available in: Lightning
search for Create Order Payment Summary. Experience
Set Input Values Available in: Enterprise,
Use values from earlier in the flow to set the inputs. Include at least one payment authorization or Unlimited, and Developer
list of payments. You don’t need both. Editions with Salesforce
Order Management
Input Description
Parameter
Order This input is an Apex-defined variable of class
Payment ConnectApi.CreateOrderPaymentSummaryInputRepresentation.
Summary The variable includes these fields:
Create
Input • orderSummaryId — Reference to the order summary associated with
the payments. In orgs with the multicurrency feature enabled, the order
payment summary inherits the ISO Currency value from the order
summary.
• paymentAuthorizationId — Reference to the payment
authorization to associate with the summary.

351
Automate Your Business Processes Flows

Input Parameter Description


• paymentIds — List of IDs of the payments to associate with the summary.

Store Output Values

Output Parameter Description


Order Payment This value is an Apex-defined variable of class ConnectApi.CreateOrderPaymentSummaryOutputRepresentation.
Summary Output The orderPaymentSummaryId field contains the ID of the created order payment summary.

Usage
To set up the Order Payment Summary Create Input for payments, first use Assignment elements to add the payment IDs to a list of
strings variable. Then use that variable in the action input.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Order Management: Create Order Summary
Create an order summary based on an order. That order is considered the original order for the
EDITIONS
order summary. Subsequent change orders that apply to the order summary are also represented
as order records. Available in: Lightning
In Flow Builder, add an Action element to your flow. Select the Order Management category, and Experience
search for Create Order Summary.
Available in: Enterprise,
Set Input Values Unlimited, and Developer
Use values from earlier in the flow to set the inputs. Editions with Salesforce
Order Management
Input Description
Parameter
Order This input is an Apex-defined variable of class
Summary ConnectApi.OrderSummaryInputRepresentation.
Create The variable has four fields:
Input
• name—Optional. Order summary number to assign to the order summary.
• orderId—The ID of the original order to create an order summary for.
• orderLifeCycleType—Optional. Specifies whether the order is
managed in Salesforce Order Management or by an external system. It can
have one of these values:
– MANAGED—The order is managed in Salesforce Order Management. If
no value is specified, the default is MANAGED.
– UNMANAGED—The order is managed by an external system.

• status—Optional. Status to assign to the order summary. The value must


match one of the picklist values on the Status field of the Order Summary
object.

352
Automate Your Business Processes Flows

Store Output Values

Output Parameter Description


Order Summary This value is an Apex-defined variable of class OrderSummaryOutputRepresentation.
Output The orderSummaryId field contains the ID of the created order summary.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Order Management: Create Return Order
Create a return order and return order items for order items belonging to an order summary.
EDITIONS
In Flow Builder, add an Action element to your flow. Select the Order Management category, and
search for Create Return Order. Available in: Lightning
Experience
Set Input Values
Use values from earlier in the flow to set the inputs. Available in: Enterprise,
Unlimited, and Developer
Input Description Editions with Salesforce
Parameter Order Management and
Returns
Return This input is an Apex-defined variable of class
Order ConnectApi.ReturnOrderInputRepresentation.
Input The variable has four fields:
• orderSummaryId—ID of the order summary containing the items to
be returned. The order summary’s order lifecycle type must be Managed.
• returnOrderLifeCycleType—The LifeCycleType of the return
order. Possible values are:
– Managed—Process the return order using the actions and APIs. It can
generate change orders and effects financial fields and rollup calculations.
– Unmanaged—The return order is for tracking purposes only. It isn’t
involved in any financial calculations and doesn’t generate any change
orders. The system doesn’t prevent the creation of duplicate return order
line items in an unmanaged return order for the same order item.

• returnOrderLineItems—A list of Apex-defined variables of class


ConnectApi.ReturnOrderLineItemInputRepresentation. Each variable has
these fields:
– canReduceShipping—Whether the associated shipping charge
can be refunded.
– orderItemSummaryId—ID of the associated OrderItemSummary.
If the OrderItemSummary already has an associated ReturnOrderLineItem,
then you must specify a different reasonForReturn. Duplicating
the reason breaks the financial calculations.
– quantityExpected—Quantity expected to be returned.

353
Automate Your Business Processes Flows

Input Parameter Description


– quantityReceived—(Optional) Quantity already physically returned. This value isn’t used by any
standard features, but it’s provided for use in customizations.
– reasonForReturn—(Optional) Reason for the return. The value must match an entry in the
ReturnOrderLineItem object’s ReasonForReturn picklist.

• status—Status to assign to the return order. The value must match one of the picklist values on the
Status field of the Return Order object.

Store Output Values

Output Parameter Description


Return Order This value is an Apex-defined variable of class ConnectApi.ReturnOrderOutputRepresentation.
Output The returnOrderId field contains the ID of the created return order.

Usage
To set up the Create Return Order Input:
1. Use Assignment elements to set the canReduceShipping, orderItemSummaryId, quantityExpected,
quantityReceived, and reasonForReturn field values on one or more
ConnectApi.ReturnOrderLineItemInputRepresentation variables.
2. Use an Assignment element to add the ConnectApi.ReturnOrderLineItemInputRepresentation variables to
the returnOrderLineItems field on a ConnectApi.ReturnOrderInputRepresentation variable.
3. Use Assignment elements to set the orderSummaryId, returnOrderLifeCycleType, and status field values on
the ConnectApi.ReturnOrderInputRepresentation variable.
4. Use the ConnectApi.ReturnOrderInputRepresentation variable in the action input.

SEE ALSO:
Flow Core Action for Order Management: Return Return Order Items
Add and Edit Elements
Flow Core Action for Order Management: Ensure Funds Async
Ensure funds for an invoice, and apply them to it. If needed, capture authorized funds by sending
EDITIONS
a request to a payment provider. This action inserts a background operation into an asynchronous
job queue and returns the ID of that operation so you can track its status. Payment gateway responses Available in: Lightning
appear in the payment gateway log and don’t affect the background operation status. Experience
In Flow Builder, add an Action element to your flow. Select the Order Management category, and
Available in: Enterprise,
search for Ensure Funds Async.
Unlimited, and Developer
Set Input Values Editions with Salesforce
Use values from earlier in the flow to set the inputs. Order Management

354
Automate Your Business Processes Flows

Input Parameter Description


Ensure Funds This input is an Apex-defined variable of class ConnectApi.EnsureFundsAsyncInputRepresentation.
Async Input The variable has one field, invoiceId, which is the ID of the invoice to ensure funds for and apply them to.

Order Summary Reference to the order summary associated with the invoice.
Id

Store Output Values

Output Parameter Description


Ensure Funds This value is an Apex-defined variable of class EnsureFundsAsyncOutputRepresentation. It only returns the ID
Async Output of the asynchronous background operation, regardless of whether a call is made to an external payment
gateway. It doesn’t include any errors from the operation.
The backgroundOperationId field contains the ID of the background operation.

Usage
This action checks the order payment summaries associated with the specified order summary for funds to pay the invoice balance as
follows:

Note: If multiple order payment summaries have equal amounts, their order of selection is random.

1. Verify that the invoice balance doesn’t exceed the total amount of all the order payment summaries.
2. Look for an order payment summary with a captured amount equal to the invoice balance. If one exists, apply those funds.
3. If no exact match was found, identify all order payment summaries with captured amounts greater than the invoice balance. If any
exist, select the smallest one and apply funds from it equal to the invoice balance.
4. If no captured amounts greater than the invoice balance were found, traverse the order payment summaries in order of captured
amount, from largest to smallest. Apply each captured amount to the invoice until the invoice balance is zero or all captured funds
are applied.
5. If the invoice still has a balance, look for an order payment summary with an authorized amount equal to the remaining invoice
balance. If one exists, capture and apply those funds.
6. If no exact match was found, identify all order payment summaries with authorized amounts greater than the invoice balance. If
any exist, select the smallest one and apply funds from it equal to the invoice balance.
7. If no authorized amounts greater than the invoice balance were found, traverse the order payment summaries in order of authorized
amount, from largest to smallest. Capture and apply funds until the invoice balance is zero.

SEE ALSO:
Flow Core Action for Order Management: Create an Invoice from Fulfillment Order
Flow Core Action for Order Management: Ensure Refunds Async
Add and Edit Elements
Flow Core Action for Order Management: Ensure Refunds Async

355
Automate Your Business Processes Flows

Ensure refunds for a credit memo or excess funds by sending a request to a payment provider. This
EDITIONS
action inserts a background operation into an asynchronous job queue and returns the ID of that
operation so you can track its status. Payment gateway responses appear in the payment gateway Available in: Lightning
log and don’t affect the background operation status. Experience
In Flow Builder, add an Action element to your flow. Select the Order Management category, and
Available in: Enterprise,
search for Ensure Refunds Async.
Unlimited, and Developer
Set Input Values Editions with Salesforce
Use values from earlier in the flow to set the inputs. Order Management

Input Description
Parameter
Ensure This input is an Apex-defined variable of class
Refunds ConnectApi.EnsureReundsAsyncInputRepresentation.
Async The variable has two fields. You must specify at least one of them.
Input
• creditMemoId — The ID of the credit memo to ensure refunds for.
• excessFundsAmount — The amount of excess funds to apply the
refunds against.

Order Reference to the order summary associated with the credit memo.
Summary
Id

Store Output Values

Output Parameter Description


Ensure Refunds This value is an Apex-defined variable of class EnsureRefundsAsyncOutputRepresentation. It only returns the
Async Output ID of the asynchronous background operation, regardless of whether a call is made to an external payment
gateway. It doesn’t include any errors from the operation.
The backgroundOperationId field contains the ID of the background operation.

Usage
This action checks the order payment summaries associated with the specified order summary for amounts to refund following this
logic:

Note: If multiple order payment summaries have equal amounts, their order of selection is random.

1. If a credit memo is specified, identify order payment summaries with captured amounts that were applied to the corresponding
invoice.
a. Examine those order payment summaries. If one has a captured amount matching the credit memo amount, apply the refund
to that payment.
b. If no exact match was found, look for captured amounts greater than the credit memo amount. If any exist, apply the refund to
the smallest one.

356
Automate Your Business Processes Flows

c. If no greater amounts were found, traverse the order payment summaries in order of captured amount, from largest to smallest.
Apply the refund to them until it’s fully applied.

2. If an excess funds amount is specified, identify order payment summaries with captured amounts that weren’t applied to any invoice.
a. Examine those order payment summaries. If one has a captured amount matching the excess funds amount, apply the refund
to that payment.
b. If no exact match was found, look for captured amounts greater than the excess funds amount. If any exist, apply the refund to
the smallest one.
c. If no greater amounts were found, traverse the order payment summaries in order of captured amount, from largest to smallest.
Apply the refund to them until it’s fully applied.

SEE ALSO:
Flow Core Action for Order Management: Create Credit Memo
Flow Core Action for Order Management: Ensure Funds Async
Add and Edit Elements
Flow Core Action for Order Management: Find Routes with Fewest Splits
Evaluate ordered product quantities against available inventory to determine the smallest
EDITIONS
combination of locations that can fulfill the order. If multiple combinations of the minimum number
of locations can fulfill the order, the action returns multiple options. Optionally, you can specify a Available in: Lightning
maximum allowable number of locations. Experience
In Flow Builder, add an Action element to your flow. Select the Order Management category, and
Available in: Enterprise,
search for Find Routes With Fewest Splits.
Unlimited, and Developer
Set Input Values Editions with Salesforce
Use values from earlier in the flow to set the inputs. Order Management

Input Description
Parameter
Order This input is an Apex-defined variable of class
Routing ConnectApi.FindRoutesWithFewestSplitsInputRepresentation.
Minimize The locationAvailableInventory field is a list of Apex-defined
Shipments variables of class ConnectApi.LocationAvailabilityInputRepresentation. Each of
Input the variables represents a fulfillment location to consider and includes these
fields:
• externalReferenceId — External reference ID of the inventory
location.
• quantity — Available quantity of the product.
• stockKeepingUnit — Stock Keeping Unit (SKU) of the product.
The maximumNumberOfSplits field is the maximum allowable number
of shipment splits. The action doesn’t return routing options that involve more
than this number of splits.

Note: Each split represents an additional shipment. Specifying a


maximum of 0 returns only locations that can fulfill the entire order in a

357
Automate Your Business Processes Flows

Input Parameter Description

single shipment. A maximum of 1 returns combinations of locations that can fulfill the order in one or
two shipments, and so on.
The orderedQuantities field is a list of Apex-defined variables of class
ConnectApi.QuantityWithSkuInputRepresentation. Each of the variables represents an ordered product quantity
to fulfill, and includes these fields:
• quantity — Ordered quantity of the product.
• stockKeepingUnit — SKU of the product.

Store Output Values

Output Parameter Description


Order Routing This output is an Apex-defined variable of class ConnectApi.FindRoutesWithFewestSplitsOutputRepresentation,
Minimize which contains the sets of fulfillment locations that meet the requirements.
Shipments The variable has one field, targetLocations. This field is a list of Apex-defined variables of class
Output ConnectApi.AvailableLocationOutputRepresentation, each of which represents a set of fulfillment locations
that can combine to fulfill the ordered products.
Each of the variables includes one field, locations. This field is a list of the locations in the set.

Usage
To set up the Order Routing Minimize Shipments Input:
1. Use Assignment elements to set the externalReferenceId, quantity, and stockKeepingUnit field values on one
or more ConnectApi.LocationAvailabilityInputRepresentation variables.
2. Use Assignment elements to set the quantity and stockKeepingUnit field values on one or more
ConnectApi.QuantityWithSkuInputRepresentation variables.
3. Use an Assignment element to add the ConnectApi.LocationAvailabilityInputRepresentation variables to
the locationAvailableInventory field on a
ConnectApi.FindRoutesWithFewestSplitsInputRepresentation variable.
4. Optionally, use an Assignment element to set the maximumNumberOfSplits field on the
ConnectApi.FindRoutesWithFewestSplitsInputRepresentation variable.
5. Use an Assignment element to add the ConnectApi.QuantityWithSkuInputRepresentation variables to the
orderedQuantities field on the ConnectApi.FindRoutesWithFewestSplitsInputRepresentation
variable.
6. Use the ConnectApi.FindRoutesWithFewestSplitsInputRepresentation variable in the action input.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Order Management: Find Routes with Fewest Splits Using OCI

358
Automate Your Business Processes Flows

Evaluate ordered product quantities against available inventory to determine the smallest
EDITIONS
combination of locations that can fulfill the order. If multiple combinations of the minimum number
of locations can fulfill the order, the action returns multiple options. Optionally, you can specify a Available in: Lightning
maximum allowable number of locations and a list of locations to exclude from the calculation. Experience
This action combines the Omnichannel Inventory Get Availability action and the Order Management
Find Routes with Fewest Splits actions. Instead of calling Get Availability and including the output Available in: Enterprise,
in the Find Routes with Fewest Splits input, call this action and specify a location or location group Unlimited, and Developer
to fulfill each ordered product. This action handles the inventory check. Editions with Salesforce
Order Management
In Flow Builder, add an Action element to your flow. Select the Order Management category, and
search for Find Routes With Fewest Splits Using OCI.

Note: Set the flow’s runtime API version to 54.0 or later.

Set Input Values


Use values from earlier in the flow to set the inputs.

Input Parameter Description


Find Routes This input is an Apex-defined variable of class
With Fewest ConnectApi.FindRoutesWithFewestSplitsUsingOCIInputRepresentation.
Splits Using The findRoutesWithFewestSplitsUsingOCIInputs field is a list of Apex-defined variables of
OCI Input class ConnectApi.FindRoutesWithFewestSplitsGroupUsingOCIInputRepresentation. Each of the variables
represents one order and includes these fields:
• excludeLocations —List of locations to exclude from the routing calculations.
• maximumNumberOfSplits —Maximum allowable number of shipment splits. The action doesn’t
return routing options that involve more than this number of splits.

Note: Each split represents an additional shipment. Specifying a maximum of 0 returns only locations
that can fulfill the entire order in a single shipment. A maximum of 1 returns combinations of locations
that can fulfill the order in one or two shipments, and so on.

• orderedItems —A list of Apex-defined variables of class


ConnectApi.FindRoutesWithFewestSplitsUsingOCIItemInputRepresentation. Each of the variables represents
an ordered product quantity to fulfill and a location or location group, and includes these fields:
– locationGroupIdentifier —External reference ID of the inventory location or location group.
– quantity —Ordered quantity of the product.
– stockKeepingUnit —Stock Keeping Unit (SKU) of the product.

Store Output Values


Use output values later in the flow.

359
Automate Your Business Processes Flows

Output Parameter Description


Find Routes This output is an Apex-defined variable of class
With Fewest ConnectApi.FindRoutesWithFewestSplitsUsingOCIOutputRepresentation, which contains inventory availability
Splits Using data and the sets of fulfillment locations that meet the requirements.
OCI Output The variable has one field, results. This field is a list of Apex-defined variables of class
ConnectApi.FindRoutesWithFewestSplitsWithInventoryOutputRepresentation, each of which represents the
output for one order, and includes these fields:
• inventory —Inventory availability data for the location groups and locations specified in the input.
• targetLocations —A list of Apex-defined variables of class
ConnectApi.AvailableLocationOutputRepresentation, each of which represents a set of fulfillment locations
that can combine to fulfill the ordered products. Each of the variables includes one field, locations.
This field is a list of the locations in the set.

Usage
To set up the Find Routes With Fewest Splits Using OCI Input:
1. Use assignment elements to set the values for the locationGroupIdentifier, quantity, and stockKeepingUnit
field values on one or more ConnectApi.FindRoutesWithFewestSplitsUsingOCIItemInputRepresentation variables.
2. Use assignment elements to add the ConnectApi.FindRoutesWithFewestSplitsUsingOCIItemInputRepresentation variables to the
orderedItems field on a ConnectApi.FindRoutesWithFewestSplitsGroupUsingOCIInputRepresentation variable.
3. Optionally, use an assignment element to set the value for the maximumNumberOfSplits field on the
ConnectApi.FindRoutesWithFewestSplitsGroupUsingOCIInputRepresentation variable.
4. Use an assignment element to add the ConnectApi.FindRoutesWithFewestSplitsGroupUsingOCIInputRepresentation variable to the
findRoutesWithFewestSplitsUsingOCIInputs field on a
ConnectApi.FindRoutesWithFewestSplitsUsingOCIInputRepresentation variable.
5. Repeat steps 1-4 for each order that you want to include in the action, adding the inputs to the same
ConnectApi.FindRoutesWithFewestSplitsUsingOCIInputRepresentation variable.
6. Use the ConnectApi.FindRoutesWithFewestSplitsUsingOCIInputRepresentation variable in the action input.
Flow Core Action for Order Management: Get Fulfillment Order Capacity Values
Get information about the current fulfillment order capacity of one or more locations.
EDITIONS
In Flow Builder, add an Action element to your flow. Select the Order Management category, and
search for Get Fulfillment Order Capacity Values. Available in: Lightning
Experience
Set Input Values
Use values from earlier in the flow to set the inputs. Available in: Enterprise,
Unlimited, and Developer
Input Description Editions with Salesforce
Parameter Order Management

Get This input is an Apex-defined variable of class


Fulfillment ConnectApi.GetFOCapacityValuesRequestInputRepresentation, which includes
Order this field:
Capacity • locationIds —List of IDs of the locations to get fulfillment order
Values capacity information for.
Input

360
Automate Your Business Processes Flows

Store Output Values


Use output values later in the flow.

Output Parameter Description


Get This output is an Apex-defined variable of class ConnectApi.GetFOCapacityValuesOutputRepresentation, which
Fulfillment includes this field:
Order Capacity • locations —This field is a list of Apex-defined variables of class
Values Output ConnectApi.LocationCapacityOutputRepresentation, each of which includes these fields:
– assigned —Value of the location’s Assigned Fulfillment Order Count.
– capacity —Value of the location’s Fulfillment Order Capacity. This property represents the location’s
maximum capacity.
– error —This field is an Apex-defined variable of class ConnectApi.ErrorResponse, which includes
these fields:
• errorCode —Error code, if the request returned an error.
• message —More error detail, if available.

– heldCapacity —Number of fulfillment orders that the location is holding capacity for.
– locationId —ID of the location.

Flow Core Action for Order Management: Hold Fulfillment Order Capacity
Hold capacity to process fulfillment orders at one or more locations. This action increases a location’s
EDITIONS
held capacity. Hold capacity when you plan to assign a fulfillment order to a location.
In Flow Builder, add an Action element to your flow. Select the Order Management category, and Available in: Lightning
search for Hold Fulfillment Order Capacity. Experience
Set Input Values Available in: Enterprise,
Use values from earlier in the flow to set the inputs. Unlimited, and Developer
Editions with Salesforce
Input Description Order Management
Parameter
Hold This input is an Apex-defined variable of class
Fulfillment ConnectApi.HoldFOCapacityRequestInputRepresentation, which includes these
Order fields:
Capacity • allOrNothing —(Optional) Controls whether a single failed request
Input cancels all other requests in the list (true) or whether some requests can
succeed if others fail (false). The default value is false.
• capacityRequests —This field is a list of Apex-defined variables of
class ConnectApi.CapacityRequestInputRepresentation. Each of the variables
represents a request to hold capacity for one fulfillment order at one location,
and includes these fields:
– actionRequestId —Unique string that identifies the request. Can
be a UUID. Use the action request IDs in response data to identify which
requests succeeded or failed.
– locationId —ID of the location associated with the request.

361
Automate Your Business Processes Flows

Store Output Values


Use output values later in the flow. The values are assigned when the capacity properties are updated.

Output Parameter Description


Hold This output is an Apex-defined variable of class ConnectApi.HoldFOCapacityResponseOutputRepresentation,
Fulfillment which includes this field:
Order Capacity • capacityResponses —This field is a list of Apex-defined variables of class
Output ConnectApi.CapacityResponseOutputRepresentation, each of which includes these fields:
– actionRequestId —Unique string that identifies the original capacity request.
– error —This field is an Apex-defined variable of class ConnectApi.ErrorResponse, which includes
these fields:
• errorCode —Error code, if the request returned an error.
• message —More error detail, if available.

– success —Indicates whether the request was successful (true) or not (false).

Flow Core Action for Order Management: Order Routing Rank by Average Distance
Calculate the average distance from sets of inventory locations to an order recipient, and return
EDITIONS
the sets sorted by that average distance. Use this action to compare the average shipping distances
for different sets of locations that can fulfill an order. Available in: Lightning
In Flow Builder, add an Action element to your flow. Select the Order Management category, and Experience
search for Order Routing Rank By Average Distance.
Available in: Enterprise,
Set Input Values Unlimited, and Developer
Use values from earlier in the flow to set the inputs. Editions with Salesforce
Order Management
Input Description
Parameter
Order This input is an Apex-defined variable of class
Routing ConnectApi.RankAverageDistanceInputRepresentation.
Rank By The deliveryCountryCode field is the country code of the order recipient.
Average
Distance The deliveryPostalCode field is the postal code of the order recipient.
Input The distanceUnit field specifies whether to return average distances in
miles or kilometers, respectively. The value can be mi or km.
The sortResult field specifies whether to sort the location sets in ascending
or descending order by average distance. The value can be ASC or DESC.
The targetLocations field is a list of Apex-defined variables of class
ConnectApi.TargetLocationInputRepresentation. Each of the variables represents
a set of fulfillment locations that can fulfill an order together, and includes one
field, locations. This field is a list of Apex-defined variables of class
ConnectApi.LocationInputRepresentation, each of which represents one location
in the list and contains these fields:
• countryCode — Country code of the location.

362
Automate Your Business Processes Flows

Input Parameter Description


• locationIdentifier — ID of the location.
• postalCode — Postal code of the location.

Store Output Values

Output Parameter Description


Order Routing This output is an Apex-defined variable of class ConnectApi.RankAverageDistanceOutputRepresentation, which
Rank By contains the list of fulfillment location sets, sorted by average distance to the order recipient.
Average The distanceUnit field is the specified unit of distance. It can be miles or kilometers.
Distance
Output The results field is a list of Apex-defined variables of class
ConnectApi.AverageDistanceResultOutputRepresentation, each of which includes one field,
distanceCalculation. It’s an Apex-defined variable of class
ConnectApi.DistanceCalculationOutputRepresentation, which includes these fields:
• averageDistance — Average distance from the locations to the order recipient.
• locations — A list of Apex-defined variables of class ConnectApi.LocationOutputRepresentation, each
of which represents a location in the set and includes two fields:
– distance — Distance from the location to the order recipient.
– locationIdentifier — ID of the location.

• rank — This result’s rank among all results by average distance to the order recipient.

Usage
To set up the Order Routing Rank By Average Distance Input:
1. Use Assignment elements to set the countryCode, locationIdentifier, and postalCode field values on one or
more ConnectApi.LocationInputRepresentation variables to represent the locations in a set.
2. Use an Assignment element to add the ConnectApi.LocationInputRepresentation variables to the locations
field on a ConnectApi.TargetLocationInputRepresentation variable.
3. Repeat the previous two steps for each set of fulfillment locations.
4. Use an Assignment element to add the ConnectApi.TargetLocationInputRepresentation variables to the
targetLocations field on a ConnectApi.RankAverageDistanceInputRepresentation variable.
5. Use Assignment elements to set the deliveryCountryCode, deliveryPostalCode, distanceUnit, and
sortResult field values on the ConnectApi.RankAverageDistanceInputRepresentation variable.
6. Use the ConnectApi.RankAverageDistanceInputRepresentation variable in the action input.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Order Management: Release Held Fulfillment Order Capacity

363
Automate Your Business Processes Flows

Release held fulfillment order capacity at one or more locations. This action decreases a location’s
EDITIONS
held capacity without increasing its assigned fulfillment order count. Release held capacity when
you cancel assigning a fulfillment order to a location. Available in: Lightning
In Flow Builder, add an Action element to your flow. Select the Order Management category, and Experience
search for Release Held Fulfillment Order Capacity.
Available in: Enterprise,
Set Input Values Unlimited, and Developer
Use values from earlier in the flow to set the inputs. Editions with Salesforce
Order Management
Input Description
Parameter
Fulfillment This input is an Apex-defined variable of class
Order ConnectApi.ReleaseHeldFOCapacityRequestInputRepresentation, which includes
Location these fields:
Release • allOrNothing —(Optional) Controls whether a single failed request
Held cancels all other requests in the list (true) or whether some requests can
Capacity succeed if others fail (false). The default value is false.
Input
• capacityRequests —This field is a list of Apex-defined variables of
class ConnectApi.CapacityRequestInputRepresentation. Each of the variables
represents a request to release capacity for one fulfillment order at one
location, and includes these fields:
– actionRequestId —Unique string that identifies the request. Can
be a UUID. Use the action request IDs in response data to identify which
requests succeeded or failed.
– locationId —ID of the location associated with the request.

Store Output Values


Use output values later in the flow. The values are assigned when the capacity properties are updated.

Output Parameter Description


Fulfillment This output is an Apex-defined variable of class
Order Location ConnectApi.ReleaseHeldFOCapacityResponseOutputRepresentation, which includes this field:
Release Held • capacityResponses —This field is a list of Apex-defined variables of class
Capacity ConnectApi.CapacityResponseOutputRepresentation, each of which includes these fields:
Output
– actionRequestId —Unique string that identifies the original capacity request.
– error —This field is an Apex-defined variable of class ConnectApi.ErrorResponse, which includes
these fields:
• errorCode —Error code, if the request returned an error.
• message —More error detail, if available.

– success —Indicates whether the request was successful (true) or not (false).

Flow Core Action for Order Management: Return Order Item Summaries Preview

364
Automate Your Business Processes Flows

Preview the expected results of a simple return of one or more order product summaries from an
EDITIONS
order summary without executing the return. The output of this action contains the values that
would be set on the change order created by submitting the proposed return. Available in: Lightning
In Flow Builder, add an Action element to your flow. Select the Order Management category, and Experience
search for Return Order Item Summaries Preview.
Available in: Enterprise,
Set Input Values Unlimited, and Developer
Use values from earlier in the flow to set the inputs. Editions with Salesforce
Order Management
Input Description
Parameter
Order Reference to the order summary that you want to preview returning order product
Summary summaries from.
Id

Return This input is an Apex-defined variable of class


Order ConnectApi.ChangeInputRepresentation.
Product The variable has one field, changeItems. This field is a list of Apex-defined
Summary variables of class ConnectApi.ChangeItemInputRepresentation. Each of the
Items variables includes these fields:
Input
• orderItemSummaryId — ID of an order product summary to return.
It can’t be a shipping charge product.
• quantity — Quantity to return.
• reason — Return reason. The value must match one of the picklist values
on the Reason field of the Order Product Summary Change object.
• shippingReductionFlag — Boolean flag that specifies whether to
prorate any related delivery charge based on the price change.

Store Output Values

Output Parameter Description


Return Order This output is an Apex-defined variable of class ConnectApi.PreviewCancelOutputRepresentation, which
Product contains the values that would populate a change order record for the proposed return.
Summary Items
Note: The sign of a value in the changeBalances field is the opposite of the corresponding value
Output
on a change order record. For example, a discount is a positive value in changeBalances and a
negative value on a change order record.
The orderSummaryId field is the ID of the order summary specified in the input.
The changeBalances field is an Apex-defined variable of class
ConnectApi.ChangeItemOutputRepresentation, which includes these fields:
• grandTotalAmount — Change to the total with tax.
• totalAdjDeliveryAmtWithTax — Change to the adjusted delivery subtotal, including tax.
• totalAdjDistAmountWithTax — Change to the total order adjustments, including tax.
• totalAdjProductAmtWithTax — Change to the adjusted product subtotal, including tax.

365
Automate Your Business Processes Flows

Output Parameter Description


• totalAdjustedDeliveryAmount — Change to the adjusted delivery subtotal.
• totalAdjustedDeliveryTaxAmount — Change to the adjusted delivery subtotal tax.
• totalAdjustedProductAmount — Change to the adjusted product subtotal.
• totalAdjustedProductTaxAmount — Change to the adjusted product subtotal tax.
• totalAdjustmentDistributedAmount — Change to the total order adjustments.
• totalAdjustmentDistributedTaxAmount — Change to the total order adjustments tax.
• totalAmount — Change to the pretax total.
• totalExcessFundsAmount — The amount of excess funds available on the order payment
summaries related to the order summary. It’s equal to the captured amount that is owed as a refund, but
it isn’t associated with an invoice or credit memo. Excess funds normally occur when order products are
canceled before fulfillment but after payment is captured. This situation isn’t common in the US, where
funds are normally authorized but not captured until the fulfillment process begins. This value includes all
excess funds related to the order summary, not only the funds related to the current action.
• totalRefundableAmount — The total amount available to be refunded. It’s the sum of the excess
funds and any outstanding change order grand total amounts that apply to post-fulfillment changes. This
value includes all refundable amounts related to the order summary, not only the amount related to the
current action.
• totalTaxAmount — Change to the total tax.

Usage
To set up the Return Order Product Summary Items Input:
1. Use Assignment elements to set the orderItemSummaryId, quantity, reason, and shippingReductionFlag
field values on one or more ConnectApi.ChangeItemInputRepresentation variables.
2. Use an Assignment element to add the ConnectApi.ChangeItemInputRepresentation variables to the
changeItems field on a ConnectApi.ChangeInputRepresentation variable.
3. Use the ConnectApi.ChangeInputRepresentation variable and the order summary ID in the action input.
In a flow for returning order product summaries, display the output of this action for the user to review before executing the return.
When the user verifies the expected results, pass the same input to a Return Order Item Summaries Submit action.

SEE ALSO:
Flow Core Action for Order Management: Return Order Item Summaries Submit
Add and Edit Elements
Flow Core Action for Order Management: Return Order Item Summaries Submit

366
Automate Your Business Processes Flows

Return one or more order product summaries from an order summary. This action is a simple return
EDITIONS
that creates a change order but not a return order.
In Flow Builder, add an Action element to your flow. Select the Order Management category, and Available in: Lightning
search for Return Order Item Summaries Submit. Experience
Set Input Values Available in: Enterprise,
Use values from earlier in the flow to set the inputs. Unlimited, and Developer
Editions with Salesforce
Input Description Order Management
Parameter
Order Reference to the order summary that you want to return order product summaries
Summary from.
Id

Return This input is an Apex-defined variable of class


Order ConnectApi.ChangeInputRepresentation.
Product The variable has one field, changeItems. This field is a list of Apex-defined
Summary variables of class ConnectApi.ChangeItemInputRepresentation. Each of the
Items variables includes these fields:
Input
• orderItemSummaryId — ID of an order product summary to return.
It can’t be a shipping charge product.
• quantity — Quantity to return.
• reason — Return reason. The value must match one of the picklist values
on the Reason field of the Order Product Summary Change object.
• shippingReductionFlag — Boolean flag that specifies whether to
prorate any related delivery charge based on the price change.

Store Output Values

Output Parameter Description


Return Order This output is an Apex-defined variable of class ConnectApi.SubmitReturnOutputRepresentation.
Product
Note: The sign of a value in the changeBalances field is the opposite of the corresponding value
Summary Items
on a change order record. For example, a discount is a positive value in changeBalances and a
Output
negative value on a change order record.
The changeOrderId field is the ID of the change order record created for the return.
The changeBalances field is an Apex-defined variable of class
ConnectApi.ChangeItemOutputRepresentation, which includes these fields:
• grandTotalAmount — Change to the total with tax.
• totalAdjDeliveryAmtWithTax — Change to the adjusted delivery subtotal, including tax.
• totalAdjDistAmountWithTax — Change to the total order adjustments, including tax.
• totalAdjProductAmtWithTax — Change to the adjusted product subtotal, including tax.
• totalAdjustedDeliveryAmount — Change to the adjusted delivery subtotal.
• totalAdjustedDeliveryTaxAmount — Change to the adjusted delivery subtotal tax.

367
Automate Your Business Processes Flows

Output Parameter Description


• totalAdjustedProductAmount — Change to the adjusted product subtotal.
• totalAdjustedProductTaxAmount — Change to the adjusted product subtotal tax.
• totalAdjustmentDistributedAmount — Change to the total order adjustments.
• totalAdjustmentDistributedTaxAmount — Change to the total order adjustments tax.
• totalAmount — Change to the pretax total.
• totalExcessFundsAmount — The amount of excess funds available on the order payment
summaries related to the order summary. It’s equal to the captured amount that’s owed as a refund, but
it’s not associated with an invoice or credit memo. Excess funds normally occur when order products are
canceled before fulfillment but after payment is captured. This situation isn’t common in the US, where
funds are normally authorized but not captured until the fulfillment process begins. This value includes all
excess funds related to the order summary, not only the funds related to the current action.
• totalRefundableAmount — The total amount available to be refunded. It’s the sum of the excess
funds and any outstanding change order grand total amounts that apply to post-fulfillment changes. This
value includes all refundable amounts related to the order summary, not only the amount related to the
current action.
• totalTaxAmount — Change to the total tax.

Usage
To set up the Return Order Product Summary Items Input:
1. Use Assignment elements to set the orderItemSummaryId, quantity, reason, and shippingReductionFlag
field values on one or more ConnectApi.ChangeItemInputRepresentation variables.
2. Use an Assignment element to add the ConnectApi.ChangeItemInputRepresentation variables to the
changeItems field on a ConnectApi.ChangeInputRepresentation variable.
3. Use the ConnectApi.ChangeInputRepresentation variable and the order summary ID in the action input.
In a flow for returning order product summaries, run a Return Order Item Summaries Preview action before running this action. Then
display its output for the user to review. When the user verifies the expected results, pass the same input to this action.

SEE ALSO:
Flow Core Action for Order Management: Return Order Item Summaries Preview
Add and Edit Elements
Flow Core Action for Order Management: Return Return Order Items
Process one or more return order line items belonging to a return order. This action creates a change
EDITIONS
order record and makes the processed return order line items read-only. If a processed return order
line item has any remaining expected quantity, then the action creates a separate return order line Available in: Lightning
item representing that quantity. Experience
In Flow Builder, add an Action element to your flow. Select the Order Management category, and
Available in: Enterprise,
search for Return Return Order Items.
Unlimited, and Developer
Set Input Values Editions with Salesforce
Use values from earlier in the flow to set the inputs. Order Management and
Returns

368
Automate Your Business Processes Flows

Input Parameter Description


Return Order Reference to the return order that you want to process return order line items from.
Id

Return Items This input is an Apex-defined variable of class ConnectApi.ReturnItemsInputRepresentation. It has two fields.
Input The returnOrderItemDeliveryCharges field is an optional list of Apex-defined variables of class
ConnectApi.ReturnOrderItemDeliveryChargeInputRepresentation. Each of the variables includes one field:
• returnOrderLineItemId—ID of a return order line item representing a shipping charge to return.
The returnOrderItems field is a list of Apex-defined variables of class
ConnectApi.ReturnOrderItemInputRepresentation. Each of the variables includes these fields:
• quantityReceived—(Optional) The quantity of the return order line item that has been received.
The value must be zero or greater. This value isn’t used by any standard features, but is provided for use in
customizations.
• quantityRejected—(Optional) The quantity of the return order line item that has been rejected for
return. The value must be zero or greater. This value isn’t used by any standard features, but is provided for
use in customizations.
• quantityReturned—The quantity of the return order line item that has been returned. The value
must be greater than zero. If this value plus quantityToCancel is less than the expected return quantity,
then the remaining quantity to be returned is added to a new return order line item.
• quantityToCancel—(Optional) The quantity of the return order line item to remove because it’s not
being returned. The value must be zero or greater. If this value plus quantityReturned is less than the
expected return quantity, then the remaining quantity to be returned is added to a new return order line
item.
• reasonForRejection—(Optional) The reason why the rejected quantity, if any, was rejected. This
value isn’t used by any standard features, but is provided for use in customizations.
• returnOrderLineItemId—The return order line item ID.

Store Output Values

Output Parameter Description


Return Items This output is an Apex-defined variable of class ConnectApi.ReturnItemsOutputRepresentation. It has two
Output fields.
The changeOrderId field is the ID of the change order record created for the return.
The returnLineItemSplits field is a list of Apex-defined variables of class
ConnectApi.ReturnOrderItemSplitLineOutputRepresentation, which includes these fields:
• newReturnOrderItemId—ID of the new return order line item that holds the remaining return
quantity.
• originalReturnOrderItemId—ID of the original return order line item.

Note: After a change order is created for a return order line item, that return order line item is read-only.
If this action is used to return a partial quantity, it creates a new “split” return order line item to hold the
remaining quantity to be returned. In that case, it returns the IDs of the original and split return order
line items in an element of the returnLineItemSplits output list property.

369
Automate Your Business Processes Flows

Usage
To set up the Return Return Order Items Input:
1. Use Assignment elements to set the quantityReceived, quantityRejected, quantityReturned,
quantityToCancel, reasonForRejection, and returnOrderLineItemId field values on one or more
ConnectApi.ReturnOrderItemInputRepresentation variables.
2. Use Assignment elements to set the returnOrderLineItemId field value on one or more
ConnectApi.ReturnOrderItemDeliveryChargeInputRepresentation variables.
3. Use an Assignment element to add the ConnectApi.ReturnOrderItemInputRepresentation variables to the
returnOrderItems field on a ConnectApi.ReturnItemsInputRepresentation variable.
4. Use an Assignment element to add the ConnectApi.ReturnOrderItemDeliveryChargeInputRepresentation
variables to the returnOrderItemDeliveryCharges field on a
ConnectApi.ReturnItemsInputRepresentation variable.
5. Use the ConnectApi.ReturnItemsInputRepresentation variable and the return order ID in the action input.

SEE ALSO:
Flow Core Action for Order Management: Create Return Order
Add and Edit Elements

Salesforce Omnichannel Inventory Flow Core Actions


Salesforce Omnichannel Inventory provides several core actions for implementing inventory
EDITIONS
functionality in flows. To add one of these actions to your flow, add an Action element. Then select
the Omnichannel Inventory Service category, and search for the appropriate action. Available in: Lightning
These actions use Apex-defined input and output variables that map to input and output classes Experience
in the Apex ConnectApi namespace. For more information on using Apex-defined variables in flows,
Available in: Enterprise,
see Considerations for the Apex-Defined Data Type on page 221.
Unlimited, and Developer
Important: A flow that uses Omnichannel Inventory actions must have a runtime API version Editions with Salesforce
of 52.0 or later. If possible, always use the latest API version in your flows. Omnichannel Inventory

Flow Core Action for Omnichannel Inventory: Create Reservation


Create one or more inventory reservations at a location or location group.
Flow Core Action for Omnichannel Inventory: Fulfill Reservation
Fulfill one or more inventory reservations at a location.
Flow Core Action for Omnichannel Inventory: Get Availability
Get inventory availability data for one or more products at one or more inventory locations or location groups.
Flow Core Action for Omnichannel Inventory: Release Reservation
Release one or more inventory reservations.
Flow Core Action for Omnichannel Inventory: Transfer Reservation
Transfer one or more inventory reservations between locations or location groups. This action reduces the reserved quantity at the
source and increases it at the destination. It doesn’t change physical quantities.

SEE ALSO:
Add and Edit Elements

370
Automate Your Business Processes Flows

Flow Core Action for Omnichannel Inventory: Create Reservation


Create one or more inventory reservations at a location or location group.
EDITIONS
In Flow Builder, add an Action element to your flow. Select the Omnichannel Inventory Service
category, and search for Omnichannel Inventory Service Create Reservation. Available in: Lightning
Experience
Note: Set the flow’s runtime API version to 52.0 or later.
Available in: Enterprise,
Set Input Values Unlimited, and Developer
Use values from earlier in the flow to set the inputs. Editions with Salesforce
Omnichannel Inventory
Input Description
Parameter
Omnichannel This input is an Apex-defined variable of class
Inventory ConnectApi.OCICreateReservationInputRepresentation.
Create The variable has these fields:
Service
Reservation • actionRequestId—A UUID that identifies the request. To identify
Input which actions succeeded or failed, use the action request IDs in output
variables.
• allowPartialReservations—Optional. When true, if the system
can’t create the entire reservation, then it attempts to create a partial
reservation.
• createRecords—A list of Apex-defined variables of class
ConnectApi.OCICreateReservationSingleInputRepresentation. Each variable
has these fields:
– locationGroupIdentifier—Identifier of the location group
at which to reserve inventory. Either locationGroupIdentifier
or locationIdentifier is required, but not both.
– locationIdentifier—Identifier of the location at which to
reserve inventory. Either locationIdentifier or
locationGroupIdentifier is required, but not both.
– quantity—The quantity of the product to reserve.
– stockKeepingUnit—The Stock Keeping Unit (SKU) of the product
to reserve.

• expirationSeconds—Optional. A length of time in seconds. If the


reservation isn’t fulfilled within this amount of time after the reservationTime,
then it expires. The maximum value is 14400.
• externalRefId—Optional The external reference ID.
• reservationTime—Optional The time at which to record the
reservation. Example: 2020-07-24T21:13:00Z

Store Output Values

371
Automate Your Business Processes Flows

Output Parameter Description


Omnichannel This value is an Apex-defined variable of class ConnectApi.OCICreateReservationOutputRepresentation.
Inventory The variable has these fields:
Service Create
Reservation • details—A list of Apex-defined variables of class
Output ConnectApi.OCICreateReservationSingleOutputRepresentation. Each variable represents one product being
reserved and has these fields:
– errorCode—The error code, if any.
– locationGroupIdentifier—Identifier of the location group where the inventory is reserved.
– locationIdentifier—Identifier of the location where the inventory is reserved
– quantity—The reserved quantity of the product.
– stockKeepingUnit—The SKU of the reserved product.

• errors—A list of Apex-defined variables of class


ConnectApi.OCICreateReservationErrorOutputRepresentation. Each variable represents a returned error,
and has these fields:
– errorCode—The error code.
– message—Details of the error, if available.

• expirationTime—The time at which the reservation would expire.


• reservationTime—The time when the reservation was recorded.
• success—Indicates whether the reservation succeeded.

Usage
To set up the Omnichannel Inventory Create Service Reservation Input:
1. For each product to reserve, use Assignment elements to set the locationGroupIdentifier or locationIdentifier
field, quantity field, and stockKeepingUnit field values on a
ConnectApi.OCICreateReservationSingleInputRepresentation variable.
2. Use Assignment elements to add the ConnectApi.OCICreateReservationSingleInputRepresentation
variables to the createRecords field on a ConnectApi.OCICreateReservationInputRepresentation
variable.
3. Use Assignment elements to set the actionRequestId, allowPartialReservations, expirationSeconds,
externalRefId, and reservationTime field values on the
ConnectApi.OCICreateReservationInputRepresentation variable.
4. Use the ConnectApi.OCICreateReservationInputRepresentation variable in the action input.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Omnichannel Inventory: Fulfill Reservation

372
Automate Your Business Processes Flows

Fulfill one or more inventory reservations at a location.


EDITIONS
In Flow Builder, add an Action element to your flow. Select the Omnichannel Inventory Service
category, and search for Omnichannel Inventory Service Fulfill Reservation. Available in: Lightning
Experience
Note: Set the flow’s runtime API version to 52.0 or later.
Available in: Enterprise,
Set Input Values Unlimited, and Developer
Use values from earlier in the flow to set the inputs. Editions with Salesforce
Omnichannel Inventory
Input Description
Parameter
Omnichannel This input is an Apex-defined variable of class
Inventory ConnectApi.OCIFulfillReservationInputRepresentation.
Service The variable has one field, fulfillmentRecords. This field is a list of
Fulfill Apex-defined variables of class
Reservation ConnectApi.OCIFulfillReservationSingleInputRepresentation. Each variable has
Input these fields:
• actionRequestId—A UUID that identifies the request. To identify
which actions succeeded or failed, use the action request IDs in output
variables.
• externalRefId—Optional. The external reference ID.
• locationIdentifier—Identifier of the location at which to fulfill
reserved inventory.
• quantity—The quantity of the product to fulfill.
• stockKeepingUnit—The Stock Keeping Unit of the product to fulfill.

Store Output Values

Output Parameter Description


Omnichannel This value is an Apex-defined variable of class ConnectApi.OCIFulfillReservationOutputRepresentation.
Inventory The variable has these fields:
Service
Fulfill • errors—A list of Apex-defined variables of class
Reservation ConnectApi.OCIFulfillReservationErrorOutputRepresentation. Each variable represents a returned error and
Output has these fields:
– details—An Apex-defined variable of class
ConnectApi.OCIFulfillReservationSingleOutputRepresentation. Each variable represents a returned
error and includes the values from the input so you can resubmit them:
• actionRequestId—A UUID that identifies the failed request.
• externalRefId—The external reference ID.
• locationIdentifier—Identifier of the location at which to fulfill reserved inventory.
• quantity—The quantity of the product to fulfill.
• stockKeepingUnit—The Stock Keeping Unit of the product to fulfill.

373
Automate Your Business Processes Flows

Output Parameter Description


– errorCode—The error code.
– message—Details of the error, if available.

• success—Indicates whether the fulfillment succeeded.

Usage
To set up the Omnichannel Inventory Service Fulfill Reservation Input:
1. For each reservation to fulfill, use Assignment elements to set the actionRequestId, externalRefId,
locationIdentifier, quantity, and stockKeepingUnit field values on a
ConnectApi.OCIFulfillReservationSingleInputRepresentation variable.
2. Use Assignment elements to add the ConnectApi.OCIFulfillReservationSingleInputRepresentation
variables to the fulfillmentRecords field on a ConnectApi.OCIFulfillReservationInputRepresentation
variable.
3. Use the ConnectApi.OCIFulfillReservationInputRepresentation variable in the action input.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Omnichannel Inventory: Get Availability
Get inventory availability data for one or more products at one or more inventory locations or
EDITIONS
location groups.
In Flow Builder, add an Action element to your flow. Select the Omnichannel Inventory Service Available in: Lightning
category, and search for Omnichannel Inventory Service Get Availability. Experience

Note: Set the flow’s runtime API version to 52.0 or later. Available in: Enterprise,
Unlimited, and Developer
Set Input Values Editions with Salesforce
Use values from earlier in the flow to set the inputs. Omnichannel Inventory

Input Description
Parameter
Omnichannel This input is an Apex-defined variable of class
Inventory ConnectApi.OCIGetInventoryAvailabilityInputRepresentation.
Service The variable has these fields:
Get
Availability • locationGroupIdentifier—Optional. Can’t combine with
Input locationGroupIdentifiers or locationIdentifiers. The
identifier of a location group to retrieve inventory availability data for.
Specifying this value retrieves inventory data for all locations belonging to
this group.
• locationGroupIdentifiers—Optional; can’t combine with
locationGroupIdentifier or locationIdentifiers. A list
of up to 100 identifiers of location groups to retrieve inventory availability
data for.

374
Automate Your Business Processes Flows

Input Parameter Description


• locationIdentifiers—Optional; can’t combine with locationGroupIdentifier or
locationGroupIdentifiers. A list of up to 100 identifiers of locations to retrieve inventory
availability data for.
• stockKeepingUnit—Optional; can’t combine with stockKeepingUnits. The SKU of a product
to retrieve inventory availability data for. Specifying a SKU with no locations or location groups returns
availability data for that SKU at all inventory locations that aren’t assigned to location groups.
• stockKeepingUnits—Optional; can’t combine with stockKeepingUnit. A list of up to 100
SKUs of products to retrieve inventory availability data for.
• useCache—Optional. Fetch the inventory data from the cache. Default value is true.

Store Output Values

Output Parameter Description


Omnichannel This input is an Apex-defined variable of class ConnectApi.OCIGetInventoryAvailabilityOutputRepresentation.
Inventory The variable has these fields:
Service Get
Availability • locationGroups—A list of Apex-defined variables of class
Output ConnectApi.OCILocationGroupAvailabilityOutputRepresentation. Each variable represents availability data
for one location group and has these fields:
– inventoryRecords—A list of Apex-defined variables of class
ConnectApi.OCIInventoryRecordOutputRepresentation. Each variable represents availability of one
product and has these fields:
• availableToFulfill—The Available To Fulfill quantity.
• availableToOrder—The Available To Order quantity.
• effectiveDate—The effective date of the inventory.
• futures—A list of Apex-defined variables of class
ConnectApi.OCIFutureInventoryOutputRepresentation. Each variable represents one future restock
and has these fields:
– expectedDate—Date when the future inventory is expected.
– quantity—Quantity of the future inventory.

• onHand—The On Hand quantity.


• reserved—The Reserved quantity.
• safetyStockCount—The Safety Stock Count.
• stockKeepingUnit—The SKU of the product.

– locationGroupIdentifier—The identifier of the location group.

• locations—A list of Apex-defined variables of class


ConnectApi.OCILocationAvailabilityOutputRepresentation. Each variable represents availability data for
one location and has these fields:

375
Automate Your Business Processes Flows

Output Parameter Description


– inventoryRecords—A list of Apex-defined variables of class
ConnectApi.OCIInventoryRecordOutputRepresentation. Each variable represents availability of one
product and has these fields:
• availableToFulfill—The Available To Fulfill quantity.
• availableToOrder—The Available To Order quantity.
• effectiveDate—The effective date of the inventory.
• futures—A list of Apex-defined variables of class
ConnectApi.OCIFutureInventoryOutputRepresentation. Each variable represents one future restock
and has these fields:
– expectedDate—Date when the future inventory is expected.
– quantity—Quantity of the future inventory.

• onHand—The On Hand quantity.


• reserved—The Reserved quantity.
• safetyStockCount—The Safety Stock Count.
• stockKeepingUnit—The SKU of the product.

– locationIdentifier—The identifier of the location.

Usage
To set up the Omnichannel Inventory Service Get Availability Input:
1. Use Assignment elements to set the locationGroupIdentifier, locationGroupIdentifiers, or
locationIdentifiers field value, stockKeepingUnit or stockKeepingUnits field value, and useCache
field value on a ConnectApi.OCIGetInventoryAvailabilityInputRepresentation variable.
2. Use the ConnectApi.OCIGetInventoryAvailabilityInputRepresentation variable in the action input.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Omnichannel Inventory: Release Reservation
Release one or more inventory reservations.
EDITIONS
In Flow Builder, add an Action element to your flow. Select the Omnichannel Inventory Service
category, and search for Omnichannel Inventory Service Release Reservation. Available in: Lightning
Experience
Note: Set the flow’s runtime API version to 52.0 or later.
Available in: Enterprise,
Set Input Values Unlimited, and Developer
Use values from earlier in the flow to set the inputs. Editions with Salesforce
Omnichannel Inventory

376
Automate Your Business Processes Flows

Input Parameter Description


Omnichannel This input is an Apex-defined variable of class ConnectApi.OCIReleaseReservationInputRepresentation.
Inventory The variable has one field, releaseRecords. This field is a list of Apex-defined variables of class
Service ConnectApi.OCIReleaseReservationSingleInputRepresentation. Each variable has these fields:
Release
Reservation • actionRequestId—A UUID that identifies the request. To identify which actions succeeded or failed,
Input use the action request IDs in output variables.
• externalRefId—Optional. The external reference ID.
• locationGroupIdentifier—Identifier of the location group at which to release reserved inventory.
Either locationGroupIdentifier or locationIdentifier is required, but not both.
• locationIdentifier—Identifier of the location at which to release reserved inventory. Either
locationIdentifier or locationGroupIdentifier is required, but not both.
• quantity—The quantity of the product to release.
• stockKeepingUnit—The Stock Keeping Unit of the product to release.

Store Output Values

Output Parameter Description


Omnichannel This value is an Apex-defined variable of class ConnectApi.OCIReleaseReservationOutputRepresentation.
Inventory The variable has these fields:
Service
Release • errors—A list of Apex-defined variables of class
Reservation ConnectApi.OCIReleaseReservationErrorOutputRepresentation. Each variable represents a returned error
Output and has these fields:
– details—An Apex-defined variable of class
ConnectApi.OCIReleaseReservationSingleOutputRepresentation. Each variable represents a returned
error and includes the values from the input so you can resubmit them:
• actionRequestId—A UUID that identifies the failed request.
• externalRefId—The external reference ID.
• locationGroupIdentifier—Identifier of the location group at which to release reserved
inventory.
• locationIdentifier—Identifier of the location at which to release reserved inventory.
• quantity—The quantity of the product to release.
• stockKeepingUnit—The Stock Keeping Unit of the product to release.

– errorCode—The error code.


– message—Details of the error, if available.

• success—Indicates whether the release succeeded.

Usage
To set up the Omnichannel Inventory Service Release Reservation Input:

377
Automate Your Business Processes Flows

1. For each reservation to release, use Assignment elements to set the actionRequestId, externalRefId,
locationGroupIdentifier or locationIdentifier, quantity, and stockKeepingUnit field values on a
ConnectApi.OCIReleaseReservationSingleInputRepresentation variable.
2. Use Assignment elements to add the ConnectApi.OCIReleaseReservationSingleInputRepresentation
variables to the releaseRecords field on a ConnectApi.OCIReleaseReservationInputRepresentation
variable.
3. Use the ConnectApi.OCIReleaseReservationInputRepresentation variable in the action input.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Omnichannel Inventory: Transfer Reservation
Transfer one or more inventory reservations between locations or location groups. This action
EDITIONS
reduces the reserved quantity at the source and increases it at the destination. It doesn’t change
physical quantities. Available in: Lightning
In Flow Builder, add an Action element to your flow. Select the Omnichannel Inventory Service Experience
category, and search for Omnichannel Inventory Service Transfer Reservation.
Available in: Enterprise,
Note: Set the flow’s runtime API version to 52.0 or later. Unlimited, and Developer
Editions with Salesforce
Set Input Values Omnichannel Inventory
Use values from earlier in the flow to set the inputs.

Input Parameter Description


Omnichannel This input is an Apex-defined variable of class ConnectApi.OCITransferReservationInputRepresentation.
Inventory The variable has these fields:
Service
Transfer • allOrNothingTransferId—Optional. Controls whether a single failed transfer cancels all other
Reservation transfers in the transferRecords list.
Input – To allow some transfers in the transferRecords list to succeed when others fail, don’t set this value.
– To cancel all the transfers in the transferRecords list when any of them fail, set this value to a UUID. The
ID must be unique, but isn’t otherwise used.

• transferRecords—A list of Apex-defined variables of class


ConnectApi.OCITransferReservationSingleInputRepresentation. Each variable represents an inventory transfer
and has these fields:
– actionRequestId—A UUID that identifies the request. To identify which actions succeeded or
failed, use the action request IDs in output variables.
– externalRefId—Optional. The external reference ID.
– fromLocationGroupIdentifier—The identifier of the location group transferring the
reservation. Either fromLocationGroupIdentifier or fromLocationIdentifier is
required, but not both.
– fromLocationIdentifier—The identifier of the location transferring the reservation. Either
fromLocationIdentifier or fromLocationGroupIdentifier is required, but not
both.
– ignoreAvailabilityCheck—If true, force the transfer even if the receiving location doesn’t
have sufficient available inventory. The default value is false.

378
Automate Your Business Processes Flows

Input Parameter Description


– quantity—The quantity of the product reservation to transfer.
– stockKeepingUnit—The Stock Keeping Unit (SKU) of the product reservation to transfer.
– toLocationGroupIdentifier—The identifier of the location group receiving the reservation.
Either toLocationGroupIdentifier or toLocationIdentifier is required, but not
both.
– toLocationIdentifier—The identifier of the location receiving the reservation. Either
toLocationIdentifier or toLocationGroupIdentifier is required, but not both.

Store Output Values

Output Parameter Description


Omnichannel This value is an Apex-defined variable of class ConnectApi.OCITransferReservationOutputRepresentation.
Inventory The variable has these fields:
Service
Transfer • errors—A list of Apex-defined variables of class
Reservation ConnectApi.OCITransferReservationErrorOutputRepresentation. Each variable represents a returned error
Output and has these fields:
– details—An Apex-defined variable of class
ConnectApi.OCITransferReservationSingleOutputRepresentation. Each variable represents a returned
error and includes the fields from the input:
• actionRequestId—A UUID that identifies the failed request.
• externalRefId—The external reference ID.
• fromLocationGroupIdentifier—The identifier of the location group transferring the
reservation.
• fromLocationIdentifier—The identifier of the location transferring the reservation.
• ignoreAvailabilityCheck—Whether this call ignored availability data at the location
that received the reservation.
• quantity—The quantity of the product reservation to transfer.
• stockKeepingUnit—The SKU of the product reservation to transfer.
• toLocationGroupIdentifier—The identifier of the location group intended to receive
the reservation.
• toLocationIdentifier—The identifier of the location intended to receive the reservation.

– errorCode—The error code.


– message—Details of the error, if available.

• success—Indicates whether the transfer succeeded.

Usage
To set up the Omnichannel Inventory Service Transfer Reservation Input:

379
Automate Your Business Processes Flows

1. For each reservation to transfer, use Assignment elements to set the actionRequestId, externalRefId,
fromLocationGroupIdentifier or fromLocationIdentifier, quantity, stockKeepingUnit, and
toLocationGroupIdentifier or toLocationIdentifier field values on a
ConnectApi.OCITransferReservationSingleInputRepresentation variable.
2. Use Assignment elements to add the ConnectApi.OCITransferReservationSingleInputRepresentation
variables to the transferRecords field on a ConnectApi.OCITransferReservationInputRepresentation
variable.
3. Use an Assignment element to set the allOrNothingTransferId field on the
ConnectApi.OCITransferReservationInputRepresentation variable.
4. Use the ConnectApi.OCITransferReservationInputRepresentation variable in the action input.

SEE ALSO:
Add and Edit Elements

Flow Core Action: Send Custom Notification


Add the Send Custom Notification action to a flow, then add recipients and content.
EDITIONS
Important: The Send Custom Notifications user permission is enforced in orgs created in
Winter ’21 or later. Available in: both Salesforce
Classic and Lightning
The Send Custom Notifications user permission isn’t required to trigger the Send Custom Experience
Notification action in processes or flows that run in system context.
Available in: Essentials,
Tip: Professional, Enterprise,
Performance, Unlimited,
• Before you begin, make sure that the custom notification type you want to call from your and Developer Editions
process exists. If not, create the notification type.
• To query for the Notification Type ID directly from a flow, add the Get Record element to
your flow and filter by API name. If you’ve installed a notification type via a managed USER PERMISSIONS
package, filter by the namespace prefix as well as the API name. To trigger the Send Custom
• To add recipients, define Recipient ID as a resource. Then add values to your Recipient ID Notification action in flows
collection by adding the Assignment element to your flow. that run in user context, REST
API calls, and Apex callouts:
In Flow Builder, add an Action element to your flow. In the Action field, enter Notifications, • Send Custom
and select Send Custom Notification. Notifications

Set Input Values


Use values from earlier in the flow to set the inputs for the email. Specify at least one recipient for the email.

Field Description
Custom Notification The ID of the Custom Notification Type being used for the notification.
Type ID
This parameter accepts single-value resources of any type. That value is treated as text.

Notification Body The body of the notification that recipients see.

Note: The content of mobile push notifications depends on the Display full content push
notifications setting.

380
Automate Your Business Processes Flows

Field Description
This parameter accepts single-value resources of any type. That value is treated as text and is limited
to 750 characters.

Notification Title The title of the notification as seen by recipients.


This parameter accepts single-value resources of any type. That value is treated as text and is limited
to 250 characters.

Recipient IDs The ID of the recipient or recipient type of the notification.


Valid values are:
• User ID—The notification is sent to this user, if this user is active.
• Account ID—The notification is sent to all active users who are members of this account’s
Account Team. Valid only if account teams are enabled for your org.
• Opportunity ID—The notification is sent to all active users who are members of this
opportunity’s Opportunity Team. Valid only if team selling is enabled for your org.
• Group ID—The notification is sent to all active users who are members of this group.
• Queue ID—The notification is sent to all active users who are members of this queue.
This parameter accepts collection variables of type Text and is limited to 500 values.

Target ID Optional. The Record ID for the target record of the notification.
Specify either a Target ID or a Target Page Reference.
This parameter accepts single-value resources of any type. That value is treated as text.

Target Page Optional. The Page Reference for the navigation target of the notification.
Reference
Specify either a Target ID or a Target Page Reference.
This parameter accepts single-value resources of any type. That value is treated as text.

Note: To see how to specify the target using JSON, see pageReference.

Sender ID Optional. The User ID of the sender of the notification.


This parameter accepts single-value resources of any type. That value is treated as text.

Usage
• Each notification can have up to 10,000 users as recipients. However, you can add an action to the same process within Process
Builder or to the same flow in Flow Builder to have more recipients.
• Your org saves your most recent 1 million custom notifications for view in notification trays. Your org can save up to 1.2 million
custom notifications, but it trims the amount to the most recent 1 million notifications when you reach the 1.2 million limit.
• An org can execute up to 10,000 notification actions per hour. When you exceed this limit, no more notifications are sent in that
hour, and all unsent notifications are lost. Notification actions resume in the next hour.

381
Automate Your Business Processes Flows

For example, your notification action processes are triggered 10,250 times between 4:00 and 4:59. Salesforce executes the first 10,000
of those actions. The remaining 250 notifications aren’t sent and are lost. Salesforce begins executing notification actions again at
5:00.

SEE ALSO:
Send Custom Notifications
Which Context Do Flows Run In?
Flow Elements
Add and Edit Elements
Customize What Happens When a Flow Fails
Route a Flow

Flow Core Action: Send Email


Send an email by specifying the subject, body, and recipients in the flow.
EDITIONS
Tip:
Available in: both Salesforce
• Store the text for the email body in a text template. Classic and Lightning
• To use an email template that exists in your org, call an email alert instead. Experience

In Flow Builder, add an Action element to your flow. In the Action field, enter Email, and select Available in: Essentials,
Send Email. Professional, Enterprise,
Performance, Unlimited,
Set Input Values and Developer Editions
Use values from earlier in the flow to set the inputs for the email. Specify at least one recipient for
the email.

Field Description
Body Text for the body of the email. The email is treated as plain text. HTML formatting isn’t respected.
This parameter accepts single-value resources of any type. That value is treated as text.

Subject Text for the subject of the email.


This parameter accepts single-value resources of any type. That value is treated as text.

Email Addresses Optional. Recipients of the email.


(collection) For the email to send successfully, enter a value for Email Addresses (comma-separated)
or Email Addresses (collection). You can use both parameters as long as the combined
number of email addresses is five or fewer.
This parameter accepts collection variables of type Text.

Email Addresses Optional. Recipients of the email.


(comma-separated) For the email to send successfully, enter a value for Email Addresses (comma-separated)
or Email Addresses (collection). You can use both parameters as long as the combined
number of email addresses is five or fewer.
This parameter accepts single-value resources of any type. That value is treated as text.

382
Automate Your Business Processes Flows

Field Description
Sender Address The organization-wide email address that’s used to send the email. Required only if Sender Type
is set to OrgWideEmailAddress.
This parameter accepts single-value resources of any type. That value is treated as text.

Sender Type Optional. Email address used as the email’s From and Reply-To addresses. Valid values are:
• CurrentUser—Email address of the user running the flow. (Default)
• DefaultWorkflowUser—Email address of the default workflow user.
• OrgWideEmailAddress—The organization-wide email address that is specified in Sender
Address.

Usage
At run time, the email isn’t sent until the interview’s transaction completes. Transactions are complete when the interview either finishes
or executes a Screen, Local Action, or Pause element.
Each licensed org can send single emails to a maximum of 5,000 external email addresses per day based on Greenwich Mean Time
(GMT). For orgs created before Spring ’19, the daily limit is enforced only for emails sent via Apex and Salesforce APIs except for the REST
API. For orgs created in Spring ’19 and later, the daily limit is also enforced for email alerts, simple email actions, Send Email actions in
flows, and REST API. If one of the newly counted emails can’t be sent because your org has reached the limit, we notify you by email
and add an entry to the debug logs. Single emails sent using the email author or composer in Salesforce don't count toward this limit.
There’s no limit on sending single emails to contacts, leads, person accounts, and users in your org directly from account, contact, lead,
opportunity, case, campaign, or custom object pages. In Developer Edition orgs and orgs evaluating Salesforce during a trial period, you
can send to a maximum of 50 recipients per day, and each single email can have up to 15 recipients.

SEE ALSO:
Add and Edit Elements
Options for Sending Emails from a Flow
Flow Resource: Text Template
Customize What Happens When a Flow Fails
Route a Flow

Flow Core Action: Send Surveys


Create an action to send an active survey by specifying the name, subject, recipients, and invitation
EDITIONS
link options in the flow.
In Flow Builder, add an Action element to your flow. In the Action field, enter the name of an active Available in: both Salesforce
survey. Or, in the left navigation, click Survey, and then in the Action field, select an active survey. Classic and Lightning
Define the name of the action and the survey recipients. Experience

Note: If you deactivate a survey after it’s added to a flow and then activate it, the Flow Builder Available in: Essentials,
renders an incorrect Action layout for that survey. Professional, Enterprise,
Performance, Unlimited,
Example: You want to collect feedback from all the participants when a case is closed. First, and Developer Editions
create a flow and get all records where the status of the case object is closed. Then, create
an action that selects the survey to send to the participants for feedback.

383
Automate Your Business Processes Flows

Set Input Values


Specify at least one recipient for the survey.

Field Description
Label Name for the action.

API Name Associate an API name for the action.


This parameter auto-generates the API name based on the label, which you can edit, if necessary.

Description Optional. Description about the purpose of the action.

Survey Subject Optional. Select a survey subject that you want to perform the action on. For example, to get all case
records, select the survey subject as Case, or create a required resource for the subject.
This parameter accepts flow variables of type Text.

Recipient Type Select the type of recipient of the survey. Choose the Lead or Contact recipient type only when there’s
a default Experience Cloud site selected for sending public surveys.
This parameter accepts flow variable of type Text.

Unique link Optional. Each participant receives a unique survey invitation. The responses are mapped to the
participant name.

Anonymize responses Optional. The responses received aren’t mapped to any participant.

Don’t require Optional. By default, surveys sent to lead or contact require authentication. However, you can enable
authentication this option to allow access to the survey without any authentication.

Invitation expires Optional. Define the number of days after which the access to the survey is restricted.
in days

SEE ALSO:
Add and Edit Elements

Slack Flow Core Actions


Manage Slack channels, channel members, and messages from flows. As your Salesforce records
EDITIONS
change, a flow can trigger changes in Slack.

Important: Slack core actions execute in user context. The flow has access to whatever the Available in: both Salesforce
running user of the flow has access to. Classic and Lightning
Experience
Note: This feature is a Beta Service. Customer may opt to try such Beta Service in its sole
Available in: Essentials,
discretion. Any use of the Beta Service is subject to the applicable Beta Services Terms provided
Professional, Enterprise,
at Agreements and Terms.
Performance, Unlimited,
In Flow Builder, add an Action element to your flow. Select the Slack category, and search for an and Developer Editions
action.

Flow Core Actions for Slack: Archive Slack Channel (Beta)


Archive a Slack channel in a Slack workspace.

384
Automate Your Business Processes Flows

Flow Core Actions for Slack: Check If Users Are Connected to Slack (Beta)
Determine whether a collection of Salesforce users is connected to a given Slack workspace.
Flow Core Actions for Slack: Create Slack Channel (Beta)
Create a Slack channel in a Slack workspace.
Flow Core Actions for Slack: Edit Slack Message (Beta)
Edit a message that was previously sent to Slack.
Flow Core Actions for Slack: Get Information About Slack Conversation (Beta)
Retrieve the name of a Slack channel and find out whether it’s archived. Archived channels are closed to new activity, but users can
still view and search an archived channel’s message history.
Flow Core Actions for Slack: Invite Users to Slack Channel (Beta)
Add users who are connected to a given Slack app to a Slack channel or direct message.
Flow Core Actions for Slack: Pin or Unpin Slack Message (Beta)
Pin or unpin a message in a Slack channel or direct message. Pin messages so that they’re readily available from the conversation
header.
Flow Core Actions for Slack: Send Slack Message (Beta)
Send a message to a Slack channel, direct message, or the Messages tab of a Slack app.
Flow Core Actions for Slack: Send Message to Launch Flow (Beta)
Send a message to a Slack channel, direct message, or the Messages tab of a Slack app that includes a button that a recipient can
use to launch a screen flow.
Flow Core Actions for Slack: Archive Slack Channel (Beta)
Archive a Slack channel in a Slack workspace.
EDITIONS
Note: This feature is a Beta Service. Customer may opt to try such Beta Service in its sole
discretion. Any use of the Beta Service is subject to the applicable Beta Services Terms provided Available in: both Salesforce
at Agreements and Terms. Classic and Lightning
Experience
In Flow Builder, add an Action element to your flow. In the New Action window, select Slack, and
then select Archive Slack Channel (Beta). Available in: Essentials,
Professional, Enterprise,
Set Connection Values for Slack Performance, Unlimited,
The flow sends the connection values that you provide to Slack to retrieve an access token. and Developer Editions

Input Parameter Description


Slack App Required. The Slack app that executes the action. Only Slack apps
that are installed for the org are available. The input value
evaluates to the Slack app ID.

Slack Workspace ID Required. The Slack workspace where the Slack app is installed.
Select a value or resource. The input value evaluates to the Slack
workspace ID.
You can obtain the Slack workspace ID by logging in to Slack.com
and launching Slack in your browser. The workspace ID is the
penultimate parameter in the URL. For example, in this URL, the
workspace ID is T01234ABCDE:
https://app.slack.com/client/T01234ABCDE/C56789FGHIJ

385
Automate Your Business Processes Flows

Input Parameter Description


Execute Action As The entity that executes the action. Valid values are:
Slack App
Execute the action as the Slack app that you selected in the Slack App field. This is
the default value.
The Slack app must be a member of the conversation to execute the action on.
User Who Runs the Flow
Execute the action as the user who runs the flow. The user can execute the action
only when the flow runs in the user context. If the flow runs in the system context,
it’s executed by the Slack app.
The user must be a member of the conversation to execute the action on.

Set Slack Channel

Input Parameter Description


Slack Channel ID Required. The ID of the channel to archive.
You can obtain the Slack channel ID by logging in to Slack.com and launching Slack in
your browser. The channel ID is the last parameter in the URL. For example, in this URL,
the channel ID is C56789FGHIJ:
https://app.slack.com/client/T01234ABCDE/C56789FGHIJ

Usage
This action is available only if you enable the connection to Slack in Setup and the user who runs the flow is connected to Slack. Otherwise,
the action fails.
Flow Core Actions for Slack: Check If Users Are Connected to Slack (Beta)
Determine whether a collection of Salesforce users is connected to a given Slack workspace.
EDITIONS
Note: This feature is a Beta Service. Customer may opt to try such Beta Service in its sole
discretion. Any use of the Beta Service is subject to the applicable Beta Services Terms provided Available in: both Salesforce
at Agreements and Terms. Classic and Lightning
Experience
In Flow Builder, add an Action element to your flow. In the New Action window, select Slack, and
then select Check If Users Are Connected to Slack (Beta). Available in: Essentials,
Professional, Enterprise,
Set Connection Values for Slack Performance, Unlimited,
and Developer Editions
Input Parameter Description
Slack App Required. The Slack app that executes the action. Only Slack apps
that are installed for the org are available. The input value
evaluates to the Slack app ID.

386
Automate Your Business Processes Flows

Input Parameter Description


Slack Workspace Required. The Slack workspace where the Slack app is installed. Select a value or resource.
The input value evaluates to the Slack workspace ID.
You can obtain the Slack workspace ID by logging in to Slack.com and launching Slack
in your browser. The workspace ID is the penultimate parameter in the URL. For example,
in this URL, the workspace ID is T01234ABCDE:
https://app.slack.com/client/T01234ABCDE/C56789FGHIJ

Salesforce User ID Required. The collection resource that contains the Salesforce user IDs to check. The
Collection Resource maximum number of user IDs is 1,000.

Store Output Values

Output Parameter Description


Collection of Salesforce A collection resource that contains the Salesforce user IDs connected to Slack.
User IDs Connected to Slack

Collection of Salesforce A collection resource that contains the Salesforce user IDs not connected to Slack.
User IDs Not Connected to
Slack

Usage
This action is available only if you enable the connection to Slack in Setup. Otherwise, the action fails. Additionally, the user that initiates
the flow and any users impacted by the action must have logged in to a Salesforce Slack app at least once.
Flow Core Actions for Slack: Create Slack Channel (Beta)
Create a Slack channel in a Slack workspace.
EDITIONS
Note: This feature is a Beta Service. Customer may opt to try such Beta Service in its sole
discretion. Any use of the Beta Service is subject to the applicable Beta Services Terms provided Available in: both Salesforce
at Agreements and Terms. Classic and Lightning
Experience
In Flow Builder, add an Action element to your flow. In the New Action window, select Slack, and
then select Create Slack Channel (Beta). Available in: Essentials,
Professional, Enterprise,
Set Connection Values for Slack Performance, Unlimited,
The flow sends the connection values that you provide to Slack to retrieve an access token. and Developer Editions

Input Parameter Description


Slack App Required. The Slack app that executes the action. Only Slack apps
that are installed for the org are available. The input value
evaluates to the Slack app ID.

Slack Workspace ID Required. The Slack workspace where the Slack app is installed.
Select a value or resource. The input value evaluates to the Slack
workspace ID.

387
Automate Your Business Processes Flows

Input Parameter Description


You can obtain the Slack workspace ID by logging in to Slack.com and launching Slack
in your browser. The workspace ID is the penultimate parameter in the URL. For example,
in this URL, the workspace ID is T01234ABCDE:
https://app.slack.com/client/T01234ABCDE/C56789FGHIJ

Execute Action As The entity that executes the action. Valid values are:
Slack App
Execute the action as the Slack app that you selected in the Slack App field. This is
the default value.
The Slack app must be a member of the conversation to execute the action on.
User Who Runs the Flow
Execute the action as the user who runs the flow. The user can execute the action
only when the flow runs in the user context. If the flow runs in the system context,
it’s executed by the Slack app.
The user must be a member of the conversation to execute the action on.

Set Slack Channel Details

Input Parameter Description


Slack Channel Name Required. The name of the new channel. Specify a value or select a resource.

Channel Type Select a value or Boolean resource. Valid values are:


• Public
• Private
• Resource
If you select a Boolean value that evaluates to true, the channel type is private. If you
select a Boolean value that evaluates to false, the channel type is public. The default
channel type is public.

Slack Workspace ID for Indicates whether to associate the new channel with a different workspace ID than the
Channel workspace ID of the Slack app. If you turn this option on, select a value or resource.

Store Output Values

OUTPUT Parameter Description


Slack Channel ID The ID of the new channel.

Usage
This action is available only if you enable the connection to Slack in Setup and the user who runs the flow is connected to Slack. Otherwise,
the action fails.

388
Automate Your Business Processes Flows

Flow Core Actions for Slack: Edit Slack Message (Beta)


Edit a message that was previously sent to Slack.
EDITIONS
Note: This feature is a Beta Service. Customer may opt to try such Beta Service in its sole
discretion. Any use of the Beta Service is subject to the applicable Beta Services Terms provided Available in: both Salesforce
at Agreements and Terms. Classic and Lightning
Experience
In Flow Builder, add an Action element to your flow. In the New Action window, select Slack, and
then select Edit Slack Message (Beta). Available in: Essentials,
Professional, Enterprise,
Set Input Values Performance, Unlimited,
The flow sends the connection values that you provide to Slack to retrieve an access token. and Developer Editions

Input Parameter Description


Slack App ID for Required. The Slack app that executes the action. Only Slack apps
Token that are installed for the org are available. The input value
evaluates to the Slack app ID.
The Slack app must be a member of the conversation that
contains the message to edit.

Slack Conversation Required. The ID of the channel or direct message to send the
ID message to. Alternatively, specify a Slack user ID if the message
was sent to the user via the Messages tab of the Slack app. Enter
a value or select a resource.
You can obtain the Slack conversation ID by logging in to
Slack.com and launching Slack in your browser. The conversation
ID is the last parameter in the URL. For example, in this URL, the
conversation ID is C56789FGHIJ:
https://app.slack.com/client/T01234ABCDE/C56789FGHIJ

Slack Message Required. The message to send. For best results, include no more
than 4,000 characters. Slack truncates messages containing more
than 40,000 characters. Enter a value or select a resource.
Slack supports text formatting with Slack mrkdown. To disable
formatting for a plain text message that contains Slack
mrkdown, use an escape sequence.
Slack does not support text formatting with HTML and renders
rich text messages as plain text.

Slack Message Required. The timestamp of the sent message. Enter a value or
Timestamp select a resource. For example, enter 1234567890.123456.
The numerals before the period character (.) specify a Unix
timestamp. The numerals after the period character specify
microseconds.
You can store the Slack Message Timestamp output parameter
of the Send Slack Message (Beta), Edit Slack Message (Beta), or
Send Message To Launch Flow (Beta) action as a resource to use
later.

389
Automate Your Business Processes Flows

Input Parameter Description


Slack Workspace ID for Token Required. The Slack workspace where the Slack app is installed. Select a value or resource.
The input value evaluates to the Slack workspace ID.
You can obtain the Slack workspace ID by logging in to Slack.com and launching Slack
in your browser. The workspace ID is the penultimate parameter in the URL. For example,
in this URL, the workspace ID is T01234ABCDE:
https://app.slack.com/client/T01234ABCDE/C56789FGHIJ

Usage
This action is available only if you enable the connection to Slack in Setup and the user who runs the flow is connected to Slack. Otherwise,
the action fails.
Flow Core Actions for Slack: Get Information About Slack Conversation (Beta)
Retrieve the name of a Slack channel and find out whether it’s archived. Archived channels are
EDITIONS
closed to new activity, but users can still view and search an archived channel’s message history.

Note: This feature is a Beta Service. Customer may opt to try such Beta Service in its sole Available in: both Salesforce
discretion. Any use of the Beta Service is subject to the applicable Beta Services Terms provided Classic and Lightning
Experience
at Agreements and Terms.
In Flow Builder, add an Action element to your flow. In the New Action window, select Slack, and Available in: Essentials,
then select Get Information About Slack Conversation (Beta). Professional, Enterprise,
Performance, Unlimited,
Set Connection Values for Slack and Developer Editions
The flow sends the connection values that you provide to Slack to retrieve an access token.

Input Parameter Description


Slack App Required. The Slack app that executes the action. Only Slack apps that are installed for
the org are available. The input value evaluates to the Slack app ID.

Slack Workspace ID Required. The Slack workspace where the Slack app is installed. Select a value or resource.
The input value evaluates to the Slack workspace ID.
You can obtain the Slack workspace ID by logging in to Slack.com and launching Slack
in your browser. The workspace ID is the penultimate parameter in the URL. For example,
in this URL, the workspace ID is T01234ABCDE:
https://app.slack.com/client/T01234ABCDE/C56789FGHIJ

Execute Action As The entity that executes the action. Valid values are:
Slack App
Execute the action as the Slack app that you selected in the Slack App field. This is
the default value.
The Slack app must be a member of the conversation to execute the action on.

390
Automate Your Business Processes Flows

Input Parameter Description

User Who Runs the Flow


Execute the action as the user who runs the flow. The user can execute the action
only when the flow runs in the user context. If the flow runs in the system context,
it’s executed by the Slack app.
The user must be a member of the conversation to execute the action on.

Set Slack Conversation

Input Parameter Description


Slack Conversation ID Required. The ID of the channel to retrieve information about.
You can obtain the Slack conversation ID by logging in to Slack.com and launching Slack
in your browser. The conversation ID is the last parameter in the URL. For example, in this
URL, the conversation ID is C56789FGHIJ:
https://app.slack.com/client/T01234ABCDE/C56789FGHIJ

Store Output Values

Output Parameter Description


Conversation Is Archived Indicates whether the conversation is archived.

Slack Conversation ID The ID of the Slack conversation that you retrieved information about.

Slack Conversation Name The name of the Slack conversation that you retrieved information about.

Usage
This action is available only if you enable the connection to Slack in Setup and the user who runs the flow is connected to Slack. Otherwise,
the action fails.
Flow Core Actions for Slack: Invite Users to Slack Channel (Beta)
Add users who are connected to a given Slack app to a Slack channel or direct message.
EDITIONS
Note: This feature is a Beta Service. Customer may opt to try such Beta Service in its sole
discretion. Any use of the Beta Service is subject to the applicable Beta Services Terms provided Available in: both Salesforce
at Agreements and Terms. Classic and Lightning
Experience
In Flow Builder, add an Action element to your flow. In the New Action window, select Slack, and
then select Invite Users to Slack Channel (Beta). Available in: Essentials,
Professional, Enterprise,
Set Connection Values for Slack Performance, Unlimited,
and Developer Editions

391
Automate Your Business Processes Flows

Input Parameter Description


Slack App Required. The Slack app that executes the action. Only Slack apps that are installed for
the org are available. The input value evaluates to the Slack app ID.

Slack Workspace Required. The Slack workspace where the Slack app is installed. Select a value or resource.
The input value evaluates to the Slack workspace ID.
You can obtain the Slack workspace ID by logging in to Slack.com and launching Slack
in your browser. The workspace ID is the penultimate parameter in the URL. For example,
in this URL, the workspace ID is T01234ABCDE:
https://app.slack.com/client/T01234ABCDE/C56789FGHIJ

Execute Action As The entity that executes the action. Valid values are:
Slack App
Execute the action as the Slack app that you selected in the Slack App field. This is
the default value.
The Slack app must be a member of the conversation to execute the action on.
User Who Runs the Flow
Execute the action as the user who runs the flow. The user can execute the action
only when the flow runs in the user context. If the flow runs in the system context,
it’s executed by the Slack app.
The user must be a member of the conversation to execute the action on.

Set Slack Channel Details


Use values from earlier in the flow to set the inputs for the action.

Input Parameter Description


Slack Channel ID Required. The ID of the channel or direct message to invite users to.
You can obtain the Slack channel ID by logging in to Slack.com and launching Slack in
your browser. The channel ID is the last parameter in the URL. For example, in this URL,
the channel ID is C56789FGHIJ:
https://app.slack.com/client/T01234ABCDE/C56789FGHIJ

Slack Workspace ID for Required. The Slack workspace that contains the channel. Select a value or resource. The
Channel input value evaluates to the Slack workspace ID.
You can obtain the Slack workspace ID by logging in to Slack.com and launching Slack
in your browser. The workspace ID is the penultimate parameter in the URL. For example,
in this URL, the workspace ID is T01234ABCDE:
https://app.slack.com/client/T01234ABCDE/C56789FGHIJ

Salesforce User ID The collection resource that contains the Salesforce user IDs to invite to the channel. The
Collection Resource maximum number of user IDs is 1,000.

392
Automate Your Business Processes Flows

Usage
This action is available only if you enable the connection to Slack in Setup and the user who runs the flow is connected to Slack. Otherwise,
the action fails. Additionally, the user that initiates the flow and any users impacted by the action must have logged in to a Salesforce
Slack app at least once.
Flow Core Actions for Slack: Pin or Unpin Slack Message (Beta)
Pin or unpin a message in a Slack channel or direct message. Pin messages so that they’re readily
EDITIONS
available from the conversation header.

Note: This feature is a Beta Service. Customer may opt to try such Beta Service in its sole Available in: both Salesforce
discretion. Any use of the Beta Service is subject to the applicable Beta Services Terms provided Classic and Lightning
Experience
at Agreements and Terms.
In Flow Builder, add an Action element to your flow. In the New Action window, select Slack, and Available in: Essentials,
then select Pin or Unpin Slack Message (Beta). Professional, Enterprise,
Performance, Unlimited,
Set Connection Values for Slack and Developer Editions

Input Parameter Description


Slack App Required. The Slack app that executes the action. Only Slack apps
that are installed for the org are available. The input value
evaluates to the Slack app ID.

Slack Workspace ID Required. The Slack workspace where the Slack app is installed.
Select a value or resource. The input value evaluates to the Slack
workspace ID.
You can obtain the Slack workspace ID by logging in to Slack.com
and launching Slack in your browser. The workspace ID is the
penultimate parameter in the URL. For example, in this URL, the
workspace ID is T01234ABCDE:
https://app.slack.com/client/T01234ABCDE/C56789FGHIJ

Execute Action As The entity that executes the action. Valid values are:
Slack App
Execute the action as the Slack app that you selected in the
Slack App field. This is the default value.
The Slack app must be a member of the conversation to
execute the action on.
User Who Runs the Flow
Execute the action as the user who runs the flow. The user
can execute the action only when the flow runs in the user
context. If the flow runs in the system context, it’s executed
by the Slack app.
The user must be a member of the conversation to execute
the action on.

Set Message Details

393
Automate Your Business Processes Flows

Input Parameter Description


Slack Conversation ID Required. The ID of the channel or group direct message to send the message to. Enter
a value or select a resource.
You can obtain the Slack conversation ID by logging in to Slack.com and launching Slack
in your browser. The conversation ID is the last parameter in the URL. For example, in this
URL, the conversation ID is C56789FGHIJ:
https://app.slack.com/client/T01234ABCDE/C56789FGHIJ

Slack Message Timestamp Required. The timestamp of the sent message. Enter a value or select a resource. For
example, enter 1234567890.123456.
The numerals before the period character (.) specify a Unix timestamp. The numerals after
the period character specify microseconds.
You can store the Slack Message Timestamp output parameter of the Send Slack Message
(Beta), Edit Slack Message (Beta), or Send Message To Launch Flow (Beta) action as a
resource to use later.

Pin or Unpin Message Select a value or Boolean resource. Valid values are:
Pin
Pins the message to the conversation header.
Unpin
Unpins the message from the conversation header.
If you select a Boolean value that evaluates to true, the action pins the message. If you
select a Boolean value that evaluates to false, the action unpins the message. The default
is Pin.

Usage
This action is available only if you enable the connection to Slack in Setup and the user who runs the flow is connected to Slack. Otherwise,
the action fails.
Flow Core Actions for Slack: Send Slack Message (Beta)
Send a message to a Slack channel, direct message, or the Messages tab of a Slack app.
EDITIONS
Note: This feature is a Beta Service. Customer may opt to try such Beta Service in its sole
discretion. Any use of the Beta Service is subject to the applicable Beta Services Terms provided Available in: both Salesforce
at Agreements and Terms. Classic and Lightning
Experience
In Flow Builder, add an Action element to your flow. In the New Action window, select Slack, and
then select Send Slack Message (Beta). Available in: Essentials,
Professional, Enterprise,
Set Connection Values for Slack Performance, Unlimited,
and Developer Editions
Input Parameter Description
Slack App Required. The Slack app that executes the action. Only Slack apps
that are installed for the org are available. The input value
evaluates to the Slack app ID.

394
Automate Your Business Processes Flows

Input Parameter Description


Slack Workspace Required. The Slack workspace where the Slack app is installed. Select a value or resource.
The input value evaluates to the Slack workspace ID.
You can obtain the Slack workspace ID by logging in to Slack.com and launching Slack
in your browser. The workspace ID is the penultimate parameter in the URL. For example,
in this URL, the workspace ID is T01234ABCDE:
https://app.slack.com/client/T01234ABCDE/C56789FGHIJ

Execute Action As The entity that executes the action. Valid values are:
Slack App
Execute the action as the Slack app that you selected in the Slack App field. This is
the default value.
The Slack app must be a member of the conversation to execute the action on.
User Who Runs the Flow
Execute the action as the user who runs the flow. The user can execute the action
only when the flow runs in the user context. If the flow runs in the system context,
it’s executed by the Slack app.
The user must be a member of the conversation to execute the action on.

Set Slack Message Details

Input Parameter Description


Slack Conversation ID Required. The ID of the channel or direct message to send the message to. Alternatively,
specify a Slack user ID to send the message to the user via the Messages tab of the Slack
app. Enter a value or select a resource.
You can obtain the Slack conversation ID by logging in to Slack.com and launching Slack
in your browser. The conversation ID is the last parameter in the URL. For example, in this
URL, the conversation ID is C56789FGHIJ:
https://app.slack.com/client/T01234ABCDE/C56789FGHIJ

Slack Message Required. The message to send. For best results, include no more than 4,000 characters.
Slack truncates messages containing more than 40,000 characters. Enter a value or select
a resource.
Slack supports text formatting with Slack mrkdown. To disable formatting for a plain
text message that contains Slack mrkdown, use an escape sequence.
Slack does not support text formatting with HTML and renders rich text messages as plain
text.

Slack Message Timestamp The timestamp of the Slack message. Specify a timestamp to start a Slack thread. Enter a
value or select a resource. For example, enter 1234567890.123456.
The numerals before the period character (.) specify a Unix timestamp. The numerals after
the period character specify microseconds.

395
Automate Your Business Processes Flows

Input Parameter Description


You can store the Slack Message Timestamp output parameter of the Send Slack Message
(Beta), Edit Slack Message (Beta), or Send Message To Launch Flow (Beta) action as a
resource to use later.

Store Output Values

OUTPUT Parameter Description


Slack Message Timestamp The timestamp of the sent message.

Usage
This action is available only if you enable the connection to Slack in Setup and the user who runs the flow is connected to Slack. Otherwise,
the action fails.
Flow Core Actions for Slack: Send Message to Launch Flow (Beta)
Send a message to a Slack channel, direct message, or the Messages tab of a Slack app that includes
EDITIONS
a button that a recipient can use to launch a screen flow.

Note: This feature is a Beta Service. Customer may opt to try such Beta Service in its sole Available in: both Salesforce
discretion. Any use of the Beta Service is subject to the applicable Beta Services Terms provided Classic and Lightning
Experience
at Agreements and Terms.
In Flow Builder, add an Action element to your flow. In the New Action window, select Slack, and Available in: Essentials,
then select the name of the flow to send. Professional, Enterprise,
Performance, Unlimited,
Set Connection Values for Slack and Developer Editions

Input Parameter Description


Slack App Required. The Slack app that executes the action. Only Slack apps
that are installed for the org are available. The input value
evaluates to the Slack app ID.

Slack Workspace Required. The Slack workspace where the Slack app is installed.
Select a value or resource. The input value evaluates to the Slack
workspace ID.
You can obtain the Slack workspace ID by logging in to Slack.com
and launching Slack in your browser. The workspace ID is the
penultimate parameter in the URL. For example, in this URL, the
workspace ID is T01234ABCDE:
https://app.slack.com/client/T01234ABCDE/C56789FGHIJ

396
Automate Your Business Processes Flows

Input Parameter Description


Execute Action As The entity that executes the action. Valid values are:
Slack App
Execute the action as the Slack app that you selected in the Slack App field. This is
the default value.
The Slack app must be a member of the conversation to execute the action on.
User Who Runs the Flow
Execute the action as the user who runs the flow. The user can execute the action
only when the flow runs in the user context. If the flow runs in the system context,
it’s executed by the Slack app.
The user must be a member of the conversation to execute the action on.

Set Slack Message Details

Input Parameter Description


Slack Conversation ID Required. The ID of the channel or direct message to send the message to. Alternatively,
specify a Slack user ID to send the message to the user via the Messages tab of the Slack
app. Enter a value or select a resource.
You can obtain the Slack conversation ID by logging in to Slack.com and launching Slack
in your browser. The conversation ID is the last parameter in the URL. For example, in this
URL, the conversation ID is C56789FGHIJ:
https://app.slack.com/client/T01234ABCDE/C56789FGHIJ

Slack Message Required. The message to send. For best results, include no more than 4,000 characters.
Slack truncates messages containing more than 40,000 characters. Enter a value or select
a resource.
Slack supports text formatting with Slack mrkdown. To disable formatting for a plain
text message that contains Slack mrkdown, use an escape sequence.
Slack does not support text formatting with HTML and renders rich text messages as plain
text.

Button Label Required. The label for the button that appears below the message. The user clicks the
button to launch the flow from Slack.
Slack supports text formatting with Slack mrkdown. To disable formatting for a plain
text message that contains Slack mrkdown, use an escape sequence.
Slack does not support text formatting with HTML and renders rich text messages as plain
text.

Slack Bot Name The name of the bot that sends the message in Slack. Enter a value or select a resource.

397
Automate Your Business Processes Flows

Input Parameter Description


Slack Message Timestamp The timestamp of the Slack message. Specify a timestamp to start a Slack thread. Enter a
value or select a resource. For example, enter 1234567890.123456.
The numerals before the period character (.) specify a Unix timestamp. The numerals after
the period character specify microseconds.
You can store the Slack Message Timestamp output parameter of the Send Slack Message
(Beta), Edit Slack Message (Beta), or Send Message To Launch Flow (Beta) action as a
resource to use later.

Store Output Values

Input Parameter Description


Slack Message Timestamp The timestamp of the sent message.

Usage
This action is available only if you enable the connection to Slack in Setup and the user who runs the flow is connected to Slack. Otherwise,
the action fails.

SEE ALSO:
Make a Flow Available in Slack (Beta)
Flow Environments

Flow Core Action: Submit for Approval


Submit one Salesforce record for approval.
EDITIONS
Tip: Before you begin, store the ID for the record that you want to submit for approval in a
variable. Available in: both Salesforce
Classic and Lightning
In Flow Builder, add an Action element to your flow. In the Action field, enter Submit, and select Experience
Submit for Approval.
Available in: Enterprise,
Set Input Values
Performance, Unlimited,
Use values from earlier in the flow to set the inputs for the approval request. and Developer Editions

Input Parameter Description


Record ID The ID of the record that you want to submit for approval.
This parameter accepts single-value resources of any type. That value is
treated as text.

Approval The unique name or ID of the approval process that you want to submit
Process Name the record to. The process must have the same object type as the record
or ID you specified in Record ID.
Required if Skip Entry Criteria is set to true.

398
Automate Your Business Processes Flows

Input Parameter Description


If this parameter and Submitter ID aren’t set, the flow succeeds only when:
• The approver on submit is determined automatically, and
• The user who launched the flow is an allowed initial submitter
Make sure that:
• The approver on submit is determined automatically.
• The initial submitters for the approval processes related to this object include all users who could
launch this flow.
This parameter accepts single-value resources of any type. That value is treated as text.

Next Approver IDs The ID of the user to be assigned the approval request when the approval process doesn’t assign the
approver.
This parameter accepts collection variables of type Text that include exactly one item.

Skip Entry Criteria If set to true, the record isn’t evaluated against the entry criteria set on the process that is defined
in Approval Process Name or ID.
This parameter accepts any single-value resource of type Boolean.

Submission Comments Text that you want to accompany the submission. Don’t reference merge fields or formula expressions.
Submission comments appear in the approval history for the specified record. This text also appears
in the initial approval request email if the template uses the {!ApprovalRequest.Comments}
merge field.
This parameter accepts single-value resources of any type. That value is treated as text.

Submitter ID The ID for the user who submitted the record for approval. The user receives notifications about
responses to the approval request.
The user must be one of the allowed submitters for the process.
If you don’t set this field, the user who launched the flow is the submitter. If a workflow rule triggers
a flow that includes this element, the submitter is the user who triggered the workflow rule. Workflow
rules can be triggered when a user creates or edits a record. When the record is approved or rejected,
the user who launched the flow or triggered the workflow rule is notified.
This parameter accepts single-value resources of any type. That value is treated as text.

Store Output Values


To use the approval request’s outputs later in the flow, store them in variables. The values are assigned when the approval request is
created.

Optional Output Description


Parameter
Instance ID The ID of the approval request that was submitted.
This parameter accepts single-value variables of type Text, Picklist, or Multi-Select Picklist.

399
Automate Your Business Processes Flows

Optional Output Description


Parameter
Instance Status The status of the current approval request. Valid values are Approved, Rejected, Removed, or Pending.
This parameter accepts single-value variables of type Text, Picklist, or Multi-Select Picklist.

New Work Item IDs The IDs of the new items submitted to the approval request. There can be 0 or 1 approval processes.
This parameter accepts collection variables of type Text.

Next Approver IDs The IDs of the users who are assigned as the next approvers.
This parameter accepts collection variables of type Text.

Record ID The ID of the record that the flow submitted for approval.
This parameter accepts single-value variables of type Text, Picklist, or Multi-Select Picklist.

Usage
At run time, the approval request isn’t created until the interview’s transaction is completed. Transactions are complete when the
interview either finishes or executes a Screen, Local Action, or Pause element.

SEE ALSO:
Flow Elements
Add and Edit Elements
Customize What Happens When a Flow Fails
Route a Flow

Salesforce Anywhere Core Flow Actions (Beta)


Salesforce Anywhere provides several core actions for implementing Salesforce Anywhere
EDITIONS
functionality in flows. To add one of these actions to your flow, add an Action element. Then select
the Salesforce Anywhere category, and search for the appropriate action. Available in: Lightning
Note: Salesforce Anywhere Beta is a Non-GA Service and not a “Service” or part of the Experience
“Services”, as defined in the Main Services Agreement ("MSA") with Salesforce. Such Non-GA Available in: Enterprise,
Service is subject to the terms and conditions of the Universal Pilot Research Agreement Performance, Professional,
("UPRA"), including the Data Processing Addendum to the UPRA. Use of this Non-GA Service Developer, and Unlimited
is at your sole discretion, and any purchase decisions should be made only on the basis of Editions
Salesforce generally available products and features.
These actions are available when you enable Salesforce Anywhere.

Flow Core Action for Salesforce Anywhere: Create a Salesforce Anywhere Chat (Beta)
Create a Salesforce Anywhere chat by specifying participants, and optionally, an initial message and chat title.
Flow Core Action for Salesforce Anywhere: Add a Message to a Salesforce Anywhere Chat (Beta)
Add a message to an existing Salesforce Anywhere chat by specifying the chat URL and message content.
Flow Core Action for Salesforce Anywhere: Add Users to a Salesforce Anywhere Chat (Beta)
Add users to an existing Salesforce Anywhere chat by specifying the chat URL and the users to be added.

400
Automate Your Business Processes Flows

Flow Core Action for Salesforce Anywhere: Send Salesforce Anywhere Alerts to Users (Beta)
Notify users about Salesforce Anywhere chat by specifying the chat URL and the users to be added.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Salesforce Anywhere: Create a Salesforce Anywhere Chat (Beta)
Create a Salesforce Anywhere chat by specifying participants, and optionally, an initial message
EDITIONS
and chat title.

Note: Salesforce Anywhere Beta is a Non-GA Service and not a “Service” or part of the Available in: Lightning
“Services”, as defined in the Main Services Agreement ("MSA") with Salesforce. Such Non-GA Experience
Service is subject to the terms and conditions of the Universal Pilot Research Agreement Available in: Enterprise,
("UPRA"), including the Data Processing Addendum to the UPRA. Use of this Non-GA Service Performance, Professional,
is at your sole discretion, and any purchase decisions should be made only on the basis of Developer, and Unlimited
Salesforce generally available products and features. Editions
In Flow Builder, add an Action element to your flow. Select the Salesforce Anywhere category, and
search for chat. Select Create Chat.
Set Input Values
Use values from earlier in the flow to set the inputs for the chat.

Input Parameter Description


chatMessage The first message sent to the chat.
This parameter accepts single-value resources of any type. That value is treated as text.

userEmails A comma-separated list of email addresses belonging to one or more users getting added to the chat. Must
list at least two email addresses and no more than 50 email addresses.
Email addresses must be part of your Salesforce Anywhere organization. If an email address isn’t included in
your Salesforce Anywhere organization, the user isn’t included in the chat.
This parameter accepts single-value resources of any type. That value is treated as text.

Store Output Values

Output Parameter Description


chatId The chat’s ID.
This parameter accepts single-value resources of any type. That value is treated as text.

chatTitle The name users see at the top of the chat.


This parameter accepts single-value resources of any type. That value is treated as text.

chatUrl The chat’s URL.


This parameter accepts single-value resources of any type. That value is treated as text.

401
Automate Your Business Processes Flows

Usage
In Flow Builder, this action does not check the number of email addresses or the validity of the email addresses. When either criteria is
invalid, the flow fails at run time.
The API used for this action has a rate limit of 50 requests per minute and 750 requests per hour.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Salesforce Anywhere: Add a Message to a Salesforce Anywhere Chat (Beta)
Add a message to an existing Salesforce Anywhere chat by specifying the chat URL and message
EDITIONS
content.

Note: Salesforce Anywhere Beta is a Non-GA Service and not a “Service” or part of the Available in: Lightning
“Services”, as defined in the Main Services Agreement ("MSA") with Salesforce. Such Non-GA Experience
Service is subject to the terms and conditions of the Universal Pilot Research Agreement Available in: Enterprise,
("UPRA"), including the Data Processing Addendum to the UPRA. Use of this Non-GA Service Performance, Professional,
is at your sole discretion, and any purchase decisions should be made only on the basis of Developer, and Unlimited
Salesforce generally available products and features. Editions
In Flow Builder, add an Action element to your flow. Select the Salesforce Anywhere category, and
search for message. Select Add Message to Chat.
Set Input Values
Use values from earlier in the flow to set the inputs for the message.

Input Parameter Description


chatUrl The chat's URL.
This parameter accepts single-value resources of any type. That value is treated as text.

chatMessage The message to send to the chat.


This parameter accepts single-value resources of any type. That value is treated as text.

recordId The ID of the Salesforce record to send to the chat. The record's compact layout is displayed in the chat.
This parameter accepts single-value resources of any type. That value is treated as text.

Store Output Values

Output Parameter Description


chatId The chat’s ID.
This parameter accepts single-value resources of any type. That value is treated as text.

chatMessage The message sent to the chat.


This parameter accepts single-value resources of any type. That value is treated as text.

chatUrl The chat’s URL.


This parameter accepts single-value resources of any type. That value is treated as text.

402
Automate Your Business Processes Flows

Output Parameter Description


recordId The ID of the record sent to the chat.
This parameter accepts single-value resources of any type. That value is treated as text.

Usage
Only existing chat members can trigger this action. For example, only an existing chat member can successfully run a flow that sends a
message to a chat about a service case when that case record is updated.
A flow can’t create a record and then reference that new record ID as an input for this action.
The API used for this action has a rate limit of 50 requests per minute and 750 requests per hour.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Salesforce Anywhere: Add Users to a Salesforce Anywhere Chat (Beta)
Add users to an existing Salesforce Anywhere chat by specifying the chat URL and the users to be
EDITIONS
added.

Note: Salesforce Anywhere Beta is a Non-GA Service and not a “Service” or part of the Available in: Lightning
“Services”, as defined in the Main Services Agreement ("MSA") with Salesforce. Such Non-GA Experience
Service is subject to the terms and conditions of the Universal Pilot Research Agreement Available in: Enterprise,
("UPRA"), including the Data Processing Addendum to the UPRA. Use of this Non-GA Service Performance, Professional,
is at your sole discretion, and any purchase decisions should be made only on the basis of Developer, and Unlimited
Salesforce generally available products and features. Editions
In Flow Builder, add an Action element to your flow. Select the Salesforce Anywhere category, and
search for users. Select Add Users to Chat.
Set Input Values
Use values from earlier in the flow to set the inputs for the new users.

Input Parameter Description


chatUrl The chat's URL.
This parameter accepts single-value resources of any type. That value is treated as text.

userEmails Required. A comma-separated list of email addresses belonging to up to 50 users getting added to the chat.
Email addresses must be part of your Salesforce Anywhere organization. If an email address isn’t included in
your Salesforce Anywhere organization, the user isn’t be included in the chat.
This parameter accepts single-value resources of any type. That value is treated as text.

Store Output Values

403
Automate Your Business Processes Flows

Output Parameter Description


chatId The chat’s ID.
This parameter accepts single-value resources of any type. That value is treated as text.

chatUrl The chat’s URL.


This parameter accepts single-value resources of any type. That value is treated as text.

chatTitle The name users see at the top of the chat.


This parameter accepts single-value resources of any type. That value is treated as text.

Usage
In Flow Builder, this action doesn’t check the number of email addresses or the validity of the email addresses. When either criteria is
invalid, the flow fails at run time.
Only existing chat members can trigger this action. For example, only an existing chat member can successfully run a flow that adds
new users to a chat about a service case when that case record is updated.
The API used for this action has a rate limit of 50 requests per minute and 750 requests per hour.

SEE ALSO:
Add and Edit Elements
Flow Core Action for Salesforce Anywhere: Send Salesforce Anywhere Alerts to Users (Beta)
Notify users about Salesforce Anywhere chat by specifying the chat URL and the users to be added.
EDITIONS
Note: Salesforce Anywhere Beta is a Non-GA Service and not a “Service” or part of the
“Services”, as defined in the Main Services Agreement ("MSA") with Salesforce. Such Non-GA Available in: Lightning
Service is subject to the terms and conditions of the Universal Pilot Research Agreement Experience
("UPRA"), including the Data Processing Addendum to the UPRA. Use of this Non-GA Service Available in: Enterprise,
is at your sole discretion, and any purchase decisions should be made only on the basis of Performance, Professional,
Salesforce generally available products and features. Developer, and Unlimited
In Flow Builder, add an Action element to your flow. Select the Salesforce Anywhere category, and Editions
search for alert. Select Send Alert.
Set Input Values
Use values from earlier in the flow to set the inputs for the alert.

Input Parameter Description


alertMessage The message sent in the alert.
This parameter accepts single-value resources of any type. That value is treated as text.

userEmails A comma-separated list of the users’ email addresses.


This parameter accepts single-value resources of any type. That value is treated as text.

recordId The ID of the Salesforce record to send to the chat. The record's compact layout is displayed in the chat.
This parameter accepts single-value resources of any type. That value is treated as text.

404
Automate Your Business Processes Flows

Store Output Values

Output Parameter Description


eventOperationId The unique ID generated for the alert.
This parameter accepts single-value resources of any type. That value is treated as text.

SEE ALSO:
Platform Events Developer Guide : Platform Events Considerations
Add and Edit Elements

Flow Element: Create Records


Create multiple Salesforce records by using a record collection variable. Create exactly one Salesforce
EDITIONS
record by using a record variable or other values from the flow.

Note: Looking for the Fast Create and Record Create elements from Cloud Flow Designer? Available in: both Salesforce
The Create Records element combines the functionality of both elements. For the equivalent Classic and Lightning
Experience
of the Record Create element, create one record and set the record fields using separate
variables, resources, and literal values. Choosing the other options is the equivalent of the Available in: Essentials,
Fast Create element. Professional, Enterprise,
How many records you choose to create and how to set the field values determines what to enter Performance, Unlimited,
in the rest of the Create Records element. and Developer Editions

To create more than one record


To create multiple records, you must use the values from a record collection variable. Earlier in the flow, populate the record collection
variable with the new records’ field values.
When you use a record collection variable to create multiple records at once, you reduce the number of DML requests in your flow.
That means you’re more likely to stay within your org’s limits. For more information, see Flow Bulkification in Transactions.
To create exactly one record
If you’ve populated a record variable with the field values for the new record, choose to set the record fields by using all the values
from a record variable. Then select the record variable or record collection variable to use.
To manually map values from various resources in the flow, choose to set the record fields by using separate variables, resources,
and literal values. Choose the object that you want to create a record for, and set the field values for the record. Optionally, store the
ID of the created record in a Text variable. For example, you might need the record’s ID to create child records or to provide a link
to the created record.

Example: A user enters a name and address into the flow. Verify that a matching user exists by using the Get Records element.
If a matching contact doesn’t exist, create a record for that user by using the Create Records element.

Usage
To prevent the flow from failing, make sure that:
• All required fields are populated with values. If you don’t know which fields are required, check the object definition.
• For record variables and record collection variables, the ID field values are blank. The flow populates the ID fields after the record is
created.

405
Automate Your Business Processes Flows

Note: The record isn’t created until the interview’s transaction is completed. Transactions are complete when the interview either
finishes or executes a Screen, Local Action, or Pause element.

SEE ALSO:
Flow Operators in Data Elements and Record Choice Sets
Customize What Happens When a Flow Fails
Route a Flow
Flow Elements

Flow Element: Get Records


Find Salesforce records that meet filter conditions, and store values from the records in variables.
EDITIONS
Note: Looking for the Fast Lookup and Record Lookup elements from Cloud Flow Designer?
The Get Records element combines the functionality of both elements. For the equivalent of Available in: both Salesforce
the Record Lookup element, store only the first record in separate variables. Choosing the Classic and Lightning
Experience
other options is the equivalent of the Fast Lookup element.
Identify the object whose records you want to find, and specify conditions to narrow down the list Available in: Essentials,
of returned records. How many records you choose to store and where to store the field values Professional, Enterprise,
determines what to enter in the rest of the Get Records element. When you add a Get Records Performance, Unlimited,
element to a screen flow or an autolaunched flow, we automatically store all the record values in and Developer Editions
a flow variable. When the flow moves to the next element, the values are assigned to the variable.
To store record values manually in a screen flow or autolaunched flow, select Choose fields and assign variables (advanced).
To store field values manually for only the first record

Tip: If you choose to store values from only the first record, filter by a unique field, such as ID. Otherwise, you can’t guarantee
which record’s field values are stored.
You can store field values from the first record together in a record variable or in separate variables.
To store the values together, select the record variable, and identify the fields whose values you want to store.
To store the values in separate variables, select each field you want to store, and select the variable to store each field value in.
To store field values manually for more than one record
To store field values for multiple records, you must store the values in a record collection variable.
When you use a record collection variable to create, update, or delete multiple records at once, you reduce the number of DML
requests in your flow. That means you’re more likely to stay within your org’s limits. For more information, see Flow Bulkification in
Transactions.

Example:
• Find the product name or description for a product with a specific bar code.
• Confirm stock availability for a particular item.
• Verify a caller’s identity.

Considerations for Defining Filter Criteria


• When you define multiple filters, the filter logic usually defaults to AND. However, if multiple filters have the same field selected and
use the equals operator, the filters are combined with OR.

406
Automate Your Business Processes Flows

For example, your filters check whether a case’s Type equals Problem (1), Type equals Feature Request (2), and Escalated equals true
(3). At run time, the filters are combined to (1 OR 2) AND 3.

• The available filter operators depend on the data type of the selected fields. For details, see Flow Operators in Data Elements and
Record Choice Sets.

SEE ALSO:
Flow Operators in Data Elements and Record Choice Sets
Flow Elements
Customize What Happens When a Flow Fails
Route a Flow

Flow Element: Decision


Evaluate a set of conditions, and route users through the flow based on the outcomes of those
EDITIONS
conditions. This element performs the equivalent of an if-then statement.
Available in: both Salesforce
Outcomes Classic and Lightning
Experience
For each path that the flow can take, create an outcome. For each outcome, specify the conditions
that must be met for the flow to take that path. To relabel the path that the flow takes if no outcome’s Available in: Essentials,
conditions are met, click Default Outcome. Professional, Enterprise,
Performance, Unlimited,
Field Description and Developer Editions

Label Identifies the connector for this outcome on the canvas.

Outcome The requirement for uniqueness applies only to elements within the current
API Name flow. Two elements can have the same API name, provided they're used in
different flows. An API name can include underscores and alphanumeric
characters without spaces. It must begin with a letter and can’t end with an
underscore. It also can’t have two consecutive underscores.

Condition Determines whether the flow takes this outcome’s path. Sets logic and conditions
Requirements for each outcome that determine if the flow follows its path.
to Execute
Outcome

When to Available on record-triggered flows. Determines whether this outcome’s path


Execute is taken, based on whether the triggering record is updated to meet the
Outcome condition requirements. For example, the opportunity update that triggered
the flow to run changed its stage to Closed Won from any value that isn’t Closed
Won.

Note: This option checks if the triggering record didn't previously meet
the condition requirements and if the $Record variable now meets the
condition requirements. If your flow changes any of the $Record variable’s
fields before it runs the configured Decision element, the Decision checks
if the $Record’s new field values now meet the condition requirements.

407
Automate Your Business Processes Flows

Example: Using a Decision element, determine whether:


• To give customers a return shipping address or instructions on how to resolve the problem when an item is determined to be
faulty.
• To offer a customer a loan based on the results of a credit scoring formula.
• To inform sales leaders when an opportunity’s stage is changed to Closed Won.

Tip: Configure your flow so that it does different things based on what a user selects for a Picklist screen component. To do
so, add a decision after the screen to create the branches of the flow based on the choices available in the picklist. Then you
can represent each choice in your decision and connect it to a branch of your flow.

Usage
When a flow executes a Decision element, it evaluates each decision outcome in order. For the first outcome whose conditions are met,
the flow takes the associated path. If no outcome’s conditions are met, the flow takes the path for the default outcome.

SEE ALSO:
Flow Elements
Define Conditions in a Flow
Flow Operators in Decision and Pause Elements
Route a Flow

Flow Element: Delete Records


Identify Salesforce records to delete by using the IDs stored in a record variable or record collection
EDITIONS
variable, or by specifying conditions.

Note: Looking for the Fast Delete and Record Delete elements from Cloud Flow Designer? Available in: both Salesforce
The Delete Records element combines the functionality of both elements. Classic and Lightning
Experience
• For the equivalent of the Fast Delete element, use the IDs from a record variable or record
collection variable. Available in: Essentials,
Professional, Enterprise,
• For the equivalent of the Record Delete element, specify the conditions to identify the
Performance, Unlimited,
records to delete.
and Developer Editions
How you choose to identify the records to delete determines what to enter in the rest of the Delete
Records element.
Use a record variable or record collection variable
If you store the IDs of the records to delete in a record variable or record collection variable, choose to use the IDs from a record
variable or record collection variable. Then select the variable to use.

Important: For the variable that you select, make sure that each record’s ID value is set. The flow identifies which records to
delete based on the ID value.
When you use a record collection variable to delete multiple records at once, you reduce the number of DML requests in your flow.
That means you’re more likely to stay within your org’s limits. For more information, see Flow Bulkification in Transactions.
Specify conditions
To use conditions to identify the records to delete, choose the object, and add at least one condition to filter down the list of records.

Example: When a customer accepts a quote, delete the remaining quotes from the opportunity.

408
Automate Your Business Processes Flows

Considerations for Defining Filter Criteria


• When you define multiple filters, the filter logic usually defaults to AND. However, if multiple filters have the same field selected and
use the equals operator, the filters are combined with OR.
For example, your filters check whether a case’s Type equals Problem (1), Type equals Feature Request (2), and Escalated equals true
(3). At run time, the filters are combined to (1 OR 2) AND 3.

• The available filter operators depend on the data type of the selected fields. For details, see Flow Operators in Data Elements and
Record Choice Sets.

Usage
Warning:
• Be careful when testing flows that contain delete elements. Even if the flow is inactive, it triggers the delete operation.
• To prevent deleting records by mistake, be as specific in your filter criteria as possible.
• Records are deleted from your org the moment the flow executes the delete element.
• Deleted records are sent to the Recycle Bin and remain there for 15 days before they are permanently deleted.
• Flows can delete records that are pending approval.

Note: At run time, the record isn’t deleted until the interview’s transaction is completed. Transactions are complete when the
interview either finishes or executes a Screen, Local Action, or Pause element.

SEE ALSO:
Flow Operators in Data Elements and Record Choice Sets
Customize What Happens When a Flow Fails
Route a Flow
Flow Elements

Flow Element: Email Alert


Send an email by using a workflow email alert to specify the email template and recipients. The
EDITIONS
flow provides only the record ID.
Before you begin: Available in: both Salesforce
Classic and Lightning
• Make sure that the email alert you want to call from your flow exists. If not, create the email
Experience
alert on page 692.
• Understand the daily limits for emails sent from email alerts. Available in: Essentials,
Professional, Enterprise,
• Store the ID for the record that you want to reference in this email, such as by using a Get
Performance, Unlimited,
Records element. If the email alert has merge fields, the referenced record is the starting point
and Developer Editions
for those fields.
Drag an Email Alert element onto the canvas. In the Email Alert field, select the email alert to
configure. To filter the list of email alerts by a specific object, enter the API name of the object. The unique name for each email alert is
prefixed with its object. For example, email alert emailAlert-Account.Owner_Changed is associated with the Account
object.

409
Automate Your Business Processes Flows

Set Input Values

Field Description
Record ID Select a variable that contains the ID for the record that you want the email to reference. If the email alert uses
merge fields, this record is the starting point for those merge fields.
This field accepts single-value variables of any type. The value is treated as text. The object type of the referenced
record must match the object type of the email alert.

Usage
At run time, the email isn’t sent until the interview’s transaction is completed. Transactions are complete when the interview either
finishes or executes a Screen, Local Action, or Pause element.
Flow Builder displays email alerts from managed packages only if the email alert isn’t protected.

SEE ALSO:
Options for Sending Emails from a Flow
Customize What Happens When a Flow Fails
Route a Flow
Daily Allocations for Email Alerts

Flow Element: Loop


Start a loop path for iterating over items in a collection variable. For each iteration, the flow
EDITIONS
temporarily stores the item in the loop variable. To execute actions on each item’s field values, use
other elements in the loop. Available in: both Salesforce
A collection is a list of items, such as field values or email addresses. A loop uses a loop variable to Classic and Lightning
store the values for the current item in the collection. When the loop finishes examining an item, Experience
it copies the field values for the next item into the loop variable. To reference each collection item
Available in: Essentials,
in elements along the loop path, use the loop variable. To keep changes made along the loop path, Professional, Enterprise,
add the loop variable as an item in a new collection variable. Performance, Unlimited,
and Developer Editions
Field Description
Collection The collection that you want to loop through. This field accepts any collection
Variable variable.

Direction Determines whether the flow starts with the first item or the last item in the
collection variable.

Loop The variable that the flow uses to contain the current item’s values during a
Variable loop iteration.
• If Collection Variable is set to a non-record collection variable,
this field accepts a variable with the same data type.
• If Collection Variable is set to a record collection variable, this
field accepts a record variable with the same object type.

410
Automate Your Business Processes Flows

Usage
After you add a Loop element and the elements that you want the loop to include, from the Loop element:
• Determine which element to execute first when a new item’s values are copied into the loop variable by using the “For each item”
connector.
• Determine which element to execute after the loop has processed all the items in the collection by using the “After last item”
connector.

Sample Flow That Loops Through a Collection


Transfer ownership of accounts from one user to another by using record collection variables and loops. The flow already has the
required user IDs.

SEE ALSO:
Route a Flow
Flow Elements
Flow Resource: Variable

Sample Flow That Loops Through a Collection


Transfer ownership of accounts from one user to another by using record collection variables and
EDITIONS
loops. The flow already has the required user IDs.
First, create an Account-based record collection variable called collAcctJSmith and populate Available in: both Salesforce
it with all account records that John Smith owns. Classic and Lightning
Experience
Then create a loop that iterates through the collection. For each item in the collection, the loop
does the following: Available in: Essentials,
1. Assigns the collection item to the loop variable. Professional, Enterprise,
Performance, Unlimited,
2. Evaluates whether the account has more than 10,000 employees. and Developer Editions
3. If the account has more than 10,000 employees, assigns Madison’s user ID to the OwnerId
field in the loop variable.
4. If the account doesn’t have more than 10,000 employees, assigns Amber’s user ID to the OwnerId field in the loop variable.
5. Adds the loop variable’s values as a new item in a second collection called collReassignedAccts.
Finally, add a Update Records element to update the accounts in collReassignedAccts with the new OwnerId after the loop
finishes iterating through the collection.

411
Automate Your Business Processes Flows

This section of the flow uses a single query to look up the list of accounts and a single DML statement to update those accounts. If you
updated the records by setting the fields individually, you would use:
• One Update Records element to find all accounts that John owns and have more than 10,000 employees (1 query). Then update
those records’ OwnerId to Madison’s Id (1 DML statement).
• One Update Records element to find all accounts that John owns and don’t have more than 10,000 employees (1 query). Then
update those records’ OwnerId to Amber’s Id (1 DML statement).

Flow Element: Pause


If pause conditions are met, pause the flow interview. Resume when a specified time occurs or
EDITIONS
when the flow interview receives a platform event message.

Note: Available in: both Salesforce


Classic and Lightning
• Flows that contain Pause elements must be autolaunched. If a flow includes Pause Experience
elements and screens, choice, or choice sets, you can’t activate or run it.
Available in: Essentials,
• Before you add a Pause element to your flow, understand the special behavior and
Professional, Enterprise,
limitations. See Paused Flow Interview Considerations on page 228 for details.
Performance, Unlimited,
Each pause configuration corresponds to a pause connector on the canvas. When a flow pauses, and Developer Editions
it waits for one or more resume events. For the first resume event that occurs, the flow resumes
and executes the connector for the associated pause configuration.

Flow Pause Conditions


Each pause configuration that you define in a flow has optional pause conditions. At run time, these conditions determine whether
the flow waits for the associated resume event.
Flow Resume Events
Define the event to wait for if the pause conditions are met. When an event occurs, the flow resumes and takes the path associated
with this pause configuration.

412
Automate Your Business Processes Flows

Sample Flows That Wait for Events


Configure a flow to wait for events in one of four ways.

SEE ALSO:
Customize What Happens When a Flow Fails
Route a Flow
Flow Elements
Configure the Process Trigger

Flow Pause Conditions


Each pause configuration that you define in a flow has optional pause conditions. At run time, these
EDITIONS
conditions determine whether the flow waits for the associated resume event.
If the pause conditions aren’t met for a resume event, the interview doesn’t wait for that event. If Available in: both Salesforce
all resume events have unmet pause conditions, the interview doesn’t pause. Instead, it executes Classic and Lightning
the default path. Experience

Example: Use pause conditions when: Available in: Essentials,


Professional, Enterprise,
• The flow waits for different events based on a field value on a given record. Performance, Unlimited,
For example, send an email reminder to a contract’s owner before the contract’s end and Developer Editions
date. However, the date on which you send the email depends on the rating of the
contract’s account. If the account is hot, send the email a month before the end date. If
the account isn’t hot, send the email two weeks before the end date.
For this example, you create two events. The event for hot accounts occurs 30 days before
the contract’s end date. Its pause conditions check whether the rating for the contract’s
account is equal to “Hot.”

413
Automate Your Business Processes Flows

The second event occurs 14 days before the contract’s end date. Its pause conditions check whether the rating for the contract’s
account is not equal to “Hot.” If the account is hot, the interview doesn’t wait for the second event.

• The flow waits for multiple events to occur, such as to send periodic email reminders. For an example of this scenario, see
Sample Flow That Pauses Until Multiple Resume Events Occur on page 428.

SEE ALSO:
Define Conditions in a Flow
Flow Element: Pause
Flow Resume Events
Define Conditions in a Flow
Flow Element: Pause
Flow Resume Events

Flow Resume Events


Define the event to wait for if the pause conditions are met. When an event occurs, the flow resumes and takes the path associated with
this pause configuration.

Flow Resume Event: Specific Time


Resume the paused flow when a specific time occurs.
Flow Resume Event: Platform Event Message
Resume the flow interview when it receives a platform event message.

SEE ALSO:
Flow Element: Pause
Flow Pause Conditions

Flow Resume Event: Specific Time


Resume the paused flow when a specific time occurs.
Make sure to familiarize yourself with Paused Flow Interview Considerations.
Define Resume Time: Flow-Based Time
When the time source is a specific time, configure the resume time with these fields.

Parameter Description
Base Time A date/time value. You can manually enter a date/time value or reference a merge field or flow
resource.

Offset Number Optional. The number of days or hours to offset the selected field’s value. Required if you provide
an offset unit.
Manually enter the integer. You can’t use a merge field or flow resource for this value.
To resume the flow before the base time, use a negative number. To resume the flow after the base
time, use a positive number.

414
Automate Your Business Processes Flows

Parameter Description
Offset Unit Optional. The unit to offset the selected field’s value. Required if you provide an offset number.
Manually enter Days or Hours. You can’t use a merge field or flow resource for this value.

Example: To resume the flow 3 days after the flow paused, use the $Flow.CurrentDate global variable as the base time,
set the offset number to 3, and set the offset unit to Days.
Define Resume Time: Record-Based Time
When the time source is a record field, configure the resume time with these fields. The base resume time is a date/time field value on
a record.

Parameter Description
Object The API name of the object to use for the base resume time. See Record-Based Time: Supported
Objects on page 416.
Manually enter the string. You can’t use a merge field or flow resource for this value.

Field The API name for a date/time field. The field must belong to the specified object.
Manually enter the string. You can’t use a merge field or flow resource for this value.

Record ID The ID of the record to use for the base time. The record’s object must match what’s entered in
Object. The record’s value for the selected field is used as the base resume time.
You can enter a string or select a merge field or flow resource.

Offset Number Optional. The number of days or hours to offset the selected field’s value. Required if you provide
an offset unit.
Manually enter the integer. You can’t use a merge field or flow resource for this value.
To resume the flow before the base time, use a negative number. To resume the flow after the base
time, use a positive number.

Offset Unit Optional. The unit to offset the selected field’s value. Required if you provide an offset number.
Manually enter Days or Hours. You can’t use a merge field or flow resource for this value.

Example: You want to resume the flow 3 days before a contract ends. To identify the base resume time, set Object to
Contract, Field to EndDate, and Record ID to {!varContractId}. To offset the base resume time, set the offset number
to -3, and set the offset unit to Days.
Store Output Values in Variables
Reference information from the resume event in your flow by storing its outputs in flow variables.

Parameter Description Example


Resume Time The actual time at which the event occurred and the flow interview 11/26/2014 10:12 AM
resumed.

415
Automate Your Business Processes Flows

Parameter Description Example


Event Delivery The status of the event when the flow interview resumed. After a Delivered
Status resume event occurs, Salesforce delivers data from the event to the
flow that’s waiting for it so that the flow knows to resume. Valid
values are:
• Delivered—The event was successfully delivered.
• Invalid—An error occurred during delivery, but the flow
successfully resumed.

Record-Based Time: Supported Objects


You can configure a flow to wait for a record-base time for any custom object or the following standard objects.
• Account
• AccountContactRelation
• AccountRelationship
• ActionPlan
• ActiveScratchOrg
• ActivityMetric
• ActivityMetricRollup
• Address
• AgentWork
• AgentWorkSkill
• AiImageDetectedObject
• AiImageObject
• AiImageTrainingObject
• Asset
• AssetRelationship
• AssignedResource
• AssistantProgress
• BusinessAccount
• Campaign
• CampaignInfluence
• CampaignMember
• CareBarrier
• CareBarrierDeterminant
• CareBarrierType
• CareDeterminant
• CareDeterminantType
• CareDiagnosis
• CareInterventionType

416
Automate Your Business Processes Flows

• CarePreauth
• CarePreauthItem
• CareProgram
• CareProgramCampaign
• CareProgramEnrollee
• CareProgramTeamMember
• CareRequest
• CareRequestDrug
• CareRequestItem
• Case
• CaseComment
• Certification
• CertificationDef
• CertificationSectionDef
• CertificationStep
• CertificationStepDef
• ChannelProgram
• ChannelProgramLevel
• ChannelProgramMember
• ChatterActivity
• Claim
• CollaborationGroup
• CollaborationGroupMember
• ConsumptionRate
• ConsumptionSchedule
• Contact
• ContactEmail
• ContactPhone
• ContactPointConsent
• ContactPointTypeConsent
• ContactRequest
• ContactWeb
• Contract
• ContractLineItem
• CoverageBenefit
• CoverageBenefitItem
• CoverageLimit
• CoverageType
• CustomerAssetAuto
• CustomerAssetHome

417
Automate Your Business Processes Flows

• DandBCompany
• DataSharingCustomerLocal
• DataUsePurpose
• DigitalSignature
• DuplicateRecordItem
• DuplicateRecordSet
• EmailMessage
• EngagementProgramNode
• EngagementProgramVersion
• Entitlement
• EntitlementContact
• EntityMilestone
• EnvironmentHubMember
• EnvironmentHubMemberRel
• Event
• ExchangeUserMapping
• ExpressionFilter
• ExpressionFilterCriteria
• ExternalEventMapping
• FeedItem
• Goal
• GoalLink
• HealthCareDiagnosis
• HealthCareProcedure
• Idea
• IdentityDocument
• IdentityProvEventLog
• Image
• InStoreLocation
• Individual
• InsurancePolicy
• InsurancePolicyAsset
• InsurancePolicyBeneficiary
• InsurancePolicyCoverageLimit
• InsurancePolicyMember
• InsurancePolicyOwner
• InsuranceProfile
• KeyPerformanceIndicator
• Lead
• LinkedArticle

418
Automate Your Business Processes Flows

• LiveAgentSession
• LiveChatTranscript
• LiveChatTranscriptEvent
• LiveChatTranscriptSkill
• Location
• Macro
• MacroAction
• MacroInstruction
• MaintenanceAsset
• MaintenancePlan
• MemberPlan
• MessagingEndUser
• MessagingSession
• Metric
• MobileDeviceCommand
• NetworkMember
• OperatingHours
• Opportunity
• OpportunityLineItem
• OpportunityScore
• OpportunitySplit
• OpportunityTeamMember
• Order
• OrderDeliveryGroup
• OrderDeliveryGroupLine
• OrderDeliveryMethod
• OrderItem
• OrderItemSummary
• OrderPriceAdjustDistrLine
• OrderPriceAdjustmentLine
• OrderSummary
• OrgDeleteRequest
• OrgSnapshot
• Organization
• PartnerFundAllocation
• PartnerFundClaim
• PartnerFundRequest
• PartnerMarketingBudget
• PaymentAuthorizationReversal
• PendingServiceRouting

419
Automate Your Business Processes Flows

• PersonAccount
• PersonEducation
• PersonEmployment
• PersonLifeEvent
• PlanBenefit
• PlanBenefitItem
• Producer
• Product2
• ProductCategoryProduct
• ProductConsumed
• ProductCoverage
• ProductCoverageLimit
• ProductItem
• ProductItemTransaction
• ProductRequest
• ProductRequestLineItem
• ProductRequired
• ProductTransfer
• ProfileSkill
• ProfileSkillEndorsement
• ProfileSkillUser
• PurchaserPlan
• PurchaserPlanAssn
• Question
• QuickText
• Quote
• QuoteLineItem
• Reply
• RequestsForAccessSIQ
• ResourceAbsence
• ResourcePreference
• RetailLocationGroup
• RetailStore
• RetailStoreKpi
• RetailStoreVisitTemplate
• RetailVisitKpi
• RetailVisitTemplate
• RetailVisitTemplateWorkTask
• RetailVisitWorkTask
• RetailWorkTask

420
Automate Your Business Processes Flows

• RetailWorkTaskKpi
• ReturnOrder
• ReturnOrderLineItem
• SOSSession
• SOSSessionActivity
• SalesAgreement
• SalesAgreementProduct
• SalesAgreementProductSchedule
• ScoreIntelligence
• ScratchOrgInfo
• ServiceAppointment
• ServiceAppointmentCapacityUsage
• ServiceContract
• ServiceCrew
• ServiceCrewMember
• ServiceReport
• ServiceResource
• ServiceResourceCapacity
• ServiceResourceSkill
• ServiceTerritory
• ServiceTerritoryLocation
• ServiceTerritoryMember
• ServiceTerritoryWorkType
• SettingUsageMap
• Shipment
• SignupRequest
• Site
• SkillRequirement
• SocialPersona
• SocialPost
• Solution
• SsoUserMapping
• StreamActivityAccess
• StreamingChannel
• Survey
• SurveyInvitation
• SurveyPage
• SurveyQuestion
• SurveyQuestionChoice
• SurveyQuestionResponse

421
Automate Your Business Processes Flows

• SurveyQuestionScore
• SurveyResponse
• SurveySubject
• SurveyVersion
• Task
• TimeSheet
• TimeSheetEntry
• TimeSlot
• Topic
• TopicAssignment
• UsageEntitlementPeriod
• User
• UserLicense
• UserProvisioningRequest
• UserServicePresence
• Visit
• WebStore
• WebStoreNetwork
• WebStorePricebook
• WorkBadge
• WorkBadgeDefinition
• WorkCapacityLimit
• WorkCapacityUsage
• WorkCoaching
• WorkFeedback
• WorkFeedbackQuestion
• WorkFeedbackQuestionSet
• WorkFeedbackRequest
• WorkFeedbackTemplate
• WorkGoal
• WorkOrder
• WorkOrderLineItem
• WorkPerformanceCycle
• WorkReward
• WorkRewardFund
• WorkRewardFundType
• WorkThanks
• WorkType
• WorkTypeGroup
• WorkUpgradeAction

422
Automate Your Business Processes Flows

• WorkUpgradeCustomer
• WorkUpgradeUser
• article__kav

SEE ALSO:
Flow Resume Events

Flow Resume Event: Platform Event Message


Resume the flow interview when it receives a platform event message.
Make sure to familiarize yourself with Paused Flow Interview Considerations.
Filter Platform Event Messages
If you leave the condition requirements set to No Conditions, the flow interview resumes when it receives any platform event message,
regardless of field values. The fields are defined in the platform event definition.
Store Output Values in Variables
When a platform event message resumes a flow, the message provides one output value. The output value includes the values for every
field on the platform event message that resumed the flow. To use values from the message, store Platform Event Message in a record
variable. Make sure that the record variable’s object matches the platform event.
For example, to reference Expected Delivery Date from a Vendor Response platform event, store Platform Event Message in the
{!vendorResponse} record variable. Then reference {!vendorResponse.Expected_Delivery_Date__c} to get
the specific field value.

Note: To create a record variable to store values from the platform event message, you must have the Customize Application
permission.

SEE ALSO:
Define Platform Events
Flow Resume Events

Sample Flows That Wait for Events


Configure a flow to wait for events in one of four ways.

Sample Flow That Pauses Until a Single Event Occurs


This flow waits for a single event. The base time for the event in this example, which uses a flow-based resume time, is the
{!$Flow.CurrentDateTime} global variable.
Sample Flow That Pauses Until Only the First Resume Event Occurs
This flow waits for the first of multiple events to occur before proceeding. The base times for these events are field values, so this
example's resume events use record-based time.
Sample Flow That Pauses Until Multiple Resume Events Occur
This flow waits for many resume events to occur, rather than just the first one. The base times for these events are field values, so
this example's resume events use record-based time.

423
Automate Your Business Processes Flows

Sample Flow That Pauses Until a Platform Event Message is Received


You’re designing a flow that places a supply order and waits for shipment confirmation from the vendor. Then it assigns an installation
task the day after the supplies are expected to be delivered.

SEE ALSO:
Flow Element: Pause

Sample Flow That Pauses Until a Single Event Occurs


This flow waits for a single event. The base time for the event in this example, which uses a
EDITIONS
flow-based resume time, is the {!$Flow.CurrentDateTime} global variable.
You’re designing a flow that requests feedback from customers after a contract is activated, but Available in: both Salesforce
you want to delay the email by a day. Classic and Lightning
Experience
Example
This flow already contains the following populated variables. Available in: Essentials,
Professional, Enterprise,
• {!customerEmail} contains the email address for the customer Performance, Unlimited,
• {!creatorEmail} contains the email address for the flow’s creator and Developer Editions
The flow activates a contract (1) and then pauses (2).

Within the Pause element, a single resume event is defined (1 day after activated). The flow sends the feedback request one day after
the contract is activated, so configure a flow-based resume time. The base time is the {!$Flow.CurrentDateTime} global
variable (3), and the offset is one day (4).

424
Automate Your Business Processes Flows

Because there’s only one pause configuration and you only want the feedback request to be sent once, don’t set any pause conditions
for this pause configuration. However, just in case something goes wrong, don’t forget to set a fault path. In this example, the fault path
sends an email that contains the fault message to the user who created the flow.

SEE ALSO:
Flow Element: Pause
Flow Resume Event: Specific Time

Sample Flow That Pauses Until Only the First Resume Event Occurs
This flow waits for the first of multiple events to occur before proceeding. The base times for these
EDITIONS
events are field values, so this example's resume events use record-based time.
You’re designing a flow that reminds account owners to follow up with their customers a week Available in: both Salesforce
before either the account renews or the contract ends. The flow sends a reminder email for whichever Classic and Lightning
date occurs first. Experience

Example Available in: Essentials,


This flow already contains these populated variables. Professional, Enterprise,
Performance, Unlimited,
• {!accountId} contains the ID for the account and Developer Editions
• {!contractId} contains the ID for the contract

425
Automate Your Business Processes Flows

• {!accountOwner} contains the ID for the account’s owner


• {!ownerEmail} contains the account owner’s email address
Before the flow executes the Pause element, it looks up and stores the contract’s ID, its parent account’s ID and OwnerId, and the
account owner’s Email.

The Pause element defines two time-based resume events.

Tip: Every time-based resume event consists of a base time and an offset. For record-based time, the flow needs three pieces of
information to determine the base time: the object, the date/time field, and the specific record. The offset for record-based time
works the same as it does for flow-based time. The flow needs to know the unit (either Days or Hours) and the number of
those units. For both of these events, the base time is offset by -7 days, because weeks isn’t an acceptable offset unit.
The base time for the first event (“Week before account renews”) is the value of Account.Renewal_Date__c (1) on the record
whose ID is stored in {!accountId} (2). The offset is -7 days (3).

426
Automate Your Business Processes Flows

The base time for the second event (“Week before contract expires”) is the value of Contract.EndDate (4) on the record whose
ID is stored in {!contractId} (5). The offset is -7 days (6).

You only want to send one follow-up reminder and the flow always waits for both events, so neither of these events need pause
conditions. However, just in case something goes wrong, set a fault path. In this example, the fault path sends an email that contains
the fault message to the user who created the flow.

SEE ALSO:
Flow Element: Pause
Flow Resume Event: Specific Time
Flow Pause Conditions

427
Automate Your Business Processes Flows

Sample Flow That Pauses Until Multiple Resume Events Occur


This flow waits for many resume events to occur, rather than just the first one. The base times for
EDITIONS
these events are field values, so this example's resume events use record-based time.
You’re designing a flow that reminds contract owners to follow up with their customers before the Available in: both Salesforce
contract ends. Rather than sending just one reminder, however, the flow sends them regularly. This Classic and Lightning
example shows how to use one Pause element to send a reminder two weeks before and then Experience
again one week before the contract ends. You could easily extend this flow to send reminders at
Available in: Essentials,
more intervals, such as three days and one day before the contract ends. Professional, Enterprise,
Example Performance, Unlimited,
and Developer Editions
This flow already contains these populated variables.
• {!contract} is a record variable that contains the contract’s EndDate and OwnerId
• {!contractId} is a text variable that contains the contract’s Id
• {!oneWeekVisited} is a Boolean variable whose default value is {!$GlobalConstant.False}
• {!twoWeeksVisited}is a Boolean variable whose default value is {!$GlobalConstant.False}
Before the flow executes the Pause element, it looks up and stores the contract’s EndDate and OwnerId.

Because the flow sends the reminder emails both two weeks and a week before the contract’s end date, the Pause element defines two
time-based resume events that use record-based time.

Tip: Every time-based resume event consists of a base time and an offset. For record-based time, the flow needs three pieces of
information to determine the base time: the object, the date/time field, and the specific record. The offset for record-based time
works the same as it does for flow-based time. The flow needs to know the unit (either Days or Hours) and the number of
those units. To wait for a number of days or hours before the record field, set Offset Number to a negative integer.

428
Automate Your Business Processes Flows

For both of these events, the offset is declared in Days, because weeks isn’t an acceptable offset unit.

The base time for the first event (“2 Weeks”) is the value of Contract.EndDate (1) on the record whose ID is stored in
{!contractId} (2). The offset is -14 days (3) to represent two weeks.

You want to use the same Pause element for every reminder, so after a flow interview sends one email reminder, it returns to the Pause
element. But first, to ensure that the interview doesn’t send the same email again and again, use pause conditions. When an interview
executes a Pause element, it first checks the conditions for each pause configuration to determine whether to wait for those events. If
a pause configuration has conditions set and those conditions aren’t met, the interview doesn’t wait for the associated resume event.
For the first resume event, the interview checks whether the Boolean variable {!twoWeekVisited} is set to false. The variable’s
default value is set to {!$GlobalConstant.False}, so the flow waits for the event until the variable’s value is changed.

Indicate what the flow does when the “2 Weeks” event occurs by connecting the Pause element to other elements. Then, before you
return the flow path to the Pause element, change the value of {!twoWeeksVisited} to {!$GlobalConstant.True}.
You can do so with an Assignment element. If the value for {!twoWeeksVisited} isn’t false when the Pause element is executed,
the flow doesn’t wait for the “2 Weeks” event to occur. Essentially, the interview checks whether the first resume event has occurred yet,
since the variable is changed to true only in the associated pause configuration’s path. If that resume event has occurred (and the variable
isn’t set to false), the interview knows not to wait for that event.
The second event (“1 Week”) has the same base time as the first event; the offset is -7 days to represent a week.

429
Automate Your Business Processes Flows

For the second event, the flow checks whether the Boolean variable {!oneWeekVisited} is set to false. If it isn’t, the flow doesn’t
wait for this event.

Like with the first pause configuration, use an Assignment element to change the value of {!oneWeekVisited} to
{!$GlobalConstant.True} before the flow path returns to the Pause element. As long as {!oneWeekVisited} isn’t false,
the flow doesn’t wait for the “1 Weeks” event to occur.

Tip: When a flow executes a Pause element and all the pause configurations have conditions that aren’t met, the flow executes
the default path. Because this flow is finished after it sends the final reminder, don’t connect the default path to another element.
Just in case something goes wrong, set a fault path. In this example, the fault path sends an email that contains the fault message to
the user who created the flow.

430
Automate Your Business Processes Flows

Sample Flow That Pauses Until a Platform Event Message is Received


You’re designing a flow that places a supply order and waits for shipment confirmation from the
EDITIONS
vendor. Then it assigns an installation task the day after the supplies are expected to be delivered.
The vendor that you buy supplies from has set up a platform event for you to subscribe to. This Available in both Salesforce
platform event, called Vendor Response, includes the order number, order status, and expected Classic and Lightning
delivery date. Experience

Note: This flow is part of a larger example. It gets launched by a process that starts when a Available in: Performance,
Printer Status platform event message is received. For details about the process, see Sample Unlimited, Enterprise, and
Process: Printer Management. Developer Editions

The Order Printer Supplies flow starts when the Printer Management process launches it. The process
populates the following variables in the flow.
• {!assetId}—The asset’s ID
• {!assetOwner}—The asset’s owner
• {!inkManufacturer}—The manufacturer of the printer’s ink
• {!inkNeeded}—Whether the printer needs more ink
• {!inkType}—Specific type of ink that the printer uses
• {!paperNeeded}—Whether the printer needs more paper
• {!paperSize}—Paper size that the printer uses
• {!serialNumber}—The asset’s serial number
First, the flow determines whether to order ink or paper. Based on the decision, it submits an order of ink or paper with the vendor by
using an Apex action. Then it pauses until the vendor sends a platform event message that says the order has been shipped. When
Salesforce receives the specified event message, the flow resumes and creates a task for the asset’s owner to install the new supplies.

Decision Element
The decision includes two outcomes: Ink and Paper. The Ink outcome is true if the variable {!inkNeeded} is true. The Paper outcome
is true if the variable {!paperNeeded} is true.

431
Automate Your Business Processes Flows

Apex Action Elements


The flow includes two Apex actions that submit a supply order with a vendor but provide different information to it based on whether
the flow executed the Ink outcome or Paper outcome. All the variables used for input values (like {!serialNumber} and
{!paperSize}) are set when a process launches the flow.
The first Apex action provides information about which ink to order.

The second Apex action provides information about which paper to order.

432
Automate Your Business Processes Flows

In both Apex actions, the action returns an order number. The flow stores that value in the {!orderNumber} variable to reference
in the Pause element.

Pause Element
After the Apex action submits the supply order, the flow waits for confirmation that the order has been shipped. That confirmation is
received through the Vendor Response platform event.
The flow pauses until Salesforce receives a Vendor Request event message with specific values. The order number must be the same as
the order number that the Apex action provided. And the order status must be Shipped.

When the correct event message is received and the flow resumes, the flow stores the event message’s data in a record variable. That
way, you can reference the expected delivery date to calculate when the supplies are scheduled to be installed.

Create Records Element


When the flow resumes, it creates a task for the asset owner to install the new supplies.

433
Automate Your Business Processes Flows

For the task’s field values, the flow uses these resources.
• {!installDate}—A formula that calculates the day after the event’s expected delivery date.
• {!taskDescription}—A text template that gives more details about the installation.
• {!assetOwner}—Provided by the process that launches the flow
• {!assetId}—Provided by the process that launches the flow

434
Automate Your Business Processes Flows

Flow Element: Recommendation Assignment


Generate Einstein Next Best Action recommendations by combining data from records in the
EDITIONS
recommendation object, records in other objects, values in collections, and manually entered values.
The Recommendation Assignment element is similar to the Assignment element: both set values Available in: both Salesforce
in variables. However, there are important differences: Classic and Lightning
Experience
• Use Recommendation Assignment to output a new recommendation collection variable. In
contrast, use Assignment to add or change values in an existing variable. Available in: Essentials,
• Recommendation Assignment can’t update values in existing variables. Professional, Enterprise,
Performance, Unlimited,
• Recommendation Assignment can set a field’s value across all recommendations in the output
and Developer Editions
collection. For example, if you set the AcceptanceLabel to Accept, the AcceptanceLabel for
all records in the output collection is set to Accept.
• Recommendation Assignment can create recommendations from another object’s records. For example, use leads in the source
collection to create recommendations that have the same names as those leads.
• Recommendation Assignment is available only in Recommendation Strategy flows.

Set Source Collection


Select a record collection variable with the data that you want to use to create recommendations. Recommendation Assignment creates
one recommendation for every record in the source collection.
If you select a record collection variable that contains recommendations, you can choose the fields that set values in the target collection.
If you select a record collection variable that contains any other object’s records, the element requires certain recommendation fields.

Set Target Collection Values


Assign values to recommendation fields in the output recommendation collection. Values defined in this section are set in every record
in the output collection. If there are values in the source collection variable that aren’t set here, those values are passed to the output
recommendation collection.
To use the source collection records’ values from a specific field, select currentItemFromSourceCollection in the Value
column, then select the desired field.

435
Automate Your Business Processes Flows

Each value is modified by the operator and value combination.

Column Header Description


Recommendation Field The recommendation field whose value you want to change. Select
an existing field.

Operator Select Equals to set the value in a field. Select Add to add the
text that you enter or select for Value to the end of
Recommendation Field.

Value Recommendation Field and Value in the same row must


have compatible data types.
Options:
• Select an existing flow resource, such as a variable or screen
component.
• Create a resource.
• Manually enter a literal value or merge field.

Einstein Next Best Action always requires certain recommendation fields to display a recommendation. However, the Recommendation
Assignment element only requires these fields if you select a source collection that contains non-recommendation records. If you select
a source collection with recommendations, Recommendation Assignment doesn’t require the fields because it’s possible that your
source collection already has values in those fields. However, the fields are still required to display the recommendation.
• AcceptanceLabel
• ActionReference

436
Automate Your Business Processes Flows

• Description
• Name
• RejectionLabel

Usage
Recommendation Assignment outputs a collection with the assembled recommendation records and doesn’t change the contents of
the source collection. The output collection is null until its corresponding Recommendation Assignment element runs.

Note: A Recommendation Assignment’s output collection is named after its API name. For example, if a Recommendation
Assignment element is named CreateRecs, its output collection is called Recommendations from CreateRecs.
However, recommendations display to users only if they’re in the outputRecommendations variable. To add recommendations to the
outputRecommendations collection, use an Assignment element.

SEE ALSO:
Get Started with Einstein Next Best Action
Create Recommendations
Recommendation Fields
Einstein Next Best Actions Considerations

Flow Element: Screen


Collect information from users who run the flow or show them some information.
EDITIONS

Screen Properties Available in: both Salesforce


Classic and Lightning
When you don’t have a screen component or record field selected, the properties pane shows the
Experience
entire screen.
Available in: Essentials,
Configure Frame
Professional, Enterprise,
Control whether the header and footer are displayed for this screen. These options are supported
Performance, Unlimited,
only in Lightning runtime. If you hide the footer, use a custom screen component to let the
and Developer Editions
user navigate between screens.
Control Navigation
Deselect the navigation options that you want to disable for this screen. By default, navigation options appear as buttons in the
screen footer. The Next action is available when an element is in the flow after the screen. The Finish action is available when the
screen is the last element in the flow. The Previous action is available when a screen is before this screen. The Pause action is available
when Let users pause flows is enabled in your org’s Process Automation settings.
For example, a flow prompts a user to enter information and uses that information to get a Contact record. If no matching contact
is found, the flow displays a screen to tell the user to go back and try again.

Tip:
• If you hide the footer but want to let the user navigate between screens, expose the actions with Lightning components.
• If the screen element is preceded by a data element, such as Update Records, or an action, such as Post to Chatter, deselect
Previous.
• To force the flow user to go back, such as to correct an earlier input, deselect Next or Finish.

If the Pause action is enabled:

437
Automate Your Business Processes Flows

• Use Pause Confirmation Message to tell the user where to resume the flow. For the components that list a user’s paused
flows, see Make It Easy for Users to Find Their Paused Flow Interviews.
• Customize the flow’s interview label.
• In your org’s Process Automation settings, enable Let users pause flows.
Provide Help
Give your users more context for this screen. The text you enter is available in an info bubble in the screen’s header. If you hide the
header but want to expose the help text, use a custom screen component.

Screen Components
The Components tab contains all the standard input components, standard display components, and custom components that are
available for the screen. Click and drag a component to add it to the screen.

Tip: If you have many custom components, enter text in the search field to find the one you need. You can access third-party
custom components on AppExchange using the button at the bottom of the pane.

Record Fields
Build screen flows faster by adding your existing Salesforce record fields directly from the Fields tab. When you add a record field to a
flow screen, the field’s name, data type, help text, requiredness, and existing values are automatically configured for you. To add a record
field, select or create a record variable, then click and drag a field to add it to the screen.

Make Flow Screens Dynamic with Conditional Visibility


You can control when screen components appear with conditional visibility.
Validate User Input on Flow Screens
You can validate what a user enters in a flow screen and provide an error message to guide the user.
Place Record Fields Directly on Flow Screens (Beta)
Build flow screens faster by adding fields directly from your Salesforce objects. When you add a record field to a flow screen, its name,
data type, help text, requiredness, and, in some cases, existing values, are automatically configured.

SEE ALSO:
Flow Elements
Build Rich Screens with Custom Screen Components
Route a Flow
Provided Flow Screen Components

438
Automate Your Business Processes Flows

Make Flow Screens Dynamic with Conditional Visibility


You can control when screen components appear with conditional visibility.
EDITIONS
1. For the screen component, expand the Set Component Visibility section.
Available in: both Salesforce
2. Define the conditions for when the component is visible.
Classic and Lightning
3. Define the filter logic if you entered multiple conditions. Experience

Available in: Essentials,


SEE ALSO: Professional, Enterprise,
Flow Conditional Visibility Considerations Performance, Unlimited,
and Developer Editions

USER PERMISSIONS

To open, edit, or create a


flow in Flow Builder:
• Manage Flow

Validate User Input on Flow Screens


You can validate what a user enters in a flow screen and provide an error message to guide the
EDITIONS
user.
1. For the screen input component, expand the Validate Input section. Available in: both Salesforce
Classic and Lightning
2. Customize the error message that appears if the user enters an invalid value.
Experience
To format the error message, use HTML tags.
Available in: Essentials,
3. Define the values allowed for the component by entering a Boolean formula. Professional, Enterprise,
Performance, Unlimited,
Note:
and Developer Editions
• The formula expression must return a Boolean value (true or false).
• If the formula expression evaluates to true, the input is valid. USER PERMISSIONS
• If the formula expression evaluates to false, the error message is displayed to the
user. To open, edit, or create a
flow in Flow Builder:
• If the user leaves the field blank and the field is not required, the flow doesn’t validate.
• Manage Flow
• If the user leaves the field blank and the field is required, the flow shows the default
error message and not the custom error message.

Example:
• Validate the format of an email address
REGEX({!Email_Address},"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}")

• Validate the format of a zip code


REGEX({!Zipcode},"\\d{5}(-\\d{4})?")

439
Automate Your Business Processes Flows

Place Record Fields Directly on Flow Screens (Beta)


Build flow screens faster by adding fields directly from your Salesforce objects. When you add a
EDITIONS
record field to a flow screen, its name, data type, help text, requiredness, and, in some cases, existing
values, are automatically configured. Available in: both Salesforce
Note: This feature is a Beta Service. Customer may opt to try such Beta Service in its sole Classic and Lightning
Experience
discretion. Any use of the Beta Service is subject to the applicable Beta Services Terms provided
at Agreements and Terms. Available in: Essentials,
Join the Trailblazer Community to ask questions and provide feedback directly to the Product Professional, Enterprise,
Management team. Performance, Unlimited,
and Developer Editions

Considerations USER PERMISSIONS


Before you add fields from your Salesforce objects directly to your flow screens, understand the
considerations and special behaviors of record fields in this beta feature. To open, edit, or create a
flow in Flow Builder:
• Record fields support these field data types: Address, Checkbox, Date, Date/Time, Email, Name, • Manage Flow
Number, Phone, Picklist, Text, Text Area, and Text Area (Long).
• Record fields use record variables to determine which fields can be placed on a flow screen
and their configuration.
• To use a record field’s existing value, use a Get Records element for the record variable.
• Record fields don’t support the default values of their source fields. If a record field’s source field has a default value, the record field
is blank.
• If the field contains a value in the record variable, that value is set in the screen at run time as a default value.
• Just like other fields on a screen, record fields don’t save data automatically. To save the record variable, use a Create Records or
Update Records element.
• You can’t reference record fields in other areas of your flow such as formulas, decisions, and conditional visibility. Instead, reference
the record variable you used to create the record field.
• If a user changes the value in a record field and that record field’s record variable is used in a conditional visibility rule for a screen
component on the same screen, that rule is ignored.
• In the record field details, the values shown in Update Compatible and Create Compatible reflect the properties of the field and your
permissions. The values don’t reflect the permissions of the users running the flow.
• Record fields support dependent picklists only if the dependent field is on the same screen as its controlling field.
• System context doesn’t apply to record fields. If a user doesn’t have access to a record field, they can’t see it in a flow.
• Record fields aren’t supported in screen flows on Experience Cloud sites that use Lightning Web Runtime (LWR).
• Record fields use the label returned by UI API, which can differ from the labels that appear on record pages and in Object Manager.
For record fields of the Name data type, the label appears as Full Name instead of Name for most objects.
• If the value of a Name subfield is changed at runtime, the new value is set, and the subfield displays the new value. But the full Name
record field still shows the original value.

Configure a Record Field


1. Create or edit a screen element, and go to the Fields (Beta) tab.
2. Select a record variable, or create a variable with the Record data type and the object that contains the desired field. Or select a
record variable automatically created by a Get Records element or a Loop element.
3. From the list of fields that appears, drag a field to the screen canvas.

440
Automate Your Business Processes Flows

Flow Element: Start


Connect the Start element to the flow element that you want to execute first at run time. In an
EDITIONS
autolaunched flow, you can open the Start element to add a trigger that launches the flow. Without
a trigger, you must set up other things to invoke the autolaunched flow, such as custom buttons, Available in: both Salesforce
processes, Apex classes, or Einstein Bots. Classic and Lightning
Experience
SEE ALSO: Available in: Essentials,
Schedule Triggers for Flows That Run for Batches of Records Professional, Enterprise,
Record Triggers for Flows That Make Before-Save Updates Performance, Unlimited,
and Developer Editions
Create Formulas with Flow Formula Builder

Flow Element: Subflow


Launch another flow that’s available in your org. A flow that is launched by another flow is called
EDITIONS
the referenced flow.
Add a Subflow element to your flow. In the Referenced Flow field, search for an autolaunched or Available in: both Salesforce
screen flow to configure. For each flow, the list shows the label of the active version. If a flow doesn’t Classic and Lightning
have an active version, the list displays the label of the latest version. You can't reference a screen Experience
flow from an autolaunched flow.
Available in: Essentials,
Tip: Create smaller flows that perform common tasks. For example, build utility flows to Professional, Enterprise,
capture address and credit card information or to authorize a credit card purchase amount. Performance, Unlimited,
Then call those flows as needed from multiple product-ordering flows. and Developer Editions

Set Input Values


Use values from earlier in the flow to set the input variables for the referenced flow. In the Set Input Values tab, the Subflow elements
displays only input variables from the active version and the latest version of the referenced flow.
The values are assigned at run time when the flow calls the referenced flow. However, for a text, picklist, or multi-select picklist variable
that isn’t a collection, a value of null is converted to an empty string in the referenced flow.

Store Output Values


To use the referenced flow’s outputs later in the flow, store them in variables. The values are assigned when the referenced flow finishes
running. In the Store Output Values tab, the Subflow elements show only output variables from the active version and the latest version
of the referenced flow.

Usage
Flow Builder doesn’t display descriptions for input and output values. For details about each variable in the referenced flow, ask the
admin who built the flow for more information.
At run time, the flow calls the active version of each referenced flow by default. If a referenced flow has no active version, the flow calls
the latest version of the referenced flow. To run only the latest version of each referenced flow, you have two options:
• In Flow Builder, click Debug, select Run the latest version of each flow called by subflow elements, and then click Run.
• Append the URL for the master flow with ?latestSub=true.

441
Automate Your Business Processes Flows

Note: Only flow admins can run inactive flows. For other users, the flow fails at run time if a Subflow element calls a flow with no
active version.

SEE ALSO:
Flow Elements
Add and Edit Elements
Customize What Happens When a Flow Fails
Route a Flow
Flow Lightning Runtime Considerations

Flow Element: Update Records


Identify Salesforce records to update, and set the values to change in those records. To do so, use
EDITIONS
the IDs and field values stored in a record variable or record collection variable, or use specify
conditions to identify the records and set the field values individually. Available in: both Salesforce
Note: Looking for the Fast Update and Record Update elements from Cloud Flow Designer? Classic and Lightning
Experience
The Update Records element combines the functionality from both elements. For the
equivalent of a Fast Update element, choose to use the IDs and field values from a record Available in: Essentials,
variable or record collection variable. For the equivalent of a Record Update element, choose Professional, Enterprise,
to specify conditions to identify the records and set the field values individually. Performance, Unlimited,
In the Update Records element, your selection for how to identify the records to update and set and Developer Editions
their values determines what to enter in the rest of the element.
Use a record variable or record collection variable
If you’ve populated a record variable or record collection variable with the field values to change, choose to use the IDs and field
values from a record variable or record collection variable, and then select the variable to use. To update the field values in a record
variable or record collection variable, configure an Assignment element earlier in the flow.

Important: For the variable that you select, make sure that each record’s ID value is set. That ID value is how the flow identifies
which records to update.
When you use a record collection variable to update multiple records at once, you reduce the number of DML requests in your flow.
That means you’re more likely to stay within your org’s limits. For more information, see Flow Bulkification in Transactions.
Use conditions and set fields individually
Otherwise, choose to use conditions and set fields individually. Choose the object whose records you want to update, add conditions
to filter down the list of records, and set the field values to change for those records. You can update any field on the record, but the
Update Records element doesn’t know which fields are required for this object.

Important: Configure at least one filter condition, or the flow updates all the records for the object.

Example: On an opportunity record, when a user clicks the “Won” button, a flow updates the opportunity’s stage.

Considerations for Defining Filter Criteria


• When you define multiple filters, the filter logic usually defaults to AND. However, if multiple filters have the same field selected and
use the equals operator, the filters are combined with OR.
For example, your filters check whether a case’s Type equals Problem (1), Type equals Feature Request (2), and Escalated equals true
(3). At run time, the filters are combined to (1 OR 2) AND 3.

442
Automate Your Business Processes Flows

• The available filter operators depend on the data type of the selected fields. For details, see Flow Operators in Data Elements and
Record Choice Sets.

Usage
Note: At run time, the record isn’t updated until the interview’s transaction is completed. Transactions are complete when the
interview either finishes or executes a Screen, Local Action, or Pause element.

SEE ALSO:
Flow Operators in Data Elements and Record Choice Sets
Customize What Happens When a Flow Fails
Route a Flow
Flow Elements

Provided Flow Screen Components


Salesforce provides several screen components that extend the types of input fields available in
EDITIONS
screens.

Tip: If you need more functionality, install a custom screen component from an external Available in: both Salesforce
library, such as LightningFlow.net, or have a developer build one for you. Classic and Lightning
Experience

Flow Screen Input Component: Address Available in: Essentials,


Professional, Enterprise,
Make gathering address information easier by adding the Address component to a flow screen.
Performance, Unlimited,
The Address screen component displays a complete address form that’s customized to your
and Developer Editions
settings. It can also use State and Country/Territory Picklists.
Flow Screen Input Component: Checkbox
Offer flow users a yes-or-no choice with a checkbox.
Flow Screen Input Component: Checkbox Group
Let users choose multiple options in a checkbox format.
Flow Screen Input Component: Currency
Let users enter currency values from a flow screen.
Flow Screen Input Component: Date
Let users enter date values from a flow screen.
Flow Screen Input Component: Date & Time
Let users enter date and time values from a flow screen, such as to request an appointment.
Flow Screen Input Component: Dependent Picklists
Display picklists in a flow screen in which the options for one picklist depend on the selected value of another picklist. The Dependent
Picklists screen component determines which options to display in each picklist by using an existing field dependency in your org.
A field dependency connects two picklist fields on the same object.
Flow Screen Input Component: Display Image
Easily insert images in flow screens. Upload images to Salesforce as static resources and then you can reference them while configuring
the component.

443
Automate Your Business Processes Flows

Flow Screen Input Component: Email


Let users enter email address values from a flow screen.
Flow Screen Input Component: File Upload
Let users upload files from a flow screen.
Flow Screen Input Component: Long Text Area
Let users enter a paragraph or two of text from a flow screen.
Flow Screen Input Component: Lookup
Let users search for a record in a flow.
Flow Screen Input Component: Multi-Select Picklist
Let users choose multiple options in a picklist format.
Flow Screen Input Component: Name
Let users enter multiple name values with one screen component. Instead of the Name screen component, you can use Text input
fields to capture name information, but it takes a lot more configuration.
Flow Screen Input Component: Number
Let users enter number values from a flow screen.
Flow Screen Input Component: Password
Let users enter sensitive information in a flow screen, such as a social security number. Text entered by the user is masked.
Flow Screen Input Component: Phone
Let users enter phone values from a flow screen.
Flow Screen Input Component: Picklist
Let users choose from a list of options in a picklist format.
Flow Screen Input Component: Radio Buttons
Let users choose from a list of options in a radio button format.
Flow Screen Input Component: Slider
Let users visually specify number values from a flow screen.
Flow Screen Input Component: Text
Let users enter text from a flow screen, such as the name of the user’s company.
Flow Screen Input Component: Toggle
Let users flip a toggle in a flow screen.
Flow Screen Input Component: URL
Let users enter URL values in a flow screen.
Flow Screen Output Component: Display Text
Display information in a flow screen.
Flow Screen Output Component: Section
Organize screen components and record fields to give your users a better experience.
Choice Resources for Flow Screen Components
A key part of configuring flow screen components that display choices is selecting the choices to display in that field. The choices
appear as radio buttons, checkboxes, or picklist options. Use at least one of these resources: choices, record choice sets, or picklist
choice sets.

444
Automate Your Business Processes Flows

Flow Screen Input Component: Address


Make gathering address information easier by adding the Address component to a flow screen.
EDITIONS
The Address screen component displays a complete address form that’s customized to your settings.
It can also use State and Country/Territory Picklists. Available in: both Salesforce
Classic and Lightning
Experience

Available in: Essentials,


Professional, Enterprise,
Performance, Unlimited,
and Developer Editions

For information about adding screen components to your flow screen, see Flow Element: Screen.

Note: This screen component requires Lightning runtime.

Configure the Address Component


You can select resources from the flow, such as variables or global constants, or you can manually enter a value.

Attribute Description
API Name An API name can include underscores and alphanumeric characters without spaces. It must begin
with a letter and can’t end with an underscore. It also can’t have two consecutive underscores.

City Value To give City a default value, set this attribute's value.
This attribute accepts single-value resources. The value is treated as text.

Country Options The active countries and territories configured in state and country/territory picklists. To override the
options, set this attribute to a comma-delimited set of countries and territories. This field populates a
dropdown menu of options.
This attribute accepts single-value resources. The value is treated as text.

Country Value To give Country a default value, set this attribute's value.
This attribute accepts single-value resources. The value is treated as text.

Label The label for the heading that appears above the group of address fields.
This attribute accepts single-value resources. The value is treated as text.

445
Automate Your Business Processes Flows

Attribute Description
Postal Code Value To give Postal Code a default value, set this attribute's value.
This attribute accepts single-value resources. The value is treated as text.

State/Province The active states configured in state and country/territory picklists. To override the options, set this
Options attribute to a comma-delimited set of states. This field populates a dropdown menu of options.
This attribute accepts single-value resources. The value is treated as text.

State Value The state or province field of the address. If State/Province Options is configured, this
value is selected by default. To give State a default value, set this attribute's value.
This attribute accepts single-value resources. The value is treated as text.

Street Value To give Street a default value, set this attribute's value.
This attribute accepts single-value resources. The value is treated as text.

Store the Address Component’s Values in the Flow


When you add a screen component to a flow, we automatically store all the attribute values in a variable. When the user navigates to
the next screen, the values are assigned to the flow variable.
To store values manually, select Manually assign variables (advanced).
All attributes are available to store in flow variables. Most likely, you must store one of these attributes.

Attribute Description
City Value What the user entered in the City Value field.
This value can be stored in a single-value Text variable or a Text field on a record variable.

Country Value What the user entered in the Country Value field.
This value can be stored in a single-value Text variable or a Text field on a record variable.

Postal Code Value What the user entered in the Postal Code Value field.
This value can be stored in a single-value Text variable or a Text field on a record variable.

State Value What the user entered in the State Value field.
This value can be stored in a single-value Text variable or a Text field on a record variable.

Street Value What the user entered in the Street Value field.
This value can be stored in a single-value Text variable or a Text field on a record variable.

Tip: By default, screen components that require Lightning runtime have no memory. If a user enters a value, navigates to another
screen, and returns to the component’s screen, the user-entered value is lost. To enable a flow to remember the value of an

446
Automate Your Business Processes Flows

attribute, set the attribute. The flow stores the value automatically. If you store values manually, store the attribute’s output value
in a variable.

SEE ALSO:
Provided Flow Screen Components

Flow Screen Input Component: Checkbox


Offer flow users a yes-or-no choice with a checkbox.
EDITIONS

Configure the Checkbox Component Available in: both Salesforce


Classic and Lightning
Attribute Description Experience

API Name An API name can include underscores and alphanumeric characters Available in: Essentials,
without spaces. It must begin with a letter and can’t end with an Professional, Enterprise,
Performance, Unlimited,
underscore. It also can’t have two consecutive underscores.
and Developer Editions
Default Value Pre-populated value for the component. If the associated screen isn’t
executed or the conditions for component visibility aren’t met, the stored
value of the component is null.

Label User-friendly text that displays to the left of the component.

Provide Help Give your users more context with this screen component. The text you
enter is available in an info bubble next to the component.

Validate Input Provide a formula that evaluates whether what the user entered is valid
and the error message to display if invalid.

Example: Let users opt into a marketing campaign, agree to a follow-up call after a purchase, or confirm that they understand
an important policy.

Usage
When the user selects the checkbox, the screen component evaluates to true. If the user doesn’t select the checkbox, the screen
component evaluates to false. If the associated screen isn’t executed, the screen component evaluates to null.

SEE ALSO:
Flow Resource: Global Constant
Provided Flow Screen Components

447
Automate Your Business Processes Flows

Flow Screen Input Component: Checkbox Group


Let users choose multiple options in a checkbox format.
EDITIONS

Configure the Checkbox Group Component Available in: both Salesforce


Classic and Lightning
Attribute Description Experience

API Name An API name can include underscores and alphanumeric characters Available in: Essentials,
without spaces. It must begin with a letter and can’t end with an Professional, Enterprise,
Performance, Unlimited,
underscore. It also can’t have two consecutive underscores.
and Developer Editions
Choice Add at least one choice, record choice set, or picklist choice set to this
component. Available only when you add a choice component to the
screen component.

Note: You can’t reorder choices or select the same choice twice.
Choices must be compatible with the component’s Data Type
setting.

Component Type Modify a choice component type.

If the user can select only one option, these component types become
available:
• Picklist
• Radio Buttons
If the user can select multiple options, these component types become
available:
• Checkbox Group
• Multi-select Picklist

Data Type Only Text choices are supported for this component.

Default Value Pre-selected choice for the component. If the associated screen isn’t
executed or the conditions for component visibility aren’t met, the stored
value of the component is null.

Label User-friendly text that displays to the left of the component.

Provide Help Give your users more context with this screen component. The text you
enter is available in an info bubble next to the component.

Require Requires users to select a value before they can move to the next screen.

Set Component Configure when the component is displayed using conditional logic.
Visibility You can set the components to:
• Always be displayed
• When all conditions are met (AND)
• When any condition is met (OR)
• When custom conditional logic is met

448
Automate Your Business Processes Flows

Considerations
When a user clicks the info bubble for a Checkbox Group component, the help text appears in a separate window. For other types of
Salesforce-provided components, the help text appears in a popover.

SEE ALSO:
Provided Flow Screen Components

Flow Screen Input Component: Currency


Let users enter currency values from a flow screen.
EDITIONS

Configure the Currency Component Available in: both Salesforce


Classic and Lightning
Attribute Description Experience

API Name An API name can include underscores and alphanumeric characters Available in: Essentials,
without spaces. It must begin with a letter and can’t end with an Professional, Enterprise,
Performance, Unlimited,
underscore. It also can’t have two consecutive underscores.
and Developer Editions
Decimal Places Controls the number of digits to the right of the decimal point up to 17
places. If you leave this field blank or set it to zero, only whole numbers
appear when your flow runs.

Default Value Pre-populated value for the component. If the associated screen isn’t
executed or the conditions for component visibility aren’t met, the stored
value of the component is null.

Label User-friendly text that displays to the left of the component.

Provide Help Give your users more context with this screen component. The text you
enter is available in an info bubble next to the component.

Require Requires users to enter a value before they can move to the next screen.

Validate Input Provide a formula that evaluates whether what the user entered is valid
and the error message to display if invalid.

SEE ALSO:
Provided Flow Screen Components

449
Automate Your Business Processes Flows

Flow Screen Input Component: Date


Let users enter date values from a flow screen.
EDITIONS

Configure the Data Component Available in: both Salesforce


Classic and Lightning
Attribute Description Experience

API Name An API name can include underscores and alphanumeric characters Available in: Essentials,
without spaces. It must begin with a letter and can’t end with an Professional, Enterprise,
Performance, Unlimited,
underscore. It also can’t have two consecutive underscores.
and Developer Editions
Default Value Pre-populated value for the component. If the associated screen isn’t
executed or the conditions for component visibility aren’t met, the stored
value of the component is null.

Label User-friendly text that displays to the left of the component.

Provide Help Give your users more context with this screen component. The text you
enter is available in an info bubble next to the component.

Require Requires users to enter a value before they can move to the next screen.

Validate Input Provide a formula that evaluates whether what the user entered is valid
and the error message to display if invalid.

SEE ALSO:
Provided Flow Screen Components

Flow Screen Input Component: Date & Time


Let users enter date and time values from a flow screen, such as to request an appointment.
EDITIONS

Configure the Date & Time Component Available in: both Salesforce
Classic and Lightning
Attribute Description Experience

API Name An API name can include underscores and alphanumeric characters Available in: Essentials,
without spaces. It must begin with a letter and can’t end with an Professional, Enterprise,
Performance, Unlimited,
underscore. It also can’t have two consecutive underscores.
and Developer Editions
Default Value Pre-populated value for the component. If the associated screen isn’t
executed or the conditions for component visibility aren’t met, the stored
value of the component is null.

Label User-friendly text that displays to the left of the component.

Provide Help Give your users more context with this screen component. The text you
enter is available in an info bubble next to the component.

Require Requires users to enter a value before they can move to the next screen.

450
Automate Your Business Processes Flows

Attribute Description
Validate Input Provide a formula that evaluates whether what the user entered is valid and the error message to
display if invalid.

SEE ALSO:
Provided Flow Screen Components

Flow Screen Input Component: Dependent Picklists


Display picklists in a flow screen in which the options for one picklist depend on the selected value
EDITIONS
of another picklist. The Dependent Picklists screen component determines which options to display
in each picklist by using an existing field dependency in your org. A field dependency connects two Available in: both Salesforce
picklist fields on the same object. Classic and Lightning
Experience
Note: This screen component requires Lightning runtime.
Available in: Essentials,
Professional, Enterprise,
Configure the Dependent Picklists Component Performance, Unlimited,
and Developer Editions
Tip: Before you add a Dependent Picklists screen component to your flow, define field
dependencies for the appropriate picklist fields in your org.
You can select resources from the flow, such as variables or global constants, or you can manually enter a value.

Attribute Description
API Name An API name can include underscores and alphanumeric characters without spaces. It must begin
with a letter and can’t end with an underscore. It also can’t have two consecutive underscores.

Object API Name The API name of the object. The picklist fields that you identify in Picklist 1 API Name, Picklist 2 API
Name, and Picklist 3 API Name must be associated with this object.
This attribute accepts single-value resources. The value is treated as text.

Picklist 1 API Name The API name of the first picklist field. For the specified object, this picklist field must be the controlling
field in a field dependency between Picklist 1 and Picklist 2.
This attribute accepts single-value resources. The value is treated as text.

Picklist 1 Label The label for the first picklist field.


This attribute accepts single-value resources. The value is treated as text.

Picklist 1 Required To make Picklist 1 required, use {!$GlobalConstant.True}.

Picklist 1 Value The default selection for the first picklist field. Configuring this attribute pre-selects an option for the
field.
This attribute accepts single-value resources. The value is treated as text.

451
Automate Your Business Processes Flows

Attribute Description
Picklist 2 API Name The API name of the second picklist field. For the specified object, this picklist field must be the
dependent field in a field dependency between Picklist 1 and Picklist 2. If you display a third picklist
field, Picklist 2 must be the controlling field in a field dependency between Picklist 2 and Picklist 3.
This attribute accepts single-value resources. The value is treated as text.

Picklist 2 Label The label for the second picklist field.


This attribute accepts single-value resources. That value is treated as text.

Picklist 2 Required To make Picklist 2 required, use {!$GlobalConstant.True}.

Picklist 2 Value The default selection for the second picklist field. Configuring this attribute pre-selects an option for
the field.
This attribute accepts single-value resources. The value is treated as text.

Picklist 3 API Name The API name of the third picklist field. For the specified object, this picklist field must be the dependent
field in a field dependency between Picklist 2 and Picklist 3.
This attribute accepts single-value resources. That value is treated as text.

Picklist 3 Label The label for the third picklist field.


This attribute accepts single-value resources. The value is treated as text.

Picklist 3 Required To make Picklist 3 required, use {!$GlobalConstant.True}.

Picklist 3 Value The default selection for the third picklist field. Configuring this attribute pre-selects an option for the
field.
This attribute accepts single-value resources. The value is treated as text.

Store the Dependent Picklists Component’s Values in the Flow


When you add a screen component to a flow, we automatically store all the attribute values in a variable. When the user navigates to
the next screen, the values are assigned to the flow variable.
To store values manually, select Manually assign variables (advanced).
All attributes are available to store in flow variables. Most likely, you must store one of these attributes.

Attribute Description
Picklist 1 Value What the user selected for the first picklist field.
You can store this value in a single-value Text variable or a Text field on a record variable.

Picklist 2 Value What the user selected for the second picklist field.
You can store this value in a single-value Text variable or a Text field on a record variable.

Picklist 3 Value What the user selected for the third picklist field.
You can store this value in a single-value Text variable or a Text field on a record variable.

452
Automate Your Business Processes Flows

Tip: By default, screen components that require Lightning runtime have no memory. If a user enters a value, navigates to another
screen, and returns to the component’s screen, the user-entered value is lost. To enable a flow to remember the value of an
attribute, set the attribute. The flow stores the value automatically. If you store values manually, store the attribute’s output value
in a variable.

Example: In a Dinner Order flow, users select a specific dessert. Each dessert comes in different flavors, and the flavor options
change based on the dessert that the user selects.
1. On the Order custom object, define two picklist fields: Dessert and Flavor.
2. Define a field dependency between Dessert and Flavor, where Dessert is the controlling picklist. Identify which Flavor options
apply to each Dessert option.

3. In your flow screen, add a Dependent Picklists screen component. Configure the component with these values.

Attribute Value
Object API Name Order__c

Picklist 1 API Dessert__c


Name

Picklist 1 Label Dessert

Picklist 2 Value Flavor__c

Picklist 2 Label Flavor

When a user runs the flow, the options for Flavor change based on what’s selected for Dessert.

453
Automate Your Business Processes Flows

Considerations
Screen input component values are set to null when they’re hidden by conditional visibility. But hidden picklists in a Dependent Picklists
component aren’t set to null unless the entire Dependent Picklists component is hidden.

SEE ALSO:
Provided Flow Screen Components
Define Field Dependencies

Flow Screen Input Component: Display Image


Easily insert images in flow screens. Upload images to Salesforce as static resources and then you
EDITIONS
can reference them while configuring the component.
For information about adding screen components to your flow screen, see Flow Element: Screen. Available in: both Salesforce
Classic and Lightning
Note: This screen component requires Lightning runtime. Experience

Available in: Essentials,


Configure the Display Image Component Professional, Enterprise,
Performance, Unlimited,
Attribute Description and Developer Editions

API Name An API name can include underscores and alphanumeric characters
without spaces. It must begin with a letter and can’t end with an
underscore. It also can’t have two consecutive underscores.

Horizontal If you don't want the browser to determine the image's horizontal
Alignment alignment, enter a specific alignment value. Valid values are: left, center,
or right.
This attribute accepts single-value resources. The value is treated as text.

Image Alt Text Alternative text for screen readers and other assistive technology and for
browsers that can’t load the image. Provide a meaningful description
unless the image is purely decorative or redundant.
To have assistive technology skip the image, set Image Alt Text
to {!$GlobalConstant.EmptyString}.

454
Automate Your Business Processes Flows

Attribute Description
If you don't set this attribute, assistive technology reads the file path from the image source (img
src), which can confuse your users and potentially create an accessibility compliance issue.
This attribute accepts single-value resources. The value is treated as text.

Image CSS Override the CSS for your image by providing your own CSS string. Example: border-radius:
8px; box-shadow: 10px 5px 5px blue; opacity: 0.75;
This attribute accepts single-value resources. The value is treated as text.

Image Height If you don't want the browser to determine the image height, enter a specific height value. Valid values
are a number and unit, or a percentage of the container. Examples: 200px, 2cm, 50%. If you enter a
number value and don’t enter a unit value, the unit value defaults to pixels.
This attribute accepts single-value resources. The value is treated as text.

Image Name Required. The name of a static resource that contains an image file. The image should be a .png or
.jpg file.
This attribute accepts single-value resources. The value is treated as text.

Image Width If you don't want the browser to determine the image width, enter a specific width value. Valid values
are a number and unit, or a percentage of the container. Examples: 200px, 2cm, 50%. If you enter a
number value and don’t enter a unit value, the unit value defaults to pixels.
This attribute accepts single-value resources. The value is treated as text.

Store the Display Image Component’s Values in the Flow


When you add a screen component to a flow, we automatically store all the attribute values in a variable. When the user navigates to
the next screen, the values are assigned to the flow variable.
To store values manually, select Manually assign variables (advanced).

Tip: By default, screen components that require Lightning runtime have no memory. If a user enters a value, navigates to another
screen, and returns to the component’s screen, the user-entered value is lost. To enable a flow to remember the value of an
attribute, set the attribute. The flow stores the value automatically. If you store values manually, store the attribute’s output value
in a variable.

SEE ALSO:
Provided Flow Screen Components

455
Automate Your Business Processes Flows

Flow Screen Input Component: Email


Let users enter email address values from a flow screen.
EDITIONS

Available in: both Salesforce


Classic and Lightning
Experience

Available in: Essentials,


Professional, Enterprise,
Note: This screen component requires Lightning runtime. Performance, Unlimited,
and Developer Editions

Configure the Email Component


You can select resources from the flow, such as variables or global constants, or you can manually enter a value.

Attribute Description
API Name An API name can include underscores and alphanumeric characters without spaces. It must begin
with a letter and can’t end with an underscore. It also can’t have two consecutive underscores.

Disabled If set to $GlobalConstant.True, the user can’t modify or copy the value.
This attribute accepts single-value Boolean resources.

Label The label that appears above the email field.


This attribute accepts single-value resources. The value is treated as text.

Placeholder Text Text that appears in the field when it’s empty. Use placeholder text to give users a hint about what
to enter in the field.
This attribute accepts single-value resources. The value is treated as text.

Read Only If set to $GlobalConstant.True, the user can’t modify the value, but the user can copy it.
This attribute accepts single-value Boolean resources.

Required If set to $GlobalConstant.True, the user must enter a value.


This attribute accepts single-value Boolean resources.

Value The value of the email field. Setting this attribute prepopulates the field. To use the value that the user
enters, store this attribute’s output in a variable.
The Email component validates that the entered email address follows this pattern:
local-part@domain. For example, user@example, user@example.com, and
user.name@example.com are all valid
This attribute accepts single-value resources. The value is treated as text.

Store the Email Component’s Values in the Flow


When you add a screen component to a flow, we automatically store all the attribute values in a variable. When the user navigates to
the next screen, the values are assigned to the flow variable.

456
Automate Your Business Processes Flows

To store values manually, select Manually assign variables (advanced).


All attributes are available to store in flow variables, but Value is the most likely attribute you must store.
To store the email address that the user entered, store the Value attribute in a flow variable.

Tip: By default, screen components that require Lightning runtime have no memory. If a user enters a value, navigates to another
screen, and returns to the component’s screen, the user-entered value is lost. To enable a flow to remember the value of an
attribute, set the attribute. The flow stores the value automatically. If you store values manually, store the attribute’s output value
in a variable.

SEE ALSO:
Provided Flow Screen Components

Flow Screen Input Component: File Upload


Let users upload files from a flow screen.
EDITIONS

Available in: both Salesforce


Classic and Lightning
Experience

Available in: Essentials,


Professional, Enterprise,
Performance, Unlimited,
and Developer Editions

Note: This screen component requires Lightning runtime.

Configure the File Upload Component


You can select resources from the flow, such as variables or global constants, or you can manually enter a value.

457
Automate Your Business Processes Flows

Attribute Description
Accepted Formats Using the format .ext, enter a comma-separated list of the file extensions that the user can upload.
This attribute accepts single-value resources. The value is treated as text.

Allow Multiple Files If set to $GlobalConstant.True, the user can upload multiple files.
This attribute accepts single-value Boolean resources.

API Name An API name can include underscores and alphanumeric characters without spaces. It must begin
with a letter and can’t end with an underscore. It also can’t have two consecutive underscores.

Disabled If set to $GlobalConstant.True, the component is disabled.


This attribute accepts single-value Boolean resources.

File Upload Label Required. Label that appears above the upload button.
This attribute accepts single-value resources. The value is treated as text.

Hover Text Tooltip that appears when the user hovers over the component.
This attribute accepts single-value resources. The value is treated as text.

Related Record ID Required. ID of the record to associate the files with. If no value is passed, the component is disabled.
This attribute accepts single-value resources. The value is treated as text.

Note: Custom fields added to the ContentVersion object page are rendered in Experience Cloud sites through the
contentVersionEditWizard. The contentVersionEditWizard is supported on desktop, but not mobile. Since there’s no screen in
mobile to edit or add details to custom fields, file uploads fail when custom fields are marked as required.

Store the File Upload Component’s Values in the Flow


All attributes are available to store in flow variables, but usually you must store one of these attributes. The values are assigned to the
flow variables when the user navigates to the next screen.

Attribute Description
Content Document IDs The IDs of the uploaded files.
You can store this value in a Text collection variable.

Upload File Names The names of the uploaded files.


You can store this value in a Text collection variable.

File Upload Limits


By default, you can upload up to 10 files simultaneously, unless Salesforce changed that limit. The org limit for the number of files
simultaneously uploaded is 25 files with a minimum of one file. The maximum file size you can upload is 2 GB. In Experience Cloud sites,
the file size limits and types allowed follow the settings determined by site file moderation. By default, guest user files are blocked from
being uploaded. Admins can change the settings to let guest users upload files. From Setup > , select > General Settings, and then

458
Automate Your Business Processes Flows

select Allow site guest users to upload files. This setting is only valid if the Secure guest user record access setting is enabled in the
org.

Note: The file upload component isn’t supported on mobile app or browser when used with flows that are accessed through
URLs. This restriction doesn’t apply when the file upload component is used in Lightning App Builder or Experience Builder.
Lightning Out doesn’t support the File Upload component.

SEE ALSO:
Provided Flow Screen Components

Flow Screen Input Component: Long Text Area


Let users enter a paragraph or two of text from a flow screen.
EDITIONS

Configure the Long Text Area Component Available in: both Salesforce
Classic and Lightning
Attribute Description Experience

API Name An API name can include underscores and alphanumeric characters Available in: Essentials,
without spaces. It must begin with a letter and can’t end with an Professional, Enterprise,
Performance, Unlimited,
underscore. It also can’t have two consecutive underscores.
and Developer Editions
Default Value Pre-populated value for the component. If the associated screen isn’t
executed or the conditions for component visibility aren’t met, the stored
value of the component is null.

Label User-friendly text that displays to the left of the component.

Provide Help Give your users more context with this screen component. The text you
enter is available in an info bubble next to the component.

Require Requires users to enter a value before they can move to the next screen.

Validate Input Provide a formula that evaluates whether what the user entered is valid
and the error message to display if invalid.

SEE ALSO:
Provided Flow Screen Components

459
Automate Your Business Processes Flows

Flow Screen Input Component: Lookup


Let users search for a record in a flow.
EDITIONS

Configure the Lookup Component Available in: both Salesforce


Classic and Lightning
Attribute Description Experience

API Name An API name can include underscores and alphanumeric characters Available in: Essentials,
without spaces. It must begin with a letter and can’t end with an Professional, Enterprise,
Performance, Unlimited,
underscore. It also can’t have two consecutive underscores.
and Developer Editions
Field API Name The API name of a lookup field on the source object.

Label User-friendly text that displays to the left of the component.

Object API The API name of the source object.


Name

Record Id Record ID value for the lookup.

Require Requires users to enter a value before they can move to the next screen.

Store the Lookup Component’s Values in the Flow


When you add a screen component to a flow, we automatically store all the attribute values in a variable. When the user navigates to
the next screen, the values are assigned to the flow variable.
To store values manually, select Manually assign variables (advanced).
All attributes are available to store in flow variables, but most likely you must store these attributes.

Attribute Description
Record ID The ID of the record that the user selects.
You can store this value in a Text variable.

Record Name The name of the record that the user selects.
You can store this value in a Text variable.

Tip: By default, screen components that require Lightning runtime have no memory. If a user enters a value, navigates to another
screen, and returns to the component’s screen, the user-entered value is lost. To enable a flow to remember the value of an
attribute, set the attribute. The flow stores the value automatically. If you store values manually, store the attribute’s output value
in a variable.

Considerations
• Dependent lookup filters aren't enforced for the Lookup component in a flow. Other lookup filters are enforced the same as they
are in Lightning Experience record pages. When the flow accesses the Salesforce database, lookup filters are enforced. For example,
when the flow executes the Create Records element, the flow fails if the value of the lookup field doesn't meet the lookup filter
requirements.

460
Automate Your Business Processes Flows

• The running user of a flow must have the Create permission on the source object. For example, to search a contact’s account, the
running user must have the Create permission on the Contact object.
• A custom lookup field to a user record isn’t supported.

Tip: To let a flow user choose from a list of user records, employ a standard User lookup field like CreatedById or
LastModifiedById. OwnerId isn’t supported.

• At run time, when the flow user types two characters in the field, it shows up to five recent records whose Name field matches the
query.
• Dependent lookup filters aren’t supported.
• During run time, the lookup component displays Search undefined... if the lookup field defined in Field API Name
isn’t on an assigned page layout. To display the correct text, add the defined lookup field to all of the source object’s page layouts
that are assigned to running users.

SEE ALSO:
Provided Flow Screen Components
Considerations for Lookup Filters
Customize Page Layouts with the Enhanced Page Layout Editor

Flow Screen Input Component: Multi-Select Picklist


Let users choose multiple options in a picklist format.
EDITIONS

Configure the Multi-Select Picklist Component Available in: both Salesforce


Classic and Lightning
Attribute Description Experience

API Name An API name can include underscores and alphanumeric characters Available in: Essentials,
without spaces. It must begin with a letter and can’t end with an Professional, Enterprise,
Performance, Unlimited,
underscore. It also can’t have two consecutive underscores.
and Developer Editions
Choice Add at least one choice, record choice set, or picklist choice set to this
component. Available only when you add a choice component to the
screen component.

Note: You can’t reorder choices or select the same choice twice.
Choices must be compatible with the component’s Data Type
setting.

Component Type Modify a choice component type.

If the user can select only one option, these component types become
available:
• Picklist
• Radio Buttons
If the user can select multiple options, these component types become
available:
• Checkbox Group

461
Automate Your Business Processes Flows

Attribute Description
• Multi-select Picklist

Data Type Only Text choices are supported for this component.

Default Value Pre-selected choice for the component. If the associated screen isn’t executed or the conditions for
component visibility aren’t met, the stored value of the component is null.

Label User-friendly text that displays to the left of the component.

Let Users Select Specifies whether the user can choose only one option or multiple options. When you select Yes for
Multiple Options Let Users Select Multiple Options, Data Type is automatically set to Text, and non-text Choice resources
are cleared from the component configuration.

Provide Help Give your users more context with this screen component. The text you enter is available in an info
bubble next to the component.

Require Requires users to select a value before they can move to the next screen.

Set Component Configure when the component is displayed using conditional logic.
Visibility You can set the components to:
• Always be displayed
• When all conditions are met (AND)
• When any condition is met (OR)
• When custom conditional logic is met

SEE ALSO:
Provided Flow Screen Components

Flow Screen Input Component: Name


Let users enter multiple name values with one screen component. Instead of the Name screen
EDITIONS
component, you can use Text input fields to capture name information, but it takes a lot more
configuration. Available in: both Salesforce
Classic and Lightning
Experience

Available in: Essentials,


Professional, Enterprise,
Performance, Unlimited,
and Developer Editions

462
Automate Your Business Processes Flows

Note: This screen component requires Lightning runtime.

Configure the Name Component


You can select resources from the flow, such as variables or global constants, or you can manually enter a value.

Attribute Description
API Name An API name can include underscores and alphanumeric characters without spaces. It must begin
with a letter and can’t end with an underscore. It also can’t have two consecutive underscores.

Disabled If set to $GlobalConstant.True, the user can’t modify or copy the value.
This attribute accepts single-value Boolean resources.

Fields to Display By default, the component displays only the First Name and Last Name fields, but other fields are
available. To customize which fields to display at run time, set this attribute to a comma-separated
list of the field names.
• For First Name, use firstName
• For Last Name, use lastName
• For Middle Name, use middleName
• For Informal Name, use informalName
• For Salutation, use salutation
• For Suffix, use suffix

Note: This attribute doesn’t control the order that the fields display in.

For example, to display all the fields, set this attribute to firstName, lastName,
middleName, informalName, salutation, suffix.
This attribute accepts single-value resources. The value is treated as text.

First Name The value of the First Name field. Setting this attribute prepopulates the field. To use the value that
the user enters, store this attribute’s output in a variable.
This attribute accepts single-value resources. The value is treated as text.

Informal Name The value of the Informal Name field. Setting this attribute prepopulates the field. To use the value
that the user enters, store this attribute’s output in a variable.
This attribute accepts single-value resources. The value is treated as text.

Label The label that appears above the name fields.


This attribute accepts single-value resources. The value is treated as text.

Last Name The value of the Last Name field. Setting this attribute prepopulates the field. To use the value that
the user enters, store this attribute’s output in a variable.
This attribute accepts single-value resources. The value is treated as text.

463
Automate Your Business Processes Flows

Attribute Description
Middle Name The value of the Middle Name field. Setting this attribute prepopulates the field. To use the value that
the user enters, store this attribute’s output in a variable.
This attribute accepts single-value resources. The value is treated as text.

Read Only If set to $GlobalConstant.True, the user can’t modify the value, but the user can copy it.
This attribute accepts single-value Boolean resources.

Salutation The value of the Salutation field. Setting this attribute prepopulates the field. To use the value that
the user enters, store this attribute’s output in a variable.
This attribute accepts single-value resources. The value is treated as text.

Salutation Options By default, the options for Salutation are Mr., Mrs., and Ms. To override these options, set this attribute
to a comma-separated list of values.
This attribute accepts single-value resources. The value is treated as text.

Suffix The value of the Suffix field. Setting this attribute prepopulates the field. To use the value that the user
enters, store this attribute’s output in a variable.
This attribute accepts single-value resources. The value is treated as text.

Store the Name Component’s Values in the Flow


When you add a screen component to a flow, we automatically store all the attribute values in a variable. When the user navigates to
the next screen, the values are assigned to the flow variable.
To store values manually, select Manually assign variables (advanced).
All attributes are available to store in flow variables. Most likely, you must store one of these attributes.

Attribute Description
First Name What the user entered in the First Name field.
This value can be stored in a single-value Text variable or a Text field on a record variable.

Informal Name What the user entered in the Informal Name field.
This value can be stored in a single-value Text variable or a Text field on a record variable.

Last Name What the user entered in the Last Name field.
This value can be stored in a single-value Text variable or a Text field on a record variable.

Middle Name What the user entered in the Middle Name field.
This value can be stored in a single-value Text variable or a Text field on a record variable.

Salutation What the user entered in the Salutation field.


This value can be stored in a single-value Text variable or a Text field on a record variable.

464
Automate Your Business Processes Flows

Attribute Description
Suffix What the user entered in the Suffix field.
This value can be stored in a single-value Text variable or a Text field on a record variable.

Tip: By default, screen components that require Lightning runtime have no memory. If a user enters a value, navigates to another
screen, and returns to the component’s screen, the user-entered value is lost. To enable a flow to remember the value of an
attribute, set the attribute. The flow stores the value automatically. If you store values manually, store the attribute’s output value
in a variable.

SEE ALSO:
Provided Flow Screen Components

Flow Screen Input Component: Number


Let users enter number values from a flow screen.
EDITIONS

Configure the Number Component Available in: both Salesforce


Classic and Lightning
Attribute Description Experience

API Name An API name can include underscores and alphanumeric characters Available in: Essentials,
without spaces. It must begin with a letter and can’t end with an Professional, Enterprise,
Performance, Unlimited,
underscore. It also can’t have two consecutive underscores.
and Developer Editions
Decimal Places Controls the number of digits to the right of the decimal point up to 17
places. If you leave this field blank or set it to zero, only whole numbers
appear when your flow runs.

Default Value Pre-populated value for the component. If the associated screen isn’t
executed or the conditions for component visibility aren’t met, the stored
value of the component is null.

Label User-friendly text that displays to the left of the component.

Provide Help Give your users more context with this screen component. The text you
enter is available in an info bubble next to the component.

Require Requires users to enter a value before they can move to the next screen.

Validate Input Provide a formula that evaluates whether what the user entered is valid
and the error message to display if invalid.

SEE ALSO:
Provided Flow Screen Components

465
Automate Your Business Processes Flows

Flow Screen Input Component: Password


Let users enter sensitive information in a flow screen, such as a social security number. Text entered
EDITIONS
by the user is masked.

Note: This screen component doesn’t encrypt the value entered by the user. When the flow Available in: both Salesforce
references a Password screen component, such as in an Assignment element or a Display Classic and Lightning
Experience
Text screen component, the value isn’t masked.
Available in: Essentials,
Configure the Password Component Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
Attribute Description
API Name An API name can include underscores and alphanumeric characters
without spaces. It must begin with a letter and can’t end with an
underscore. It also can’t have two consecutive underscores.

Default Value Pre-populated value for the component. If the associated screen isn’t
executed or the conditions for component visibility aren’t met, the stored
value of the component is null.

Label User-friendly text that displays to the left of the component.

Provide Help Give your users more context with this screen component. The text you
enter is available in an info bubble next to the component.

Require Requires users to enter a value before they can move to the next screen.

Validate Input Provide a formula that evaluates whether what the user entered is valid
and the error message to display if invalid.

SEE ALSO:
Provided Flow Screen Components

Flow Screen Input Component: Phone


Let users enter phone values from a flow screen.
EDITIONS

Available in: both Salesforce


Classic and Lightning
Experience

Available in: Essentials,


Professional, Enterprise,
Note: This screen component requires Lightning runtime.
Performance, Unlimited,
and Developer Editions
Configure the Phone Component
You can select resources from the flow, such as variables or global constants, or you can manually enter a value.

466
Automate Your Business Processes Flows

Attribute Description
API Name An API name can include underscores and alphanumeric characters without spaces. It must begin
with a letter and can’t end with an underscore. It also can’t have two consecutive underscores.

Label The label that appears above the phone field.


This attribute accepts single-value resources. The value is treated as text.

Pattern Determines whether the value is valid. By default, there is no pattern.


This attribute accepts single-value resources. The value is treated as text.

Placeholder Text Text that appears in the field when it’s empty. Use placeholder text to give users a hint about what
to enter in the field.
This attribute accepts single-value resources. The value is treated as text.

Read Only If set to $GlobalConstant.True, the user can’t modify the value, but the user can copy it.
This attribute accepts single-value Boolean resources.

Required If set to $GlobalConstant.True, the user must enter a value.


This attribute accepts single-value Boolean resources.

Value The value of the phone field. Setting this attribute prepopulates the field. To use the value that the
user enters, store this attribute’s output in a variable.
This attribute accepts single-value resources. The value is treated as text.

Store the Phone Component’s Values in the Flow


When you add a screen component to a flow, we automatically store all the attribute values in a variable. When the user navigates to
the next screen, the values are assigned to the flow variable.
To store values manually, select Manually assign variables (advanced).
All attributes are available to store in flow variables, but Value is the most likely attribute you must store.
To store the phone number that the user entered, map the Value attribute to a flow variable.

Tip: By default, screen components that require Lightning runtime have no memory. If a user enters a value, navigates to another
screen, and returns to the component’s screen, the user-entered value is lost. To enable a flow to remember the value of an
attribute, set the attribute. The flow stores the value automatically. If you store values manually, store the attribute’s output value
in a variable.

SEE ALSO:
Provided Flow Screen Components

467
Automate Your Business Processes Flows

Flow Screen Input Component: Picklist


Let users choose from a list of options in a picklist format.
EDITIONS

Configure the Picklist Component Available in: both Salesforce


Classic and Lightning
Attribute Description Experience

API Name An API name can include underscores and alphanumeric characters Available in: Essentials,
without spaces. It must begin with a letter and can’t end with an Professional, Enterprise,
Performance, Unlimited,
underscore. It also can’t have two consecutive underscores.
and Developer Editions
Choice Add at least one choice, record choice set, or picklist choice set to this
component. Available only when you add a choice component to the
screen component.

Note: You can’t reorder choices or select the same choice twice.
Choices must be compatible with the component’s Data Type
setting.

Component Type Modify a choice component type.

If the user can select only one option, these component types become
available:
• Picklist
• Radio Buttons
If the user can select multiple options, these component types become
available:
• Checkbox Group
• Multi-select Picklist

Data Type Controls which choices are available for this component. For example, if
you choose Number, you can’t select a Text choice.

Decimal Places Controls the number of digits to the right of the decimal point up to 17
places. If you leave this field blank or set it to zero, only whole numbers
appear when your flow runs.
Available only when the data type is Number or Currency.

Default Value Pre-selected choice for the component. If the associated screen isn’t
executed or the conditions for component visibility aren’t met, the stored
value of the component is null.

Label User-friendly text that displays to the left of the component.

Let Users Specifies whether the user can choose only one option or multiple options.
Select When you select Yes for Let Users Select Multiple Options, Data Type is
Multiple automatically set to Text, and non-text Choice resources are cleared from
Options the component configuration.

468
Automate Your Business Processes Flows

Attribute Description
Provide Help Give your users more context with this screen component. The text you enter is available in an info
bubble next to the component.

Require Requires users to select a value before they can move to the next screen.

Set Component Configure when the component is displayed using conditional logic.
Visibility You can set the components to:
• Always be displayed
• When all conditions are met (AND)
• When any condition is met (OR)
• When custom conditional logic is met

Starting with Flow Run-time API version 52, the first option listed for all picklists is --None--. If you don’t set a default value for a picklist
in Flow Builder, the --None-- option is automatically selected at run time. --None-- is treated as a null value. If you set the picklist as
required and the user selects --None--, then the flow run time prevents the user from proceeding to the next screen.

SEE ALSO:
Provided Flow Screen Components

Flow Screen Input Component: Radio Buttons


Let users choose from a list of options in a radio button format.
EDITIONS

Configure the Radio Buttons Component Available in: both Salesforce


Classic and Lightning
Attribute Description Experience

API Name An API name can include underscores and alphanumeric characters Available in: Essentials,
without spaces. It must begin with a letter and can’t end with an Professional, Enterprise,
Performance, Unlimited,
underscore. It also can’t have two consecutive underscores.
and Developer Editions
Choice Add at least one choice, record choice set, or picklist choice set to this
component. Available only when you add a choice component to the
screen component.

Note: You can’t reorder choices or select the same choice twice.
Choices must be compatible with the component’s Data Type
setting.
All multi-select choice components use a text data type, but radio buttons
and picklists can also use numbers or Boolean choices.

Component Type Modify a choice component type.

If the user can select only one option, these component types become
available:

469
Automate Your Business Processes Flows

Attribute Description
• Picklist
• Radio Buttons
If the user can select multiple options, these component types become available:
• Checkbox Group
• Multi-select Picklist

Data Type Controls which choices are available for this component. For example, if you choose Number, you
can’t select a Text choice.

Decimal Places Controls the number of digits to the right of the decimal point up to 17 places. If you leave this field
blank or set it to zero, only whole numbers appear when your flow runs.
Available only when the data type is Number or Currency.

Default Value Pre-selected choice for the component. If the associated screen isn’t executed or the conditions for
component visibility aren’t met, the stored value of the component is null.

Label User-friendly text that displays to the left of the component.

Let Users Select Specifies whether the user can choose only one option or multiple options. When you select Yes for
Multiple Options Let Users Select Multiple Options, Data Type is automatically set to Text, and non-text Choice resources
are cleared from the component configuration.

Provide Help Give your users more context with this screen component. The text you enter is available in an info
bubble next to the component.

Require Requires users to select a value before they can move to the next screen.

Set Component Configure when the component is displayed using conditional logic.
Visibility You can set the components to:
• Always be displayed
• When all conditions are met (AND)
• When any condition is met (OR)
• When custom conditional logic is met

SEE ALSO:
Provided Flow Screen Components

470
Automate Your Business Processes Flows

Flow Screen Input Component: Slider


Let users visually specify number values from a flow screen.
EDITIONS

Available in: both Salesforce


Classic and Lightning
Experience

Available in: Essentials,


Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
Note: This screen component requires Lightning runtime.

Configure the Slider Component


You can select resources from the flow, such as variables or global constants, or you can manually enter a value.

Attribute Description
API Name An API name can include underscores and alphanumeric characters without spaces. It must begin
with a letter and can’t end with an underscore. It also can’t have two consecutive underscores.

Label This label appears above the slider.


This attribute accepts single-value resources. The value is treated as text.

Range Maximum The maximum value of the slider range. The default is 100.
This parameter accepts single-value Number resources.

Range Minimum The minimum value of the slider range. The default is 0.
This parameter accepts Number resources.

Slider Size Controls the size of the slider. The accepted values are x-small, small, medium, or large.
This parameter accepts single-value resources of any type. That value is treated as text.

Step Size Divides the slider into a set of steps. The default is 1.
For example, for a range of 0–100, set the Step Size to 10 to let the user select every 10th value. Other
example step sizes are 0.1 and 5.
This parameter accepts single-value Number resources.

Value The default value represented by the slider position. Setting this attribute from the Inputs tab pre-sets
the value.
This parameter accepts single-value Number resources.

Store the Slider Component’s Values in the Flow


When you add a screen component to a flow, we automatically store all the attribute values in a variable. When the user navigates to
the next screen, the values are assigned to the flow variable.

471
Automate Your Business Processes Flows

To store values manually, select Manually assign variables (advanced).


All attributes are available to store in flow variables, but Value is the most likely attribute you must store.
To store the value that the user selected, map the Value attribute to a Number flow variable.

Tip: By default, screen components that require Lightning runtime have no memory. If a user enters a value, navigates to another
screen, and returns to the component’s screen, the user-entered value is lost. To enable a flow to remember the value of an
attribute, set the attribute. The flow stores the value automatically. If you store values manually, store the attribute’s output value
in a variable.

SEE ALSO:
Provided Flow Screen Components

Flow Screen Input Component: Text


Let users enter text from a flow screen, such as the name of the user’s company.
EDITIONS

Configure the Text Component Available in: both Salesforce


Classic and Lightning
Attribute Description Experience

API Name An API name can include underscores and alphanumeric characters Available in: Essentials,
without spaces. It must begin with a letter and can’t end with an Professional, Enterprise,
Performance, Unlimited,
underscore. It also can’t have two consecutive underscores.
and Developer Editions
Default Value Pre-populated value for the component. If the associated screen isn’t
executed or the conditions for component visibility aren’t met, the stored
value of the component is null.

Label User-friendly text that displays to the left of the component.

Provide Help Give your users more context with this screen component. The text you
enter is available in an info bubble next to the component.

Require Requires users to enter a value before they can move to the next screen.

Validate Input Provide a formula that evaluates whether what the user entered is valid
and the error message to display if invalid.

SEE ALSO:
Provided Flow Screen Components

472
Automate Your Business Processes Flows

Flow Screen Input Component: Toggle


Let users flip a toggle in a flow screen.
EDITIONS

Available in: both Salesforce


Classic and Lightning
Experience

Available in: Essentials,


Note: This screen component requires Lightning runtime. Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
Configure the Toggle Component
You can select resources from the flow, such as variables or global constants, or you can manually
enter a value.

Attribute Description
Active Label When the toggle is active, this label appears underneath the toggle. Use it to clarify what active means.
The default label is “Active.”
This attribute accepts single-value resources. The value is treated as text.

API Name An API name can include underscores and alphanumeric characters without spaces. It must begin
with a letter and can’t end with an underscore. It also can’t have two consecutive underscores.

Disabled If set to $GlobalConstant.True, the user can’t modify or copy the value.
This attribute accepts single-value Boolean resources.

Inactive Label When the toggle is inactive, this label appears underneath the toggle. Use it to clarify what inactive
means. The default label is “Inactive.”
This attribute accepts single-value resources. The value is treated as text.

Label This label appears next to the toggle and describes what the user is enabling.
This attribute accepts single-value resources. The value is treated as text.

Value Whether the toggle is active ($GlobalConstant.True) or inactive


($GlobalConstant.False). Setting this attribute from the Inputs tab controls the default state
of the toggle. To store the user’s selection in a flow variable, set this attribute from the Outputs tab.
This parameter accepts single-value Boolean resources.

Store the Toggle Component’s Values in the Flow


When you add a screen component to a flow, we automatically store all the attribute values in a variable. When the user navigates to
the next screen, the values are assigned to the flow variable.
To store values manually, select Manually assign variables (advanced).
All attributes are available to store in flow variables, but Value is the most likely attribute you must store.
To store the user’s selection, map the Value attribute to a Boolean flow variable or a checkbox field on a record variable.

473
Automate Your Business Processes Flows

Tip: By default, screen components that require Lightning runtime have no memory. If a user enters a value, navigates to another
screen, and returns to the component’s screen, the user-entered value is lost. To enable a flow to remember the value of an
attribute, set the attribute. The flow stores the value automatically. If you store values manually, store the attribute’s output value
in a variable.

SEE ALSO:
Provided Flow Screen Components

Flow Screen Input Component: URL


Let users enter URL values in a flow screen.
EDITIONS

Available in: both Salesforce


Classic and Lightning
Experience

Available in: Essentials,


Professional, Enterprise,
Note: This screen component requires Lightning runtime. Performance, Unlimited,
and Developer Editions

Configure the URL Component


You can select resources from the flow, such as variables or global constants, or you can manually enter a value.

Attribute Description
API Name An API name can include underscores and alphanumeric characters without spaces. It must begin
with a letter and can’t end with an underscore. It also can’t have two consecutive underscores.

Disabled If set to $GlobalConstant.True, the user can’t modify or copy the value.
This attribute accepts single-value Boolean resources.

Label The label that appears above the URL field.


This attribute accepts single-value resources. The value is treated as text.

Pattern Determines whether the value is valid. The default pattern verifies that the first character is a letter
and that the value includes a colon (:).
To force the user to enter a value in a specific format, use a regular expression. Make sure that your
regular expression checks for a valid protocol in the URL, such as https:// or file:///.
This example expression checks for a secure HTTP protocol (https://) and a specific domain
(acmewireless.com).
^https?://(?:www\.)?acmewireless\.com/?.*

This attribute accepts single-value resources. The value is treated as text.

Read Only If set to $GlobalConstant.True, the user can’t modify the value, but the user can copy it.
This attribute accepts single-value Boolean resources.

474
Automate Your Business Processes Flows

Attribute Description
Required If set to $GlobalConstant.True, the user must enter a value.
This attribute accepts single-value Boolean resources.

Value The value of the URL field. Setting this attribute prepopulates the field. To use the value that the user
enters, store this attribute’s output in a variable.
This attribute accepts single-value resources. The value is treated as text.

Store the URL Component’s Values in the Flow


When you add a screen component to a flow, we automatically store all the attribute values in a variable. When the user navigates to
the next screen, the values are assigned to the flow variable.
To store values manually, select Manually assign variables (advanced).
All attributes are available to store in flow variables, but Value is the most likely attribute you must store.
To store the URL that the user entered, map the Value attribute to a flow variable.

Tip: By default, screen components that require Lightning runtime have no memory. If a user enters a value, navigates to another
screen, and returns to the component’s screen, the user-entered value is lost. To enable a flow to remember the value of an
attribute, set the attribute. The flow stores the value automatically. If you store values manually, store the attribute’s output value
in a variable.

SEE ALSO:
Provided Flow Screen Components
StackOverflow: Sample Regular Expressions for Valid URLs
MDN: What is a URL?

Flow Screen Output Component: Display Text


Display information in a flow screen.
EDITIONS

Configure the Display Text Component Available in: both Salesforce


Classic and Lightning
Attribute Description Experience

API Name An API name can include underscores and alphanumeric characters Available in: Essentials,
without spaces. It must begin with a letter and can’t end with an Professional, Enterprise,
Performance, Unlimited,
underscore. It also can’t have two consecutive underscores.
and Developer Editions
Text box The text to display to the flow user.

Example: Display a confirmation message that summarizes what the flow did on the user’s behalf.

SEE ALSO:
Provided Flow Screen Components

475
Automate Your Business Processes Flows

Flow Screen Output Component: Section


Organize screen components and record fields to give your users a better experience.
EDITIONS
Note: This screen component requires Lightning runtime.
Available in: both Salesforce
Classic and Lightning
Usage Experience

Use sections to organize screen components and fields to give users context and easier navigation. Available in: Essentials,
The Section component contains an optional header and up to four side-by-side columns. Each Professional, Enterprise,
column can contain multiple components and fields. You can place multiple sections on a screen, Performance, Unlimited,
each with its own header and number of columns. and Developer Editions

Tip: Apply conditional visibility rules to a section to affect all components and fields in that
section. Use this method to set visibility rules once for a large number of components, even
if you want only one column.

Headers (1)
Use section headers to create a visual hierarchy to guide your users to the most important items on a screen. All sections with headers
are collapsible and open by default each time a user visits the screen. Also, section header labels can be translated.
Columns (2)
Use columns to organize your screen and save your users from unnecessary scrolling.
Column Width (3)
When you add or delete a new column, Flow Builder sets the width of all columns in that section to be equal. To change a column’s
width, select a width from the predefined options.
Column Deletion (4)
When you delete a column, all components and fields in that column are deleted.

Tip: To center or indent your components and fields, or add padding, include empty columns on your screen.

Considerations
• Sections are responsive to the size of the window that’s showing the flow. On small form factor devices, columns are stacked vertically
instead. However, it isn’t responsive to the width of Lightning page columns and utility bars. For example, if a Lightning page shows
a flow in a sidebar, the width of the entire window determines how the columns appear, even though the sidebar is narrower.

476
Automate Your Business Processes Flows

• If a screen contains a Section screen component, the screen ignores the Layout property when the flow is distributed in Experience
Builder, the Lightning App Builder, or the utility bar. Screens with a Section screen component also ignore the flowLayout URL
parameter when the flow is distributed via URL.

SEE ALSO:
Customize a Flow URL to Render Two-Column Screens
Set the Runtime Experience for URL-Based Flows

Choice Resources for Flow Screen Components


A key part of configuring flow screen components that display choices is selecting the choices to
EDITIONS
display in that field. The choices appear as radio buttons, checkboxes, or picklist options. Use at
least one of these resources: choices, record choice sets, or picklist choice sets. Available in: both Salesforce
Record choice sets and picklist choice sets are easier to configure and don’t require as much Classic and Lightning
maintenance as choices. We recommend using a choice resource only when you can’t use the Experience
other two.
Available in: Essentials,
Professional, Enterprise,
If you want the user to select... Use this resource Performance, Unlimited,
Something that can’t be generated from a Choice and Developer Editions
record, picklist field, or multi-select picklist field

From a collection of existing records Collection Choice Set

From a set of values that correspond to an Picklist Choice Set


existing picklist or multi-select picklist field

From a set of filtered records Record Choice Set

SEE ALSO:
Flow Resource: Record Choice Set
Flow Resource: Picklist Choice Set
Flow Resource: Choice

Flow Connectors
Connectors determine the available paths that a flow can take at run time. On the canvas in Flow
EDITIONS
Builder, a connector looks like an arrow that points from one element to another.
Available in: both Salesforce
Label Example Description Classic and Lightning
Unlabeled Identifies which element to execute next. Experience

Available in: Essentials,


Decision Identifies which element to execute when Professional, Enterprise,
outcome the criteria of a Decision outcome are met. Performance, Unlimited,
and Developer Editions
Pause Identifies which element to execute when
configuration an event that’s defined in a Pause element
label occurs.

477
Automate Your Business Processes Flows

Label Example Description


Fault Identifies which element to execute when the previous
element results in an error.

For each item Identifies the first element to execute for each iteration of a
Loop element.

After last item Identifies which element to execute after a Loop element
finishes iterating through a collection.

Go To Identifies which element to go to and execute next.

SEE ALSO:
Flow Elements

Flow Operators
Operators behave differently, depending on what you’re configuring. In Assignment elements,
EDITIONS
operators let you change resource values. In conditions and filters, operators let you evaluate
information and narrow the scope of a flow operation. Available in: both Salesforce
Classic and Lightning
Flow Operators in Assignment Elements Experience
Use Assignment element operators to change the value of a selected resource. Available in: Essentials,
Flow Operators in Decision and Pause Elements Professional, Enterprise,
Use condition operators to verify the value of a selected resource. Conditions are used in Decision Performance, Unlimited,
elements and Pause elements. and Developer Editions

Flow Operators in Data Elements and Record Choice Sets


Filter conditions narrow the scope of records that the flow operates on. For example, use filter conditions to update only the contacts
that are associated with the Acme Wireless account. When you add an Update Records element, use filter conditions to narrow the
scope to just the contacts whose parent account is Acme Wireless.

Flow Operators in Assignment Elements


Use Assignment element operators to change the value of a selected resource.
EDITIONS
Use this reference to understand the supported operators. The list is organized according to the
data type that you select for Resource. Available in: both Salesforce
Classic and Lightning
• Apex-Defined
Experience
• Boolean
Available in: Essentials,
• Collection
Professional, Enterprise,
• Currency Performance, Unlimited,
• Date and Developer Editions
• Date/Time
• Multi-Select Picklist
• Number

478
Automate Your Business Processes Flows

• Picklist
• Record
• Stage
• Text

Note: Looking for the sObject data type from Cloud Flow Designer? In Flow Builder, we replaced sObject with the Record data
type. So your sObject collection variables are now record collection variables.

Apex-Defined
Match the @AuraEnabled attribute’s Apex data type with a flow data type in this reference to determine which operators are
supported.

Apex Data Type Flow Data Type


Boolean Boolean

Date Date

DateTime Date/Time

Decimal Number

Double Number

Integer Number

List Collection

Long Number

String Text

Boolean
Replace a Boolean resource with a new value.

Operator Description Supported Example


Data Types
Equals What you enter or select for Value Boolean Before Assignment: {!varBoolean} is false
replaces the value of Variable. Assignment: {!varBoolean} Equals
{!$GlobalConstant.True}
After Assignment: {!varBoolean} is true

Collection
Update or replace the value of a collection variable or record collection variable.

479
Automate Your Business Processes Flows

Operator Description Supported Data Types Example


Equals Value replaces the value Collection of the same data Before the Assignment:
of Variable. type or object type • {!collText} is Yellow, Green, Blue
Text, Picklist, and • {!collPicklist} is Blue, Red, Orange
Multi-Select Picklist data
Assignment: {!collText} Equals {!collPicklist}
types are compatible with
each other. After the Assignment: {!collText} is Blue, Red,
Orange

Add Value is added as a new Variable of the same data Before the Assignment:
item at the end of the type or record variable of • {!collText} is Yellow, Green, Blue
collection in Variable. the same object type
• {!varPicklist} is Red
Text, Picklist, and
Assignment: {!collText} Add {!varPicklist}
Multi-Select Picklist data
types are compatible with After the Assignment: {!collText} is Yellow,
each other. Green, Blue, Red
Stages (including
$Flow.CurrentStage) can be
added to text collections.

Remove The first instance of Value Variable of the same data Before the Assignment:
After First is found within the type or record variable of • {!collText} is Red, Orange, Yellow,
collection in Variable. All the same object type Green, Blue
items after the first For text collections only:
instance are removed • {!varText} is Yellow
from the collection in • Multi-Select Picklist Assignment: {!collText} Remove After First
Variable. • Picklist {!varText}
• $Flow.CurrentRecord After the Assignment: {!collText} is Red, Orange,
Yellow

Add At Start Value is added as a new Collection of the same data Before the Assignment:
item at the beginning of type or object type • {!collText} is Yellow, Green, Blue
the collection in Variable. Variable of the same data
• {!varPicklist} is Red
type or record variable of
Assignment: {!collText} Add At Start
the same object type
{!varPicklist}
For text collections only:
After the Assignment: {!collText} is Red, Yellow,
• Multi-Select Picklist Green, Blue
• Picklist
• $Flow.CurrentRecord

Remove All All instances of Value are Collection of the same data Before the Assignment:
removed from the type or object type • {!collText} is Red, Orange, Red, Yellow
collection in Variable. Variable of the same data • {!varText} is Red
type or record variable of
Assignment: {!collText} Remove All {!varText}
the same object type

480
Automate Your Business Processes Flows

Operator Description Supported Data Types Example


For text collections only: After the Assignment: {!collText} is Orange,
• Multi-Select Picklist Yellow

• Picklist
• $Flow.CurrentRecord

Remove The first instance of Value Collection of the same data Before the Assignment:
First is removed from the type or object type • {!collText} is Red, Orange, Red, Yellow
collection in Variable. For text collections only: • {!varText} is Red
• Multi-Select Picklist Assignment: {!collText} Remove First {!varText}
• Picklist After the Assignment: {!collText} is Orange, Red,
• $Flow.CurrentRecord Yellow

Remove The first instance of Value Variable of the same data Before the Assignment:
Before First is found within the type or record variable of • {!collText} is Red, Orange, Yellow,
collection in Variable. All the same object type Green, Blue
items before the first For text collections only:
instance are removed • {!varText} is Yellow
from the collection in • Multi-Select Picklist Assignment: {!collText} Remove Before First
Variable. • Picklist {!varText}
• $Flow.CurrentRecord After the Assignment: {!collText} is Yellow,
Green, Blue

Remove Value specifies a position Number Before the Assignment:


Position in the collection. The item • {!collText} is Red, Orange, Yellow
at the position is removed
• {!varNum} is 2
from the collection in
Variable. Assignment: {!collText} Remove Position {!varNum}
Make sure that Value at After the Assignment: {!collText} is Red, Yellow
run time is a positive
integer that is within the
range of the number of
items in the collection in
Variable.

Remove The items in the Value Collection of the same data Before the Assignment:
Uncommon collection are found type or object type • {!collText1} is Red, Orange, Yellow,
within the Variable Green
collection. The found
items are kept, and all • {!collText2} is Orange, Green, Blue
other items are removed Assignment: {!collText1} Remove Uncommon
from the collection in {!collText2}
Variable. After the Assignment: {!collText1} is Orange,
Green

481
Automate Your Business Processes Flows

Currency and Number


Replace (Equals), add to (Add), or subtract from (Subtract) the value of a currency or number resource. Count (Equals Count) the number
of active stages or the number of items in a collection.

Operator Description Supported Data Types Example


Equals The number that you • Currency Before the Assignment: {!varCurrency} is 10
enter or select for Value Assignment: {!varCurrency} Equals 7
• Number
replaces the value of
Variable. After the Assignment: {!varCurrency} is 7

Add The number that you • Currency Before the Assignment: {!varCurrency} is 10
enter or select for Value is Assignment: {!varCurrency} Add 7
• Number
added to the value of
Variable. After the Assignment: {!varCurrency} is 17

Subtract The number that you • Currency Before the Assignment: {!varCurrency} is 10
enter or select for Value is Assignment: {!varCurrency} Subtract 7
• Number
subtracted from the value
of Variable. After the Assignment: {!varCurrency} is 3

Equals The number of stages or • Collection Before the Assignment:


Count collection items in what • {!varNumber} is 0
• $Flow.ActiveStages
you enter for Value
• {!collText} is Yellow, Green, Blue
replaces the value of
Variable. Assignment: {!varNumber} Equals Count
{!collText}
After the Assignment: {!varNumber} is 3

Date
Replace (Equals), add to (Add), or subtract from (Subtract) the value of a date/time resource.

Operator Description Supported Example


Data Types
Equals The date that you enter or select for • Date Before the Assignment: {!varDate} is 1/16/2016
Value replaces the value of Variable. Assignment: {!varDate} Equals 1/15/2016
• Date/Time
After the Assignment: {!varDate} is 1/15/2016

Add Value is added, in days, to the • Currency Before the Assignment: {!varDate} is 1/16/2016
selected Variable’s value. Assignment: {!varDate} Add 7
• Number
After the Assignment: {!varDate} is 1/23/2016

Subtract Value is subtracted, in days, from the • Currency Before the Assignment: {!varDate} is 1/16/2016
selected Variable’s value. Assignment: {!varDate} Subtract 7
• Number
After the Assignment: {!varDate} is 1/9/2016

482
Automate Your Business Processes Flows

Date/Time
Replace a date/time resource with a new value (Equals).

Operator Description Supported Example


Data Types
Equals The date that you enter or select for • Date Before the Assignment: {!varDateTime} is 1/16/2016
Value replaces the value of Variable. 01:00
• Date/Time
Assignment: {!varDateTime} Equals 1/16/2016
08:00
After the Assignment: {!varDateTime} is 1/16/2016
08:00

Picklist
Replace a picklist resource with a new value (Equals) or concatenate a value onto the original value (Add).

Note: Before values are assigned or added to a picklist resource, they’re converted into string values.

Operator Description Supported Example


Data Types
Equals What you enter or select for Value • Boolean Before the Assignment: {!varPicklist} is Blue
replaces the value of the selected Assignment: {!varPicklist} Equals Yellow
• Currency
picklist.
• Date After the Assignment: {!varPicklist} is Yellow
• Date/Time
• Multi-Select
Picklist
• Number
• Picklist
• Text

Add What you enter or select for Value • Boolean Before the Assignment: {!varPicklist} is Blue
is added to the end of the selected Assignment: {!varPicklist} Add -green
• Currency
picklist.
• Date After the Assignment: {!varPicklist} is Blue-green
• Date/Time
• Multi-Select
Picklist
• Number
• Picklist
• Text

483
Automate Your Business Processes Flows

Multi-Select Picklist
Replace a multi-select picklist resource with a new value (Equals), concatenate a value onto the original value (Add), or add a selection
to the resource (Add Item).

Note: Before values are assigned or added to a multi-select picklist resource, they’re converted into string values.

Operator Description Supported Example


Data Types
Equals What you enter or select for Value • Boolean Before the Assignment: {!varMSP} is Blue
replaces the value of the selected Assignment: {!varMSP} Equals Yellow
• Collection
multi-select picklist.
• Currency After the Assignment: {!varMSP} is Yellow
• Date
• Date/Time
• Multi-Select
Picklist
• Number
• Picklist
• Text

Add What you enter or select for Value • Boolean Before the Assignment: {!varMSP} is Blue; Green.
is added to the last item selected in This value includes two separate selections
• Currency
the multi-select picklist. It doesn’t Assignment: {!varMSP} Add Yellow
create a selection. • Date
• Date/Time After the Assignment: {!varMSP} is Blue;
Easily add items to a multi-select GreenYellow. This value includes two separate selections
picklist resource by using the “add • Multi-Select
item” operator. Picklist
To add semi-colon-delimited items • Number
to a multi-select picklist variable • Picklist
with the “add” operator, always add • Text
a single space after the semi-colon
and don’t include a space before the
semi-colon. This way, you can
compare the variable’s values to the
values of a multi-select picklist field
from the Salesforce database. For
example: ; Yellow

Add Item What you enter or select for Value • Boolean Before the Assignment: {!varMSP} is Blue; Green
is added as a new selection to the Assignment: {!varMSP} Add item Yellow
• Currency
end of the multi-select picklist. The
Assignment automatically adds “;” • Date After the Assignment: {!varMSP} is Blue; Green;
before the new item. That way, • Date/Time Yellow. This value includes three separate selections
Salesforce reads it as a separate item • Multi-Select
selected by the multi-select picklist. Picklist
• Number

484
Automate Your Business Processes Flows

Operator Description Supported Example


Data Types

• Picklist
• Text

Record
Replace a record variable with a new value (Equals).

Operator Description Supported Example


Data Types
Equals The record variable that you select Record – with the Before the Assignment:
for Value replaces the value of same object type • {!account1} contains field values for the Acme
Variable. Wireless account
• {!account2} contains field values for the Global Media
account
Assignment: {!account1} Equals {!account2}
After the Assignment: both {!account1} and
{!account2} contain the field values for the Global Media
account

Stage
You can’t update the value of a stage, but you can update the values of the stage global variables: $Flow.CurrentStage and
$Flow.ActiveStages.

Note: Assignments use the stage’s fully qualified name: namespace.flowName:stageName or flowName:stageName.

$Flow.CurrentStage
Replace the stage selected in $Flow.CurrentStage.

Operator Description Supported Example


Data Types
Equals Value replaces the value of • Stage Before the Assignment: $Flow.CurrentStage is stage1
$Flow.CurrentStage.
• Fully qualified Assignment: {!$Flow.CurrentStage} Equals
stage name {!stage2}
After the Assignment: $Flow.CurrentStage is stage2

$Flow.ActiveStages
Add or remove active stages in the $Flow.ActiveStages global variable.

485
Automate Your Business Processes Flows

Operator Description Supported Data Types Example


Add Value is added to the end of • Stage Before the Assignment: $Flow.ActiveStages is
$Flow.ActiveStages. stage1, stage2
• $Flow.ActiveStages
Assignment: {!$Flow.ActiveStages} Add
• $Flow.CurrentStage
{!stage3}
• Fully qualified stage
name After the Assignment: $Flow.ActiveStages is
stage1, stage2, stage3

Remove The first instance of the stage • Stage Before the Assignment: $Flow.ActiveStages is
After First in Value is found within stage1, stage2, stage3, stage4
• $Flow.CurrentStage
$Flow.ActiveStages.
Assignment: {!$Flow.ActiveStages} Remove
All stages after the first • Fully qualified stage
After First {!stage2}
instance are removed from name
$Flow.ActiveStages. After the Assignment: $Flow.ActiveStages is
stage1, stage2

Add At Start Value is added to the • Stage Before the Assignment: $Flow.ActiveStages is
beginning of stage1, stage2
• $Flow.ActiveStages
$Flow.ActiveStages.
Assignment: {!$Flow.ActiveStages} Add At
• $Flow.CurrentStage
Start {!stage0}
• Fully qualified stage
name After the Assignment: $Flow.ActiveStages is
stage0, stage1, stage2

Remove All All instances of Value are • Stage Before the Assignment: $Flow.ActiveStages is
removed from stage1, stage2, stage3
• $Flow.ActiveStages
$Flow.ActiveStages.
Assignment: {!$Flow.ActiveStages} Remove
• $Flow.CurrentStage
All {!$Flow.ActiveStages}
• Fully qualified stage
name After the Assignment: $Flow.ActiveStages is
empty

Remove First The first instance of the stage • Stage Before the Assignment: $Flow.ActiveStages is
in Value is removed from stage1, stage2, stage3, stage1
• $Flow.CurrentStage
$Flow.ActiveStages.
Assignment: {!$Flow.ActiveStages} Remove
• Fully qualified stage
First stage1
name
After the Assignment: $Flow.ActiveStages is
stage2, stage3, stage1

Remove The first instance of the stage • Stage Before the Assignment: $Flow.ActiveStages is
Before First in Value is found within stage1, stage2, stage3, stage4
• $Flow.CurrentStage
$Flow.ActiveStages.
Assignment: {!$Flow.ActiveStages} Remove
All stages before that first • Fully qualified stage
Before First {!stage3}
instance are removed from name
$Flow.ActiveStages. After the Assignment: $Flow.ActiveStages is
stage3, stage4

486
Automate Your Business Processes Flows

Operator Description Supported Data Types Example


Remove Value specifies a position in Number Before the Assignment:
Position $Flow.ActiveStages. • $Flow.ActiveStages is stage1,
The stage at that position is stage2, stage3
removed from
• {!varNum} is 2
$Flow.ActiveStages.
Assignment: {!$Flow.ActiveStages} Remove
Make sure that Value at run
Position {!varNum}
time is a positive integer that
is within the range of the After the Assignment: $Flow.ActiveStages is
number of stages in stage1, stage3
$Flow.ActiveStages.

Text
Replace a text resource with a new value (Equals) or concatenate a value onto the end of the original value (Add).

Note: Before values are assigned or added to a text resource, they’re converted into string values.

Operator Description Supported Example


Data Types
Equals The text that you enter or select for • Boolean Before the Assignment: {!varText} is Blue
Value replaces the value of Variable. Assignment: {!varText} Equals Yellow
• Currency
• Date After the Assignment: {!varText} is Yellow
• Date/Time
• Number
• Multi-Select
picklist
• Picklist
• Stage,
including
$Flow.CurrentStage
and
$Flow.ActiveStages
• Text

Add The text that you enter or select for • Boolean Before the Assignment: {!varText} is Blue
Value is added to the end of Assignment: {!varText} Add Yellow
• Currency
Variable.
• Date After the Assignment: {!varText} is BlueYellow
• Date/Time
• Number
• Multi-Select
picklist
• Picklist

487
Automate Your Business Processes Flows

Operator Description Supported Example


Data Types

• Stage,
including
$Flow.CurrentStage
and
$Flow.ActiveStages
• Text

Flow Operators in Decision and Pause Elements


Use condition operators to verify the value of a selected resource. Conditions are used in Decision
EDITIONS
elements and Pause elements.
Use this reference to understand the supported operators. The list is organized according to the Available in: both Salesforce
data type that you select for Resource, Classic and Lightning
Experience
• Apex-Defined
• Boolean Available in: Essentials,
Professional, Enterprise,
• Choice
Performance, Unlimited,
• Collection and Developer Editions
• Currency
• Date
• Date/Time
• Multi-Select Picklist
• Number
• Picklist
• Record
• Stage
• Text

Note: Looking for the sObject data type from Cloud Flow Designer? In Flow Builder, we replaced sObject with the Record. So
your sObject collection variables are now record collection variables.

Apex-Defined
Match the @AuraEnabled attribute’s Apex data type with a flow data type in this reference to determine which operators are
supported.

Apex Data Type Flow Data Type


Boolean Boolean

Date Date

DateTime Date/Time

Decimal Number

488
Automate Your Business Processes Flows

Apex Data Type Flow Data Type


Double Number

Integer Number

List Collection

Long Number

String Text

Boolean
Check whether a Boolean resource’s value matches another value or resource.

Operator True if... Supported Data


Types
Does Not The value of the selected Resource doesn’t match what you enter or select for Value. Boolean
Equal

Equals The value of the selected Resource matches what you enter or select for Value. Boolean
• A decision outcome resolves to true if the flow interview took that outcome.
• A pause configuration resolves to true if the flow waited for the associated resume event.
• A data element or action element resolves to true if it executed without error. If a fault
occurred, the element resolves to false. If the element wasn’t executed, it resolves to null.

Was Set The value for Resource is a field in a record variable, and that field has been populated with Boolean
a value in the flow at least once.

Was Visited The selected Resource is an element in the flow, and it has been visited during the flow Boolean
interview.

Choice
Every choice resource has a data type and obeys the operator rules for that data type. However, choice resources support one extra
operator that other resources don’t, no matter what their data type is.

Operator True if... Supported Data


Types
Was Selected A user selected that choice, picklist choice set, or record choice set in a screen component. Boolean
If your flow references the same choice in multiple screens, Was Selected always respects the
most recent screen that the flow visited.
If your flow references the same choice with a text input in more than one place on the same
screen, this operator always respects the first usage in the screen.

489
Automate Your Business Processes Flows

Collection
Check whether a Collection resource’s value contains or matches another value or resource.

Operator True if... Supported Data Types


Contains An item in the collection that’s selected for Resource Resource of the same data type.
contains the exact same value as Value For record collection variables, only record resources with
the same object type are supported.

Does Not Equal The collection that’s selected for Resource doesn’t match Collection of the same data type.
the collection that’s selected for Value For record collection variables, only record collection
Two record collection variables are unequal if they include variables with the same object type are supported.
different fields or if the fields have different values.

Equals The collection that’s selected for Resource matches the Collection of the same data type.
collection that’s selected for Value For record collection variables, only record collection
Two record collection variables are equal if they include variables with the same object type are supported.
the same fields and those fields have the same values.

Is Null The collection that’s selected for Resource isn’t populated Boolean
with any values

Currency and Number


Check whether a Currency or Number resource’s value matches, is larger than, or is smaller than another value or resource.

Operator True if... Supported Data


Types
Does Not The value for Resource doesn’t match what’s entered or selected for Value • Currency
Equal
• Number

Equals The value for Resource matches what’s entered or selected for Value • Currency
• Number

Greater Than The value for Resource is larger than what’s entered or selected for Value • Currency
• Number

Greater Than The value for Resource is larger than what’s entered or selected for Value or is the same • Currency
or Equal
• Number

Less Than The value for Resource is smaller than what’s entered or selected for Value • Currency
• Number

Less Than or The value for Resource is smaller than what’s entered or selected for Value or is the same • Currency
Equal

490
Automate Your Business Processes Flows

Operator True if... Supported Data


Types

• Number

Is Null Resource isn’t populated with a value Boolean

Was Set The value for Resource is a field in a record variable, and that field has been populated with Boolean
a value in the flow at least once

Date and Date/Time


Check whether a Date or Date/Time resource’s value matches, is before, or is after another value or resource.

Operator True if... Supported Data


Types
Does Not The value for Resource doesn’t match what’s entered or selected for Value • Date
Equal
• Date/Time

Equals The value for Resource matches what’s entered or selected for Value • Date
• Date/Time

Greater Than The value for Resource is a later date or time than what’s entered or selected for Value • Date
• Date/Time

Greater Than The value for Resource is a later date or time than what’s entered or selected for Value or is • Date
or Equal the same date or time
• Date/Time

Less Than The value for Resource is an earlier date or time than what’s entered or selected for Value • Date
• Date/Time

Less Than or The value for Resource is an earlier date or time than what’s entered or selected for Value or • Date
Equal is the same date or time
• Date/Time

Is Null Resource isn’t populated with a value Boolean

Was Set The value for Resource is a field in a record variable, and that field has been populated with Boolean
a value in the flow at least once

Picklist
Check whether a Picklist resource’s value matches or contains another value or resource.

Note: These operators treat the resource’s value as a text value.

491
Automate Your Business Processes Flows

Operator True if... Supported Data


Types
Contains The value for Resource contains what’s entered or selected for Value • Boolean
For example, if the value of {!varPicklist} is yellow-green, the condition • Currency
{!varPicklist} Contains green evaluates to true.
• Date
• Date/Time
• Multi-Select
Picklist
• Number
• Picklist
• Text

Does Not The value for Resource doesn’t match what’s entered or selected for Value • Boolean
Equal
• Currency
• Date
• Date/Time
• Multi-Select
Picklist
• Number
• Picklist
• Text

Equals The value for Resource matches what’s entered or selected for Value • Boolean
• Currency
• Date
• Date/Time
• Multi-Select
Picklist
• Number
• Picklist
• Text

Was Set The value for Resource is a field in a record variable, and that field has been populated with Boolean
a value in the flow at least once

Multi-Select Picklist
Check whether a multi-select picklist resource’s value matches or contains another value or resource.

Note: These operators treat the resource’s value as a text value. If the resource’s value includes multiple items, the operators treat
the value as one string that happens to include semi-colons. It doesn’t treat each selection as a different value. For example, the
operators treat red; blue; green as a single value rather than three separate values.

492
Automate Your Business Processes Flows

Operator True if... Supported Data


Types
Contains The value for Resource contains what’s entered or selected for Value • Boolean
Tip: When you use this operator for a multi-select picklist resource, be aware of the • Currency
values that a user can enter. If you want to check that a specific value is included and • Date
that value is also included as part of another value, create a flow formula resource that
• Date/Time
uses the INCLUDES() function.
• Multi-Select
For example, your org has a Color multi-select picklist value. Among the possible values Picklist
are “green” and “yellow-green”. If both “green” and “yellow-green” are acceptable
• Number
values, use the Contains operator in a flow condition. If only “green” is an acceptable
value, create a formula that uses the INCLUDES() function. • Picklist
• Text

Does Not The value for Resource doesn’t match what’s entered or selected for Value • Boolean
Equal
Note: Order matters. If you aren’t sure which order the values that you’re checking • Currency
for will appear in, use the INCLUDES() function in a flow formula. For example, if you • Date
compare “red; blue; green” to “blue; green; red” using the Does Not Equal operator,
• Date/Time
that condition resolves to true.
• Multi-Select
Picklist
• Number
• Picklist
• Text

Equals The value for Resource exactly matches what’s entered or selected for Value • Boolean
Note: Order matters. If you aren’t sure which order the values that you’re checking • Currency
for will appear in, use the INCLUDES() function in a flow formula. For example, if you • Date
compare “red; blue; green” to “blue; green; red” using the Equals operator, that condition
• Date/Time
will resolve to false.
• Multi-Select
Picklist
• Number
• Picklist
• Text

Was Set The value for Resource is a field in a record variable, and that field has been populated with Boolean
a value in the flow at least once

Record
Check whether a record resource’s value matches another value or resource.

493
Automate Your Business Processes Flows

Operator True if... Supported Data


Types
Does Not The value for Resource doesn’t match what’s entered or selected for Value Record with the same
Equal object type

Equals The value for Resource matches what’s entered or selected for Value Record with the same
object type

Is Null Resource isn’t populated with a value Boolean

Stage
Note: Stages resolve to the fully qualified stage name: namespace.flowName:stageName or flowName:stageName.

Check whether a Stage resource or the $Flow.CurrentStage global variable matches, ends with, or starts with another value or
resource.

Operator True if... Supported Data


Types
Does Not The value for Resource doesn’t match what’s entered or selected for Value • Stage
Equal
• Text

Equals The value for Resource matches what’s entered or selected for Value • Stage
• Text

Ends With The end of the value for Resource matches what’s entered or selected for Value • Stage
• Text

Is Null Resource isn’t populated with a value Boolean

Starts With The beginning of the value for Resource matches what’s entered or selected for Value • Stage
• Text

Check whether $Flow.ActiveStages contains a particular stage, matches the value of a Text collection, or is null.

Operator True if... Supported Data


Types
Contains $Flow.ActiveStages contains an item that matches the resource that’s selected for • Stage
Value.
• Text

Does Not The collection that’s selected for Resource doesn’t match $Flow.ActiveStages. Text collection
Equal

Equals The collection that’s selected for Resource doesn’t match $Flow.ActiveStages. Text collection

494
Automate Your Business Processes Flows

Operator True if... Supported Data


Types
Is Null $Flow.ActiveStages isn’t populated with any stages. Boolean

Text
Check whether a Text resource’s value matches, contains, ends with, or starts with another value or resource.

Note:
• Before values are compared to a text resource, they’re converted into string values.
• Stages resolve to the fully qualified stage name: namespace.flowName:stageName or flowName:stageName.

Operator True if... Supported Data


Types
Contains The value for Resource contains what’s entered or selected for Value • Boolean
• Currency
• Date
• Date/Time
• Multi-Select
Picklist
• Number
• Picklist
• Stage
• Text

Does Not The value for Resource doesn’t match what’s entered or selected for Value • Boolean
Equal
• Currency
• Date
• Date/Time
• Multi-Select
Picklist
• Number
• Picklist
• Stage
• Text

Equals The value for Resource matches what’s entered or selected for Value • Boolean
• Currency
• Date
• Date/Time

495
Automate Your Business Processes Flows

Operator True if... Supported Data


Types

• Multi-Select
Picklist
• Number
• Picklist
• Stage
• Text

Ends With The end of the value for Resource matches what’s entered or selected for Value • Boolean
• Currency
• Date
• Date/Time
• Multi-Select
Picklist
• Number
• Picklist
• Stage
• Text

Is Null Resource isn’t populated with a value Boolean

Starts With The beginning of the value for Resource matches what’s entered or selected for Value • Boolean
• Currency
• Date
• Date/Time
• Multi-Select
Picklist
• Number
• Picklist
• Stage
• Text

Was Set The value for Resource is a field in a record variable, and that field has been populated with Boolean
a value in the flow at least once

496
Automate Your Business Processes Flows

Flow Operators in Data Elements and Record Choice Sets


Filter conditions narrow the scope of records that the flow operates on. For example, use filter
EDITIONS
conditions to update only the contacts that are associated with the Acme Wireless account. When
you add an Update Records element, use filter conditions to narrow the scope to just the contacts Available in: both Salesforce
whose parent account is Acme Wireless. Classic and Lightning
Use this reference, organized by the data type of the field that you select, to understand the Experience
supported operators.
Available in: Essentials,
• Address Fields Professional, Enterprise,
• Autonumber Fields Performance, Unlimited,
and Developer Editions
• Checkbox Fields
• Currency Fields
• Date Fields
• Date/Time Fields
• Email Fields
• Encrypted Text Fields
• External Lookup Relationship Fields
• Fax Fields
• Lookup Relationship Fields
• Multi-Select Picklist Fields
• Number Fields
• Parent Fields
• Percent Fields
• Phone Fields
• Picklist Fields
• Text Fields
• Text Area (Long) Fields
• Text Area (Rich) Fields
• URL Fields

Checkbox Fields
When you select a checkbox field under Field, these operators are available. A flow treats null as a different value than false. If you
filter for records whose checkbox field is null, no records are returned.

Operator Filters to records where the selected Supported Data Types


field’s value ...
Does Not Equal Doesn’t match what you enter or select for Boolean
Value

Equals Matches what you enter or select for Value Boolean

Is Null Hasn’t been populated with a value yet (if Boolean


you select True for Value)

497
Automate Your Business Processes Flows

Currency, Number, and Percent Fields


When you select a currency, number, or percent field under Field, these operators are available.

Operator Filters to records where the selected Supported Data Types


field’s value ...
Does Not Equal Doesn’t match what’s entered or selected • Currency
for Value
• Number

Equals Matches what’s entered or selected for • Currency


Value
• Number

Greater Than Is larger than what’s entered or selected for • Currency


Value
• Number

Greater Than or Equal Is larger than what’s entered or selected for • Currency
Value or is the same
• Number

Is Null Hasn’t been populated with a value yet (if Boolean


you select True for Value)

Less Than Is smaller than what’s entered or selected • Currency


for Value
• Number

Less Than or Equal Is smaller than what’s entered or selected • Currency


for Value or is the same.
• Number

Date and Date/Time


When you select a date or date/time field under Field, these operators are available.

Operator Filters to records where the selected Supported Data Types


field’s value ...
Does Not Equal Doesn’t match what’s entered or selected • Date
for Value
• Date/Time

Equals Matches what’s entered or selected for • Date


Value
• Date/Time

Greater Than Is a later date or time than what’s entered • Date


or selected for Value
• Date/Time

498
Automate Your Business Processes Flows

Operator Filters to records where the selected Supported Data Types


field’s value ...
Greater Than or Equal Is a later date or time than what’s entered • Date
or selected for Value or is the same date or
• Date/Time
time

Is Null Hasn’t been populated with a value yet (if Boolean


you select True for Value)

Less Than Is an earlier date or time than what’s entered • Date


or selected for Value
• Date/Time

Less Than or Equal Is an earlier date or time than what’s entered • Date
or selected for Value or is the same date or
• Date/Time
time

Picklist and Text Fields


When you select a picklist or text field under Field, these operators are available.

Operator Filters to records where the selected Supported Data Types


field’s value ...
Contains Contains what’s entered or selected for • Boolean
Value
• Currency
• Date
• Date/Time
• Multi-Select Picklist
• Number
• Picklist
• Stage
• Text

Does Not Equal Doesn’t match what’s entered or selected • Boolean


for Value
• Currency
• Date
• Date/Time
• Multi-Select Picklist
• Number
• Picklist
• Stage
• Text

499
Automate Your Business Processes Flows

Operator Filters to records where the selected Supported Data Types


field’s value ...
Equals Matches what’s entered or selected for • Boolean
Value
• Currency
• Date
• Date/Time
• Multi-Select Picklist
• Number
• Picklist
• Stage
• Text

Ends With Ends with what’s entered or selected for • Boolean


Value
• Currency
• Date
• Date/Time
• Multi-Select Picklist
• Number
• Picklist
• Stage
• Text

Is Null Hasn’t been populated with a value yet (if Boolean


you select True for Value)

Starts With Begins with what’s entered or selected for • Boolean


Value
• Currency
• Date
• Date/Time
• Multi-Select Picklist
• Number
• Picklist
• Stage
• Text

Multi-Select Picklist Fields


When you select a multi-select picklist field under Field, these operators are available.

500
Automate Your Business Processes Flows

Tip: Be careful when using these operators to filter records based on a multi-select picklist field. Even if two resources have the
same items in a multi-select picklist, they can be mismatched if these cases differ.
• The spacing before or after the semi-colon. For example, one resource’s value is “red; green; blue” and the other’s value is
“red;green;blue”
• The order of the items. For example, one resource’s value is “red; green; blue” and the other’s value is “red; blue; green”
For best results, use the INCLUDES function in a flow formula.

Operator Filters to records where the selected Supported Data Types


field’s value ...
Does Not Equal Doesn’t match what’s entered or selected • Boolean
for Value
• Currency
• Date
• Date/Time
• Multi-Select Picklist
• Number
• Picklist
• Stage
• Text

Equals Matches what’s entered or selected for • Boolean


Value
• Currency
• Date
• Date/Time
• Multi-Select Picklist
• Number
• Picklist
• Stage
• Text

Ends With Ends with what’s entered or selected for • Boolean


Value
• Currency
• Date
• Date/Time
• Multi-Select Picklist
• Number
• Picklist
• Stage
• Text

Is Null Hasn’t been populated with a value yet (if Boolean


you select True for Value)

501
Automate Your Business Processes Flows

Operator Filters to records where the selected Supported Data Types


field’s value ...
Starts With Begins with what’s entered or selected for • Boolean
Value
• Currency
• Date
• Date/Time
• Multi-Select Picklist
• Number
• Picklist
• Stage
• Text

Flow Version Properties


A flow version’s properties consist of its label, description, interview label, and type. These properties
EDITIONS
drive the field values that appear on the flow’s detail page.

To change the properties of a flow version, open it in Flow Builder. Then click . Available in: both Salesforce
Classic and Lightning
Experience
Property Description
Available in: Essentials,
Flow Label The label for the flow version. The label appears in the flow detail page
Professional, Enterprise,
and list views. When a user runs this flow, the header displays the flow
Performance, Unlimited,
label.
and Developer Editions
You can edit the label for inactive flows and flow versions.

Flow API Name The API name for the flow. The API name is used to refer to this flow
from other parts of Salesforce, such as in a URL or Lightning web
component. An API name can include underscores and alphanumeric
characters without spaces. It must begin with a letter and can’t end with
an underscore. It also can’t have two consecutive underscores. The API
name appears on the flow detail page.
You can’t edit the API name after saving the flow.

Description Differentiates the flow version from other versions. The description
appears in the flow detail page and list views.
You can edit the description for inactive flows and flow versions.

Template Specifies whether the flow is a template. When a template is installed


from a managed package, the subscriber can view the flow and save it
as a new, editable flow. Non-template flows that are installed from
managed packages can only be activated and deactivated.
Suppose that your company needs a flow that differs slightly for each
country where you do business. You can create or install a template for
the base flow and then clone it to create each country-specific flow.

502
Automate Your Business Processes Flows

Property Description
Even if you don’t use managed packages, you can use this field to clearly identify the base flow.

How to Run the Flow Determines the context that the flow runs in. You can choose to always run flow in system context
with sharing or system context without sharing. By default, the context that the flow runs in depends
on how the flow is launched.

Type Determines which elements and resources are supported in the flow and the ways that the flow
can be implemented. The type appears in the flow detail page and list views. In flow version
properties, the type appears in the Advanced section. For details, see Flow Types on page 100.
Flow Builder doesn’t support saving a new version as a different flow type. To change a flow’s type,
save it as a new flow. Before you change the flow type, make sure that the flow contains only
elements, resources, and functionality that the new flow type supports. You can fix some, but not
all, compatibility issues in the new flow.

API Version for Determines which versioned run-time behavior improvements the flow adopts.
Running the Flow Changing this field requires the Manage Flows permission. Before you select a new API version,
review all run-time improvements that were delivered between the currently selected API version
and the new API version. You can find all flow and process run-time improvements for an API version
in the Salesforce Release Notes.
By default, when you create a flow, it runs in the latest API version. If an existing flow is saved as a
new flow or flow version, the existing flow’s run-time API version is used in the new flow or flow
version.
The run-time API version doesn’t change as future Salesforce releases roll out. You decide when, if
ever, to change the API version for running each flow version. This field lets you test and upgrade
your flows one by one, and at your own pace. You can even opt to never adopt versioned updates
for one or all your flows.

Interview Label The label for the flow’s interviews. An interview is a running instance of a flow. This label appears
in the following areas.
• List views of paused interviews in Setup
• Paused Interviews component on the Home page or in an Experience Builder site
• Paused Interviews item in the Salesforce mobile app
• Actions & Recommendations component in a Lightning page
You can edit the interview label for inactive flows and flow versions. By default, the interview label
contains the flow name and the {!$Flow.CurrentDateTime} global variable.
Use a text template to reference multiple resources in the label. For example, Flow Name -
{!Account.Name} - {!$Flow.CurrentDateTime}.

SEE ALSO:
Always Run in System Context
API Version for Running a Flow

503
Automate Your Business Processes Orchestrator

Orchestrator
As your company grows, so does the complexity of your workflows. Processes often require input from multiple users in multiple
departments across multiple time zones. This increased complexity results in an increased amount of time spent waiting for each person
to complete their task in the proper order.

What Is Orchestrator?
Orchestrator lets you create orchestrations: multi-step processes that interact with multiple users. An orchestration is a sequence of
stages, each comprised of a series of steps. A stage can contain interactive and background steps. Interactive steps have an assigned
user and execute a designated screen flow. An admin places the Orchestrator Work Guide Lightning App Builder component on the
page layout for the type of record the interactive step affects. When an orchestration runs an interactive step, the designated user receives
an email with a link to their assigned action. The assigned user clicks the link to go to the record where they complete their action in
the Work Guide. Background steps execute an autolaunched flow that’s executed by the system and requires no user interaction.

When Should You Use Orchestrator?


Use Orchestrator to create advanced approval processes, task lists for groups, or any other processes that require multiple interrelated
steps. For example, consider employee onboarding that requires a new employee to go through a multi-level, multi-user approval
process to get equipment and access to digital company resources. Use Orchestrator to compose and orchestrate that complex process,
and enjoy a first-class experience to manage and monitor every onboarding.

Flow Builder for Orchestrator


Get to know the Flow Builder requirements and user interface for Orchestrator.
Orchestrator Concepts
Learn about what an orchestration is made of and how it relates to Salesforce Flow.
Build an Orchestration
Orchestrator allows you to build sophisticated business processes by combining and coordinating flows.
Deploy an Orchestration
After you design and test your orchestration, it’s time to put it to work!
Orchestration Run
An orchestration run is a running instance of an orchestration. An orchestration is an application built by your admin that uses stages
and decisions to organize a complex business process.
Manage Orchestrations and Work Items
Manage orchestrations and work items with list views. Cancel running orchestrations and reassign work items that have been
assigned, but not completed.
Troubleshoot Orchestrations
To troubleshoot a failed orchestration run, use the orchestration fault email. To test an orchestration and observe what happens as
it runs, use the debug option.
Orchestrator Limits and Considerations
When designing, managing, and running orchestrations, consider these issues.
Orchestrator Reference
Bookmark this page for quick access to information about orchestration elements, resources, events, and more.

504
Automate Your Business Processes Flow Builder for Orchestrator

Flow Builder for Orchestrator


Get to know the Flow Builder requirements and user interface for Orchestrator.
EDITIONS
User Permissions Needed Available in: both Salesforce
To open, edit, or create an orchestration in Flow Manage Flow Classic and Lightning
Builder: Experience

Available in: Enterprise,


Performance, Unlimited,
Tour the Flow Builder User Interface for Orchestrator and Developer Editions

Orchestrator uses the Auto-Layout canvas in Flow Builder. This feature is supported in
Government Cloud and
Government Cloud Plus.

Button Bar (1)


Manage your orchestration as you build it.
• To run the most recent saved version of the orchestration that’s open, click Run.

Note: The Run button is only available for autolaunched orchestrations.

• To the left of the buttons, you can see the version’s active or inactive status and when it was last saved.

Note: The Run button is only available for autolaunched orchestrations.

• If the orchestration has warnings or errors, the Show Warnings icon ( ) or the Show Errors ( ) icon appears. To see their
details, click the icon.
Toolbox (2)
Create variables, constants, formulas, or text templates to use in your orchestration. Or view a list of all resources and elements that
you added.
Canvas (3)
Build an orchestration on the canvas. As you add elements to the canvas and connect them, you can see a diagram of your
orchestration.

Note: To insert an element, click where you want it to appear. Flow Builder then shows the options and possible elements
for this location.
Details (4)
Set attributes for the element selected in the canvas. The Details panel closes when no element is selected.

505
Automate Your Business Processes Orchestrator Concepts

Keyboard Shortcuts
Use these handy keyboard shortcuts for macOS and Windows to quickly navigate orchestrations.

Action macOS Windows


Zoom in Cmd+Option+= Ctrl+Alt+=

Zoom out Cmd+Option+- Ctrl+Alt+-

Zoom to fit Cmd+Option+1 Ctrl+Alt+1

Zoom to view Cmd+Option+0 Ctrl+Alt+0

View available keyboard shortcuts Cmd+/ Ctrl+/

Orchestrator Concepts
Learn about what an orchestration is made of and how it relates to Salesforce Flow.

Orchestrations
An orchestration uses stages, steps, and decisions to organize complex business processes.
Building Blocks of Orchestrations
Stages, steps, and flows are the building blocks of an orchestration.
Anatomy of an Orchestration
Combine elements, connectors, and resources to build orchestrations.
Orchestration Types
An orchestration’s type determines how the orchestration can be distributed.
Triggers for Orchestrations
Creating or updating a record can trigger an orchestration that requires additional input from users, approval from assigned users,
other updates to the record, or changes to related records. In the Start element of a record-triggered orchestration, you can specify
new and changed records of a specific object. Autolaunched orchestrations don’t use triggers. Use another mechanism to launch
an autolaunched orchestration, such as custom Apex classes or custom URLs. Use Orchestrator to automate complex processes, and
use Flow Trigger Explorer to order record-triggered flows.
What’s the Difference Between Salesforce Flow and Orchestrator?
Salesforce offers several features that automate internal procedures and business processes to save time across your org.
Advanced Orchestration Concepts
After you understand the basics, you’re ready for a closer look at the context in which orchestrations run and how they perform work
items at the same time.

506
Automate Your Business Processes Orchestrator Concepts

Orchestrations
An orchestration uses stages, steps, and decisions to organize complex business processes.
EDITIONS
Build orchestrations using the Orchestrator tiles in Flow Builder. Orchestrator tiles limit the available
elements in your orchestration and include certain elements, such as stages and steps, that aren’t Available in: both Salesforce
available in flows. Orchestrator always uses Auto-Layout in Flow Builder. Classic and Lightning
Experience
The two Orchestrator tiles are Autolaunched Orchestration (No Trigger) and Record-Triggered
Orchestration. Trigger an autolaunched orchestration using a custom Apex class or a custom URL. Available in: Enterprise,
The creation or update of a record can trigger a record-triggered orchestration, but only after the Performance, Unlimited,
record is saved. and Developer Editions
Variables in Orchestrations This feature is supported in
Autolaunched orchestrations can use input variables to require input from a process that calls Government Cloud and
it. Government Cloud Plus.

Variable Description Notes


Internal-only Orchestrations don’t have a way to assign a value to an
internal-only variable.

Input The user-defined variable is Orchestrations can’t change


marked Available for input. the value of variables, but
When the orchestration is they can pass input variables
called by a process, its input to input parameters for
variables are required inputs evaluation flows or flows
for the other process. called by steps in an
orchestration.

Output Orchestrations don’t have a way to assign a value to a variable


that’s available for output.

Building Blocks of Orchestrations


Stages, steps, and flows are the building blocks of an orchestration.

Orchestration Stages
A stage groups related steps, organizing them into logical phases. Stages are executed sequentially, and only one stage in an
orchestration can be in progress at a time. You configure the conditions that must be met for the stage to be considered complete.
Orchestration Steps
Steps are grouped in stages and can be run sequentially or concurrently. Interactive steps require user intervention. Background
steps require no user interaction.
Flows in Orchestrations
Every step in an orchestration runs an associated flow. You can use an evaluation flow to set custom criteria for starting a step or to
mark an interactive step or stage complete.
Orchestration Work Items
When an interactive step in an orchestration runs, it creates a work item and assigns it to a user, group, or queue. The orchestration
then sends an email with a link to the specified record page to all assigned users. They complete the work in the Orchestrator Work
Guide component on the specified record page.

507
Automate Your Business Processes Orchestrator Concepts

Orchestration Stages
A stage groups related steps, organizing them into logical phases. Stages are executed sequentially,
EDITIONS
and only one stage in an orchestration can be in progress at a time. You configure the conditions
that must be met for the stage to be considered complete. Available in: both Salesforce
Classic and Lightning
General Experience

An orchestration must contain at least one stage. You can’t set entry conditions for a stage because Available in: Enterprise,
they run sequentially. To control when a stage completes, select one of the exit conditions. Performance, Unlimited,
and Developer Editions
Note: The Stage element in Orchestrator isn’t related to the Stage resource in Salesforce
Flow. This feature is supported in
Government Cloud and
Government Cloud Plus.
Exit Condition
To control when a stage completes, select an exit condition.

Stage Exit Condition Requires


When all steps have been marked Complete, the stage is marked
Complete

When the specified evaluation flow returns True, the stage is The name of the evaluation flow that determines when a stage
marked Complete completes.

Automatic Output
An orchestration has access to a stage’s status.

Status
When an orchestration is running, it manages the status for each stage. Because stages run sequentially and have no entry conditions,
they only have a status after they’re in progress.

Stage Status Description


In Progress • The stage started.
• The stage was in progress when an interactive step within the
orchestration encountered an error.
• The stage was in progress when a screen flow associated with
an interactive step within the stage encountered an error.

Completed • The stage met its exit condition, and the orchestration
completed.
• The stage completed, and the orchestration was canceled.

Canceled The stage was in progress when the orchestration was canceled.

508
Automate Your Business Processes Orchestrator Concepts

Stage Status Description


Discontinued • The stage was completed when the orchestration encountered
an error.
• The stage was in progress when the orchestration encountered
an error.

Error • The stage encountered an error.


• A background step within the stage encountered an error.
• An autolaunched flow called by a background step within the
stage encountered an error.

History
In history, an orchestration stage has several possible milestones.

Stage Milestone Description


Start Stage The stage started.

End Stage The stage completed.

Discontinue Stage • The orchestration encountered an error after the stage was
completed.
• The orchestration encountered an error while the stage was
in progress.

Fail Stage • The stage encountered an error.


• A background step within the stage encountered an error.
• An autolaunched flow called by a background step within the
stage encountered an error.

Orchestration Steps
Steps are grouped in stages and can be run sequentially or concurrently. Interactive steps require
EDITIONS
user intervention. Background steps require no user interaction.

Note: The Step resource in Orchestrator isn’t related to the discontinued Step element in Available in: both Salesforce
Salesforce Flow. Classic and Lightning
Experience

Background Step Available in: Enterprise,


Performance, Unlimited,
A background step launches an autolaunched flow and requires no user interaction. You can control and Developer Editions
when a background step is ready to start.
This feature is supported in
Government Cloud and
Government Cloud Plus.

509
Automate Your Business Processes Orchestrator Concepts

Asynchronous Background Step


By default, background steps are processed synchronously. When you select Contains external callouts or pause elements, a
background step is processed asynchronously. Use an asynchronous background step when the background step calls an autolaunched
flow that contains a Pause element or an external callout.

Interactive Step
An interactive step requires user interaction. When the orchestration is designed, an interactive step is assigned to a user, group, or
queue. At run time, the assigned user or a user from the assigned group or queue completes the associated screen flow on a specified
record page. You can control both when an interactive step is ready to start and when it’s considered complete.

Entry Condition
To control when a background or interactive step starts, select an entry condition.

Step Entry Condition Requires


When the stage starts, the step starts

When another step is marked Complete, the step starts The name of the step that must be completed before the current
step can start.

510
Automate Your Business Processes Orchestrator Concepts

Step Entry Condition Requires


When the specified evaluation flow returns True, the step starts The name of the evaluation flow that determines whether a step
can start.

Exit Condition
To control when an interactive step completes, select an exit condition.

Step Exit Condition Requires


When the assigned user has completed the screen flow, the step
is marked Complete

When the specified evaluation flow returns True, the step is marked The name of the evaluation flow that determines when an
Complete interactive step completes.

Automatic Output
An orchestration has access to a step’s status and output variables from each step’s associated flow.

Note: To allow an orchestration access to a user-defined output variable in a flow called by a step, mark it as Available for output
in the flow.

Note: An orchestration uses the isOrchestrationConditionMet output variable in evaluation flows. All other user-defined output
variable values are discarded.

Status
When an orchestration is running, it manages the status for each step.

Step Status Description


Not Started The step hasn’t met its entry condition.

In Progress • The step started.


• The step was in progress when its associated stage
encountered an error.
• The screen flow associated with the interactive step
encountered an error.

Completed • The interactive step met its exit condition.


• The background step’s flow completed.
• The step completed when its associated stage encountered
an error.

Discontinued • The step was in progress when its associated stage completed.
• The step was completed when the orchestration encountered
an error.

511
Automate Your Business Processes Orchestrator Concepts

Step Status Description

• The step was in progress when the orchestration encountered


an error.
• The step was in progress when its associated stage
encountered an error.

Error • The step encountered an error.


• The autolaunched flow associated with a background step
encountered an error.

History
In history, a step in an orchestration has several possible milestones.

Step Milestone Description


Start Step The step started.

End Step The step completed.

Discontinue Step • The step’s stage completed while the step was in progress.
• The orchestration encountered an error after the step was
completed.
• The orchestration encountered an error while the step was in
progress.
• The step’s stage encountered an error while the step was in
progress.

Fail Step The step encountered an error.

Flows in Orchestrations
Every step in an orchestration runs an associated flow. You can use an evaluation flow to set custom
EDITIONS
criteria for starting a step or to mark an interactive step or stage complete.
Background Steps Available in: both Salesforce
Each background step calls an autolaunched flow. Classic and Lightning
Experience
Interactive Steps
Each interactive step assigns a screen flow to a user, group, or queue. Available in: Enterprise,
Entry Conditions Performance, Unlimited,
and Developer Editions
Each step can call an evaluation flow to determine whether the step can be started. An evaluation
flow is a flow with a process type of Evaluation Flow. It’s an autolaunched flow that contains a This feature is supported in
predefined Boolean output variable named isOrchestrationConditionMet. To Government Cloud and
indicate that the custom entry conditions are met, the output variable must be set to true. Government Cloud Plus.

Note: The Boolean isOrchestrationConditionMet variable defined in an


evaluation flow must be initialized to false.

512
Automate Your Business Processes Orchestrator Concepts

Note: Previously, you could select any autolaunched flow that used the isOrchestrationConditionMet variable
to evaluate custom entry or exit criteria. An orchestration that uses this type of autolaunched flows for evaluation criteria is
unaffected by this change until you update it. New orchestrations and existing orchestrations that you update can use only
flows with a process type of Evaluation Flow.
Exit Conditions
An interactive step can call an evaluation flow to determine whether the step can be considered complete. An evaluation flow is a
flow with a process type of Evaluation Flow. It’s an autolaunched flow that contains a predefined Boolean output variable named
isOrchestrationConditionMet. To indicate that the custom exit conditions are met, the output variable must be set to
true.

Note: The Boolean isOrchestrationConditionMet variable defined in an evaluation flow must be initialized to
false.

Note: Previously, you could select any autolaunched flow that used the isOrchestrationConditionMet variable
to evaluate custom entry or exit conditions. An orchestration that uses this type of autolaunched flow for evaluation conditions
is unaffected by this change until you update it. New orchestrations and existing orchestrations that you update can use only
flows with a process type of Evaluation Flow.
Flow Variables
Flows can have internal-only, input, and output variables.

Variable Description Notes


Internal-only The variable is used inside the flow and You can create your own internal variables,
isn’t available for input or output in an or you can let flow create them for you.
orchestration. Orchestrations can’t use these variables.

Input The user-defined variable is marked Flows that can require input values from
Available for input. When the flow is called an orchestration for input variables are:
by an orchestration step, its input variables • Autolaunched flows
are required inputs for the step.
• Screen flows
• Evaluation flows

Output The user-defined variable is marked Orchestrations can access user-defined


Available for output. Output variables are output variables from:
accessible as automatic outputs for the • Autolaunched flows
associated step and are available
• Screen flows
throughout the orchestration.

Evaluation Flows in Orchestrations


Use evaluation flows to evaluate custom entry criteria for steps and custom exit criteria for stages and interactive steps. Select the
Evaluation Flow tile in the New Flow window to create an evaluation flow.

SEE ALSO:
Flow Types
Flows

513
Automate Your Business Processes Orchestrator Concepts

Evaluation Flows in Orchestrations


Use evaluation flows to evaluate custom entry criteria for steps and custom exit criteria for stages
EDITIONS
and interactive steps. Select the Evaluation Flow tile in the New Flow window to create an evaluation
flow. Available in: both Salesforce
Classic and Lightning
Variables in Evaluation Flows Experience

When you select the Evaluation Flow tile in the New Flow window, you create an autolaunched Available in: Enterprise,
flow that contains a predefined Boolean output variable named Performance, Unlimited,
isOrchestrationConditionMet. and Developer Editions

Initialize isOrchestrationConditionMet to false, and to indicate that the custom This feature is supported in
conditions are met, set isOrchestrationConditionMet to true. Government Cloud and
Government Cloud Plus.
Note: Previously, you could select any autolaunched flow that used the
isOrchestrationConditionMet variable to evaluate custom entry or exit conditions.
An orchestration that uses this type of autolaunched flow for evaluation conditions is
unaffected by this change until you update it. New orchestrations and existing orchestrations
that you update can use only flows with a process type of Evaluation Flow.
Evaluation flows only return a value for isOrchestrationConditionMet. Values for any other output variables are discarded.

Evaluation Flow Execution


Every time a step within the current stage completes, conditions for that stage and its steps are evaluated. The status of each stage or
step determines whether an evaluation flow associated with a specific condition is run.
• In progress stage: exit condition is evaluated.
• Each not started step within the current stage: entry condition is evaluated.
• Each in progress interactive step within the current stage: exit condition is evaluated.

Orchestration Work Items


When an interactive step in an orchestration runs, it creates a work item and assigns it to a user,
EDITIONS
group, or queue. The orchestration then sends an email with a link to the specified record page to
all assigned users. They complete the work in the Orchestrator Work Guide component on the Available in: both Salesforce
specified record page. Classic and Lightning
An interactive step is associated with a screen flow to be completed by an assigned user on a Experience
specified record page. Before the orchestration runs, the admin places the Orchestrator Work Guide
Available in: Enterprise,
component on the specified record page layout in Lightning App Builder. Performance, Unlimited,
and Developer Editions
Work Assigned to a User This feature is supported in
When an interactive step runs, the orchestration creates a work item and assigns it to the specified Government Cloud and
user. The assigned user receives an email with a link to the related record page, notifying them that Government Cloud Plus.
they have an action item to complete. When the user clicks the link in the email, they complete the
screen flow in the work guide on the record page.

514
Automate Your Business Processes Orchestrator Concepts

Work Assigned to a Group or Queue


When the interactive step runs, the orchestration creates a work item and assigns it to the specified group or queue. All users in the
assigned group or queue receive an email with a link to the related record page, notifying them that they have an action to complete.
When a user clicks the link in the email and the work item opens, they can run the screen flow in the work guide on the record page.
The work item is completed by the first user to complete the screen flow. If two users execute the screen flow simultaneously, the user
who completes the flow second receives an error. After the work item is completed, other users from the assigned group or queue that
follow the link see no related work in the Work Guide component on the related record page.

Work Items Reassigned to a User, Group, or Queue


You can reassign open work items for a running orchestration to a different user, group, or queue. After reassignment, a work item is
processed like it was after the running orchestration created it.

Work Item Statuses

Work Item Status Description


Assigned • The work item has been created, but the assigned user hasn’t
completed it, and the orchestration is in progress.
• The work item has been reassigned to a different user, and the
orchestration is in progress.
• The assigned user hasn’t completed the work item, and the
orchestration was canceled.
• The assigned user completed the work item, and the
orchestration was canceled.
• The assigned user hasn’t completed the work item, and the
orchestration encountered an error.
• The assigned user hasn’t completed the work item, and the
screen flow associated with the work item’s interactive step
encountered an error.

Completed • The assigned user completed the work item, and the
orchestration completed.
• The assigned user hasn’t completed the work item, and the
stage that contains its associated step completed.
• The assigned user has completed the work item, and the
orchestration was canceled.
• The assigned user has completed the work item, and the
orchestration encountered an error.
• The assigned user has completed the work item, and the stage
that contains its associated step encountered an error.
• The assigned user hasn’t completed the work item, and the
stage that contains its associated step encountered an error.

515
Automate Your Business Processes Orchestrator Concepts

Anatomy of an Orchestration
Combine elements, connectors, and resources to build orchestrations.
EDITIONS

Available in: both Salesforce


Classic and Lightning
Experience

Available in: Enterprise,


Performance, Unlimited,
and Developer Editions

This feature is supported in


Government Cloud and
Government Cloud Plus.

• Each element (1) represents an action that the flow can execute. Orchestrations use Stage and Decision elements.
• Each connector (2) defines an available path that the orchestration can take at run time.
• Each stage consists of one or more steps (3).
• Each resource (4) represents a value that you can reference through a stage, step, or decision.

Orchestration Types
An orchestration’s type determines how the orchestration can be distributed.
EDITIONS
All orchestrations are made up of steps grouped within a series of stages. Interactive steps contain
a screen flow and require user interaction. Background steps contain an autolaunched flow and Available in: both Salesforce
don’t require user interaction. An orchestration’s type affects how an orchestration is launched. Classic and Lightning
Experience
Orchestration Type Available Distribution Methods Available in: Enterprise,
Autolaunched Orchestration (No Trigger) Performance, Unlimited,
• Custom Apex classes and Developer Editions
• Custom buttons or custom links
This feature is supported in
Record-triggered Orchestration A record-triggered flow orchestration only runs Government Cloud and
Government Cloud Plus.
when a record is created or updated.

516
Automate Your Business Processes Orchestrator Concepts

Triggers for Orchestrations


Creating or updating a record can trigger an orchestration that requires additional input from users,
EDITIONS
approval from assigned users, other updates to the record, or changes to related records. In the
Start element of a record-triggered orchestration, you can specify new and changed records of a Available in: both Salesforce
specific object. Autolaunched orchestrations don’t use triggers. Use another mechanism to launch Classic and Lightning
an autolaunched orchestration, such as custom Apex classes or custom URLs. Use Orchestrator to Experience
automate complex processes, and use Flow Trigger Explorer to order record-triggered flows.
Available in: Enterprise,
In Orchestrator, the trigger occurs after a record is saved. Performance, Unlimited,
and Developer Editions
What’s the Difference Between Salesforce Flow and This feature is supported in
Orchestrator? Government Cloud and
Government Cloud Plus.
Salesforce offers several features that automate internal procedures and business processes to save
time across your org.
Flow
A flow is an application that automates a business process by collecting data and doing something in your Salesforce org or an
external system. Flows can provide screens to guide users through your business process.
Flows aren’t tied to any one object, but they are record-centric. They can look up, create, update, and delete records for multiple
objects. You build flows using Flow Builder, which is a point-and-click tool.
Orchestration
An orchestration is an application that builds sophisticated business processes by combining and coordinating a series of flows.
Orchestrations are user-centric. You can manage processes that involve different users and different parts of your organization
through one orchestration. Orchestrator allows you to monitor operations and improve efficiency.

SEE ALSO:
What's the Difference Between Workflow Rules and Flows?

Advanced Orchestration Concepts


After you understand the basics, you’re ready for a closer look at the context in which orchestrations run and how they perform work
items at the same time.

Running User of an Orchestration


The running user determines what an orchestration can do with Salesforce data. In Orchestrator, the running user of an orchestration
depends on how an orchestration is invoked.

517
Automate Your Business Processes Build an Orchestration

Running User of an Orchestration


The running user determines what an orchestration can do with Salesforce data. In Orchestrator,
EDITIONS
the running user of an orchestration depends on how an orchestration is invoked.
The running user for an orchestration depends on the type of the orchestration. Available in: both Salesforce
Classic and Lightning
Autolaunched Orchestration
Experience
Initially, the running user is the user who launched the orchestration. If the orchestration is
launched from Apex, it sometimes runs in a system context. In both cases, after the orchestration Available in: Enterprise,
runs each interactive step, the running user becomes the user who completed the associated Performance, Unlimited,
work item. and Developer Editions
Record-Triggered Orchestration This feature is supported in
Initially, a record-triggered orchestration runs in system context. After the orchestration runs Government Cloud and
each interactive step, the running user becomes the user who published the associated Government Cloud Plus.
FlowOrchestrationEvent.

Build an Orchestration
Orchestrator allows you to build sophisticated business processes by combining and coordinating
EDITIONS
flows.
Available in: both Salesforce
User Permissions Needed Classic and Lightning
To open, edit, or create an orchestration in Flow Manage Flow Experience
Builder: Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
Before you create your orchestration, plan it out. It’s much easier to use an orchestration to automate
This feature is supported in
a business process when you understand all the details, such as the flows required to complete
Government Cloud and
each step.
Government Cloud Plus.
Steps and stages rely on flows to run. Create those flows before you build your orchestration.
1. Open Flow Builder. From Setup, in the Quick Find box, enter Flows, select Flows, and then
click New Flow.
2. Click All + Templates, select Orchestrator from the list, select the orchestration type, and then click Next.
3. (Optional) To configure the Start element for a record-triggered orchestration, click Edit.
4.
To add an element, click between the Start element and the End element, and then select an element.
5. To add steps to a stage, click Add Step.
6.
To create a loop or connect to a different element, click following the stage, click Connect to element, and then click on
the desired element.
7. Save your orchestration.
After you build an orchestration, activate it, and then test it to make sure that it’s working as you expect. You’re then ready to use it.

Define Conditions in an Orchestration


Control when an orchestration takes a specific decision outcome.

518
Automate Your Business Processes Build an Orchestration

Assign an Interactive Step in an Orchestration


When you create an interactive step, you assign it to a user, group, or queue. You can also assign an interactive step to a resource
that contains a username, group API name, or queue API name when the orchestration runs. When the screen flow associated with
the interactive step runs, an assigned user completes the flow on the related context record.
Route an Orchestration
Orchestrator uses Auto-Layout in Flow Builder. In Auto-Layout, elements on the canvas are spaced and connected automatically.
Use Go To connectors when you have elements that don't follow the usual consecutive auto-layout paths.
Use Automatic Output in Orchestrations
An orchestration has access to output for its stages, steps, and decisions. Query the status of any stage or step in the orchestration.
Use output parameters from any step’s associated flow.
Integrate an Orchestration with External Systems
Use the $Orchestration.Instance system variable to integrate external systems with your orchestration.
Add the Work Guide to a Record Page Layout
Add Orchestrator’s Lightning App Builder component to the page layouts for record types referenced by interactive steps.

Define Conditions in an Orchestration


Control when an orchestration takes a specific decision outcome.
EDITIONS
User Permissions Needed Available in: both Salesforce
To open, edit, or create an orchestration in Flow Manage Flow Classic and Lightning
Builder: Experience

Available in: Enterprise,


Performance, Unlimited,
Before you begin, add the Decision element to your orchestration. and Developer Editions
1. Set up the conditions. This feature is supported in
At run time, the conditions are evaluated in the order you specify. Government Cloud and
Government Cloud Plus.
Option Behavior for Decision
Outcomes
All Conditions Are If one of the conditions is
Met false, the orchestration
evaluates the next outcome’s
conditions.

Any Condition Is If one of the conditions is true,


Met the orchestration immediately
takes this outcome’s path.

Custom Condition When you select this option, provide the condition logic by
Logic Is Met entering up to 1000 characters. Use:
• Numbers to refer to each condition
• AND, OR, or NOT to identify which combination of
conditions must be true
• Parentheses to group parts of the string together

519
Automate Your Business Processes Build an Orchestration

Option Behavior for Decision Outcomes

Tip: If you enter AND, it’s the same as if you selected All Conditions Are Met.
If you enter OR, it’s the same as if you selected Any Condition Is Met. If you
enter any other logic, make sure that you include a number for each condition.
For example, for 1 AND NOT(2 OR 3), the flow evaluates whether the first
condition is true and neither the second nor third condition is true.

2. Identify the logic between the conditions.

Column Header Description


Resource Options:
• Select an input variable or automatic output from a stage or step.
• Select a Decision element.
• Select a global variable.

Operator The available operators depend on the data type selected for Resource. For details, see
Orchestrator Operators in Decision Elements.

Value Resource and Value in the same row must have compatible data types.
Options:
• Select an orchestration resource, such as an input variable or automatic output from a stage
or step.
• Select a global variable.
• Manually enter a literal value.

Note: When you add or subtract a number from a date value, the date adjusts in days, not
hours.

520
Automate Your Business Processes Build an Orchestration

Assign an Interactive Step in an Orchestration


When you create an interactive step, you assign it to a user, group, or queue. You can also assign
EDITIONS
an interactive step to a resource that contains a username, group API name, or queue API name
when the orchestration runs. When the screen flow associated with the interactive step runs, an Available in: both Salesforce
assigned user completes the flow on the related context record. Classic and Lightning
Experience
User Permissions Needed
Available in: Enterprise,
To open, edit, or create an orchestration in Flow Manage Flow Performance, Unlimited,
Builder: and Developer Editions

This feature is supported in


Government Cloud and
Public groups are groups with a type of Regular. Queues are groups with a type of Queue.
Government Cloud Plus.
For a user to complete an interactive step, they must have access to the associated internal Salesforce
Lightning record page. The User field for an interactive step’s assigned user includes Experience
site users. Don’t assign work to Experience site users because they generally don’t have access to internal record pages, and they can’t
complete orchestration work items.
1. For an interactive step, under Specify Assigned User, select an assignment type.
a. To specify a user, select User.
b. To specify a regular public group, select Group.
c. To specify a group that’s a queue, select Queue.
d. To specify a resource that contains a user’s username when the orchestration runs, select User Resource.
e. To specify a resource that contains a group’s API name when the orchestration runs, select Group Resource.
f. To specify a resource that contains a queue’s API name when the orchestration runs, select Queue Resource.

2. Specify the assigned user, group, or queue.


a. If you selected User, search for a user’s name, and select it from the list.
b. If you selected Group, search for a group’s label, and select it from the list.
c. If you selected Queue, search for a queue’s label, and select it from the list.
d. If you selected User Resource, specify the API name of the variable that contains the assigned user’s username when the
orchestration runs.

Note: Don’t select $User for User Resource. The $User global variable evaluates to the system user when the orchestration
is running in system context and an interactive step can’t be assigned to the system user.

e. If you selected Group Resource, specify the API name of the variable that contains the group API name when the orchestration
runs.
f. If you selected Queue Resource, specify the API name of the variable that contains the assigned queue’s API name when the
orchestration runs.

SEE ALSO:
Running User of an Orchestration

521
Automate Your Business Processes Build an Orchestration

Route an Orchestration
Orchestrator uses Auto-Layout in Flow Builder. In Auto-Layout, elements on the canvas are spaced
EDITIONS
and connected automatically. Use Go To connectors when you have elements that don't follow
the usual consecutive auto-layout paths. Available in: both Salesforce
Classic and Lightning
User Permissions Needed Experience
To open, edit, or create an orchestration in Flow Manage Flow Available in: Enterprise,
Builder: Performance, Unlimited,
and Developer Editions

This feature is supported in


To add a Go To connector, you must have at least two elements in your orchestration.
Government Cloud and
1. Government Cloud Plus.
Click directly following the element that you want to change the connector for.
2. Click Connect to element.
3. Click on the element that you want to connect to.
The original element now has a dotted line connection to the specified element.

Remove Connectors from an Orchestration


All elements in an orchestration are connected automatically or connected by Go To connectors that you add manually. To finish a
path in your orchestration, add an End element.

Remove Connectors from an Orchestration


All elements in an orchestration are connected automatically or connected by Go To connectors
EDITIONS
that you add manually. To finish a path in your orchestration, add an End element.
To add an End element, you must have at least one Decision element and two paths in your Available in: both Salesforce
orchestration. Classic and Lightning
Experience
1.
Click where you want to add the End element.
Available in: Enterprise,
2. Select End. Performance, Unlimited,
The path now ends execution when this element is reached. and Developer Editions

This feature is supported in


Government Cloud and
Government Cloud Plus.

522
Automate Your Business Processes Build an Orchestration

Use Automatic Output in Orchestrations


An orchestration has access to output for its stages, steps, and decisions. Query the status of any
EDITIONS
stage or step in the orchestration. Use output parameters from any step’s associated flow.
Available in: both Salesforce
User Permissions Needed Classic and Lightning
To open, edit, or create an orchestration in Flow Manage Flow Experience
Builder: Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
Add an element or resource to your orchestration.
This feature is supported in
When you build an orchestration, automatic outputs for every stage and step in that orchestration Government Cloud and
are universally available. This universal availability means that you can potentially use automatic Government Cloud Plus.
output in your designed orchestration before it’s available in an orchestration run. So, when using
automatic output, consider the order in which an orchestration executes its elements and resources.
1. In a resource, value, or input parameter field, select a stage or step from the dropdown list.
2. Select the automatic output field from the dropdown list.
3. Save your work.

Integrate an Orchestration with External Systems


Use the $Orchestration.Instance system variable to integrate external systems with your orchestration.

Publish an Orchestration Event


To allow an external system to make a paused orchestration evaluate its stage and step conditions, publish an orchestration event
from a record-triggered orchestration.

Publish an Orchestration Event


To allow an external system to make a paused orchestration evaluate its stage and step conditions,
EDITIONS
publish an orchestration event from a record-triggered orchestration.
Available in: both Salesforce
User Permissions Needed Classic and Lightning
To open, edit, or create an orchestration in Flow Manage Flow Experience
Builder: Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
Add a custom field to the object to hold an orchestration run ID.
This feature is supported in
Create an autolaunched flow with an input variable that accepts an orchestration run ID and passes Government Cloud and
it to the action that invokes an external system. Government Cloud Plus.
Add logic at the end of the action invoking the external system. After the external system finishes
its task, it must update the custom orchestration run ID field on the affected record with the
orchestration run ID it was passed.
Call the autolaunched flow from an asynchronous background step in an orchestration, and pass $Orchestration.Instance to the appropriate
input parameter.

523
Automate Your Business Processes Build an Orchestration

1. Create a record-triggered flow that runs when the custom orchestrator run ID field is updated on a record. If you have records of
more than one object affected by an external system, create a record-triggered flow for each object.
2. Add a Create Records element to the record-triggered flow.
3. Enter a label, API name, and description for the element.
4. Select Use separate resources, and literal values.
5. For Object, enter Orchestration, and then select Orchestration Event.
6. For Object, enter Orchestration, and then select Orchestration Event.
7. For Field, enter Orchestration, and then select OrchestrationInstanceId.
8. For Value, enter $Record, and then select $Record. Then select the name of the custom orchestration run ID field on the triggering
record.
9. Click Done.
10. Save and activate the new record-triggered flow.

SEE ALSO:
Extend Salesforce with Clicks, Not Code : Create Custom Fields
Automate Your Business Processes : Flow Resource: Variable

Add the Work Guide to a Record Page Layout


Add Orchestrator’s Lightning App Builder component to the page layouts for record types referenced
EDITIONS
by interactive steps.
1. To add the component to an existing page layout, on a page for a record type associated with Available in: both Salesforce
Classic and Lightning
an interactive step, click , and then select Edit Page. Experience
2. To create a new page layout for a record type associated with an interactive step, from Setup,
Available in: Enterprise,
in the Quick Find box, enter App Builder, and then select Lightning App Builder.
Performance, Unlimited,
a. Click New and Developer Editions
b. Select Record Page, and then click Next. This feature is supported in
c. Give your record page a label, and then click Next. Government Cloud and
Government Cloud Plus.
The label can be up to 80 characters.

d. Select a page template, and click Finish.


USER PERMISSIONS
3. Under Components, drag Orchestrator Work Guide onto the page layout.
To create and save Lightning
If this is a new page layout, add other desired components. pages in the Lightning App
Builder:
4. Save your work. • Customize Application
5. If the page layout isn’t already activated, the Page Saved window appears and asks if you want To view Lightning pages in
to activate the page. the Lightning App Builder:
Activate your orchestration. • View Setup and
Configuration

524
Automate Your Business Processes Deploy an Orchestration

Deploy an Orchestration
After you design and test your orchestration, it’s time to put it to work!

Set Up an Org-Wide Email Address


To receive emails from Orchestrator, create an org-wide email address.
Activate or Deactivate an Orchestration
You can have multiple versions of an orchestration in Salesforce, but only one version of each orchestration can be active at a time.
You can activate or deactivate an orchestration in Flow Builder or from the flow’s detail page in Setup.
Deploy Orchestrations with Change Sets
Create, test, and debug your orchestrations in a sandbox. Use a change set to send the orchestration and its associated flows to
production when you’re ready to deploy.

Set Up an Org-Wide Email Address


To receive emails from Orchestrator, create an org-wide email address.
EDITIONS
The email address you set up in this step acts as the From address in your emails from Orchestrator.
If you don’t have a From address, your notification emails don’t send. Available in: both Salesforce
Classic and Lightning
Note: If you have an existing org-wide email address, you don’t have to set up a new one, Experience
but make sure you’ve specified it as your Email Approval Sender in Process Automation
Settings in Setup. Available in: Enterprise,
Performance, Unlimited,
1. From Setup, in the Quick Find box, enter Email, and select Organization-Wide Address. and Developer Editions
2. Select Add.
This feature is supported in
3. Fill in the Organization-wide address form. Government Cloud and
a. For Display Name, enter a name that labels your org-wide address. Government Cloud Plus.

b. For Email Address, enter a company email address that can be used as the From Address
in your email alert.
c. Select Allow All Profiles to Use this From Address.
d. Save your work.

4. View your org-wide address and the status, which reads Verification Request Sent.
5. Navigate to the email address you specified in the Email Address field.
6. When Salesforce sends an email to the company address you entered previously, approve and verify the company email address.
7. Navigate back to Salesforce, and check to make sure that the status of your address is Verified.
8. From Setup, in the Quick Find box, enter automation settings, and then select Process Automation Settings..
9. For Email Approval Sender, specify your org-wide email address.
10. Save your changes.
Activate your orchestration.

525
Automate Your Business Processes Deploy an Orchestration

Activate or Deactivate an Orchestration


You can have multiple versions of an orchestration in Salesforce, but only one version of each
EDITIONS
orchestration can be active at a time. You can activate or deactivate an orchestration in Flow Builder
or from the flow’s detail page in Setup. Available in: both Salesforce
When you activate an orchestration version, the previously activated version, if one exists, is Classic and Lightning
deactivated. Any running orchestration continues to run using the version that it started with. Experience

1. In Flow Builder, open the orchestration version. Available in: Enterprise,


2. On the button bar, click Activate or Deactivate. Performance, Unlimited,
and Developer Editions

This feature is supported in


Government Cloud and
Government Cloud Plus.

USER PERMISSIONS

To activate or deactivate an
orchestration:
• Manage Flow
To activate a
record-triggered
orchestration:
• View All Data

Deploy Orchestrations with Change Sets


Create, test, and debug your orchestrations in a sandbox. Use a change set to send the orchestration
EDITIONS
and its associated flows to production when you’re ready to deploy.
Available in: both Salesforce
User Permissions Needed Classic and Lightning
To create, edit, or view processes: Manage Flow Experience

AND Available in: Enterprise,


Performance, Unlimited,
View All Data
and Developer Editions

To edit deployment connections: Deploy Change Sets This feature is supported in


Government Cloud and
AND Government Cloud Plus.
Modify Metadata Through Metadata API
Functions

To use outbound change sets: Create and Upload Change Sets

To use inbound change sets: Deploy Change Sets AND Modify Metadata
Through Metadata API Functions

Create and upload the outbound change set in your sandbox, and deploy the inbound change set in production.

526
Automate Your Business Processes Orchestration Run

1. Ensure that all group names and queue names used in the source org to assign interactive steps to users duplicate the names used
in the target org.
2. Ensure that no interactive steps are directly assigned to a specific user.
a. Create constants for each assigned user who’s directly assigned to an interactive step in the orchestration.
b. Assign each interactive step to the appropriate assigned-user constant.

3. Activate your orchestration and all its referenced flows.


4. Create an outbound change set.
5. Add components to the new change set. These components include the orchestration, its associated flows, and any new custom
actions or new custom flow screen components that the associated flows depend on.
6. Upload your outbound change set.
7. Deploy your inbound change set in your target org.
8. Update any assigned-user constants in the orchestration, and save a new version of the orchestration.
9. Activate the new version of the orchestration.
Ensure that the page layouts for each context record referenced in the orchestration include the Orchestrator Work Guide Lightning
App Builder component.

SEE ALSO:
Sandboxes: Staging Environments for Customizing and Testing : Change Sets

Orchestration Run
An orchestration run is a running instance of an orchestration. An orchestration is an application
EDITIONS
built by your admin that uses stages and decisions to organize a complex business process.
After it’s created, an orchestration run has an associated status. Available in: both Salesforce
Classic and Lightning
Orchestration Run Status Description Experience

Not Started The orchestration hasn’t started. Available in: Enterprise,


Performance, Unlimited,
In Progress The orchestration started. and Developer Editions
Completed The orchestration completed. This feature is supported in
Government Cloud and
Canceled The orchestration was manually canceled.
Government Cloud Plus.
Error • The orchestration encountered an error.
• A stage within the orchestration
encountered an error.
• A step within the orchestration encountered
an error.
• The screen flow or autolaunched flow
associated with a step within the
orchestration encountered an error.

527
Automate Your Business Processes Manage Orchestrations and Work Items

In logging, an orchestration run has two milestones.

Orchestration Run Milestone Description


Start Run The orchestration started.

End Run The orchestration completed.

Cancel Run The orchestration was manually canceled.

Fail Run • The orchestrration encountered an error.


• A stage within the orchestration encountered an error.
• A step within the orchestration encountered an error.

Manage Orchestrations and Work Items


Manage orchestrations and work items with list views. Cancel running orchestrations and reassign
EDITIONS
work items that have been assigned, but not completed.
Available in: both Salesforce
View Orchestration Work Items Classic and Lightning
Use the All Work Items list view to see all work items. Use the All Open Orchestration Work Experience
Items list view to see all assigned but not completed work items. Assigned users can see and Available in: Enterprise,
access only their pending work items in the All Open Orchestration Work Items list view. Performance, Unlimited,
View Orchestration Runs and Developer Editions
Use the Orchestration Runs list view to see all in-progress, canceled, and completed orchestration This feature is supported in
runs in your org. Access orchestration details and history through the orchestration runs list Government Cloud and
view. Government Cloud Plus.
Reassign an Orchestration Work Item
Reassign an assigned work item to a different user, group, or queue.
Cancel a Running Orchestration
Cancel an in-progress orchestration from the orchestration runs list view.
Orchestration Statuses and Milestones
Each part of an orchestration has a status assigned when an orchestration runs.

528
Automate Your Business Processes Manage Orchestrations and Work Items

View Orchestration Work Items


Use the All Work Items list view to see all work items. Use the All Open Orchestration Work Items
EDITIONS
list view to see all assigned but not completed work items. Assigned users can see and access only
their pending work items in the All Open Orchestration Work Items list view. Available in: both Salesforce
1. In the App Launcher, find and select Orchestration Work Items. Classic and Lightning
Experience
2. To see assigned and completed orchestration work items, from the dropdown list, select All
Work Items. Available in: Enterprise,
3. To see assigned orchestration work items, from the dropdown list, select All Open Work Items. Performance, Unlimited,
and Developer Editions
4. To see an assigned work item on its associated record page, click the assigned work item record
in the list view. This feature is supported in
Government Cloud and
Note: Only the assigned user or a member of the assigned group or queue can see an Government Cloud Plus.
assigned work item on its associated record page.

USER PERMISSIONS

To view all orchestration


work items:
• Manage Flow

View Orchestration Runs


Use the Orchestration Runs list view to see all in-progress, canceled, and completed orchestration
EDITIONS
runs in your org. Access orchestration details and history through the orchestration runs list view.
1. In the App Launcher, find and select Orchestration Runs. Available in: both Salesforce
Classic and Lightning
Experience

Available in: Enterprise,


Performance, Unlimited,
and Developer Editions

This feature is supported in


Government Cloud and
Government Cloud Plus.

USER PERMISSIONS

To view orchestration runs:


• Manage Flows

2. To see details for a specific orchestration run, on the All Orchestration Runs list view, click the
link for an orchestration, and then click the Related tab.

529
Automate Your Business Processes Manage Orchestrations and Work Items

3. To see the full orchestration run history, under Orchestration Run History, click View All.

Reassign an Orchestration Work Item


Reassign an assigned work item to a different user, group, or queue.
EDITIONS
You can reassign an assigned work item for an orchestration that’s still in progress.
Available in: both Salesforce
1. In the App Launcher, find and select Orchestration Work Items.
Classic and Lightning
2. On the All Open Work Items page, from the dropdown for the assigned work item, select Experience
Reassign Orchestration Work Item.
Available in: Enterprise,
3. In the Reassign Orchestration Work Item window, select the user, group, or queue to reassign Performance, Unlimited,
the work item to. and Developer Editions
4. Click Reassign Orchestration Work Item.
This feature is supported in
Government Cloud and
Government Cloud Plus.

USER PERMISSIONS

To reassign a work item


• Manage Flow

530
Automate Your Business Processes Manage Orchestrations and Work Items

Cancel a Running Orchestration


Cancel an in-progress orchestration from the orchestration runs list view.
EDITIONS
You can only cancel an in-progress orchestration.
Available in: both Salesforce
1. In the App Launcher, find and select Orchestration Runs.
Classic and Lightning
2. On the Orchestration Runs page, from the dropdown for the in-progress orchestration, select Experience
Cancel Orchestration.
Available in: Enterprise,
3. Click Cancel Orchestration. Performance, Unlimited,
and Developer Editions

This feature is supported in


Government Cloud and
Government Cloud Plus.

USER PERMISSIONS

To cancel a running
orchestration:
• Manage Flow

Orchestration Statuses and Milestones


Each part of an orchestration has a status assigned when an orchestration runs.
EDITIONS

Orchestration Details Available in: both Salesforce


Classic and Lightning
The orchestration details page gives the status of an orchestration that’s currently running. Experience

Available in: Enterprise,


Orchestration Status Performance, Unlimited,
When an orchestration runs, it can complete, it can be canceled, it can end due to an error with a and Developer Editions
flow, or it can remain in progress. Orchestration stages, steps, and work items statuses are This feature is supported in
situation-dependent. Government Cloud and
Government Cloud Plus.
Table 1: Orchestration Completed
Object Status
Orchestration Run Completed

Completed Stages Completed

Completed Steps Completed

Running Steps Discontinued

Not Started Steps Not Started

Completed Work Items Completed

Not Started Work Items Completed

531
Automate Your Business Processes Manage Orchestrations and Work Items

Table 2: Orchestration Canceled


Object Status
Orchestration Run Canceled

Completed Stages Completed

Running Stage Canceled

Completed Steps Completed

Running Steps in the Running Stage Canceled

Not Started Steps Not Started

Completed Work Items Completed

Not Started Work Items Completed

Table 3: Orchestration Stopped by Orchestration Error


Object Status
Orchestration Run Error

Running Stage Discontinued

Running Steps Discontinued

Not Started Steps Not Started

Completed Work Items Completed

Not Started Work Items Assigned

Table 4: Orchestration Stopped by Stage Error


Object Status
Orchestration Run Error

Failed Stage Error

Completed Stages Completed

Completed Steps Completed

Running Steps Discontinued

Not Started Steps Not Started

Completed Work Items Completed

Not Started Work Items Completed

532
Automate Your Business Processes Manage Orchestrations and Work Items

Table 5: Orchestration Stopped by Interactive Step Error


Object Status
Orchestration Run Error

Completed Stages Completed

Running Stage Error

Failed Step Error

Completed Steps Completed

Running Steps Discontinued

Not Started Steps Not Started

Completed Work Items Completed

Not Started Work Items Assigned

Note: These statuses apply when the interactive step fails. When the screen flow associated with the interactive step fails, the
status for running stage and failed step is In Progress and the status for not started work items is Assigned.

Table 6: Orchestration Stopped by Background Step Error


Object Status
Orchestration Run Error

Completed Stages Completed

Running Stage Error

Failed Step Error

Completed Steps Completed

Running Steps Discontinued

Not Started Steps Not Started

Completed Work Items Completed

Not Started Work Items Completed

Orchestration Run Milestones


When an orchestration runs, it logs milestones to the orchestration history.

Orchestration Run Milestone Description


Start Run The orchestration started.

End Run The orchestration completed.

Cancel Run The orchestration was manually canceled.

533
Automate Your Business Processes Troubleshoot Orchestrations

Orchestration Run Milestone Description


Fail Run • The orchestrration encountered an error.
• A stage within the orchestration encountered an error.
• A step within the orchestration encountered an error.

Troubleshoot Orchestrations
To troubleshoot a failed orchestration run, use the orchestration fault email. To test an orchestration
EDITIONS
and observe what happens as it runs, use the debug option.
Available in: both Salesforce
Emails about Orchestration Errors Classic and Lightning
When an orchestration run fails, Salesforce sends an error email. The email is sent to either the Experience
admin who last modified the associated orchestration or the Apex exception email recipients. Available in: Enterprise,
Debug an Orchestration Performance, Unlimited,
You can view debug information for in-progress and failed orchestrations. and Developer Editions

This feature is supported in


Government Cloud and
Government Cloud Plus.

Emails about Orchestration Errors


When an orchestration run fails, Salesforce sends an error email. The email is sent to either the
EDITIONS
admin who last modified the associated orchestration or the Apex exception email recipients.
The email includes the error message with details about the: Available in: both Salesforce
Classic and Lightning
• Orchestration
Experience
• Executed orchestration elements
Available in: Enterprise,
• Flows called from orchestration steps
Performance, Unlimited,
For activated orchestrations, the error email also has a link to show the failed orchestration run and Developer Editions
details in Flow Builder.
This feature is supported in
If an orchestration fails because of a flow it calls, then the recipients receive an error email for the Government Cloud and
orchestration failure and an error email for the flow failure. Government Cloud Plus.
Example:
Error element Stage_1 (FlowOrchestratedStage).
An error occurred when executing a flow interview.

Flow Details
Flow API Name: Create_Customer_Record
Type: Orchestrator
Version: 1
Status: Inactive
Org: signup.org.test.1640285093849 (00DRM000000G0SV)

Flow Interview Details

534
Automate Your Business Processes Troubleshoot Orchestrations

Interview Label: Create New Customer 2/11/2022, 1:57 PM


Interview GUID: 1fb36a45416070aa772cba20517eea2a1236-7f18
Current User: Test User (005RM0000025zTa)
Start time: 2/11/2022, 1:57 PM
Duration: 3 seconds

How the Interview Started


Orchestration Run ID: 0jERM0000004CQT
Test User (005RM0000025zTa) started the flow interview.
API Version for Running the Flow: 54

ENTER STAGE: Stage 1


ID: 0jFRM0000004CQY
Status: Error

BACKGROUND STEP: Create Account for New Customer


ID: 0jLRM0000004Cfd
Status: Error
Entry Condition:
When the stage starts, the step starts = true
Flow (Create_Account_for_New_Customer)
Inputs:
None.
Outputs:
None.

Error Occurred: An error occurred when executing a flow interview.

Salesforce Error ID: 904995012-1848 (1749972898)

Debug an Orchestration
You can view debug information for in-progress and failed orchestrations.
EDITIONS

How Does Debugging Work for Orchestrations? Available in: both Salesforce
Classic and Lightning
View debug details in Flow Builder for only in-progress and failed orchestrations that are activated. Experience
View debug details in error emails for failed flows.
Available in: Enterprise,
Note: When an orchestration fails, it doesn’t necessarily roll back record additions, changes, Performance, Unlimited,
or deletions that were made before the orchestration failed. As a result, we recommend that and Developer Editions
you design and debug your orchestration in a sandbox environment before deploying it to
This feature is supported in
production.
Government Cloud and
The debug information for in-progress and failed orchestrations is similar to the information displayed Government Cloud Plus.
for flow. In addition, orchestration debug details show milestones for orchestrations, stages, steps,
and work items.

Milestones
Orchestration milestones are a part of orchestration debugging details.

535
Automate Your Business Processes Troubleshoot Orchestrations

Orchestration Run Milestone Description


Start Run The orchestration started.

End Run The orchestration completed.

Cancel Run The orchestration was manually canceled.

Fail Run • The orchestrration encountered an error.


• A stage within the orchestration encountered an error.
• A step within the orchestration encountered an error.

Stage milestones are a part of orchestration debugging details.

Stage Milestone Description


Start Stage The stage started.

End Stage The stage completed.

Discontinue Stage • The orchestration encountered an error after the stage was
completed.
• The orchestration encountered an error while the stage was
in progress.

Fail Stage • The stage encountered an error.


• A background step within the stage encountered an error.
• An autolaunched flow called by a background step within the
stage encountered an error.

Step milestones are a part of orchestration debugging details.

Step Milestone Description


Start Step The step started.

End Step The step completed.

Discontinue Step • The step’s stage completed while the step was in progress.
• The orchestration encountered an error after the step was
completed.
• The orchestration encountered an error while the step was in
progress.
• The step’s stage encountered an error while the step was in
progress.

Fail Step The step encountered an error.

536
Automate Your Business Processes Troubleshoot Orchestrations

Work item milestones are a part of orchestration debugging details.

Work Item Milestone Description


Start Work Item The work item was created and assigned.

End Work Item The assigned user completed the work item.

Reassign Work Item The work item was reassigned.

Debug an In-Progress Orchestration


Debug an in-progress orchestration to better understand the path an orchestration takes with different scenarios and the variable
values at points in the automation
Debug a Failed Orchestration
Troubleshoot a failed orchestration, and gain insights about why it failed.

Debug an In-Progress Orchestration


Debug an in-progress orchestration to better understand the path an orchestration takes with
EDITIONS
different scenarios and the variable values at points in the automation
1. In the App Launcher, find and select Orchestration Runs. Available in: both Salesforce
Classic and Lightning
2. On the Orchestration Runs page, from the dropdown for the desired in-progress orchestration,
Experience
select Debug Orchestration.
Available in: Enterprise,
Note: If you started running an orchestration before upgrading to Spring ’22, stage and
Performance, Unlimited,
step instance IDs are shown as null in orchestration debug information. Evaluation flow and Developer Editions
output is also shown as null.
This feature is supported in
Government Cloud and
Government Cloud Plus.

USER PERMISSIONS

To debug an orchestration
• Manage Flow

537
Automate Your Business Processes Orchestrator Limits and Considerations

Debug a Failed Orchestration


Troubleshoot a failed orchestration, and gain insights about why it failed.
EDITIONS
1. From Setup, in the Quick Find box, enter flow, and then select Paused and Failed Flow
Interviews. Available in: both Salesforce
Classic and Lightning
2. On the Flow Interviews page, from the list view dropdown, select All Failed Flow Interviews.
Experience
3. For the desired failed orchestration, select Open.
Available in: Enterprise,
Note: If you started running an orchestration before upgrading to Spring ’22, stage and Performance, Unlimited,
step instance IDs are shown as null in orchestration debug information. Evaluation flow and Developer Editions
output is also shown as null.
This feature is supported in
Government Cloud and
Government Cloud Plus.

USER PERMISSIONS

To debug an orchestration
• Manage Flow

Orchestrator Limits and Considerations


When designing, managing, and running orchestrations, consider these issues.
EDITIONS

General Orchestrator Limits Available in: both Salesforce


When using orchestrations, keep orchestration limits, flow limits, and Apex governor limits in Classic and Lightning
mind. Experience

Considerations for Orchestrations Available in: Enterprise,


Keep these considerations in mind when designing and using orchestrations. Performance, Unlimited,
and Developer Editions
Considerations for Evaluation Flows
Keep these considerations in mind when using evaluation flows as entry or exit conditions. This feature is supported in
Government Cloud and
Government Cloud Plus.

General Orchestrator Limits


When using orchestrations, keep orchestration limits, flow limits, and Apex governor limits in mind.
EDITIONS
Per-Org Limit Enterprise, Available in: both Salesforce
Unlimited, Classic and Lightning
Performance, Experience
or Developer
Editions Available in: Enterprise,
Performance, Unlimited,
Versions per orchestration 50
and Developer Editions
Executed elements at runtime per orchestration 2,000 This feature is supported in
Active flows plus orchestrations 2,000 Government Cloud and
Government Cloud Plus.

538
Automate Your Business Processes Orchestrator Limits and Considerations

Per-Org Limit Enterprise, Unlimited,


Performance, or
Developer Editions
Total flows plus orchestrations 4,000

SEE ALSO:
Automate Your Business Processes : Flow Usage-Based Entitlements
Sales Productivity : Email Allocations per Edition
Platform Events Developer Guide: Platform Event Allocations

Considerations for Orchestrations


Keep these considerations in mind when designing and using orchestrations.
EDITIONS

Email Notifications Available in: both Salesforce


Classic and Lightning
When a flow called by a step fails and causes an orchestration to fail, two email notifications are Experience
sent.
Available in: Enterprise,
• A flow error notification
Performance, Unlimited,
• An orchestration error notification and Developer Editions

This feature is supported in


Government Cloud and
Government Cloud Plus.

Considerations for Evaluation Flows


Keep these considerations in mind when using evaluation flows as entry or exit conditions.
EDITIONS
An evaluation flow is a flow with a process type of Evaluation Flow. It’s an autolaunched flow that
contains a predefined Boolean output variable named isOrchestrationConditionMet. Available in: both Salesforce
Classic and Lightning
General Guidelines
Experience
Use an evaluation flow to pause an orchestration until a specific field update occurs.
Don’t loop through records or make external callouts in evaluation flows. Available in: Enterprise,
Performance, Unlimited,
To pass variables from the orchestration into an evaluation flow, use evaluation flow input and Developer Editions
variables.
This feature is supported in
Output Variable Government Cloud and
An evaluation flow has one output variable named isOrchestrationConditionMet. Government Cloud Plus.
The isOrchestrationConditionMet output variable must be Boolean and initialized
to false.
The values of all output variables other than isOrchestrationConditionMet are discarded and not used by the orchestration.

539
Automate Your Business Processes Orchestrator Reference

Orchestrator Reference
Bookmark this page for quick access to information about orchestration elements, resources, events,
EDITIONS
and more.
Available in: both Salesforce
Orchestrator Resources Classic and Lightning
Each resource represents a value that you can reference throughout the orchestration. Experience

Orchestrator Elements Available in: Enterprise,


Each element represents an action that the orchestration can execute. Orchestrations can contain Performance, Unlimited,
Decision and Stage elements. and Developer Editions

Orchestrator Connectors This feature is supported in


Connectors determine the available paths that an orchestration can take at run time. On the Government Cloud and
canvas in Flow Builder, a connector looks like an arrow that points from one element to another. Government Cloud Plus.

Orchestrator Operators
In conditions and filters, operators let you evaluate information and narrow the scope of an orchestration operation.
Orchestration Version Properties
An orchestration version’s properties consist of its label and description. These values drive the field values that appear on the
orchestration’s detail page.

Orchestrator Resources
Each resource represents a value that you can reference throughout the orchestration.
EDITIONS
In Flow Builder, the Manager tab shows the resources that are available in the orchestration.
Available in: both Salesforce
You can create some resources by clicking New Resource. The system providers certain resources,
Classic and Lightning
such as global constants and global variables. Other resources are created when you add an element
Experience
to an orchestration. For example, when you add a Decision element, a resource for each decision
outcome is created. Available in: Enterprise,
Performance, Unlimited,
Resource Description Creatable from and Developer Editions
the Resources
This feature is supported in
Tab
Government Cloud and
Constant Store a fixed value that you can use throughout an Government Cloud Plus.
orchestration.

Decision When you add a Decision element to an orchestration,


Outcome its outcomes are available as Boolean resources. If an
outcome path has already been executed in the
running orchestration, the resource’s value is True.

Element Any element that you add to an orchestration is


available as a resource with the was visited
operator in decision outcome criteria. An element is
considered visited when it’s executed in a running
orchestration.

Formula Calculate a value when the formula is used in the


orchestration.

540
Automate Your Business Processes Orchestrator Reference

Resource Description Creatable from the


Resources Tab
Orchestrator Use fixed, system-provided values such as EmptyString, True, and
Resource: False.
Global
ConstantsGlobal
Constant

Global Use system-provided variables that reference information about the


Variable Salesforce org or running user, such as the user’s ID or the API session ID.

Orchestrator Organize the work done in an orchestration stage.


Resource:
Step

Text Store text that can be changed and used throughout the orchestration. To
Template format the text, use HTML tags.

Variable Store a value that can be changed throughout the orchestration.

Orchestrator Resource: Constant


Store a fixed value that you can use throughout an orchestration.
Orchestrator Resource: Formula
Calculate a value when the formula is used in the orchestration.
Orchestrator Resource: Global Constants
Use fixed, system-provided values such as EmptyString, True, and False.
Orchestrator Resource: Global Variables
Use system-provided variables that reference information about the Salesforce org or running user, such as the user’s ID or the API
session ID.
Orchestrator Resource: Step
Organize the work done in an orchestration stage.
Orchestrator Resource: Text Template
Store text that can be changed and used throughout the orchestration. To format the text, use HTML tags.
Orchestrator Resource: Variable
Store a value that can be changed throughout the orchestration.

541
Automate Your Business Processes Orchestrator Reference

Orchestrator Resource: Constant


Store a fixed value that you can use throughout an orchestration.
EDITIONS
Field Description Available in: both Salesforce
API Name The requirement for uniqueness applies only to elements within the Classic and Lightning
current orchestration. Two elements can have the same API name, Experience
provided they’re used in different orchestrations. An API name can include Available in: Enterprise,
underscores and alphanumeric characters without spaces. It must begin Performance, Unlimited,
with a letter and can’t end with an underscore. It also can’t have two and Developer Editions
consecutive underscores.
This feature is supported in
Description Helps you differentiate this constant from other resources. Government Cloud and
Government Cloud Plus.
Data Type Determines the type of value that the constant can store. You can’t change
the data type of a previously saved constant.

Value The constant’s value. This value doesn’t change throughout the
orchestration.

Orchestrator Resource: Formula


Calculate a value when the formula is used in the orchestration.
EDITIONS
Field Description Available in: both Salesforce
API Name The requirement for uniqueness applies only to elements within Classic and Lightning
the current orchestration. Two elements can have the same API Experience
name, provided they’re used in different orchestrations. An API Available in: Enterprise,
name can include underscores and alphanumeric characters Performance, Unlimited,
without spaces. It must begin with a letter and can’t end with an and Developer Editions
underscore. It also can’t have two consecutive underscores.
This feature is supported in
Description Helps you differentiate this formula from other resources. Government Cloud and
Government Cloud Plus.
Data Type The data type for the value returned by the formula. You can’t
change the data type of a previously saved variable.

Decimal Places Controls the number of digits to the right of the decimal point up
to 17 places. If you leave this field blank or set it to zero, only whole
numbers appear when your orchestration runs.
Available only when the data type is Number or Currency.

Formula The formula expression that the orchestration evaluates at run


time. The returned value must be compatible with Data Type.

Note: Some formula functions aren’t supported in Flow


Builder.

542
Automate Your Business Processes Orchestrator Reference

Orchestrator Resource: Global Constants


Use fixed, system-provided values such as EmptyString, True, and False.
EDITIONS
Global Constant Supported Data Types Available in: both Salesforce
{!$GlobalConstant.True} Boolean Classic and Lightning
Experience
{!$GlobalConstant.False} Boolean
Available in: Enterprise,
{!$GlobalConstant.EmptyString} Text Performance, Unlimited,
and Developer Editions

This feature is supported in


Example: When you create a Boolean variable, $GlobalConstant.True and Government Cloud and
$GlobalConstant.False are supported. When you create a Currency variable, no Government Cloud Plus.
global constants are supported.

Null Versus Empty String


At run time, {!$GlobalConstant.EmptyString} and null are treated as separate, distinct values. For example:
• When you leave a text field or resource value blank, the value is null at run time. If you want the value to be treated as an empty
string, set it to {!$GlobalConstant.EmptyString}.
• For an orchestration condition, use the is null operator to check whether a value is null. If the condition compares two text
variables, make sure that their default values are correctly set to {!$GlobalConstant.EmptyString} or left blank (null).

Orchestrator Resource: Global Variables


Use system-provided variables that reference information about the Salesforce org or running user,
EDITIONS
such as the user’s ID or the API session ID.
Available in: both Salesforce
Global Description Classic and Lightning
Variable Experience
$Api References an API URL or the session ID. These merge fields are available. Available in: Enterprise,
• Enterprise_Server_URL_xxx—The Enterprise WSDL SOAP Performance, Unlimited,
endpoint, where xxx represents the API version. and Developer Editions

• Partner_Server_URL_xxx—The Partner WSDL SOAP endpoint, This feature is supported in


where xxx represents the API version. Government Cloud and
• Session_ID Government Cloud Plus.

$Label References custom labels. This global variable appears only if your org has
custom labels.
The returned value depends on the language setting of the contextual user.
The value returned is one of the following, in order of precedence:
1. The local translation’s text
2. The packaged translation’s text
3. The primary label’s text

543
Automate Your Business Processes Orchestrator Reference

Global Variable Description


$Organization References information about your company.

$Permission References information about the current user’s custom permission access.

$Profile References information from the current user’s profile, such as license type or name.

Tip:
• Use profile names to reference standard profiles in $Profile merge fields.
• Users don’t need access to their profile information to run a flow that references these merge
fields.

$Record Available only in record-triggered orchestrations.


In a record-triggered orchestration, the orchestration makes a copy of the triggering record when it starts.
If a step within that orchestration makes a field update on the triggering record, it’s not reflected in the
$Record global variable. To make field updates on the orchestration-triggering record called by one of
the orchestration’s steps, pass the record ID to the step’s flow and use it in a Get Records element.
You can reference $Record values throughout the orchestration by passing the variable as an input
parameter to a flow in a step.

$Record__Prior Available only in record-triggered orchestrations that are configured to run when a record is updated or
when a record is created or updated.
The $Record__Prior global variable contains the values that the triggering record had immediately
before the orchestration started. You can’t change these values in the orchestration or with any flows
associated with its steps.
When the orchestration is triggered by a newly created record, all $Record__Prior values are null.

$Setup References custom settings of type hierarchy. This global variable appears only if your org has hierarchy
custom settings. You can access custom settings of type list only in Apex.
Hierarchical custom settings allow values at these levels.
• Organization—The default value for everyone
• Profile—Overrides the Organization value
• User—Overrides the Organization and Profile values
Salesforce determines the correct value for this custom setting field based on the running user’s current
context.

$System $System.OriginDateTime represents the literal value of 1900-01-01 00:00:00. Use this
merge field to perform date/time offset calculations.

$User References information about the user who’s running the orchestration.

Note: Most of the time, an orchestration’s running user is the automated process user. When the
running user is the automated process user, $User doesn’t provide useful information.
$User.UITheme and $User.UIThemeDisplayed identify the look and feel that the running user
sees on a Salesforce page. The difference between the two variables is that $User.UITheme returns the
look and feel the user is supposed to see, while $User.UIThemeDisplayed returns the look and feel

544
Automate Your Business Processes Orchestrator Reference

Global Variable Description


the user actually sees. For example, a user can have the preference and permissions to see the Lightning
Experience look and feel, but if they’re using a browser that doesn’t support that look and feel, for example,
older versions of Internet Explorer, $User.UIThemeDisplayed returns a different value. These merge
fields return one of these values.
• Theme1—Obsolete Salesforce theme
• Theme2—Salesforce Classic 2005 user interface theme
• Theme3—Salesforce Classic 2010 user interface theme
• Theme4d—Modern “Lightning Experience” Salesforce theme
• Theme4t—Salesforce mobile app theme
• Theme4u—Lightning Console theme
• PortalDefault—Salesforce Customer Portal theme
• Webstore—AppExchange theme

$UserRole References information about the current user’s role, such as the role name or ID.

Global Variable Considerations for Flows


• In a record-triggered orchestration, the $Record global variable doesn’t contain the triggering record’s values for fields whose
values are derived from other records. Examples of derived fields include Contact.Name and User.MediumPhotoUrl.
• Multi-select picklist, time, and location global variables are available only in formulas.
• If a field in the database has no value, the corresponding merge field returns a blank value. For example, if no value is set for your
org’s Country field, {!$Organization.Country} returns no value.

Orchestrator Resource: $Flow Global Variables


A $Flow global variable provides information about the running orchestration. Some variables contain system-provided values.
You can update the other variables throughout the orchestration by storing output values in the variables.

Orchestrator Resource: $Flow Global Variables


A $Flow global variable provides information about the running orchestration. Some variables
EDITIONS
contain system-provided values. You can update the other variables throughout the orchestration
by storing output values in the variables. Available in: both Salesforce
Classic and Lightning
Global Variable Supported Description Value Set By Experience
Resource
Types Available in: Enterprise,
Performance, Unlimited,
$Flow.ActiveStages Stage A collection of stages that are Assignment and Developer Editions
relevant to the current path of the
flow. This feature is supported in
Government Cloud and
Note: This system variable Government Cloud Plus.
references the flow Stage
resource, not the
orchestration Stage

545
Automate Your Business Processes Orchestrator Reference

Global Variable Supported Description Value Set By


Resource Types

element. It can only be used in flows,


including those flows called by an
orchestration step, but it isn’t supported
for orchestrations.

$Flow.CurrentDate Text, Date, and Date when the flow interview executes the System
Date/Time element that references the global variable.

$Flow.CurrentRecord Text ID of a related record. The value must be a single Assignment


ID for a valid object. All custom objects and most
standard objects are valid.
When a user pauses the flow interview or the
interview executes a Wait element, the interview
is associated with this record by creating a
FlowRecordRelation record. If the ID isn’t valid,
the interview fails to pause.

$Flow.CurrentStage Stage The currently selected stage. Assignment

Note: This system variable references


the flow Stage resource, not the
orchestration Stage element. It can only
be used in flows, including those flows
called by an orchestration step, but it isn’t
supported for orchestrations.

$Flow.CurrentDateTime Text, Date, and Date and time when the flow interview executes System
Date/Time the element that references the global variable.

$Flow.FaultMessage Text System fault message that can help flow System
administrators troubleshoot runtime issues.

$Flow.InterviewGuid Text Unique identifier for the interview. System

$Flow.InterviewStartTime Text, Date, and Date and time when the flow interview started. System
Date/Time For a flow launched by a Subflow element,
$Flow.InterviewStartTime indicates
when the initial master flow started.

546
Automate Your Business Processes Orchestrator Reference

Orchestrator Resource: Step


Organize the work done in an orchestration stage.
EDITIONS
Orchestrations have background steps and interactive steps.
Available in: both Salesforce
Note: The Step resource in Orchestrator isn’t related to the discontinued Step element in Classic and Lightning
Salesforce Flow. Experience

Available in: Enterprise,


Background Steps Performance, Unlimited,
Background steps call autolaunched flows and run without user interaction. and Developer Editions

This feature is supported in


Field Description Government Cloud and
Label Helps you identify the element on the canvas. Government Cloud Plus.

API Name Automatically populated if empty when you fill out the Label field and
press TAB.The requirement for uniqueness applies only to elements within
the current orchestration. Two elements can have the same API name,
provided they’re used in different orchestrations. An API name can include
underscores and alphanumeric characters without spaces. It must begin
with a letter and can’t end with an underscore. It also can’t have two
consecutive underscores.

Description Helps you remember what this resource does. When editing an element,

appears after you click .

Condition Identifies the method used to determine whether a step is ready to start.

Step Name Specifies a step that must be marked complete before the current step
can start. Available when the entry condition is set to When another step
is marked Complete, the step starts.

Evaluation Specifies the flow that determines if the step can start. Available when
Flow the entry condition is set to When the specified evaluation flow returns
True, the step starts.

Flow Specifies which autolaunched flow to run for a step.

Interactive Steps
Interactive steps call screen flows and require user interaction.

Field Description
Label Helps you identify the element on the canvas.

API Name Automatically populated if empty when you fill out the Label field and press TAB.The requirement
for uniqueness applies only to elements within the current orchestration. Two elements can have the
same API name, provided they’re used in different orchestrations. An API name can include underscores
and alphanumeric characters without spaces. It must begin with a letter and can’t end with an
underscore. It also can’t have two consecutive underscores.

547
Automate Your Business Processes Orchestrator Reference

Field Description
Description
Helps you remember what this resource does. When editing an element, appears after you click .

Condition Identifies the method used to determine whether a step is ready to start or can be considered complete.

Step Name Specifies a step that must be marked complete before the current step can start. Available when the
entry condition is set to When another step is marked Complete, the step starts.

Evaluation Flow Specifies the flow that determines if the step can start or be marked complete. Available when the
entry condition is set to When the specified evaluation flow returns True, the step starts. Also available
when the exit condition is set toWhen the specified evaluation flow returns True, the step is marked
Complete.

Flow Specifies which screen flow to run for a step.

Record ID Specifies the ID of the record where the Work Guide displays the screen flow to the assigned user.

Username Specifies the user assigned to complete the screen flow.

Step Status

Step Status Description


Not Started The step hasn’t met its entry condition.

In Progress • The step started.


• The step was in progress when its associated stage
encountered an error.
• The screen flow associated with the interactive step
encountered an error.

Completed • The interactive step met its exit condition.


• The background step’s flow completed.
• The step completed when its associated stage encountered
an error.

Discontinued • The step was in progress when its associated stage completed.
• The step was completed when the orchestration encountered
an error.
• The step was in progress when the orchestration encountered
an error.
• The step was in progress when its associated stage
encountered an error.

Error • The step encountered an error.


• The autolaunched flow associated with a background step
encountered an error.

548
Automate Your Business Processes Orchestrator Reference

Orchestrator Resource: Text Template


Store text that can be changed and used throughout the orchestration. To format the text, use
EDITIONS
HTML tags.
Available in: both Salesforce
Field Description Classic and Lightning
API Name The requirement for uniqueness applies only to elements within the current Experience
orchestration. Two elements can have the same API name, provided they’re Available in: Enterprise,
used in different orchestrations. An API name can include underscores and Performance, Unlimited,
alphanumeric characters without spaces. It must begin with a letter and and Developer Editions
can’t end with an underscore. It also can’t have two consecutive
This feature is supported in
underscores.
Government Cloud and
Description Helps you differentiate this text template from other resources. Government Cloud Plus.

Text Template The text for the template. To reference information from other resources,
use merge fields.

Rich Text Control the text font, size, color, and alignment. Add HTML links, bullet
points, or numbered lists. Rich text is on by default. To change to rich text,

click .

Plain Text Send email core actions use plain text. Some custom actions from the
AppExchange or built by Salesforce developers also expect plain text. To

change to plain text, click .

Orchestrator Resource: Variable


Store a value that can be changed throughout the orchestration.
EDITIONS
Field Description Available in: both Salesforce
Apex Class Defines fields for the Apex-defined data type. Only fields with the Classic and Lightning
@AuraEnabled annotation are available in an orchestration. Experience

Available in: Enterprise,


API Name The requirement for uniqueness applies only to elements within the
Performance, Unlimited,
current orchestration. Two elements can have the same API name,
and Developer Editions
provided they’re used in different orchestrations. An API name can include
underscores and alphanumeric characters without spaces. It must begin This feature is supported in
with a letter and can’t end with an underscore. It also can’t have two Government Cloud and
consecutive underscores. Government Cloud Plus.

Description Helps you differentiate this variable from other resources.

Data Type Determines the types of values that the variable can store. You can’t
change the data type of a previously saved variable.
The Record data type can store multiple field values for one record. The
Apex-defined data type can store multiple field values for one Apex class.

549
Automate Your Business Processes Orchestrator Reference

Field Description

Note: Looking for sObject? In Flow Builder, that data type changed to Record.

Allow multiple When selected, the resource is a collection variable. You can store a list of values in collection variables.
values (collection) Collection variables can store only values that are compatible with their data type. When the data
type is Record, the collection variable can only store values for the associated object’s records.
For example, store multiple email addresses in a collection variable, and reference the collection
variable to send an email.

Object The object whose field values you can store in the variable. You can’t change the object of a previously
saved variable.
Available only when the data type is Record.

Decimal Places Controls the number of digits to the right of the decimal point up to 17 places. If you leave this field
blank or set it to zero, only whole numbers appear when your orchestration runs.
Available only when the data type is Number or Currency.

Availability Outside When a variable is available for input, it can be set at the start of the orchestration, such as when an
the Flow orchestration is started from a Lightning page.

Warning: Disabling input or output access for an existing variable can break the functionality
of applications and pages that call the orchestration and access the variable. For example, you
can access variables from URL parameters, processes, and other flows.
This field doesn’t affect how variables are assigned or used within the same orchestration.

Default Value Determines the variable value when the orchestration starts. If you leave this field blank, the value is
null.
Not available for Picklist and Multi-Select Picklist variables.

Orchestrator Elements
Each element represents an action that the orchestration can execute. Orchestrations can contain
EDITIONS
Decision and Stage elements.
In Flow Builder, the Add Element menu shows the types of elements that you can add to the flow Available in: both Salesforce
by selecting them. For a list of all elements already added to the orchestration, see the Elements Classic and Lightning
section of the Manager tab in the Toolbox. Experience

Available in: Enterprise,


Orchestrator Element: Decision Performance, Unlimited,
Evaluate a set of conditions, and then route users through the orchestration based on the and Developer Editions
outcomes of those conditions. This element performs the equivalent of an if-then statement. This feature is supported in
Orchestrator Element: Stage Government Cloud and
Group a series of related steps in an orchestration. Government Cloud Plus.

550
Automate Your Business Processes Orchestrator Reference

Orchestrator Element: Decision


Evaluate a set of conditions, and then route users through the orchestration based on the outcomes
EDITIONS
of those conditions. This element performs the equivalent of an if-then statement.
Available in: both Salesforce
Outcomes Classic and Lightning
Experience
For each path that the orchestration can take, create an outcome. For each outcome, specify the
conditions that must be met for the orchestration to take that path. To relabel the path that the Available in: Enterprise,
flow takes if no outcome’s conditions are met, click Default Outcome. Performance, Unlimited,
and Developer Editions
Field Description This feature is supported in
Label Identifies the connector for this outcome on the canvas. Government Cloud and
Government Cloud Plus.
Outcome The requirement for uniqueness applies only to elements within the current
API Name orchestration. Two elements can have the same API name, provided they’re
used in different orchestrations. An API name can include underscores and
alphanumeric characters without spaces. It must begin with a letter and can’t
end with an underscore. It also can’t have two consecutive underscores.

Condition Determines whether the orchestration takes this outcome’s path. Sets logic and
Requirements conditions for each outcome that determine if the orchestration follows its path.
to Execute
Outcome

When to Available on record-triggered orchestrations. Determines whether this outcome’s


Execute path is taken based on whether the triggering record is updated to meet the
Outcome condition requirements. For example, the opportunity update that triggered
the orchestration to run changed its stage to Closed Won from any value that
isn’t Closed Won.

Orchestrator Element: Stage


Group a series of related steps in an orchestration.
EDITIONS
Stages run sequentially, one stage at a time, and contain steps.
Available in: both Salesforce
Note: The Stage element in Orchestrator isn’t related to the Stage resource in Salesforce Classic and Lightning
Flow. Experience

Field Description Available in: Enterprise,


Performance, Unlimited,
Label Identifies the name for this stage on the canvas. and Developer Editions
API Name The requirement for uniqueness applies only to elements within the current This feature is supported in
orchestration. Two elements can have the same API name, provided they’re Government Cloud and
used in different orchestrations. An API name can include underscores and Government Cloud Plus.
alphanumeric characters without spaces. It must begin with a letter and can’t
end with an underscore. It also can’t have two consecutive underscores.

551
Automate Your Business Processes Orchestrator Reference

Field Description
Set Exit Determines when a stage can be considered complete.
Condition When all steps have been marked Complete, the stage is marked Complete
The stage is marked complete and the orchestration moves to the next element when every step in a
stage is marked complete.
When the specified evaluation flow returns True, the stage is marked Complete
The orchestration runs a specified evaluation flow to determine if the stage can be marked complete. The
orchestration doesn’t mark the stage complete and move to the next element until the specified evaluation
flow’s isOrchestrationConditionMet output variable returns true.

Stage Status

Stage Status Description


In Progress • The stage started.
• The stage was in progress when an interactive step within the
orchestration encountered an error.
• The stage was in progress when a screen flow associated with
an interactive step within the stage encountered an error.

Completed • The stage met its exit condition, and the orchestration
completed.
• The stage completed, and the orchestration was canceled.

Canceled The stage was in progress when the orchestration was canceled.

Discontinued • The stage was completed when the orchestration encountered


an error.
• The stage was in progress when the orchestration encountered
an error.

Error • The stage encountered an error.


• A background step within the stage encountered an error.
• An autolaunched flow called by a background step within the
stage encountered an error.

552
Automate Your Business Processes Orchestrator Reference

Orchestrator Connectors
Connectors determine the available paths that an orchestration can take at run time. On the canvas
EDITIONS
in Flow Builder, a connector looks like an arrow that points from one element to another.
Available in: both Salesforce
Label Example Description Classic and Lightning
Unlabeled Identifies which element to execute next. Experience

Available in: Enterprise,


Decision Identifies which element to execute when Performance, Unlimited,
outcome the criteria of a Decision outcome are met. and Developer Editions
Go To Identifies which element to go to and This feature is supported in
execute next. Use to create loops in an Government Cloud and
orchestration. Government Cloud Plus.

Orchestrator Operators
In conditions and filters, operators let you evaluate information and narrow the scope of an
EDITIONS
orchestration operation.
Available in: both Salesforce
Orchestrator Operators in Decision Elements Classic and Lightning
Use condition operators to verify the value of a selected resource. Conditions are used in Decision Experience
elements. Available in: Enterprise,
Performance, Unlimited,
and Developer Editions

This feature is supported in


Government Cloud and
Government Cloud Plus.

Orchestrator Operators in Decision Elements


Use condition operators to verify the value of a selected resource. Conditions are used in Decision
EDITIONS
elements.
Use this reference to understand the supported operators. The list is organized according to the Available in: both Salesforce
data type that you select for Resource. Classic and Lightning
Experience
• Apex-Defined
• Boolean Available in: Enterprise,
Performance, Unlimited,
• Collection
and Developer Editions
• Currency
This feature is supported in
• Date
Government Cloud and
• Date/Time Government Cloud Plus.
• Multi-Select Picklist
• Number
• Picklist
• Record

553
Automate Your Business Processes Orchestrator Reference

• Text

Apex-Defined
To determine which operators are supported, match the @AuraEnabled attribute’s Apex data type with an orchestrator data type
in this reference.

Apex Data Type Orchestrator Data Type


Boolean Boolean

Date Date

DateTime Date/Time

Decimal Number

Double Number

Integer Number

List Collection

Long Number

String Text

Boolean
Check whether a Boolean resource’s value matches another value or resource.

Operator True if... Supported Data


Types
Does Not The value of the selected Resource doesn’t match what you enter or select for Value. Boolean
Equal

Equals The value of the selected Resource matches what you enter or select for Value. Boolean
• If the running orchestration took that outcome, a decision outcome resolves to true.
• If it executed without error, a stage element resolves to true. If a fault occurred, the element
resolves to false. If the element wasn’t executed, it resolves to null.

Was Set The value for Resource is a field in a record variable, and that field has been populated with Boolean
a value at least once in a flow called by a step in the orchestration.

Was Visited The selected Resource is a Decision element in the orchestration, and it has been visited while Boolean
the orchestration is running.

Collection
Check whether a Collection resource’s value contains or matches another value or resource.

554
Automate Your Business Processes Orchestrator Reference

Operator True if... Supported Data Types


Contains An item in the collection that’s selected for Resource Resource of the same data type.
contains the exact same value as Value. For record collection variables, only record resources with
the same object type are supported.

Does Not Equal The collection that’s selected for Resource doesn’t match Collection of the same data type.
the collection that’s selected for Value. For record collection variables, only record collection
If two record collection variables include different fields variables with the same object type are supported.
or if the fields have different values, they’re unequal.

Equals The collection that’s selected for Resource matches the Collection of the same data type.
collection that’s selected for Value. For record collection variables, only record collection
If two record collection variables include the same fields variables with the same object type are supported.
and those fields have the same values, they’re equal.

Is Null The collection that’s selected for Resource isn’t populated Boolean
with any values.

Currency and Number


Check whether a Currency or Number resource’s value matches, is larger than, or is smaller than another value or resource.

Operator True if... Supported Data


Types
Does Not The value for Resource doesn’t match what’s entered or selected for Value. • Currency
Equal
• Number

Equals The value for Resource matches what’s entered or selected for Value. • Currency
• Number

Greater Than The value for Resource is larger than what’s entered or selected for Value. • Currency
• Number

Greater Than The value for Resource is larger than what’s entered or selected for Value or is the same. • Currency
or Equal
• Number

Less Than The value for Resource is smaller than what’s entered or selected for Value. • Currency
• Number

Less Than or The value for Resource is smaller than what’s entered or selected for Value or is the same. • Currency
Equal
• Number

Is Null Resource isn’t populated with a value. Boolean

555
Automate Your Business Processes Orchestrator Reference

Operator True if... Supported Data


Types
Was Set The value for Resource is a field in a record variable, and that field has been populated with Boolean
a value at least once in a flow called by a step in the orchestration.

Date and Date/Time


Check whether a Date or Date/Time resource’s value matches, is before, or is after another value or resource.

Operator True if... Supported Data


Types
Does Not The value for Resource doesn’t match what’s entered or selected for Value. • Date
Equal
• Date/Time

Equals The value for Resource matches what’s entered or selected for Value. • Date
• Date/Time

Greater Than The value for Resource is a later date or time than what’s entered or selected for Value. • Date
• Date/Time

Greater Than The value for Resource is a later date or time than what’s entered or selected for Value or is • Date
or Equal the same date or time.
• Date/Time

Less Than The value for Resource is an earlier date or time than what’s entered or selected for Value. • Date
• Date/Time

Less Than or The value for Resource is an earlier date or time than what’s entered or selected for Value or • Date
Equal is the same date or time.
• Date/Time

Is Null Resource isn’t populated with a value. Boolean

Was Set The value for Resource is a field in a record variable, and that field has been populated with Boolean
a value at least once in a flow called by a step in the orchestration.

Picklist
Check whether a Picklist resource’s value matches or contains another value or resource.

Note: These operators treat the resource’s value as a text value.

556
Automate Your Business Processes Orchestrator Reference

Operator True if... Supported Data


Types
Contains The value for Resource contains what’s entered or selected for Value. • Boolean
For example, if the value of {!varPicklist} is yellow-green, the condition • Currency
{!varPicklist} Contains green evaluates to TRUE.
• Date
• Date/Time
• Multi-Select
Picklist
• Number
• Picklist
• Text

Does Not The value for Resource doesn’t match what’s entered or selected for Value. • Boolean
Equal
• Currency
• Date
• Date/Time
• Multi-Select
Picklist
• Number
• Picklist
• Text

Equals The value for Resource matches what’s entered or selected for Value. • Boolean
• Currency
• Date
• Date/Time
• Multi-Select
Picklist
• Number
• Picklist
• Text

Was Set The value for Resource is a field in a record variable, and that field has been populated with Boolean
a value at least once in a flow called by a step in the orchestration.

Multi-Select Picklist
Check whether a multi-select picklist resource’s value matches or contains another value or resource.

Note: These operators treat the resource’s value as a text value. If the resource’s value includes multiple items, the operators treat
the value as one string that happens to include semicolons. It doesn’t treat each selection as a different value. For example, the
operators treat red; blue; green as a single value rather than three separate values.

557
Automate Your Business Processes Orchestrator Reference

Operator True if... Supported Data


Types
Contains The value for Resource contains what’s entered or selected for Value. • Boolean
Tip: When you use this operator for a multi-select picklist resource, be aware of the • Currency
values that a user can enter. If you want to check that a specific value is included and • Date
that value is also included as part of another value, create an orchestration formula
• Date/Time
resource that uses the INCLUDES() function.
• Multi-Select
For example, your org has a Color multi-select picklist value. Among the possible values Picklist
are “green” and “yellow-green”. If both “green” and “yellow-green” are acceptable
• Number
values, use the Contains operator in an orchestration condition. If only “green” is an
acceptable value, create a formula that uses the INCLUDES() function. • Picklist
• Text

Does Not The value for Resource doesn’t match what’s entered or selected for Value. • Boolean
Equal
Note: Order matters. If you aren’t sure which order the values that you’re checking • Currency
for appear in, use the INCLUDES() function in an orchestration formula. For example, • Date
if you compare “red; blue; green” to “blue; green; red” using the Does Not Equal operator,
• Date/Time
that condition resolves to true.
• Multi-Select
Picklist
• Number
• Picklist
• Text

Equals The value for Resource exactly matches what’s entered or selected for Value. • Boolean
Note: Order matters. If you aren’t sure which order the values that you’re checking • Currency
for will appear in, use the INCLUDES() function in an orchestration formula. For example, • Date
if you compare “red; blue; green” to “blue; green; red” using the Equals operator, that
• Date/Time
condition resolves to FALSE.
• Multi-Select
Picklist
• Number
• Picklist
• Text

Was Set The value for Resource is a field in a record variable, and that field has been populated with Boolean
a value at least once in a flow called by a step in the orchestration.

Record
Check whether a record resource’s value matches another value or resource.

558
Automate Your Business Processes Orchestrator Reference

Operator True if... Supported Data


Types
Does Not The value for Resource doesn’t match what’s entered or selected for Value. Record with the same
Equal object type

Equals The value for Resource matches what’s entered or selected for Value. Record with the same
object type

Is Null Resource isn’t populated with a value. Boolean

Text
Check whether a Text resource’s value matches, contains, ends with, or starts with another value or resource.

Operator True if... Supported Data


Types
Contains The value for Resource contains what’s entered or selected for Value. • Boolean
• Currency
• Date
• Date/Time
• Multi-Select
Picklist
• Number
• Picklist
• Text

Does Not The value for Resource doesn’t match what’s entered or selected for Value. • Boolean
Equal
• Currency
• Date
• Date/Time
• Multi-Select
Picklist
• Number
• Picklist
• Text

Equals The value for Resource matches what’s entered or selected for Value. • Boolean
• Currency
• Date
• Date/Time
• Multi-Select
Picklist
• Number

559
Automate Your Business Processes Orchestrator Reference

Operator True if... Supported Data


Types

• Picklist
• Text

Ends With The end of the value for Resource matches what’s entered or selected for Value. • Boolean
• Currency
• Date
• Date/Time
• Multi-Select
Picklist
• Number
• Picklist
• Text

Is Null Resource isn’t populated with a value. Boolean

Starts With The beginning of the value for Resource matches what’s entered or selected for Value. • Boolean
• Currency
• Date
• Date/Time
• Multi-Select
Picklist
• Number
• Picklist
• Text

Was Set The value for Resource is a field in a record variable, and that field has been populated with Boolean
a value at least once in a flow called by a step in the orchestration.

Orchestration Version Properties


An orchestration version’s properties consist of its label and description. These values drive the field
EDITIONS
values that appear on the orchestration’s detail page.
Available in: both Salesforce
Property Description Classic and Lightning
Orchestration The label for the orchestration version. The label appears in the Experience
Label orchestration detail page and list views. Available in: Enterprise,
You can edit the label for inactive orchestrations and orchestration Performance, Unlimited,
versions. and Developer Editions

This feature is supported in


Government Cloud and
Government Cloud Plus.

560
Automate Your Business Processes Workflow

Property Description
Flow API Name The API name for the orchestration. The API name is used to differentiate this orchestration from
other parts of Salesforce, such as in a URL or Lightning web component. An API name can include
underscores and alphanumeric characters without spaces. It must begin with a letter and can’t end
with an underscore. It also can’t have two consecutive underscores. The API name appears on the
orchestration detail page.
You can’t edit the API name after saving the orchestration.

Description Differentiates the orchestration version from other versions. The description appears in the
orchestration detail page and list views.
You can edit the description for inactive orchestrations and orchestration versions.

Workflow
Workflow lets you automate standard internal procedures and processes to save time across your
EDITIONS
org. A workflow rule is the main container for a set of workflow instructions. These instructions can
always be summed up in an if/then statement. Available in: Lightning
For example: If it’s raining, then bring an umbrella. Experience and Salesforce
Classic
Tip: Whenever possible, automate your if/then statements with Process Builder instead of
workflow rules. Available in: Enterprise,
Performance, Unlimited,
Workflow rules can be broken into two main components. and Developer Editions
1. Criteria: the “if” part of the “if/then” statement. In other words, what must be true of the record
for the workflow rule to execute the associated actions.
2. Actions: the “then” part of the “if/then” statement. In other words, what to do when the record meets the criteria.
In the raining example, the criteria is “it’s raining” and the action is “bring an umbrella”. If the criteria isn’t met (it isn’t raining), then the
action isn’t executed (you don’t bring an umbrella).
When a record meets all the criteria for a workflow rule, that rule’s actions are executed. Familiarize yourself with the automated actions
that are available for workflow.

Create a Workflow Rule


Automate your organization’s standard process by creating a workflow rule.
Workflow Limits
Salesforce limits the number of total and active rules in your org, the number of time triggers and actions per rule. It also processes
a limited number of daily emails and hourly time triggers.
Workflow Considerations
Learn the intricacies of workflow rules and workflow actions before you begin working with them.
Workflow Rule Examples
Looking for ideas on how workflow rules can help streamline your business? Check out these examples.
Monitor Pending Workflow Actions
When a workflow rule that has time-dependent actions is triggered, use the workflow queue to view pending actions and cancel
them if necessary.

561
Automate Your Business Processes Create a Workflow Rule

Workflow Terminology
The following terms are used when describing workflow features and functionality.

SEE ALSO:
Which Automation Tool Do I Use?

Create a Workflow Rule


Automate your organization’s standard process by creating a workflow rule.
EDITIONS
Tip: Whenever possible, automate your if/then statements with Process Builder instead of
workflow rules. Available in: Lightning
Experience and Salesforce
Watch a Demo: Creating a Workflow Rule (Salesforce Classic) Classic

Available in: Enterprise,


1. Set the Criteria for Your Workflow Rule Performance, Unlimited,
Get started with creating a new workflow rule by selecting the object the rule relates to and and Developer Editions
configuring its criteria.
2. Add Automated Actions to Your Workflow Rule USER PERMISSIONS
Once you’ve set the criteria for your workflow rule, identify what to do when that criteria are
met. To create or change
workflow rules and actions:
3. Identify Your Salesforce Org’s Default Workflow User
• Customize Application
Select a Default Workflow User that you want Salesforce to display with a workflow
rule when the user that triggered the rule is not active.
4. Activate Your Workflow Rule
Salesforce doesn't trigger a workflow rule until you activate it.

SEE ALSO:
Workflow Considerations
Workflow Rule Examples

562
Automate Your Business Processes Create a Workflow Rule

Set the Criteria for Your Workflow Rule


Get started with creating a new workflow rule by selecting the object the rule relates to and
EDITIONS
configuring its criteria.
1. From Setup, enter Workflow Rules in the Quick Find box, then select Workflow Available in: Lightning
Rules. Experience and Salesforce
Classic
2. Click New Rule.
3. Choose the object to which you want this workflow rule to apply. Available in: Enterprise,
Performance, Unlimited,
4. Click Next. and Developer Editions
5. Give the rule a name and description.
6. Set the evaluation criteria. USER PERMISSIONS

Evaluate the rule Description To create or change


workflow rules and actions:
when a record is:
• Customize Application
created Evaluate the rule criteria each time a record is created. If the
rule criteria is met, run the rule. Ignore all updates to existing
records.
With this option, the rule never runs more than once per record.

created, and every Evaluate the rule criteria each time a record is created or
time it’s edited updated. If the rule criteria is met, run the rule.
With this option, the rule repeatedly runs every time a record
is edited as long as the record meets the rule criteria.

Note: If you select this option, you can't add


time-dependent actions to the rule.

created, and any (Default) Evaluate the rule criteria each time a record is created
time it’s edited or updated.
to subsequently • For a new record, run the rule if the rule criteria is met.
meet criteria
• For an updated record, run the rule only if the record is
changed from not meeting the rule criteria to meeting the
rule criteria.
With this option, the rule can run multiple times per record,
but it won’t run when the record edits are unrelated to the rule
criteria.
For example, suppose that for an opportunity record to meet
the rule criteria, the opportunity probability must be greater
than 50%. If you create an opportunity with a probability of
75%, the workflow rule runs. If you edit that opportunity by
changing the probability to 25%, the edit doesn't cause the
rule to run. If you then edit that opportunity by changing the
probability from 25% to 75%, the edit causes the rule to run.
With this last edit, the rule runs, because the record is changed
from not meeting the rule criteria to meeting the rule criteria.

563
Automate Your Business Processes Create a Workflow Rule

7. Enter your rule criteria.


• Choose criteria are met and select the filter criteria that a record must meet to trigger the rule. For example, set the
filter to “Opportunity: Amount greater than 5000” if you want opportunity records with an amount greater than $5,000 to trigger
the rule. If your organization uses multiple languages, enter filter values in your individual language. You can add up to 25 filter
criteria, of up to 255 characters each.
• Choose formula evaluates to true and enter a formula that returns a value of “True” or “False.” Salesforce triggers
the rule if the formula returns “True.”
Examples of useful workflow formulas include:
– If the number of filled positions equals the number of total positions on a job, update the Job Status field to “Filled.”
– If mileage expenses associated with visiting a customer site are 35 cents per mile and exceed a $1,000 limit, automatically
update the Approval Required field to “Required.”
– If a monthly subscription-based opportunity amount is greater than $10,000, create a task for an opportunity owner to follow
up 60 days after the opportunity is closed.
The $Label variable isn’t supported in workflow rule formulas. Also, some functions aren't available in workflow rule formulas.

Tip: You can use merge fields for directly related objects in workflow rule formulas.

8. Click Save & Next.

SEE ALSO:
Workflow Considerations

Add Automated Actions to Your Workflow Rule


Once you’ve set the criteria for your workflow rule, identify what to do when that criteria are met.
EDITIONS

Add an Immediate Action to Your Workflow Rule Available in: Lightning


Immediate actions, like their name suggests, are executed as soon as the workflow rule finishes Experience and Salesforce
evaluating the record. Classic

Add a Time-Dependent Action to Your Workflow Rule Available in: Enterprise,


Time-dependent actions are executed at a specific time, such as 10 days before a record’s close Performance, Unlimited,
date. When that specific time passes, the workflow rule re-evaluates the record to make sure and Developer Editions
that it still meets the rule criteria. If the record does, the workflow rule executes those actions.
USER PERMISSIONS
SEE ALSO: To create or change
Identify Your Salesforce Org’s Default Workflow User workflow rules and actions:
Set the Criteria for Your Workflow Rule • Customize Application

564
Automate Your Business Processes Create a Workflow Rule

Add an Immediate Action to Your Workflow Rule


Immediate actions, like their name suggests, are executed as soon as the workflow rule finishes
EDITIONS
evaluating the record.
1. Open a workflow rule. Available in: Lightning
Experience and Salesforce
2. In the Immediate Workflow Actions section, click Add Workflow Action.
Classic
3. Select one of the options to create an action or select an existing one.
Available in: Enterprise,
For details on each action type, see Perform Automated Actions . Performance, Unlimited,
and Developer Editions
SEE ALSO:
Add Automated Actions to Your Workflow Rule USER PERMISSIONS

To create or change
workflow rules and actions:
• Customize Application

Add a Time-Dependent Action to Your Workflow Rule


Time-dependent actions are executed at a specific time, such as 10 days before a record’s close date.
EDITIONS
When that specific time passes, the workflow rule re-evaluates the record to make sure that it still
meets the rule criteria. If the record does, the workflow rule executes those actions. Available in: Lightning
Time-dependent actions and time triggers are complex features. As you work with time-dependent Experience and Salesforce
actions and time triggers, keep in mind their considerations. Classic

If you plan on configuring workflow rules that have time-dependent actions, specify a default Available in: Enterprise,
workflow user. Salesforce associates the default workflow user with a workflow rule if the user who Performance, Unlimited,
initiated the rule is no longer active. and Developer Editions
1. Open a workflow rule.
2. In the Time-Dependent Workflow Actions section, click Add Time Trigger. USER PERMISSIONS

Note: You can’t add a time trigger if: To create or change


workflow rules and actions:
• The evaluation criteria is set to Evaluate the rule when a record • Customize Application
is: created, and any time it’s edited to subsequently
meet criteria.
• The rule is activated.
• The rule is deactivated but has pending actions in the workflow queue.

3. Specify a number of days or hours before or after a date that’s relevant to the record, such as the date the record was created.
If the workflow rule is still active and valid when this time occurs, the time trigger fires the workflow action.

4. Save your time trigger.


5. In the section for the time trigger you created, click Add Workflow Action.
6. Select one of the options to create an action or select an existing one.

565
Automate Your Business Processes Create a Workflow Rule

7. Click Done.

SEE ALSO:
Add Automated Actions to Your Workflow Rule
Considerations for Time-Dependent Actions and Time Triggers

Identify Your Salesforce Org’s Default Workflow User


Select a Default Workflow User that you want Salesforce to display with a workflow rule
EDITIONS
when the user that triggered the rule is not active.
Available in: Lightning
User Permissions Needed Experience and Salesforce
To edit process automation settings: Customize Application Classic

Available in: Enterprise,


Performance, Unlimited,
If your organization uses time-dependent actions in workflow rules, you must designate a default and Developer Editions
workflow user. When the user who triggered the rule isn’t active, Salesforce displays the username
of the default workflow user in the Created By field for tasks, the Sending User field for
email, and the Last Modified By field for field updates. Salesforce does not display this username for outbound messages. If a
problem occurs with a pending action, the default workflow user receives an email notification.
When workflow email alerts approach or exceed certain limits, Salesforce sends a warning email to the default workflow user or—if the
default workflow user isn't set—to an active system administrator.
1. From Setup, enter Process Automation Settings in the Quick Find box, then select Process Automation Settings.
2. For Default Workflow User, select a user.
3. Save your changes.

SEE ALSO:
Daily Allocations for Email Alerts

Associate Actions with Workflow Rules or Approval Processes


Associate actions that have already been created in your organization with a workflow rule and
EDITIONS
approval processes.
To associate existing workflow actions with a workflow rule: Available in: Lightning
Experience and Salesforce
1. From Setup, enter Workflow Rules in the Quick Find box, then select Workflow
Classic
Rules.
2. Select the workflow rule. Available in: Enterprise,
Performance, Unlimited,
3. Click Edit in the Workflow Actions section. and Developer Editions
4. Click Add Workflow Action in either the Immediate Workflow Actions or Time-Dependent
Actions section, depending on when you want the action to occur, and choose Select Existing
USER PERMISSIONS
Action.
5. Select the type of action to associate with the workflow rule. To select existing actions:
• Customize Application

566
Automate Your Business Processes Create a Workflow Rule

6. Select the actions in the Available Actions box and use the right arrow to move them to the Selected Actions box. If necessary,
select the left arrow to remove actions from the Available Actions box.
7. Save your changes.
To associate existing workflow actions with an approval process:
1. From Setup, enter Approval Processes in the Quick Find box, then select Approval Processes.
2. Click the name of an approval process.
3. Depending on when you want the action to occur, do one of the following:
• Click Add Existing in the Initial Submission Actions, Final Approval Actions, Final Rejection Actions, or Recall Actions section.
• Click Show Actions in the Approval Steps section, then click Add Existing in the Approval, Rejection, or Recall Actions section.
See Add an Existing Automated Action to Your Approval Process on page 600.
4. Select the type of action you want to associate with the approval process. The Available Actions box lists all existing actions of the
selected type.
5. Enter the name of a specific action in the text field and click Find.
6. Select the actions in the Available Actions box that you want to associate with the approval process, and use the right arrow to
move the actions to the Selected Actions box. If necessary, select the left arrow to remove actions from the Available Actions
box.
7. Save your changes.

SEE ALSO:
Manage Automated Actions in Workflow Rules

Activate Your Workflow Rule


Salesforce doesn't trigger a workflow rule until you activate it.
EDITIONS
To activate a workflow rule, click Activate on the workflow rule detail page. Click Deactivate to
prevent a rule from triggering or if you want to edit the time-dependent actions and time triggers Available in: Lightning
that are associated with the rule. Experience and Salesforce
Classic
You can deactivate a workflow rule at any time. However, if you deactivate a rule that has pending
actions, Salesforce completes those actions as long as the record that triggered the rule is not Available in: Enterprise,
updated. Performance, Unlimited,
and Developer Editions
Note:
• You can't delete a workflow rule that has pending actions in the workflow queue. Wait
USER PERMISSIONS
until pending actions are processed, or use the workflow queue to cancel the pending
actions. To create or change
• You can't add time-dependent workflow actions to active workflow rules. Deactivate the workflow rules and actions:
workflow rule first, add the time-dependent workflow action, and reactivate the rule. • Customize Application

SEE ALSO:
Set the Criteria for Your Workflow Rule

567
Automate Your Business Processes Workflow Limits

Workflow Limits
Salesforce limits the number of total and active rules in your org, the number of time triggers and
EDITIONS
actions per rule. It also processes a limited number of daily emails and hourly time triggers.
Available in: Lightning
Per-Org Limit Value Experience and Salesforce
Total rules across objects Classic

(Applies to any combination of workflow, Available in: Enterprise,


2,000 Performance, Unlimited,
assignment, auto-response, and escalation rules,
active and inactive.) and Developer Editions

Total rules per object


(Applies to any combination of workflow,
500
assignment, auto-response, and escalation rules,
active and inactive.)

Active rules per object


(Applies to any combination of active workflow,
50
assignment, auto-response, and escalation rules,
as well as record change processes.)

Time triggers per workflow rule1 10

Immediate actions per workflow rule1 40

Time-dependent actions per time trigger 40

Workflow time triggers per hour 1,000

Flow trigger workflow actions: flow variable 25 (N/A in Professional Edition)


assignments2

Combined total of these automations that start 20,000


or resume based on a record’s field value.
• Resume events that are defined in active
flows
• Groups of scheduled actions that are
defined in active processes
• Time triggers that are defined in active
workflow rules
• Inactive flow interviews that are resumed

1
The immediate actions and each time trigger can have:
• 10 email alerts
• 10 tasks
• 10 field updates
• 10 outbound messages

568
Automate Your Business Processes Workflow Limits

2
• 10 flow triggers
2
The pilot program for flow trigger workflow actions is closed. If you've already enabled the pilot in your org, you can continue to create
and edit flow trigger workflow actions. If you didn't enable the pilot in your org, use Flow Builder to create a record-triggered flow, or
use Process Builder to launch a flow from a process.

Daily Allocations for Email Alerts


The daily allocation for emails sent through email alerts is 1,000 per standard Salesforce license per org—except for free Developer
Edition and trial orgs, where the daily workflow email allocation is 15. The overall org allocation is 2,000,000. This allocation applies
to emails sent through email alerts in workflow rules, approval processes, flows, processes, or REST API. Single emails sent to external
email addresses are also limited, and how those limits are enforced depends on when your org was created.

Daily Allocations for Email Alerts


The daily allocation for emails sent through email alerts is 1,000 per standard Salesforce license per
EDITIONS
org—except for free Developer Edition and trial orgs, where the daily workflow email allocation is
15. The overall org allocation is 2,000,000. This allocation applies to emails sent through email alerts Available in: Lightning
in workflow rules, approval processes, flows, processes, or REST API. Single emails sent to external Experience and Salesforce
email addresses are also limited, and how those limits are enforced depends on when your org was Classic
created.
Available in: Enterprise,
After your org has reached its daily workflow email allocation: Performance, Unlimited,
• Any emails in the workflow queue not sent that day are discarded. Salesforce doesn't try to and Developer Editions
resend them later.
• If a workflow rule with an action and an email alert is triggered, only the email action is blocked.
• Final approval, final rejection, approval, rejection, and recall email actions are blocked.
• An error message is added to the debug log.
These items don't count against the workflow email allocation:
• Approval notification emails
• Task assignment notifications
• Lead assignment rules notifications
• Case assignment rules notifications
• Case escalation rules notifications
• Salesforce Sites usage alerts
The allocation restriction is based on activity in the 24-hour period starting and ending at midnight GMT. Adding or removing a user
license immediately adjusts the allocation's total. If you send an email alert to a group, every recipient in that group counts against your
daily workflow email allocation.
Each licensed org can send single emails to a maximum of 5,000 external email addresses per day based on Greenwich Mean Time
(GMT). For orgs created before Spring ’19, the daily limit is enforced only for emails sent via Apex and Salesforce APIs except for the REST
API. For orgs created in Spring ’19 and later, the daily limit is also enforced for email alerts, simple email actions, Send Email actions in
flows, and REST API. If one of the newly counted emails can’t be sent because your org has reached the limit, we notify you by email
and add an entry to the debug logs. Single emails sent using the email author or composer in Salesforce don't count toward this limit.
There’s no limit on sending single emails to contacts, leads, person accounts, and users in your org directly from account, contact, lead,
opportunity, case, campaign, or custom object pages. In Developer Edition orgs and orgs evaluating Salesforce during a trial period, you
can send to a maximum of 50 recipients per day, and each single email can have up to 15 recipients.

569
Automate Your Business Processes Workflow Considerations

When workflow email alerts approach or exceed certain allocations, Salesforce sends a warning email to the default workflow user or—if
the default workflow user isn't set—to an active system administrator.

When... Salesforce Sends... Warning Email Includes...


An email alert isn't sent because the number A warning email for each unsent email alert The unsent email alert’s content and
of recipients exceeds the allocation for a recipients
single email

The org reaches 90% of the allocation of One warning email The allocation and the org's usage
emails per day

The org reaches 90% of the allocation of One warning email The allocation and the org's usage
workflow emails per day

An email alert isn't sent because the org A warning email after every 100 attempted The allocation and the org's usage
reaches the allocation of emails per day email alerts over the allocation

An email alert isn't sent because the org A warning email after every 100 attempted The allocation and the org's usage
reaches the allocation of workflow emails email alerts over the allocation
per day

The org reaches the daily allocation for One warning email The allocation and the org that exceeded
single emails sent to external email address the allocation

Workflow Considerations
Learn the intricacies of workflow rules and workflow actions before you begin working with them.
EDITIONS
Tip: Whenever possible, automate your if/then statements with Process Builder instead of
workflow rules. Available in: Lightning
Experience and Salesforce
• Each workflow rule applies to a single object. Classic
• If you have workflow rules on converted leads and want to use cross-object field updates on
Available in: Enterprise,
the resulting accounts and opportunities, you must enable the lead setting Require
Performance, Unlimited,
Validation for Converted Leads.
and Developer Editions
• Workflow rules on custom objects are automatically deleted if the custom object is deleted.
• The order that individual actions and types of actions are executed in is not guaranteed. Field
update actions are executed first, followed by other actions.
• To create workflow rules that update case fields based on new case comments or incoming email messages, choose Case Comment
or Email Message from the Select Object dropdown list. Email Message is only available if Email-to-Case or On-Demand
Email-to-Case is enabled. You can only create email message workflow rules for field updates, and case comment workflow rules
for field updates, email alerts, and outbound messages. For example, you can create a workflow rule so that an email marked as Is
Incoming changes its case's Status from Closed to New.
• Changes you make to records while using Connect Offline are evaluated by workflow rules when you synchronize.
• Salesforce processes rules in the following order:
1. Validation rules
2. Assignment rules
3. Auto-response rules

570
Automate Your Business Processes Workflow Considerations

4. Workflow rules (with immediate actions)


5. Escalation rules

• If a lookup field references a record that is deleted, Salesforce clears the value of the lookup field by default. Or you can choose to
prevent record deletions if they’re in a lookup relationship.
• If you create workflow rules to replace any Apex triggers, make sure to delete those Apex triggers when you activate the equivalent
workflow rules. Otherwise, Apex triggers and workflow rules both fire and cause unexpected results, such as overwritten field updates
or redundant email messages.

• When an Account record’s owner field is changed, processes and workflows defined on the child object do not get triggered to run.

When Do Workflow Rules Get Triggered?


• Workflow rules can be triggered any time a record is saved or created, depending on your rule criteria. Rules created after saving
records don’t affect those records retroactively.
• Workflow rules are triggered when a standard or custom object in a master-detail or lookup relationship is reparented, even if the
object's evaluation criteria is set to Evaluate the rule when a record is: created, and any time it’s
edited to subsequently meet criteria.
• Saving or creating records can trigger more than one rule.
• Workflow rules only trigger on converted leads if validation and triggers for lead convert are enabled in your Salesforce org.
• Workflow rules trigger automatically and are invisible to the user. Alternatively, approval processes allow users to submit records for
approval.
• If your organization uses multiple languages, enter filter values in your individual language. You can add up to 25 filter criteria, of up
to 255 characters each.
When you use picklists to specify filter criteria, the selected values are stored in your org's default language. If you edit or clone
existing filter criteria, first set the Default Language on the Company Information page to the same language that was used
to set the original filter criteria. Otherwise, the filter criteria no longer matches your picklist values and returns inaccurate results.

• If you use record types in your workflow rule criteria whose labels have been translated using the translation workbench, the translated
label value doesn’t trigger the workflow rule. Workflow criteria evaluate the primary label value and ignore the translated value. To
avoid this problem, set the workflow criteria to evaluate the master record type label value by entering it manually in the Value
field.
• Campaign statistic fields, such as individual campaign statistics and campaign hierarchy statistics, can’t trigger workflow rules.
• A workflow rule isn't triggered if its condition references a field that doesn't have a value. For example, if a User-based workflow rule
checks “Role not equal to CEO”, the rule isn’t triggered for a user without an assigned role. Instead of conditions, use a formula to
check that the field is either null or set to something other than “CEO”:
UserRoleId == null || UserRole.Name != "CEO"

• The following actions don't trigger workflow rules.


– Mass replacing picklist values
– Using the option to replace a picklist value while deleting the current value.
– Mass updating address fields
– Mass updating divisions
– Changing the territory assignments of accounts and opportunities
– Converting leads to person accounts
– Deactivating Self-Service Portal, Customer Portal, or Partner Portal users

571
Automate Your Business Processes Workflow Considerations

– Converting state, country, and territory data from the State and Country/Territory Picklists page in Setup
– Changing state and country/territory picklists using AddressSettings in the Metadata API

Workflow Rule Limitations


• You can't package workflow rules with time triggers.
• You can't create outbound messages for workflow rules on junction objects.

Tip: Use the Developer Console to debug workflow rules. The Developer Console lets you view debug log details and information
about workflow rules and actions. For example, you can view the name of the user who triggered the workflow rule and the name
and ID of the record being evaluated.

Workflow for the User Object (Beta)


You can create workflow rules and actions for the User object. You can, for example, send welcome emails to new employees or
sync user data with a third-party service using outbound message actions.
Considerations for Time-Dependent Actions and Time Triggers

SEE ALSO:
Set the Criteria for Your Workflow Rule

Workflow for the User Object (Beta)


You can create workflow rules and actions for the User object. You can, for example, send welcome
EDITIONS
emails to new employees or sync user data with a third-party service using outbound message
actions. Available in: Lightning
Note: This release contains a beta version of workflow on the User object that is production Experience and Salesforce
Classic
quality but has known limitations. To provide feedback and suggestions, go to IdeaExchange.
Available in: Enterprise,
Performance, Unlimited,
Example Use Cases
and Developer Editions
For the User object, you can set up workflow rules to:
• Send welcome email messages with training resources to newly created users by using email
alert actions.
• Send emails when users change roles or are deactivated by using email alert actions.
• Deactivate temporary employees after a specified period by using field update actions.
• Sync user data with third-party systems by using outbound messages actions.

Merge Field Types for the User Object


To use merge fields from user records in email templates, select from the following merge field types:
• User Fields—Use these merge fields to represent the sending user. Merge fields named {!User.field_name} return values
from the user record of the person who created or updated the record that triggered the workflow rule.
• Workflow Target User Fields—Use these merge fields only in email templates for workflow rules on the User object. Merge fields
named {!Target_User.field_name} return values from the user record that was created or updated to trigger the
workflow rule.

572
Automate Your Business Processes Workflow Considerations

Beta Limitations for Workflow on the User Object


Understand these limitations before you create workflow rules or workflow actions for the User object.
• Tasks are not supported as workflow actions for the User object.
• When setting the workflow rule criteria, you can’t select Current User fields using the picklists. You can, however, use a formula
to set the rule criteria and include fields from the current user. In the formula editor, click Insert Field, select $User, select the
field, and click Insert.
• Remember that custom validation rules run before workflow rules are executed. Refer to “Triggers and Order of Execution” in the
Apex Developer Guide.

SEE ALSO:
Workflow Considerations

Considerations for Time-Dependent Actions and Time Triggers


When creating time-dependent actions and time triggers for workflow rules, consider the following.
EDITIONS

Defining Time Triggers Available in: Lightning


Experience and Salesforce
• When defining a time trigger, use standard and custom date and date/time fields defined for Classic
the object. Specify time using days and hours. The valid range is 0 to 999 days or hours.
Available in: Enterprise,
• You can modify existing time triggers by adding or removing actions.
Performance, Unlimited,
Note: Removing all the actions from a time trigger does not remove the trigger. Empty and Developer Editions
triggers are still queued and count against your hourly workflow time trigger limit. To
remove scheduled time triggers, delete them from the workflow queue.

Time Trigger Processing


• Time-dependent actions aren’t executed independently. They’re grouped into a single batch that starts executing within one hour
after the first action enters the batch.

Note: Actual execution may be delayed based on service availability.

• Apex triggers that fire as a result of time-dependent actions may get executed in a single batch or independently. Follow these best
practices:
– In case they fire independently–Ensure that your Apex logic is scoped for a single scheduled action. For example, don't use Apex
static variables to communicate state across Apex code triggered by different scheduled actions.
– In case they fire in a single batch–Be aware of how the combination of your time-dependent actions and Apex triggers impact
your Apex governor limits.

• Salesforce evaluates time-based workflow on the organization’s time zone, not the user’s. Users in different time zones might see
differences in behavior.
• Salesforce doesn’t necessarily execute time triggers in the order they appear on the workflow rule detail page. Workflow rules list
time triggers that use the Before field first, followed by time triggers that use the After field.
• Salesforce doesn't display time-dependent action controls on the workflow rule edit page if you set the workflow rule evaluation
criteria to Evaluate the rule when created, and every time it’s edited.

573
Automate Your Business Processes Workflow Considerations

• If you change a date field that is referenced by an unfired time trigger in a workflow rule that has been evaluated, Salesforce recalculates
the unfired time triggers associated with the rule. For example, if a workflow rule is scheduled to alert the opportunity owner 7 days
before the opportunity close date and the close date is set to 2/20/2011, Salesforce sends the alert on 2/13/2011. If the close date
is updated to 2/10/2011 and the time trigger hasn't fired, Salesforce reschedules the alert for 2/3/2011. If Salesforce recalculates the
time triggers to a date in the past, Salesforce triggers the associated actions shortly after you save the record.
• If a workflow rule has a time trigger set for a time in the past, Salesforce queues the associated time-dependent actions to start
executing within one hour. For example, if a workflow rule on opportunities is configured to update a field 7 days before the close
date, and you create an opportunity record with the close date set to today, Salesforce starts to process the field update within an
hour after you create the opportunity.
• Time-dependent actions remain in the workflow queue only as long as the workflow rule criteria are still valid. If a record no longer
matches the rule criteria, Salesforce removes the time-dependent actions queued for that record.
For example, an opportunity workflow rule can specify:
– A criteria set to “Opportunity: Status not equals to Closed Won, Closed Lost”
– An associated time-dependent action with a time trigger set to 7 days before the opportunity close date
If a record that matches the criteria is created on July 1 and the Close Date is set to July 30, the time-dependent action is
scheduled for July 23. However, if the opportunity is set to “Closed Won” or “Closed Lost” before July 23, the time-dependent action
is removed from the queue.

• Salesforce ignores time triggers that reference null fields.


• Time-dependent actions can automatically be queued again if the record is updated and the evaluation criteria is set to Evaluate
the rule when a record is: created, and any time it’s edited to subsequently meet
criteria. Using the previous example, if the opportunity status is changed from Closed Lost to Prospecting and the workflow
rule evaluation criteria is Evaluate the rule when a record is: created, and any time it’s edited
to subsequently meet criteria, Salesforce reevaluates the time triggers and adds the appropriate actions to the
workflow queue.
• Deleting a record that has pending actions removes the pending actions from the workflow queue. You can't restore the actions,
even if you undelete the record.
• If the evaluation criteria is set to Evaluate the rule when a record is: created, the workflow rule evaluates
its time triggers only once. If the record that fired the rule changes to no longer meet the evaluation criteria, Salesforce removes the
pending actions from the queue and never reapplies the rule to the record.
• You can deactivate a workflow rule at any time. If the rule has pending actions in the workflow queue, editing the record that
triggered the rule removes the pending actions from the queue. If you don't edit the record, the pending actions are processed even
though the rule has been deactivated.
• Time-dependent actions aren't executed for a reevaluated workflow rule in the following situations:
– The reevaluated workflow rule’s immediate actions cause the record to no longer meet the workflow rule criteria.
– An Apex after trigger that is executed as a result of a workflow or approvals action causes the record to no longer meet the
workflow rule criteria.

• Configuring a task’s Due Date to “Rule Trigger Date” sets time triggers and workflow task due dates based on the date that the
workflow time trigger’s action is executed. For example, if the task due date is “Rule Trigger Date plus 10 days” and the time trigger
is executed on January 1, Salesforce sets the task due date to January 11.
• You can add a new active workflow rule with time triggers in a change set and deploy it. You can only change time triggers on a
workflow rule in a change set if it's inactive. The rule must be activated in the destination organization manually or through another
change set that only activates workflow rules and makes no time trigger changes.

574
Automate Your Business Processes Workflow Considerations

For example, let’s say you have an inactive workflow rule in your destination organization, and your change set contains an active
workflow rule with the same name and new or different time triggers. The deployment fails because it activates the workflow rule
first and then tries to add or remove the time triggers.

Note: You must add time-dependent actions manually when including a workflow rule in a change set. The View/Add
Dependencies function doesn’t detect time-dependent actions.

Using Time-Dependent Workflow with Leads


• You can’t convert a lead that has pending actions.
• If Validation and Triggers from Lead Convert is enabled, existing time-based workflow actions on leads aren't triggered during lead
conversion.
• If a campaign member based on a lead is converted before the completion of the time-based workflow actions associated with it,
Salesforce still performs the time-based workflow actions.

Limitations
• Time triggers don’t support minutes or seconds.
• Time triggers can’t reference the following:
– DATE or DATETIME fields containing automatically derived functions, such as TODAY or NOW.
– Formula fields that include related-object merge fields.

• Salesforce limits the number of time triggers an organization can execute per hour. If an organization exceeds the limits for its Edition,
Salesforce defers the execution of the additional time triggers to the next hour. For example, if an Unlimited Edition organization
has 1,200 time triggers scheduled to execute between 4:00 PM and 5:00 PM, Salesforce processes 1,000 time triggers between 4:00
PM and 5:00 PM and the remaining 200 time triggers between 5:00 PM and 6:00 PM.
• You can't archive a product or price book that has pending actions.
• If time-based workflow actions exist in the queue, you can’t add or remove time triggers or edit trigger dates without deleting the
actions first. Because the deleted records can’t be restored, carefully consider the implications of editing the workflow rules before
you proceed. If you decide to edit the workflow rules, deactivate the workflow that you want to edit, edit the rules as needed, and
then save your changes. For information about finding and deleting time-based workflow actions in the queue, see Monitor Pending
Workflow Actions on page 585.
You also can’t add or remove time triggers if:
– The workflow rule is active.
– The workflow rule is deactivated, but has pending actions in the queue.
– The workflow rule evaluation criteria is set to Evaluate the rule when a record is: created, and
every time it’s edited.
– The workflow rule is included in a package.

SEE ALSO:
Add Automated Actions to Your Workflow Rule
Identify Your Salesforce Org’s Default Workflow User

575
Automate Your Business Processes Workflow Rule Examples

Workflow Rule Examples


Looking for ideas on how workflow rules can help streamline your business? Check out these
EDITIONS
examples.

Important: Where possible, we changed noninclusive terms to align with our company Available in: Lightning
value of Equality. We maintained certain terms to avoid any effect on customer Experience and Salesforce
Classic
implementations.
Business Processes Available in: Enterprise,
Follow Up Before Contract Expires Performance, Unlimited,
and Developer Editions
Follow Up when Platinum Contract Case Closes
Assign Credit Check for New Customer
Notify Account Owner About New, High-Priority Cases
Set a Default Entitlement for Each New Case
Update Shipment Status if Shipment is Delayed
Automatically Activate New Users
Cross-Object Processes
Notify Sales VP About Cases Filed for Top Accounts
Set Default Opportunity Name
Set Target Resolution Date for Cases
Update Application Record when Candidate Accepts Job
Deal Management
Track Closed Opportunities
Override Default Opportunity Close Date
Report Lost Opportunities
Report Unassigned Leads
Send Alert if Quote Line Item Discount Exceeds 40%
Notifications
Notify Key People About Account Owner Changes
Set Reminder for Contact Birthday
Set Reminder for High-Value Opportunity Close Date
Notify Account Owner of Updates by Others

Follow Up Before a Contract Expires

Object Contract

Description Email a reminder to the renewal manager 20 days before a contract’s end date.

Evaluation Criteria Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria

576
Automate Your Business Processes Workflow Rule Examples

Rule Criteria (Filter) Run this rule if the following criteria is met.
(Contract: Status equals Activated)

Immediate Actions None

Time-Dependent Actions 20 Days Before Contract: End Date—Email Alert: Email a reminder to the renewal manager to
confirm whether the client wants an extension.

Follow Up When a Platinum Contract Case Closes


This example assumes that a Contract Type custom picklist is used to identify the contract level on cases and that the picklist
contains the Platinum value.

Object Case

Description If the customer has a platinum contract agreement, email a feedback request to the case contact 7 days
after a high-priority case has been closed.

Evaluation Criteria Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria

Rule Criteria (Filter) Run this rule if the following criteria are met.
(Case: Priority equals High) and
(Case: Closed equals True) and
(Case: Contract Type equals Platinum)

Immediate Actions None

Time-Dependent Actions 7 Days After Case: Date/Time Closed—Email Alert: Email a feedback request to the case contact.

Assign Credit Check for a New Customer


This example assumes that a New Customer custom field is on opportunities.

Object Opportunity

Description Assign the Accounts Receivable (AR) department a task to check the credit of a potential customer 15
days before the opportunity close date if the amount is greater than $50,000.

Evaluation Criteria Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria

Rule Criteria (Filter) Run this rule if the following criteria are met.
(Opportunity: Amount greater than 50000) and
(Opportunity: Closed equals False) and
(Opportunity: New Customer equals True)

Immediate Actions None

Time-Dependent Actions 15 Days Before Opportunity: Close Date—Task: Create a task for users in the Accounts Receivable role
to run a credit check.

577
Automate Your Business Processes Workflow Rule Examples

Notify Account Owner About New, High-Priority Cases


This example assumes that a Service Level Agreement custom picklist called SLA identifies the agreement level on accounts and contains
the Platinum value.

Object Case

Description Notify the account owner when a high-priority case is created for accounts with a platinum SLA.

Evaluation Criteria Evaluate the rule when a record is: created

Rule Criteria (Filter) Run this rule if the following criteria are met.
(Case: Priority equals High) and
(Account: SLA equals Platinum)

Immediate Actions Email Alert: Email the details of the high-priority case to the account owner.

Time-Dependent Actions None

Set a Default Entitlement for Each New Case


This example assumes that an active, autolaunched flow looks up the relevant entitlement based on the account, asset, or contact
associated with the new case and updates the case with the entitlement name.
The pilot program for flow trigger workflow actions is closed. If you've already enabled the pilot in your org, you can continue to create
and edit flow trigger workflow actions. If you didn't enable the pilot in your org, use Flow Builder to create a record-triggered flow, or
use Process Builder to launch a flow from a process.

Object Case

Description Set a default entitlement on each new case.

Evaluation Criteria Evaluate the rule when a record is: created

Rule Criteria (Filter) Run this rule if the following criteria is met.
(Case: Status not equal to Closed)

Immediate Actions Flow Trigger: Look up and assign the relevant entitlement to the case. Pass the account, asset,
or contact associated with the new case into the relevant flow variable to enable the entitlement lookup.
Pass the case ID into the relevant flow variable to enable the case update.

Time-Dependent Actions None.

Update Shipment Status If Shipment Is Delayed

Object Shipment

Description Update the Shipment Status field to Delayed if a shipment has exceeded the expected delivery
date and hasn’t reached the customer.

Evaluation Criteria Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria

578
Automate Your Business Processes Workflow Rule Examples

Rule Criteria (Filter) Run this rule if the following criteria is met.
(Shipment: Status not equal to Delivered)

Immediate Actions None

Time-Dependent Actions 1 day after Shipment: Expected Delivery Date—Field Update: Change Shipment Status
field to Delayed on Shipment record.

Automatically Activate New Users

Object User

Description Make sure that each new user is active so that the user can log in to Salesforce.

Evaluation Criteria Evaluate the rule when a record is: created

Rule Criteria (Filter) Run this rule if the following criteria is met.
(User: Active equals False)

Immediate Actions Field Update: Set Active to True.

Time-Dependent Actions None.

Notify Sales VP About Cases Filed for Top Accounts


This workflow rule is for sales VP who want to know about cases filed for top accounts. Top accounts are determined by size and revenue.

Object Case

Description Notify sales VP about cases filed for top accounts.

Evaluation Criteria Evaluate the rule when a record is: created

Rule Criteria (Filter) Run this rule if the following criteria are met.
AND(Account.AnnualRevenue > 500000, Account.NumberOfEmployees > 5000)

Immediate Actions Email Alert: Notify VP about cases for large accounts.

Time-Dependent Actions None

Set Default Opportunity Name


The opportunity naming convention for some companies is Account Name: Opportunity Name. To automate the default
name of each opportunity in your org, create the following workflow rule.

Object Opportunity

Description Enforce opportunity naming convention.

579
Automate Your Business Processes Workflow Rule Examples

Evaluation Criteria Evaluate the rule when a record is: created, and every time it’s edited

Rule Criteria (Filter) Run this rule if the following criteria is met.
NOT(CONTAINS( Name, Account.Name ))

Immediate Actions Field Update: Set opportunity name to the following formula.

Account.Name & ": " & Name

Time-Dependent Actions None

Set Target Resolution Date for Cases


This example sets a case resolution date based on the value of a field on the associated account. It uses a custom picklist field on accounts
called Support Level, which has three values: Basic, Standard, and Premium. It also has a custom date field on cases called Target
Resolution Date.
Use the following three workflow rule examples to set the target resolution date of a case based on the support level for the related
account.
Set Resolution Date for Basic Support

Object Case

Description Set the case target resolution date for accounts that have basic support level to 30 days from today.

Evaluation Criteria Evaluate the rule when a record is: created

Rule Criteria (Filter) Run this rule if the following formula is true.
ISPICKVAL(Account.Support_Level__c , "Basic")

Immediate Actions Field Update: Set the Target Resolution Date to Today() + 30.

Time-Dependent Actions None

Set Resolution Date for Standard Support

Object Case

Description Set the case target resolution date for accounts that have standard support level to 14 days from today.

Evaluation Criteria Evaluate the rule when a record is: created

Rule Criteria (Filter) Run this rule if the following formula is true.
ISPICKVAL(Account.Support_Level__c , "Standard")

Immediate Actions Field Update: Set the Target Resolution Date to Today() + 14.

Time-Dependent Actions None

580
Automate Your Business Processes Workflow Rule Examples

Set Resolution Date for Premium Support

Object Case

Description Set the case target resolution date for accounts that have premium support level to 5 days from today.

Evaluation Criteria Evaluate the rule when a record is: created

Rule Criteria (Filter) Run this rule if the following formula is true.
ISPICKVAL(Account.Support_Level__c , "Premium")

Immediate Actions Field Update: Set the Target Resolution Date to Today() + 5.

Time-Dependent Actions None

Update Application Record When Candidate Accepts Job


This workflow rule closes the Application record when a candidate accepts the job. Cross-object field updates to the master record are
supported between custom objects in a master-detail relationship.

Object Candidate

Description Change the Application Status field to Closed for the custom Application object when the
Candidate Status field for the custom Candidate object changes to Accepted.

Evaluation Criteria Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria

Rule Criteria (Filter) Run this rule if the following criteria is met.
(Candidate: Status equals Accepted)

Immediate Actions Field Update: Change the Application Status field to Closed on parent Application
record.

Time-Dependent Actions None

Track Closed Opportunities


This example assumes that a Closed Opportunities record type provides additional information to certain profiles.

Note: For information on record types, see Tailor Business Processes to Different Users Using Record Types.

Object Opportunity

Description Change the record type of closed-won opportunities.

Evaluation Criteria Evaluate the rule when a record is: created, and every time it’s edited

Rule Criteria (Filter) Run this rule if the following criteria are met.
(Opportunity: Closed equals True) and
(Opportunity: Stage equals Closed Won)

581
Automate Your Business Processes Workflow Rule Examples

Immediate Actions Field Update: Set the record type to Closed Opportunities.

Time-Dependent Actions None

Override the Default Opportunity Close Date

Object Opportunity

Description Override the default close date from the close of the quarter to 6 months after the opportunity is created.

Evaluation Criteria Evaluate the rule when a record is: created

Rule Criteria (Filter) Run this rule if the following criteria is met.
(Opportunity: Closed equals False)

Immediate Actions Field Update: Use the following formula to set the opportunity close date to 6 months after the
creation date.
DATE( YEAR(TODAY()) , (MONTH(TODAY()) + 6), DAY(TODAY()))

Time-Dependent Actions None

Report Lost Opportunities

Object Opportunity

Description Notify the VP of sales when a deal is lost if the stage was Proposal/Price Quote and the amount was
greater than $1 million.

Evaluation Criteria Evaluate the rule when a record is: created, and every time it’s edited

Rule Criteria (Filter) Run this rule if the following formula is true.
AND( ISCHANGED(StageName), ISPICKVAL(PRIORVALUE(StageName) ,
"Proposal/Price Quote"), ISPICKVAL(StageName,"Closed Lost"), (Amount
>1000000))

Immediate Actions Email Alert: Notify the VP of sales role that the deal was lost.

Time-Dependent Actions None

Report Unassigned Leads


This example assumes that all unassigned leads are placed in an unassigned leads queue by a leads assignment rule.

Object Lead

Description Ensure that unassigned leads are tracked in a timely manner by notifying the manager if a lead is not
accepted in 2 days.

582
Automate Your Business Processes Workflow Rule Examples

Evaluation Criteria Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria

Rule Criteria (Filter) Run this rule if the following criteria is met.
Lead Owner equals Unassigned Lead Queue

Immediate Actions None

Time-Dependent Actions 2 Days After Lead: Last Modified Date—Email Alert: Notify the manager role that the queue has
unassigned leads that are older than 2 days.

Send Alert If Quote Line Item Discount Exceeds 40%

Object Quote Line Item

Description Ensure that an email alert is sent if a sales rep applies a quote line item discount that exceeds 40%.

Evaluation Criteria Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria

Rule Criteria (Filter) Run this rule if the following criteria is met.
Quote Line Item: Discount is greater than 40

Immediate Actions Email Alert: Notify the manager role that the quote line item discount exceeds 40%.

Time-Dependent Actions None

Notify Key People About Account Owner Changes

Object Account

Description Notify key people in the sales department when the owner of an account changes if the account’s annual
revenue is greater than $1 million.

Evaluation Criteria Evaluate the rule when a record is: created, and every time it’s edited

Rule Criteria (Filter) Run this rule if the following formula is true.
AND( ISCHANGED(OwnerId), AnnualRevenue > 1000000 )

Immediate Actions Email Alert: Notify the person in the sales operations role of the change in account ownership.

Time-Dependent Actions None

Set Reminder for Contact Birthday


This example assumes that a Next Birthday custom formula field uses the following formula to calculate the date of the contact’s
next birthday on contact records.
IF(MONTH(Birthdate) > MONTH(TODAY()),DATE(YEAR(TODAY()),MONTH(Birthdate),DAY(Birthdate)),
IF(MONTH(Birthdate) < MONTH(TODAY()),DATE(YEAR(TODAY())+1,MONTH(Birthdate),DAY(Birthdate)),

583
Automate Your Business Processes Workflow Rule Examples

IF(DAY(Birthdate) >= (DAY(TODAY())),DATE(YEAR(TODAY()),MONTH(Birthdate),DAY(Birthdate)),


DATE(YEAR(TODAY())+1,MONTH(Birthdate),DAY(Birthdate)))))

Object Contact

Description Send an email to the contact 2 days before the contact’s birthday.

Evaluation Criteria Evaluate the rule when a record is: created

Rule Criteria (Filter) Run this rule if the following formula is true.
(Contact: Birthdate not equal to null) and
(Contact: Email not equal to null)

Immediate Actions None

Time-Dependent Actions 2 Days Before Contact: Next Birthday—Email Alert: Send a birthday greeting to the contact’s
email address.

Set Reminder for High-Value Opportunity Close Date

Object Opportunity

Description Remind the opportunity owner and senior management when the close date is approaching for an
opportunity that has an amount greater than $100,000. Create a follow-up task for the opportunity owner
if the deal is still open when the close date passes.

Evaluation Criteria Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria

Rule Criteria (Filter) Run this rule if the following criteria are met.
(Opportunity: Amount greater than 100000) and
(Opportunity: Closed equals False)

Immediate Actions None

Time-Dependent Actions • 30 Days Before Opportunity: Close Date—Email Alert: Notify the opportunity owner that 30
days remain.
• 15 Days Before Opportunity: Close Date—Email Alert: Notify the opportunity owner that 15
days remain.
• 5 Days After Opportunity: Close Date—Task: Create a follow-up task for the opportunity owner
to update the deal. Email Alert: Notify senior management to involve executives.

Notify Account Owner of Updates by Others

Object Account

Description Notify the account owner when someone else updates the account if the account’s annual revenue is
greater than $1 million.

584
Automate Your Business Processes Monitor Pending Workflow Actions

Evaluation Criteria Evaluate the rule when a record is: created, and every time it’s edited

Rule Criteria (Filter) Run this rule if the following formula is true.
AND( (LastModifiedById <> OwnerId), (AnnualRevenue > 1000000) )

Immediate Actions Email Alert: Notify the account owner that someone else has updated the account.

Time-Dependent Actions None

SEE ALSO:
Workflow
Set the Criteria for Your Workflow Rule

Monitor Pending Workflow Actions


When a workflow rule that has time-dependent actions is triggered, use the workflow queue to
EDITIONS
view pending actions and cancel them if necessary.
1. From Setup, enter Time-Based Workflow in the Quick Find box, then select Available in: Salesforce
Time-Based Workflow. Classic
2. Click Search to view all pending actions for any active workflow rules, or set the filter criteria Available in: Enterprise,
and click Search to view only the pending actions that match the criteria. The filter options are: Performance, Unlimited,
Developer, and
• Workflow Rule Name: The name of the workflow rule.
Database.com Editions
• Object: The object that triggered the workflow rule. Enter the object name in the singular
form. Workflow tasks and email
alerts are not available in
• Scheduled Date: The date the pending actions are scheduled to occur.
Database.com
• Create Date: The date the record that triggered the workflow was created.
• Created By: The user who created the record that triggered the workflow rule.
USER PERMISSIONS
• Record Name: The name of the record that triggered the workflow rule.
The filter is not case-sensitive. To manage the workflow
queue:
To cancel pending actions: • Modify All Data

1. Select the box next to the pending actions you want to cancel.
2. Click Delete.

585
Automate Your Business Processes Workflow Terminology

Workflow Terminology
The following terms are used when describing workflow features and functionality.
EDITIONS
Workflow Rule
A workflow rule sets workflow actions into motion when its designated conditions are met. Available in: both Lightning
You can configure workflow actions to execute immediately when a record meets the conditions Experience and Salesforce
in your workflow rule, or set time triggers that execute the workflow actions on a specific day. Classic
If a workflow action hasn’t executed yet, you can view and modify it in the workflow queue. Flow triggers are available
Workflow Action in: Salesforce Classic
A workflow action, such as an email alert, field update, outbound message, or task, fires when
the conditions of a workflow rule are met. Available in: Enterprise,
Performance, Unlimited,
Email Alert and Developer Editions
Email alerts are actions that send emails, using a specified email template, to specified recipients.
Outbound messages
Workflow alerts can be sent to any user or contact, as long as they have a valid email address.
available in: Professional,
Field Update Enterprise, Performance,
A field update is an action that automatically updates a field with a new value. Unlimited, and Developer
Editions
Flow
A flow is an application that can execute logic, interact with the Salesforce database, call Apex Email alerts are available in:
classes, and collect data from users. You can build flows by using Flow Builder. Essentials, Professional,
Enterprise, Performance,
Flow Trigger
Unlimited, and Developer
A flow trigger is a workflow action that launches a flow. With flow triggers, you can automate Editions
complex business processes—create flows to perform logic, and have events trigger the flows
via workflow rules—without writing code.
The pilot program for flow trigger workflow actions is closed. If you've already enabled the pilot in your org, you can continue to
create and edit flow trigger workflow actions. If you didn't enable the pilot in your org, use Flow Builder to create a record-triggered
flow, or use Process Builder to launch a flow from a process.
Outbound Message
An outbound message sends information to a designated endpoint, like an external service. Outbound messages are configured
from Setup. You must configure the external endpoint and create a listener for the messages using the SOAP API.

Approvals
It’s likely that you’re familiar with process automation in the form of workflow rules. Approvals take
EDITIONS
automation one step further, letting you specify a sequence of steps that are required to approve
a record. Available in: both Salesforce
An approval process automates how records are approved in Salesforce. An approval process Classic and Lightning
specifies each step of approval, including from whom to request approval and what to do at each Experience
point of the process.
Available in: Enterprise,
Example: Your org has a three-tier process for approving expenses. This approval process Performance, Unlimited,
automatically assigns each request to right person in your org, based on the amount requested. and Developer Editions

If an expense record is submitted for approval, lock the record so that users cannot edit it and
change the status to Submitted.

586
Automate Your Business Processes Set Up an Approval Process

If the amount is $50 or less, approve the request. If the amount is greater than $50, send an approval request to the direct manager.
If the amount is greater than $5,000 and the first approval request is approved, send an approval request to the vice president.
If all approval requests are approved, change the status to Approved and unlock the record. If any approval requests are rejected,
change the status to Rejected and unlock the record.

Set Up an Approval Process


If Approvals is the right automation tool for your business process, follow these high-level steps to create one for your org.
Prepare Your Org for Approvals
Make sure that your users can submit their records for approval, and consider how you can make it easy for approvers to respond
to approval requests.
Limits and Considerations for Approvals
Before you automate something with an approval process, be aware of the limits and considerations.
Sample Approval Processes
Review samples of common approval processes to help you get started creating your own.
Approval History Reports
If you create a custom report type for approval process instances, users can view the historical details of completed and in-progress
approval processes and their individual steps.
Manage Multiple Approval Requests
Transfer multiple approval requests from one user to another or remove multiple approval requests from the approval process.
Approval Requests for Users
Your admin can set up approval processes that let you and other users submit records for approval, which results in approval requests.
Approval Process Terminology

Set Up an Approval Process


If Approvals is the right automation tool for your business process, follow these high-level steps to
EDITIONS
create one for your org.
Available in: both Salesforce
1. Prepare to Create an Approval Process Classic and Lightning
Plan each approval process carefully to ensure a successful implementation. Experience

2. Choose the Right Wizard to Create an Approval Process Available in: Enterprise,
Before you create an approval process, determine which wizard is best for your needs. Performance, Unlimited,
and Developer Editions
3. Add an Approval Step to an Approval Process
Approval steps define the chain of approval for a particular approval process. Each step
determines which records can advance to that step, who to assign approval requests to, and USER PERMISSIONS
whether to let each approver’s delegate respond to the requests. The first step specifies what
To create approval
to do if a record doesn’t advance to that step. Later steps specify what happens if an approver processes:
rejects the request. • Customize Application
4. Add Automated Actions to an Approval Process
You can associate actions to approval steps, initial submission, final approval, final rejection, or
recall. Approval processes support four automated actions.

587
Automate Your Business Processes Set Up an Approval Process

5. Activate an Approval Process


After you’ve created at least one step for the approval process, activate the process.

SEE ALSO:
Approval Process Terminology
Sample Approval Processes
Prepare Your Org for Approvals

Prepare to Create an Approval Process


Plan each approval process carefully to ensure a successful implementation.
EDITIONS
Review the following checklist before creating your approval process.
Available in: both Salesforce
• Prepare an approval request email template.
Classic and Lightning
• Prepare an approval request post template. Experience
• Determine the approval request sender.
Available in: Enterprise,
• Determine the assigned approver. Performance, Unlimited,
• Determine the delegated approver. and Developer Editions
• Decide if your approval process needs a filter.
• Design initial submission actions.
• Decide if users can approve requests from a wireless device.
• Determine if users can edit records that are awaiting approval.
• Decide if records should be auto-approved or rejected.
• Determine how many levels your process has.
• Determine the actions when an approval request is approved or rejected.
Which email template do you want to use for approval requests?
The email template you specify on an approval process is used when notifying users that an approval request is assigned to them.
You can use the Salesforce default email template or create your own template. Include the appropriate approval process merge
fields to link directly to the approval request.
Does your org have email approval response enabled? If so, the default email template includes instructions for replying to an
approval request. Type approve, approved, yes, reject, rejected, or no in the first line of the email body and add
comments in the second line.
Which Chatter post template do you want to use for approval requests?
If your org has Approvals in Chatter enabled, specify an approval post template to use when notifying a user via Chatter about an
assigned approval request. You can use the Salesforce default post template or create your own.
Who is the sender of approval requests?
Approval request notifications are sent from the user who submitted the record for approval. When you configure an email alert,
you can add a different return email address for these notifications. You can choose the email address of the default workflow user
or a previously configured and verified org-wide address. Determine which email address to use.
Who can approve requests?
Any of the following can approve or reject a request.
• A user or queue that the approval request submitter chooses.
• A queue specified by the administrator.

588
Automate Your Business Processes Set Up an Approval Process

• A user listed in the Manager standard field on the submitter’s user detail page.
• A user listed in a custom hierarchy field on the submitter’s user detail page.
• Any combination of users and related users (users listed in a standard or custom field on the submitted record) specified by the
administrator.
Do you want approval requests delegated to another user for approval?
An approver can designate a delegate to approve requests, but you can disable this option. To assign delegates, for each user,
populate the Delegated Approver field on the user’s detail page.

Note: Internal Salesforce users are listed by and can be added using the Delegated Approver lookup field. Use Data Loader
and a comma-delineated (CSV) file to add users with communities licenses as Delegated Approvers. The CSV uses the
CommunityUserId rather than the UserId for DelegatedApproverId. Communities licenses are used with
Experience Cloud sites and legacy portals.
Which records are included in this process?
Determine what attributes a record must have to be included in your approval process. If necessary, create the custom fields to store
this information so that you can use it in your filter criteria. For example, if you want to include expense records from your headquarters
office only, create a custom picklist field called Office Location that has two options: “HQ” and “Field.” Then, you would
specify in your filter criteria that records must have “HQ” in the Office Location field to be included in the approval process.
What happens when a record is first submitted for approval?
When users submit a record for approval, Salesforce automatically locks the record so that other users cannot change it while it is
awaiting approval. You can still add campaign members to campaigns locked for approval.
Decide if you want other workflow actions to happen when a record is first submitted, such as email alerts, tasks, field updates, and
outbound messages. These actions become your initial submission actions.
Can users approve requests from a mobile device?
Determine if you want to require users to log in to Salesforce to approve requests. You can also set up your approval process to allow
users to approve requests remotely using a mobile browser.
Who can edit records that are awaiting approval?
Records submitted for approval are locked. Users with the “Modify All” object-level permission for the given object or the “Modify
All Data” permission can always unlock a record and edit it. You can also specify that the currently assigned approver can edit the
record. You can still add campaign members to campaigns locked for approval.
Can records be automatically approved, rejected, or skipped based on certain criteria?
You can set entry criteria for each step of your process. Configure Salesforce to approve, reject, or skip the process if a record doesn’t
meet the criteria. For example, all expenses submitted with an Amount less than $15 are automatically approved.
How many people have to approve these requests?
An approval process can have several layers of approvals. Determine how many users have to approve requests and in what order.
What happens when a request is approved or rejected?
When a request is recalled, approved, or rejected, Salesforce can perform up to 10 instances of each of the following types of
actions—up to 40 actions total. You can also configure up to 40 actions to occur when a record has received all necessary approvals
or is rejected.

SEE ALSO:
Set Up an Approval Process
Limits and Considerations for Approvals
Sample Approval Processes

589
Automate Your Business Processes Set Up an Approval Process

Choose the Right Wizard to Create an Approval Process


Before you create an approval process, determine which wizard is best for your needs.
EDITIONS

Create an Approval Process with the Jump Start Wizard Available in: both Salesforce
For approval processes that use a single step, use the jump start wizard. This wizard chooses Classic and Lightning
some default options for you. Experience

Default Selections for the Approval Process Jump Start Wizard Available in: Enterprise,
To make it easier for you to get started with a simple approval process, the jump start wizard Performance, Unlimited,
automatically chooses some default options for you. and Developer Editions

Create an Approval Process with the Standard Wizard


When your approval process is more complex and you want to define specific steps, use the standard wizard.

SEE ALSO:
Set Up an Approval Process

Create an Approval Process with the Jump Start Wizard


For approval processes that use a single step, use the jump start wizard. This wizard chooses some
EDITIONS
default options for you.
1. From Setup, enter Approval Processes in the Quick Find box, then select Approval Available in: both Salesforce
Processes. Classic and Lightning
Experience
2. Select an object.
3. Select Create New Approval Process > Use Jump Start Wizard. Available in: Enterprise,
Performance, Unlimited,
4. Configure the approval process by following the wizard. and Developer Editions
a. Default Selections for the Approval Process Jump Start Wizard
b. Choose Approval Request Notification Templates USER PERMISSIONS
c. Design the Approval Request Page
To create approval
d. Control Which Records Apply to an Approval Process processes:
• Customize Application
e. Identify Assigned Approvers for an Approval Step

SEE ALSO:
Default Selections for the Approval Process Jump Start Wizard
Considerations for Configuring Approvals
Considerations for Setting Approvers
Set Up an Approval Process
Choose the Right Wizard to Create an Approval Process

590
Automate Your Business Processes Set Up an Approval Process

Default Selections for the Approval Process Jump Start Wizard


To make it easier for you to get started with a simple approval process, the jump start wizard
EDITIONS
automatically chooses some default options for you.
After creating an approval process using the jump start wizard, you can modify these default options Available in: both Salesforce
and add more steps from the approval process detail page. Exception: you can’t modify the Record Classic and Lightning
Lock action on the Initial Submission Actions list. Experience

• To edit records awaiting approval in the approval process, users must have the “Modify All” Available in: Enterprise,
permission for the given object or the Modify All Data permission. Performance, Unlimited,
• The page layout for the approval request includes the record name (or number), owner, date and Developer Editions
created, and approval history.
• The security settings require approvers to log in to Salesforce to view the approval page.
• Only the owner of the record can submit the record for approval.
• Records are locked when submitted for approval.
• Records remain locked until approved or rejected.
• Rejected records are unlocked.
• Only admins can recall a record after it’s submitted.
• There are no auto-approve or auto-reject actions.
• No email notification is sent upon approval or rejection.
• No field values are automatically updated during the approval process.
• An approver cannot automatically delegate another user to approve the approval requests.
• The Allow submitters to recall approval requests option is not selected.

SEE ALSO:
Create an Approval Process with the Jump Start Wizard
Choose the Right Wizard to Create an Approval Process

Create an Approval Process with the Standard Wizard


When your approval process is more complex and you want to define specific steps, use the standard
EDITIONS
wizard.
From Setup, enter Approval Processes in the Quick Find box, then select Approval Available in: both Salesforce
Processes. Classic and Lightning
Experience
Select an object, and then select Create New Approval Process > Use Standard Setup Wizard.
Configure the approval process. Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
1. Control Which Records Apply to an Approval Process
Narrow down the list of records that can be part of the approval process by specifying criteria.
You can either use filters or write a formula. USER PERMISSIONS
2. Choose Approval Request Notification Templates To create approval
When an approval process assigns an approval request to a user, Salesforce sends the user an processes:
approval request email. If Approvals in Chatter is enabled, Salesforce also posts the approval • Customize Application
request to Chatter. Choose templates for each of these notifications.

591
Automate Your Business Processes Set Up an Approval Process

3. Choose an Automated Approver Throughout an Approval Process


Associate a hierarchy field—such as the user’s manager—with an approval process. When selected, the field is available as an
assigned approver option for approval steps. You can always select a hierarchy field here but not use it for any approval steps.
4. Specify Who Can Edit Locked Records
When a record is submitted for approval, it’s locked to prevent users from editing it during the approval process. Use the record
editability properties to determine who can edit records that are locked in this approval process.
5. Design the Approval Request Page
The approval page is where an approver responds to an approval request. Customize which fields appear on that page and in which
order. This page is used only for this approval process.
6. Specify Who Can Submit Records to an Approval Process
Only specified individuals or roles can submit a record for approval. You can also let submitters recall an approval request.

SEE ALSO:
Set Up an Approval Process
Limits and Considerations for Approvals

Control Which Records Apply to an Approval Process


Narrow down the list of records that can be part of the approval process by specifying criteria. You
EDITIONS
can either use filters or write a formula.
If you want all records to pass through the approval process, click Next. If only certain types of Available in: both Salesforce
records are considered, use one of the following options. Classic and Lightning
Experience
Option To enter the approval process... Available in: Enterprise,
criteria are met The record must meet the filter criteria. Performance, Unlimited,
and Developer Editions
formula evaluates to The formula must return True.
true Some functions aren’t available in approval process formulas. For
information on which functions you can use in approval process
formulas, see Formula Operators and Functions by Context.

Example: This filter lets an expense report enter this approval process only if the employee who submitted the report is located
at headquarters.

Current User: Office Location Equals Headquarters

This formula lets a record enter this approval process only if its discount approval cutoff date is less than 30 days away.
(Discount_Approval_CutoffDate__c < (CloseDate - 30)

SEE ALSO:
Considerations for Configuring Approvals
Formula Operators and Functions by Context

592
Automate Your Business Processes Set Up an Approval Process

Choose Approval Request Notification Templates


When an approval process assigns an approval request to a user, Salesforce sends the user an
EDITIONS
approval request email. If Approvals in Chatter is enabled, Salesforce also posts the approval request
to Chatter. Choose templates for each of these notifications. Available in: both Salesforce
These fields are available from both the jump-start and standard wizards. Classic and Lightning
Experience
Field Description Available in: Enterprise,
Approval Choose a custom email template to use when notifying approvers that Performance, Unlimited,
Assignment Email an approval request is assigned to them. Or leave blank to use the default and Developer Editions
Template email template.
The approval process uses the same template for every assignment
email—no matter which approval step it’s for.

Approval Post Available only when Approvals in Chatter is enabled.


Template Choose an approval post template to use when notifying approvers via
a post in their Chatter feed. Leave blank to use the default post template
for this object or, if there isn’t one, the system default template.

Note: If email approval response is enabled, be sure that the email template you use describes how to correctly use both response
options: clicking the link and replying by email. If the user doesn’t respond correctly (for example, if the user misspells approve
or types it on the wrong line), Salesforce doesn’t register the user’s response.

SEE ALSO:
Chatter Post Templates for Approval Requests
Email Templates in Salesforce Classic
Merge Fields for Approvals

Choose an Automated Approver Throughout an Approval Process


Associate a hierarchy field—such as the user’s manager—with an approval process. When selected,
EDITIONS
the field is available as an assigned approver option for approval steps. You can always select a
hierarchy field here but not use it for any approval steps. Available in: both Salesforce
Set Next Automated Approver Determined By with one of the following options. Classic and Lightning
Experience
Option Description Available in: Enterprise,
--None-- Approval requests aren’t automatically assigned based on a field. Instead, Performance, Unlimited,
you manually specify a user to approve all approval requests. and Developer Editions

Field Approval requests are assigned to an approver from the specified field.
You can select only a hierarchical relationship field, such as Manager.

593
Automate Your Business Processes Set Up an Approval Process

Option Description
Use Approver Field of Available only when Field is selected.
Object Owner If selected, the first executed approval step sets the approver to the value of Field on the record
owner’s user record—instead of the submitter’s user record.
All remaining steps use Field in the user record of the preceding step’s approver.

Example: If you select the Manager field, you can configure any step in this process to route approval requests to the submitting
user’s manager.
If you select Use Approver Field of Object Owner, the first step that isn’t skipped is routed to the owner’s manager. All other
steps are routed to the previous approver’s manager.

SEE ALSO:
Custom Field Types
Considerations for Setting Approvers

Specify Who Can Edit Locked Records


When a record is submitted for approval, it’s locked to prevent users from editing it during the
EDITIONS
approval process. Use the record editability properties to determine who can edit records that are
locked in this approval process. Available in: both Salesforce
Classic and Lightning
Option Description Experience
Administrators Default. Lets users edit the record that’s pending approval only if they Available in: Enterprise,
ONLY... have: Performance, Unlimited,
• The “Modify All” object-level permission for the given object, or and Developer Editions

• The “Modify All Data” permission

Administrators OR... Lets the assigned approver and admins edit the record.

Note:
• Even when a campaign is locked for approval, users can add campaign members to it.
• In Lightning Experience, you can't unlock Knowledge articles during an approval process.

594
Automate Your Business Processes Set Up an Approval Process

Design the Approval Request Page


The approval page is where an approver responds to an approval request. Customize which fields
EDITIONS
appear on that page and in which order. This page is used only for this approval process.
Available in: both Salesforce
Option Description Classic and Lightning
Selected Fields Specifies which fields to display on the approval request page. Keep in mind Experience
that approvers could view this page on a mobile device. Select only the Available in: Enterprise,
fields necessary for users to decide whether to approve or reject records. Performance, Unlimited,
and Developer Editions
Display approval If selected, the approval request page displays the approval history of the
history associated record.
information...

Security Settings Controls whether users have to log in to Salesforce to see the approval
request.
Allow approvers to access the approval page only from within the
application (Recommended)
Default. Users log in to Salesforce to view the approval page.
Allow approvers to access the approval page only from within the
application, or externally from a wireless-enabled mobile device
Users can access an external version of the approval page from a
browser, including browsers on mobile devices, without logging in to
Salesforce. If selected, you can’t add approval steps that let users
manually select the next approver.

Specify Who Can Submit Records to an Approval Process


Only specified individuals or roles can submit a record for approval. You can also let submitters
EDITIONS
recall an approval request.
Available in: both Salesforce
Initial Submitters Classic and Lightning
Experience
Submitter Type Select a type or search to populate the Available Submitters list. Available in: Enterprise,
Performance, Unlimited,
Allowed Submitters If the user who submits a record for approval isn’t included in this list, the
and Developer Editions
record doesn’t enter this approval process—even if the record meets the
entry criteria.

Page Layout Settings

Add the Submit for Approval When selected, Salesforce adds the Submit for Approval button to the Standard Buttons and Approval
button and Approval History History related list to the Related Lists for all page layouts for the object.
related list to all Object This setting is available only when you create an approval process. If the Standard Buttons for a layout
page layouts haven’t been customized before, the Submit for Approval button isn’t added.

595
Automate Your Business Processes Set Up an Approval Process

Submission Settings

Allow submitters to recall If selected, submitters can recall their approval requests. If unselected, only admins can recall requests.
approval requests This option is useful for situations where things can change on the submitter’s side while waiting for
an approval. For example, an opportunity could be lost after the user submits it for approval.

Add an Approval Step to an Approval Process


Approval steps define the chain of approval for a particular approval process. Each step determines
EDITIONS
which records can advance to that step, who to assign approval requests to, and whether to let
each approver’s delegate respond to the requests. The first step specifies what to do if a record Available in: both Salesforce
doesn’t advance to that step. Later steps specify what happens if an approver rejects the request. Classic and Lightning
You can add steps to an approval process only if it is inactive. Experience

From the approval process, click New Approval Step, and follow the wizard. Available in: Enterprise,
Steps are executed in the order specified. Performance, Unlimited,
and Developer Editions

1. Control Which Records Apply to an Approval Step


Control which records are part of the approval step by setting the step’s criteria. You can also
USER PERMISSIONS
specify what happens to records that don’t meet the step’s criteria. To create approval steps:
2. Identify Assigned Approvers for an Approval Step • Customize Application
Specify who to send an approval request for this step to.
3. Specify Rejection Behavior for an Approval Step
Configure what happens if an approver rejects a request. The final rejection actions for the approval process determine the first step’s
rejection behavior.

SEE ALSO:
Set Up an Approval Process
Enable Email Approval Response

Control Which Records Apply to an Approval Step


Control which records are part of the approval step by setting the step’s criteria. You can also specify
EDITIONS
what happens to records that don’t meet the step’s criteria.
Available in: both Salesforce
Classic and Lightning
Experience

Available in: Enterprise,


Performance, Unlimited,
and Developer Editions

Criteria Options
If all records go through this approval step, leave All records should enter this step selected.

596
Automate Your Business Processes Set Up an Approval Process

If only certain types of records are supposed to enter this process, select Enter this step if the following... and choose the appropriate
option (1). For details on the options, see Control Which Records Apply to an Approval Process.

(2) Else Options for Approval Step Criteria


If you specified filter criteria or entered a formula, choose what happens to records that don’t meet the criteria or if the formula does not
return True.

Note: You can’t change your selection after the approval process has been activated, even if you deactivate the approval process.

Option Description
approve record Approves the request and performs all final approval actions.

reject record Rejects the request and performs all final rejection actions. This option is available only for the first step
in the approval process.

go to next step Skips this step and goes to the next step. Available only when there’s a later step.
When you apply this option in the first step, keep in mind:
• If the record doesn’t meet the criteria for any subsequent steps, the record is rejected.
• If you delete all later steps, Salesforce rejects the record.
When you apply this option in another step, keep in mind:
• If you delete all later steps, Salesforce ends the process.

SEE ALSO:
Set Up an Approval Process
Enable Email Approval Response

Identify Assigned Approvers for an Approval Step


Specify who to send an approval request for this step to.
EDITIONS
Select Approver Specify who to assign the approval to. Available in: both Salesforce
Let the submitter choose the approver manually. (default) Classic and Lightning
Prompts the user to select the next approver. Experience

Automatically assign an approver using a standard or custom hierarchy Available in: Enterprise,
field. Performance, Unlimited,
Assigns the approval request to the user in the field displayed next to and Developer Editions
this option. You select this field when you configure the approval process.
Automatically assign to a queue.
Available only for objects that support queues. Assigns approval requests
to a queue.
Automatically assign to approver(s).
Assigns the approval request to one or more specific users, specific
queues, or users related to the submitted record. You can add up to 25
per step.

597
Automate Your Business Processes Set Up an Approval Process

When multiple Available only when Automatically assign to approver(s) is selected.


approvers are selected: Approve or reject based on the first response.
The first response to the approval request determines whether the record is approved or rejected.
Require unanimous approval from all selected approvers.
The record is approved only if everyone approves the request. If any approvers reject the request, the
approval request is rejected.

The approver’s delegate Users can identify a delegate in their approval settings. Delegated approvers can’t reassign approval
may also approve this requests; they can only approve or reject them.
request
Note: Internal Salesforce users are listed by and can be added using the Delegated Approver
lookup field. Use Data Loader and a comma-delineated (CSV) file to add users with communities
licenses as Delegated Approvers. The CSV uses the CommunityUserId rather than the UserId
for DelegatedApproverId. Communities licenses are used with Experience Cloud sites and
legacy portals.

SEE ALSO:
Considerations for Setting Approvers

Specify Rejection Behavior for an Approval Step


Configure what happens if an approver rejects a request. The final rejection actions for the approval
EDITIONS
process determine the first step’s rejection behavior.
Available in: both Salesforce
Option Description Classic and Lightning
Perform all rejection Rejects the request even if previous steps were approved. Experience
actions... Salesforce performs all rejection actions specified for this step and Available in: Enterprise,
all final rejection actions. Performance, Unlimited,
and Developer Editions
Perform ONLY the Rejects the request, and returns the approval request to the
rejection actions for this previous approver. Salesforce performs all rejection actions
step... specified for this step.

Add Automated Actions to an Approval Process


You can associate actions to approval steps, initial submission, final approval, final rejection, or
EDITIONS
recall. Approval processes support four automated actions.
Available in: both Salesforce
Action Type Description Classic and Lightning
Task Assigns a task to a user who you specify. You can specify the subject, status, Experience
priority, and due date of the task. Available in: Enterprise,
Performance, Unlimited,
Email Alert Sends an email to a designated recipient using a specified email template.
and Developer Editions
Field Update Changes the value of a selected field. You can specify a value or create a
formula for the new value.

598
Automate Your Business Processes Set Up an Approval Process

Action Type Description


Outbound Message Sends a message to a designated endpoint. You can also specify a username and the data to include in
the message.
Not supported for approval processes on junction objects.

Example: When expenses are approved, you want to print checks for payment. To do so, you add an outbound message, which
sends the appropriate information to your Oracle accounting service, as a Final Approval action.

Groups of Automated Actions in an Approval Process


Each approval process is organized into groups of actions based on when the actions occur, such as initial submission. To add an
automated action to your approval process, determine which group of actions to add it to.
Add an Automated Action to Your Approval Process
If you didn’t create an automated action before configuring your approval process, you can create one directly from the approval
process.
Add an Existing Automated Action to Your Approval Process
If you’ve already created an automated action, you can add it to your approval process.

SEE ALSO:
Set Up an Approval Process
Perform Automated Actions
Considerations for Automated Actions

Groups of Automated Actions in an Approval Process


Each approval process is organized into groups of actions based on when the actions occur, such
EDITIONS
as initial submission. To add an automated action to your approval process, determine which group
of actions to add it to. Available in: both Salesforce
Classic and Lightning
Group Occurs When... Default Actions Experience
Initial Submission A user first submits a record for approval. Record Lock (locks) Available in: Enterprise,
Performance, Unlimited,
Approval Step All required approvals for this step have been given None
and Developer Editions
Approval for a record.

Approval Step An approver rejects this request for this step. None
Rejection

Final Approval All required approvals have been given for a record Record Lock (locks)

Final Rejection An approver rejects the request, and it goes to the Record Lock (unlocks)
final rejection state.

599
Automate Your Business Processes Set Up an Approval Process

Group Occurs When... Default Actions


Recall A submitted approval request is recalled. Record Lock (unlocks

SEE ALSO:
Considerations for Automated Actions

Add an Automated Action to Your Approval Process


If you didn’t create an automated action before configuring your approval process, you can create
EDITIONS
one directly from the approval process.
1. Open the approval process that you want to add an action to. Available in: both Salesforce
Classic and Lightning
2. From the appropriate related list, click Add New. For an approval step where the Approval
Experience
Actions and Rejection Actions are hidden, click Show Actions.
3. Choose the type of action. Available in: Enterprise,
Performance, Unlimited,
The list of available actions differs depending on your settings and whether you have reached and Developer Editions
the limit for a type of action.

4. Configure the action. USER PERMISSIONS

To create approval actions:


SEE ALSO:
• Customize Application
Set Up an Approval Process
Considerations for Automated Actions
Groups of Automated Actions in an Approval Process

Add an Existing Automated Action to Your Approval Process


If you’ve already created an automated action, you can add it to your approval process.
EDITIONS
1. Open the approval process that you want to add an action to.
Available in: both Salesforce
2. From the appropriate related list, click Add Existing. If that button is hidden, click Show Actions.
Classic and Lightning
3. Choose the type of action. Experience
4. Move the action from Available Actions to Selected Actions. Available in: Enterprise,
5. Save your changes. Performance, Unlimited,
and Developer Editions

SEE ALSO:
Groups of Automated Actions in an Approval Process USER PERMISSIONS
Considerations for Automated Actions To select approval actions:
• Customize Application

600
Automate Your Business Processes Prepare Your Org for Approvals

Activate an Approval Process


After you’ve created at least one step for the approval process, activate the process.
EDITIONS
1. Open the approval process.
Available in: both Salesforce
2. Make sure that it’s configured correctly.
Classic and Lightning
3. Click Activate. Experience

Available in: Enterprise,


SEE ALSO: Performance, Unlimited,
Prepare Your Org for Approvals and Developer Editions
Considerations for Managing Approvals
USER PERMISSIONS

To activate approval
processes:
• Customize Application

Prepare Your Org for Approvals


Make sure that your users can submit their records for approval, and consider how you can make
EDITIONS
it easy for approvers to respond to approval requests.
Available in: both Salesforce
Let Users Submit for Approval Classic and Lightning
After you activate an approval process for an object, customize the object’s page layouts to Experience
support record submission. Available in: Enterprise,
Override the Sender for Email Approval Notifications Performance, Unlimited,
By default, the sender for email approval notifications is the user who submitted the record for and Developer Editions
approval. You can override the sender with an organization-wide address, like
approval@acmewireless.com.
Let Users Respond to Approval Requests from Your Org
Give your users an instant view of their approval requests by customizing the Home page or navigation bar.
Let Users Respond to Approval Requests by Email
If the email notification includes all the information that an approver needs to decide, enable email approval response. That way, a
user can simply reply to the email notification.
Let Users Respond to Approval Requests from Chatter
If your users don’t need in-depth information to decide how to respond to an approval request, enable Approvals in Chatter. That
way, they don’t have to leave their feed to continue with their day-to-day tasks.
Let Users Respond to Approvals Requests in Slack
If your users don’t need in-depth information to decide how to respond to an approval request, and they have a connection to Slack,
enable Approvals in Slack. That way, a user can simply respond to the Slack notification.

SEE ALSO:
Set Up an Approval Process
Limits and Considerations for Approvals

601
Automate Your Business Processes Prepare Your Org for Approvals

Let Users Submit for Approval


After you activate an approval process for an object, customize the object’s page layouts to support
EDITIONS
record submission.
Add the following components to your page layouts. Available in: both Salesforce
Classic and Lightning
• Submit for Approval button
Experience
• Approval History related list
Available in: Enterprise,
The Approval History related list lets users submit approval requests and track a record’s progress
Performance, Unlimited,
through an approval process from the record detail page.
and Developer Editions

SEE ALSO: USER PERMISSIONS


Page Layouts
To modify page layouts:
Prepare Your Org for Approvals
• Customize Application

Override the Sender for Email Approval Notifications


By default, the sender for email approval notifications is the user who submitted the record for
EDITIONS
approval. You can override the sender with an organization-wide address, like
approval@acmewireless.com. Available in: both Salesforce
Classic and Lightning
User Permissions Needed Experience
To edit process automation settings: Customize Application Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
After you add an organization-wide address to your org:
1. From Setup, enter Process Automation Settings in the Quick Find box, then select
Process Automation Settings.
2. For Email Approval Sender, select the organization-wide address.
3. Save your changes.

Let Users Respond to Approval Requests from Your Org


Give your users an instant view of their approval requests by customizing the Home page or
EDITIONS
navigation bar.
Lightning Experience Available in: both Salesforce
Classic and Lightning
• Add the Items to Approve component to the appropriate Lightning Home pages.
Experience
This component is available only for Home pages. To add it to a Home page, use the
Lightning App Builder in Setup. Available in: Enterprise,
Performance, Unlimited,
• Add the Approval Requests navigation item to the appropriate Lightning apps. and Developer Editions
This item is available only for Lightning apps. To add it to a Lightning app, use the App
Manager in Setup.

602
Automate Your Business Processes Prepare Your Org for Approvals

Salesforce mobile app


Add the Approvals item to the navigation items of any Lightning app.
Salesforce Classic
Add the Items to Approve related list to the appropriate home page layouts.

SEE ALSO:
Create Lightning Apps
Set Up the Lightning Experience Home Page
Customize Salesforce Classic Home Tab Page Layouts
Prepare Your Org for Approvals

Let Users Respond to Approval Requests by Email


If the email notification includes all the information that an approver needs to decide, enable email
EDITIONS
approval response. That way, a user can simply reply to the email notification.
Available in: both Salesforce
Considerations for Email Approval Response Classic and Lightning
Before you enable the ability to act on approvals via email, review how email works with your Experience
approval processes. Available in: Enterprise,
Default Template for Email Approval Response Performance, Unlimited,
When you enable email approval response, Salesforce uses a default email template for approval and Developer Editions
processes—unless you specify a custom email template.
Enable Email Approval Response
After you’ve reviewed the considerations and prepared the right template, flip the switch that lets users respond to approval requests
directly from their email.

SEE ALSO:
Prepare Your Org for Approvals
Let Users Respond to Approval Requests from Chatter

Considerations for Email Approval Response


Before you enable the ability to act on approvals via email, review how email works with your
EDITIONS
approval processes.
Compatibility with Approval Processes Available in: both Salesforce
Email approval response isn’t supported for approval processes that: Classic and Lightning
Experience
• Assign approval to a queue
• After the first step, let the approver manually select the next approver Available in: Enterprise,
Performance, Unlimited,
Implicit Agreement with Salesforce and Developer Editions
By enabling the email approval response feature, you agree to let Salesforce:
• Process email approval responses
• Update approval requests for all active users in your org

603
Automate Your Business Processes Prepare Your Org for Approvals

• Update the approval object on behalf of your org’s users

SEE ALSO:
Limits and Considerations for Approvals
Let Users Respond to Approval Requests by Email

Default Template for Email Approval Response


When you enable email approval response, Salesforce uses a default email template for approval
EDITIONS
processes—unless you specify a custom email template.

Example: Requesting User has requested your approval for the following item. Available in: both Salesforce
Classic and Lightning
To approve or reject this item, reply to this email with the word APPROVE, APPROVED, YES, Experience
REJECT, REJECTED, or NO in the first line of the email message, or click this link:
Available in: Enterprise,
Link to approval request page
Performance, Unlimited,
If replying via email you can also add comments on the second line. The comments will be and Developer Editions
stored with the approval request in Salesforce CRM.
Note: For Salesforce to process your response the word APPROVE, APPROVED, YES, REJECT,
REJECTED, or NO must be in the very first line of the reply email. Also, any comment must be
in the second line.

If your org has Approvals in Chatter enabled and the approver opted to receive notifications as Chatter posts, the default email template
is appended with:

Example: You can also approve, reject and comment on this request from your Chatter feed:
Link to approval post in Chatter

Note: If you use a custom email template for your approval process, make sure that it explains both response options: clicking
the link and replying by email. If the user doesn’t respond correctly (for example, if the user misspells approve or types it on the
wrong line), Salesforce doesn’t register the response.

SEE ALSO:
Email Templates in Salesforce Classic
Merge Fields for Approvals
Let Users Respond to Approval Requests by Email

604
Automate Your Business Processes Prepare Your Org for Approvals

Enable Email Approval Response


After you’ve reviewed the considerations and prepared the right template, flip the switch that lets
EDITIONS
users respond to approval requests directly from their email.
Before you begin, give the appropriate users the “API Enabled” user permission so that they can Available in: both Salesforce
respond to approval requests by email. Classic and Lightning
Experience
1. From Setup, enter Process Automation Settings in the Quick Find box, then
select Process Automation Settings. Available in: Enterprise,
2. Select Enable email approval response. Performance, Unlimited,
and Developer Editions
3. Save your changes.

USER PERMISSIONS
SEE ALSO:
Considerations for Email Approval Response To enable Email Approval
Response:
Let Users Respond to Approval Requests by Email
• Customize Application

Let Users Respond to Approval Requests from Chatter


If your users don’t need in-depth information to decide how to respond to an approval request,
EDITIONS
enable Approvals in Chatter. That way, they don’t have to leave their feed to continue with their
day-to-day tasks. Available in: both Salesforce
Classic and Lightning
Prepare to Enable Approvals in Chatter Experience
Because Approvals in Chatter relies on both Chatter and the Approvals feature, getting your Available in: Enterprise,
org set up involves more than just turning on the feature. Before you enable Approvals in Performance, Unlimited,
Chatter, understand the limitations and considerations for Approvals in Chatter and post and Developer Editions
templates.
Considerations for Approvals in Chatter
Find out more about Approvals in Chatter, before you enable it.
Enable Approvals in Chatter
If your organization has both Approvals and Chatter enabled, administrators can turn on Approvals in Chatter. Users then receive
approval requests as posts in their Chatter feeds.
Where Do Approval Request Posts Appear?
When your org has Approvals in Chatter enabled, approval request posts appear in various Chatter feeds. To see the approval request
post, you must have access to the approval record.
Chatter Post Templates for Approval Requests
Approval post templates for Chatter let you customize the information that is included in the approval request post when it displays
in a Chatter feed.

605
Automate Your Business Processes Prepare Your Org for Approvals

Prepare to Enable Approvals in Chatter


Because Approvals in Chatter relies on both Chatter and the Approvals feature, getting your org
EDITIONS
set up involves more than just turning on the feature. Before you enable Approvals in Chatter,
understand the limitations and considerations for Approvals in Chatter and post templates. Available in: both Salesforce
Do the following for each object for which you want approval requests to appear in Chatter. Classic and Lightning
Experience
1. Enable feed tracking.
2. Create an approval post template. Available in: Enterprise,
Performance, Unlimited,
Tip: For each object, create one post template that works for all approval processes. Mark and Developer Editions
that post template the default for the object.

SEE ALSO:
Feed Tracking
Chatter Post Templates for Approval Requests
Where Do Approval Request Posts Appear?
Considerations for Approvals in Chatter

Considerations for Approvals in Chatter


Find out more about Approvals in Chatter, before you enable it.
EDITIONS
• When you enable Approvals in Chatter in your org, it is turned on for all users. Users can then
update their own Chatter settings to opt out of receiving approval requests as posts in their Available in: both Salesforce
Chatter feeds. Classic and Lightning
Experience
• Chatter post approval notifications are available only for approval processes associated with an
object that has been enabled for feed tracking. Available in: Enterprise,
• If the approval object is a detail object in a master-detail relationship, Owner isn’t available Performance, Unlimited,
for approval page layouts or approval post templates. and Developer Editions

Limitations
• Approvals in Chatter doesn't support delegated approvers or queues.
• You can’t recall or reassign an approval request from a post. Instead, perform these actions from the approval record.
• Approval requests from Sites or portal users aren’t supported.
Approval Posts
• Approval posts can't be deleted in the Salesforce user interface; you can only delete them through the API.
• If you don’t select an approval post template, the approval post uses the system default template or the default template for
the object, if available.
• Only users with access to the approval record can see the approval request post. Comments on approval posts aren’t persisted
to the approval record.
• Different users see different configurations of the approval request post.
– Only approvers see approval action buttons on their posts, and then only in their profile feed or their news feed.
– Only approvers see approver names in the header.

• If you change the approver, step name, or the routing type on an approval process while it’s in progress, existing approval posts
aren’t updated.

606
Automate Your Business Processes Prepare Your Org for Approvals

• When an approval request is recalled, a new post is generated. It appears on the news feeds of the submitter, all approvers, and
followers of the object. It also appears on the record feed.
• If a step requires unanimous approval from multiple approvers, the approval request post for that step doesn’t list all selected
approvers in its header. Approvers see only their own name in the post header.

SEE ALSO:
Let Users Respond to Approval Requests by Email
Prepare to Enable Approvals in Chatter
Where Do Approval Request Posts Appear?
Limits and Considerations for Approvals

Enable Approvals in Chatter


If your organization has both Approvals and Chatter enabled, administrators can turn on Approvals
EDITIONS
in Chatter. Users then receive approval requests as posts in their Chatter feeds.
Before you begin, make sure that all approval processes in your org are properly configured to take Available in: both Salesforce
advantage of Approvals in Chatter. After turning on this feature, all existing active approval processes Classic and Lightning
start generating Chatter posts. Experience

1. From Setup, enter Chatter Settings in the Quick Find box, then select Chatter Available in: Enterprise,
Settings. Performance, Unlimited,
and Developer Editions
2. Click Edit.
3. Select Allow Approvals.
USER PERMISSIONS
4. Save your changes.
To enable Approvals in
Chatter:
SEE ALSO:
• Customize Application
Prepare to Enable Approvals in Chatter
Considerations for Approvals in Chatter
Where Do Approval Request Posts Appear?

Where Do Approval Request Posts Appear?


When your org has Approvals in Chatter enabled, approval request posts appear in various Chatter
EDITIONS
feeds. To see the approval request post, you must have access to the approval record.
Approval request posts show up in these feeds. Available in: both Salesforce
Classic and Lightning
• Chatter feed of the assigned approver
Experience
• Submitter’s profile
Available in: Enterprise,
• Chatter feed of the submitter if the submitter is following the approval request record
Performance, Unlimited,
• Chatter feed of the approval request record and Developer Editions
• Chatter feed of anyone following the approval request record
• Object-specific filter on the Chatter feed of anyone following the approval record

607
Automate Your Business Processes Prepare Your Org for Approvals

• Company filter of every user with access to the approval record

SEE ALSO:
What Happens When You Opt Out of Chatter Approval Requests?
Considerations for Approvals in Chatter
Let Users Respond to Approval Requests from Chatter

Chatter Post Templates for Approval Requests


Approval post templates for Chatter let you customize the information that is included in the
EDITIONS
approval request post when it displays in a Chatter feed.
Available in: both Salesforce
Considerations for Chatter Post Templates for Approval Requests Classic and Lightning
Keep these limitations and dependencies in mind when working with post templates. Experience

Create a Chatter Post Template Available in: Enterprise,


Identify which fields to display in an approval request post. Performance, Unlimited,
and Developer Editions

SEE ALSO:
Manage Deleted Custom Fields

Considerations for Chatter Post Templates for Approval Requests


Keep these limitations and dependencies in mind when working with post templates.
EDITIONS
Limitations
Available in: both Salesforce
• The associated object must be enabled for approvals and feed tracking.
Classic and Lightning
• You can't delete an approval post template if it's in use by an approval process. Experience
• Chatter posts for approval requests only appear in Salesforce Classic. To respond to approval
Available in: Enterprise,
requests in Lightning Experience, users go to the Approval Requests tab.
Performance, Unlimited,
Dependencies and Developer Editions
• Deleting a custom field removes it from any approval post template that references it.
Existing posts aren't affected. Undeleting the custom field restores it to the available fields
list, but doesn't restore it to any approval post templates that previously contained it.
• Deleting (or undeleting) a custom object also deletes (or undeletes) its associated approval post templates and any of its approval
request posts that are already in Chatter feeds.
• If you rename a custom object, approval post templates associated with it update accordingly.

SEE ALSO:
Create a Chatter Post Template
Limits and Considerations for Approvals

608
Automate Your Business Processes Prepare Your Org for Approvals

Create a Chatter Post Template


Identify which fields to display in an approval request post.
EDITIONS
1. From Setup, enter Post Templates in the Quick Find box, then select Post
Templates. Available in: both Salesforce
Classic and Lightning
2. Click New Template.
Experience
3. Select the object for your template.
Available in: Enterprise,
4. Click Next. Performance, Unlimited,
5. Give the template a name and description. and Developer Editions
6. If you want this template to be the default for the associated object, select Default.
7. Add up to four fields to display on the approval request post. USER PERMISSIONS
We recommend putting any text-heavy fields—such as Comments or Description—at the To create approval request
bottom. post templates:
• Customize Application
8. Save your changes.

SEE ALSO:
Choose Approval Request Notification Templates
Considerations for Chatter Post Templates for Approval Requests

Let Users Respond to Approvals Requests in Slack


If your users don’t need in-depth information to decide how to respond to an approval request, and they have a connection to Slack,
enable Approvals in Slack. That way, a user can simply respond to the Slack notification.

Considerations for Approvals in Slack


Find out more about Approvals in Slack, before you enable it.
Enable Approval Notifications in Slack
If your org uses both Approvals and Salesforce Digital HQ app, approval notifications are automatically enabled in Slack. Users receive
approval requests as messages on the Salesforce Digital HQ’s Messages tab.
Where Do Slack Approval Notifications Appear?
When you have Approvals in Slack enabled, approval notifications are sent to the approver via the Salesforce Digital HQ app as a
direct message in Slack. To see the approval request post, you must have access to Slack.

Considerations for Approvals in Slack


Find out more about Approvals in Slack, before you enable it.
EDITIONS
Users must have the Salesforce Digital HQ app in Slack. When you enable Approvals in Slack in your
org, it’s turned on for all users. Before you use Approvals in Slack, make sure you understand the Available in: both Salesforce
limitations. Classic and Lightning
Experience
• You can connect the Salesforce Digital HQ app to only one Salesforce org.
• The only available actions are Approve and Reject. Available in: Enterprise,
Performance, Unlimited,
• The Show More link doesn’t work for Salesforce Classic users.
and Developer Editions

609
Automate Your Business Processes Prepare Your Org for Approvals

• If the approver has to manually select the next approver, they must log in to the full Salesforce site to complete the approval request.
• Users can respond only to approval requests without comments.
• Up to four fields only of an approval request can appear in a Slack notification.

Enable Approval Notifications in Slack


If your org uses both Approvals and Salesforce Digital HQ app, approval notifications are automatically
EDITIONS
enabled in Slack. Users receive approval requests as messages on the Salesforce Digital HQ’s Messages
tab. Available in: both Salesforce
Note: Slack notifications are turned on automatically. Admins can turn off Slack notifications Classic and Lightning
Experience
from Setup on the Notification Delivery Settings page.
1. From Setup, in the Quick Find box, enter Notification Delivery Settings, and Available in: Enterprise,
select Notification Delivery Settings. Performance, Unlimited,
and Developer Editions
2. From the Approval requests dropdown menu, select Edit.
3. Select Slack, and enable Salesforce Digital HQ.
USER PERMISSIONS

SEE ALSO: To enable approvals in


Slack:
Salesforce Digital HQ App for Slack (Beta)
• Customize Application

Where Do Slack Approval Notifications Appear?


When you have Approvals in Slack enabled, approval notifications are sent to the approver via the
EDITIONS
Salesforce Digital HQ app as a direct message in Slack. To see the approval request post, you must
have access to Slack. Available in: both Salesforce
• Users review the request, and select Approve or Reject, or select Show More to be directed Classic and Lightning
to the Salesforce app to view details. Experience

Available in: Enterprise,


Performance, Unlimited,
and Developer Editions

• Users can continue to receive email, Lightning Experience, and mobile notifications about approval requests.

610
Automate Your Business Processes Limits and Considerations for Approvals

Limits and Considerations for Approvals


Before you automate something with an approval process, be aware of the limits and considerations.
EDITIONS
Users can’t see which approval process is triggered when they click Submit for Approval. Familiarize
users on the criteria for each approval process and what each approval process does. If the record Available in: both Salesforce
doesn’t meet the entry criteria or if they’re not an allowed submitter for any approval processes, Classic and Lightning
Salesforce displays an error. Experience

Available in: Enterprise,


Approval Limits Performance, Unlimited,
Salesforce limits the number of approval processes in your org, as well as the number of steps and Developer Editions
and actions in each approval process.
Considerations for Configuring Approvals
When creating or editing an approval process, keep in mind how approvals are compatible with other features. Before you start,
draw out the steps of your approval process.
Merge Fields for Approvals
Approval merge fields include {!ApprovalRequest.fieldName} and {!ApprovalRequestingUser.fieldName}.
They’re supported in certain email templates and return different values based on the status of the approval process instance.
Considerations for Setting Approvers
When you specify approvers for a given approval step—or for the only step if you’re using the jump-start wizard—keep some things
in mind.
Considerations for Managing Approvals
Keep these things in mind when maintaining existing approval processes—including activating and deleting them.
Considerations for the Salesforce Mobile App
Learn about the approvals functionality in Lightning Experience on desktop that isn’t available or that works differently in the
Salesforce mobile app.

SEE ALSO:
Considerations for Email Approval Response
Considerations for Approvals in Chatter
Approvals: What’s Different or Not Available in the Salesforce Mobile App
Considerations for Approval History Reports
Restrictions for Approval Processes in Change Sets

Approval Limits
Salesforce limits the number of approval processes in your org, as well as the number of steps and
EDITIONS
actions in each approval process.
Available in: both Salesforce
Per-Org Limit Value Classic and Lightning
Active approval processes 1,000 Experience

Available in: Enterprise,


Total approval processes 2,000
Performance, Unlimited,
Active approval processes per object 300 and Developer Editions

611
Automate Your Business Processes Limits and Considerations for Approvals

Per-Org Limit Value


Total approval processes per object 500

Steps per approval process 30

Approvers per step 25

Initial submission actions per approval process2 40

Final approval actions per approval process2 40

Final rejection actions per approval process2 40

Recall actions per approval process2 40

Maximum characters in approval request comments 4,000


In Chinese, Japanese, or Korean, the limit is 1,333 characters.

Considerations for Configuring Approvals


When creating or editing an approval process, keep in mind how approvals are compatible with
EDITIONS
other features. Before you start, draw out the steps of your approval process.
Associated Object Available in: both Salesforce
If the approval object is a detail object in a master-detail relationship, Owner isn’t available Classic and Lightning
for approval page layouts or approval post templates. Experience

Approval Criteria Available in: Enterprise,


In approval criteria—either the entry criteria or step criteria—don’t reference expressions that Performance, Unlimited,
resolve to random values. That way, if the criteria needs to be evaluated again, the record is and Developer Editions
evaluated the same every time.
Compatibility with Other Features
• Flows can delete records that are pending approval.
• Design automated actions so that you can use them for both workflow rules and approval processes.
Field Update Actions in Approvals
• An approval process can specify a field update action that reevaluates workflow rules for the updated object. If, however, the
re-evaluated workflow rules include a cross-object field update, those cross-object field updates are ignored.
• Field updates that are executed as approval actions don’t trigger workflow rules or entitlement processes.
Anticipate Errors
Consider reviewing the content on approvals errors. That way, you can anticipate common issues and configure your approval
process so that the error is less likely.
Approvals in Unlocked Packages
• Unlocked packages can include Approvals with steps that reference related users or queues as approvers; users are not supported.
• Queues and related user fields (lookup fields) referenced by the approval steps must be included in the unlocked package.

612
Automate Your Business Processes Limits and Considerations for Approvals

• An Approval Process can only be included in unlocked packages that don’t have a specified namespace.

SEE ALSO:
What Does This Approvals Error Mean?
Set Up an Approval Process
Considerations for Automated Actions
Considerations for Chatter Post Templates for Approval Requests

Merge Fields for Approvals


Approval merge fields include {!ApprovalRequest.fieldName} and
EDITIONS
{!ApprovalRequestingUser.fieldName}. They’re supported in certain email templates
and return different values based on the status of the approval process instance. Available in: both Salesforce
Tip: The submitter isn’t always the current user. For custom email templates, use Classic and Lightning
Experience
{!ApprovalRequestingUser.fieldName} instead of {!User.fieldName}.
Available in: Enterprise,
Performance, Unlimited,
Where Are Approval Merge Fields Supported?
and Developer Editions
You can use approval process merge fields in email templates, but not mail merge templates. Except
for {!ApprovalRequest.Comments}, approval merge fields named
{!ApprovalRequest.field_name} in email templates return values only in approval assignment emails and email alerts for
approval processes. When used in other emails—including email alerts for workflow rules—the approval merge field returns null.

What Values Does a Merge Field Provide?


The generated value of an ApprovalRequest merge field depends on which step the approval process is in.
• In the approval request email, a merge field returns the submitter’s name and the name of the first step.
• When the request is approved, the merge field returns the most recent approver’s name and the name of the second step, if applicable.
• For subsequent actions, a merge field value returns the previous completed step.
• For an approval step that requires unanimous approval from multiple approvers, {!ApprovalRequest.Comments} returns
only the most recently entered comment in emails.

SEE ALSO:
Default Template for Email Approval Response
Email Templates in Salesforce Classic

613
Automate Your Business Processes Limits and Considerations for Approvals

Considerations for Setting Approvers


When you specify approvers for a given approval step—or for the only step if you’re using the
EDITIONS
jump-start wizard—keep some things in mind.
• Users with these permissions can respond to approval requests, even if they aren’t designated Available in: both Salesforce
approvers. Classic and Lightning
Experience
– “Modify All Data”
– “Modify All” for an object Available in: Enterprise,
Performance, Unlimited,
• Make sure that the assigned approver has access to read the records for the approval requests. and Developer Editions
For example, a user who can’t view expense records can’t view expense approval requests.
• Approval processes that let users select an approver manually also let users select themselves
as the approver.
• You can assign an approval request to the same user multiple times in a single step. However, Salesforce sends the user only one
request.
• In Lightning Experience, when an approval request has multiple assigned approvers, a ProcessInstanceStep is created for each
assigned approver. When the approval request has the Approval based on first response setting enabled, the values displayed in
Assigned to and Actual Approver are affected.
– Assigned to is set to an approver assigned to the record
– Actual Approver is set to the approver who approved the request

• Here’s what happens to the list of approvers after a record enters an approval step and the approval process later returns to that
step.
– If the user who responded isn’t in the designated approvers list and has either “Modify All Data” or “Modify All”
permissions for the object, that user replaces the original approver in the list of approvers.
– If a user who responded is in the designated approvers list, the list of approvers for that step doesn’t change. This behavior
occurs even if the field values that designate the approvers have changed.
For example, an approval process’s first step requests approval from a user’s manager. If the approval request is rejected in the second
step, the approval request returns to the first step. This table explores what happens to the list of approvers.

If... The Designated Approver Is...


The user’s manager originally responded to the approval request. The manager

The user’s manager originally responded to the approval request. The original manager
Since then, the user’s manager has changed. The new manager isn’t a designated approver for this step.

A user with the “Modify All Data” permission originally responded The user with the “Modify All Data” permission
to the approval request. That user replaces the user’s manager in the list of designated
approvers for this step.

Assigning Approval Steps to Queues


You can assign approval requests to a queue only if the associated object supports queues. Email approval response isn’t supported for
approval processes that assign approval to a queue.

614
Automate Your Business Processes Limits and Considerations for Approvals

When the assigned approver is a queue:


• Any queue member can approve or reject an approval request that is assigned to the queue.
• Approval request emails are sent to the queue email address. If the queue is set up to send email to members, approval request
emails get sent to the queue members, unless their approval user preferences are set to never receive approval request emails.
• Because email notifications to a queue aren’t intended for an external audience, {!ApprovalRequest.External_URL}
returns the equivalent internal URL.
• Salesforce mobile app notifications for approval requests aren’t sent to queues. For each approval step involving a queue, we
recommend adding individual users as assigned approvers, so at least those individuals can receive the approval request notifications
in the Salesforce mobile app. To have both queues and individual users as assigned approvers, select Automatically assign
to approver(s) instead of Automatically assign to queue in the approval step.
• When an approval request is rejected and returned to the previous approver and the previous approver was a queue, the approval
request is assigned to the user who approved it instead of the queue.
• The Approval History related list displays the queue name in the Assigned To column and the actual user who approved or
rejected the approval request in the Actual Approver column.

SEE ALSO:
Identify Assigned Approvers for an Approval Step
Limits and Considerations for Approvals

Considerations for Managing Approvals


Keep these things in mind when maintaining existing approval processes—including activating
EDITIONS
and deleting them.
Admin Permissions Available in: both Salesforce
Users with one of these permissions are considered approval admins. Classic and Lightning
Experience
• Modify All object-level permission for the given object
• Modify All Data user permission Available in: Enterprise,
Performance, Unlimited,
Approval admins can: and Developer Editions
• Approve or reject pending approval requests without being part of the approval process
• Edit records that have been locked for approval
Activating Approval Processes
• An approval process must have at least one step before you can activate it.
• Before you activate your approval process, test it in your Salesforce sandbox.
• After an approval process is activated, you can’t add, delete, or change the order of the steps or change its reject or skip behavior,
even if the process is inactive.
Monitoring In-Flight Approval Processes
Standard reports for approval requests are included in both the Administrative Reports folder and the Activity Reports folder.
Deleting Approval Processes
Before you delete an approval process:
1. Make sure it’s inactive.

615
Automate Your Business Processes Sample Approval Processes

2. Delete all approval requests that are associated with it, and remove them from the Recycle Bin.

SEE ALSO:
Activate an Approval Process
Manage Multiple Approval Requests
Limits and Considerations for Approvals

Considerations for the Salesforce Mobile App


Learn about the approvals functionality in Lightning Experience on desktop that isn’t available or
EDITIONS
that works differently in the Salesforce mobile app.
Approval Responses Available in: Lightning
You can’t unlock a record that’s locked for approval. Experience
Salesforce Mobile App Notifications for Approval Requests Available in: Enterprise,
• Notifications for approval requests aren’t sent to queues or delegates. For each approval Performance, Unlimited,
step involving a queue, add individual users as assigned approvers, so those individuals and Developer Editions
can receive the approval request notifications in the mobile app. To have both queues and
individual users as assigned approvers, select Automatically assign to approver(s) instead
of Automatically assign to queue in the approval step.
• Notifications for approval requests are sent only to users who have access to the record being approved. Assigned approvers
who don’t have record access can receive email approval notifications, but they can’t complete the approval request until
someone grants record access.
Approvals in Chatter
In the Salesforce mobile app, you can’t respond to approval requests from Chatter. To respond to approval requests, go to the
Approvals navigation item.
Approval Comments
• The Salesforce mobile app prompts you for comments after you tap Approve or Reject.
• The Approval History related list displays truncated comments. To see the full comment for a given approval instance, tap the
instance, then tap Comments.
Approval History Related List
• The Approval History related list doesn’t include the Submit for Approval button.
• When working with approvals in Experience Cloud sites, role-based external users can see and take action from the Approval
History related list, but they can’t submit requests for approval.

Sample Approval Processes


Review samples of common approval processes to help you get started creating your own.

Sample Approval Process: PTO Requests


Most companies require employees to file a PTO (Paid Time Off) request and have their manager approve it. In three phases, here's
how to automate a simple one-step PTO request process using Salesforce.
Sample Approval Process: Expense Reports
If your company requires that employees file expense reports for managers to approve, you can automate this process in Salesforce.

616
Automate Your Business Processes Sample Approval Processes

Sample Approval Process: Discounting Opportunities


Opportunities that are discounted more than 40% require a CEO approval. Use this example to create a one-step approval process.
Sample Approval Process: Job Candidates
When your company interviews candidates for a position, you may have several levels of approval before you can send an offer
letter. Use this example to create a three-step approval process that requires approval from multiple management levels.

Sample Approval Process: PTO Requests


Most companies require employees to file a PTO (Paid Time Off) request and have their manager
EDITIONS
approve it. In three phases, here's how to automate a simple one-step PTO request process using
Salesforce. Available in: both Salesforce
Classic and Lightning
Prep Your Organization Experience

Before creating the approval process: Available in: Enterprise,


Performance, Unlimited,
• If you don’t yet have a custom object to track your PTO requests, create a custom object and and Developer Editions
tab called PTO Requests. Add the appropriate fields for your PTO Requests such as Start
Date, End Date, and Employee Name.
• Create an email template to notify approvers about a pending approval request. To direct users to the approval page in Salesforce,
include approval process merge fields.

Create the Approval Process


Use the jump start wizard to create an approval process for the PTO Request custom object and specify the following:
• Select the email template you created for this approval process.
• Don't specify filter criteria. That way, PTO requests are included in this approval process regardless of their attributes.
• Select the Automatically assign an approver using a standard or custom hierarchy field
option, then choose Manager.
• The jump start wizard automatically chooses the record owner as the only person who can submit PTO requests.

Tip: To let the submitter withdraw a submitted PTO request:


1. Click Edit and choose Initial Submitters.
2. Select Allow submitters to recall approval requests.

Wrap Things Up
• After you created the approval process, add the Approval History related list to the PTO Request object page layout.
• Consider adding the Items To Approved related list to your custom home page layouts. The related list shows users all approval
requests that are waiting for their response.

617
Automate Your Business Processes Sample Approval Processes

• If you have a sandbox, test the approval process, then activate it.

SEE ALSO:
Create a Custom Object
Email Templates in Salesforce Classic
Create an Approval Process with the Jump Start Wizard
Prepare Your Org for Approvals

Sample Approval Process: Expense Reports


If your company requires that employees file expense reports for managers to approve, you can
EDITIONS
automate this process in Salesforce.
Use this example to create a two-step expense report approval process for all employees in your Available in: both Salesforce
headquarters office. It specifies that expenses less than $50 are automatically approved, expenses Classic and Lightning
$50 and over require manager approval, and expenses over $5,000 require additional approval from Experience
two VPs. This example highlights a parallel approval process and the “else” option.
Available in: Enterprise,
Performance, Unlimited,
Prep Your Organization and Developer Editions

Before creating the approval process:


• If you do not yet have a custom object to track your expenses, create a custom object and tab called Expense Reports. Add the
appropriate fields such as Amount, Description, Status, Start Date, and End Date.
• Create a custom field on the user object called Office Location. Assign the “HQ” value to users in the headquarters office
location.

Create the Approval Process


Create an approval process using the Expense Report custom object and specify the following:
• The filter criteria for this approval process is Current User: Office Location equals HQ. Records must meet this
criteria before they can be submitted to this approval process.
• Choose the Manager field as the next automated approver.
• Create an email template to notify approvers that their approval is requested. To direct users to the approval page in Salesforce,
include approval process merge fields.
• Choose the record owner or any other user who you want to be able to submit expense reports.
• Create two approval steps:
1. Create a step named Step 1: Manager Approval with the following specifications:
– Name this step Step 1: Manager Approval.
– Select Enter this step if the following and choose criteria are met. Also, choose approve record for
the else option.
– Set the filter criteria to: Expense: Amount greater or equal 50.
– In the Automatically assign to approver(s) option, select the manager of the user submitting the request.
– If appropriate, choose The approver's delegate may also approve this request if you want to
allow the user in the Delegated Approver field to approve requests.

618
Automate Your Business Processes Sample Approval Processes

2. Create a second approval step named Step 2: Multiple VP Approval and specify the following:
– Use the filter criteria Expense Amount greater or equal 5000.
– Choose Automatically assign to approver(s) and select two users with a VP role.
– Select the Require UNANIMOUS approval from all selected approvers option. The request isn’t
approved unless both designated users approve.
– If appropriate, choose The approver's delegate may also approve this request if you want to
allow the user in the Delegated Approver field to approve requests.
– Choose Perform ONLY the rejection actions for this step... so that the request returns to the
manager for changes if one of the VPs rejects the request.

Tip: Consider creating the following final approval actions:


• Define a field update to automatically change the Status field to “Approved.”
• Send an approval notification to the user who submitted the expense report.
• To print a reimbursement check, send an outbound message to your back-office financial system.

Wrap Things Up
• After you created the approval process, add the Approval History related list to the Expense Report object page layout.
• Consider adding the Items To Approved related list to your custom home page layouts. The related list shows users all approval
requests that are waiting for their response.
• If you have a sandbox, test the approval process, then activate it.

SEE ALSO:
Create a Custom Object
Email Templates in Salesforce Classic
Create Custom Fields
Set Up an Approval Process
Prepare Your Org for Approvals

Sample Approval Process: Discounting Opportunities


Opportunities that are discounted more than 40% require a CEO approval. Use this example to
EDITIONS
create a one-step approval process.
Available in: both Salesforce
Prep Your Organization Classic and Lightning
Experience
Before creating the approval process:
Available in: Enterprise,
• Create an email template to notify approvers about a pending approval request. To direct users
Performance, Unlimited,
to the approval page in Salesforce, include approval process merge fields. and Developer Editions
• Create the following custom fields for opportunities:
– A percent field called Discount Percent so that users can enter a percentage
discount.
– A checkbox field called Discount Approved to indicate whether the CEO approved the discount.

619
Automate Your Business Processes Sample Approval Processes

Create the Approval Process


Create an approval process on the Opportunity object and specify the following:
• The filter criteria for this approval process is Discount Percent greater or equal 0.4. Records must meet this
criteria before they can be submitted to this approval process.
• You don't need to choose a custom field as the next automated approver because you specify later that the CEO must approve all
requests.
• Select the email template you created for this approval process.
• Choose the record owner as the only user who can submit a discount request for approval.
• Create one approval step with no filter criteria since all records submitted need to be approved or rejected.
• Choose Automatically assign to approver(s) and select the name of your CEO.
• If appropriate, choose The approver's delegate may also approve this request if you want to allow the
user in the Delegated Approver field to approve requests.
• Consider creating the following final approval actions:
– Email alert to notify the user who submitted the discount request.
– Field update to automatically select the opportunity Discount Approved checkbox.

Wrap Things Up
• After you created the approval process, add the Approval History related list to the appropriate opportunity page layouts.
• Consider adding the Items To Approved related list to your custom home page layouts. The related list shows users all approval
requests that are waiting for their response.
• If you have a sandbox, test the approval process, then activate it.

SEE ALSO:
Email Templates in Salesforce Classic
Create Custom Fields
Set Up an Approval Process
Prepare Your Org for Approvals

Sample Approval Process: Job Candidates


When your company interviews candidates for a position, you may have several levels of approval
EDITIONS
before you can send an offer letter. Use this example to create a three-step approval process that
requires approval from multiple management levels. Available in: both Salesforce
Classic and Lightning
Prep Your Organization Experience

Before creating the approval process: Available in: Enterprise,


Performance, Unlimited,
• If you don't yet have a custom object to track candidates, create a custom object and tab called and Developer Editions
Candidates. Add the appropriate fields such as Salary, Offer Extended (checkbox),
and Date of Hire.
• Create an email template to notify approvers about a pending approval request. To direct users to the approval page in Salesforce,
include approval process merge fields.

620
Automate Your Business Processes Sample Approval Processes

Create the Approval Process


Create an approval process on the Candidate custom object using the following specifications:
• Don't enter filter criteria because you want all submitted offers to be approved.
• Choose the Manager field as the next automated approver.
• Select the email template you created for this approval process.
• Choose the record owner or any other user that you want to be able to submit offer letters.
• Create three approval steps:
1. Create a step named Step 1: Manager Approval:
– No filter is necessary as you want all records to advance to this step.
– In the Automatically assign to approver(s) option, select the manager of the user submitting the request.
– If appropriate, choose The approver's delegate may also approve this request if you want to
allow the user in the Delegated Approver field to approve requests.

2. Create a second step named Step 2: VP Approval:


– No filter is necessary as you want all records to advance to this step.
– Choose Let the user choose the approver to allow the manager to select the appropriate VP to approve
the request.
– If appropriate, choose The approver's delegate may also approve this request if you want to
allow the user in the Delegated Approver field to approve requests.
– Choose Perform ONLY the rejection actions for this step... so that the request returns to the
manager for changes if the VP rejects the request.

3. Create a third step named Step 3: CFO Approval:


– No filter is necessary as you want all records to advance to this step.
– Choose Automatically assign to approver(s) and select the name of your CFO.
– If appropriate, choose The approver's delegate may also approve this request if you want to
allow the user in the Delegated Approver field to approve requests.
– Choose Perform all rejection actions for this step AND all final rejection actions.
(Final Rejection) so that offer letters rejected by your CFO are completely rejected.

Tip:
• Consider creating the following final approval actions:
– Email alert to notify the user who submitted the offer letter request.
– Field update to select the Offer Extended checkbox.

• Consider creating the following final rejection actions:


– Email alert to notify the manager that the offer won't be extended.

Wrap Things Up
• After you created the approval process, add the Approval History related list to the Candidates object page layout.
• Consider adding the Items To Approved related list to your custom home page layouts. The related list shows users all approval
requests that are waiting for their response.

621
Automate Your Business Processes Approval History Reports

• If you have a sandbox, test the approval process, then activate it.

SEE ALSO:
Create a Custom Object
Email Templates in Salesforce Classic
Set Up an Approval Process
Prepare Your Org for Approvals

Approval History Reports


If you create a custom report type for approval process instances, users can view the historical
EDITIONS
details of completed and in-progress approval processes and their individual steps.
Available in: both Salesforce
Fields Available for Approval History Reports Classic and Lightning
If you create a custom report type with Process Instance as the primary object and Process Experience
Instance Node as the related object, you can create approval history reports with various Available in: Enterprise,
combinations of fields that enable you to view a detailed history of executed and in-progress Performance, Unlimited,
approval processes and their individual steps. and Developer Editions
Examples of Approval History Reports
See sample reports to learn how you can obtain approval history data.
Considerations for Approval History Reports
Understand the limitations and special behaviors when you create or view approval history reports, which provide a detailed history
of approval processes and steps.

SEE ALSO:
Create a Custom Report Type for Approval History

Fields Available for Approval History Reports


If you create a custom report type with Process Instance as the primary object and Process Instance
EDITIONS
Node as the related object, you can create approval history reports with various combinations of
fields that enable you to view a detailed history of executed and in-progress approval processes Available in: Salesforce
and their individual steps. Classic (not available in all
orgs) and Lightning
Experience
Process Instance
A process instance represents one instance of an approval process. A new process instance is created Available in: Essentials,
each time a record is submitted for approval. Group (View Only),
Essentials, Professional,
Enterprise, Performance,
Field Description
Unlimited, and Developer
Approval Process: Name of the approval process. Editions
Name
Available in: Enhanced
Approval Process ID of the approval process instance. Folder Sharing and Legacy
Instance ID Folder Sharing

622
Automate Your Business Processes Approval History Reports

Field Description
Completed Date Date and time when the approval process instance was completed or recalled.
If no step criteria are met and the record is auto-approved or auto-rejected,
Completed Date and Submitted Date have the same values.

Elapsed Days Length of time between when the record was submitted for approval and when the
approval process was completed or recalled.
Elapsed Hours

Elapsed Minutes

Last Actor: Full Name Full name of the user who most recently participated in the approval process instance.
If no step criteria are met and the record is auto-approved or auto-rejected, Last
Actor: Full Name and Submitter: Full Name have the same values.

Object Type Object type of the record that was submitted for approval.

Pending Step Name Name of the approval step at which the record is awaiting approval or rejection.

Record Name Name of the record that was submitted for approval.

Status Status of the approval process instance.

Submitted Date Date and time when the record was submitted for approval.

Submitter: Full Name Full name of the user who submitted the record for approval.

Process Instance Node


A process instance node represents an instance of an approval step. A new process instance node is created each time a record enters
a step in an approval process. No process instance node is created when the record doesn’t meet the step criteria or if the approval
process instance is otherwise completed without entering the step.

Field Description
Step: Name Name of the approval step.

Step: Completed Date Date and time when the approval step instance was completed or recalled.

Step Elapsed Days Length of time between when the record entered the approval step and when the
approval step instance was completed or recalled.
Step Elapsed Hours

Step Elapsed Minutes

Step Last Actor: Full Name Full name of the user who most recently participated in the approval step instance.

Step Start Date Date and time when the record entered the approval step.

623
Automate Your Business Processes Approval History Reports

Field Description
Step Status Status of the approval step instance.

SEE ALSO:
Approval History Reports
Considerations for Approval History Reports
Examples of Approval History Reports

Examples of Approval History Reports


See sample reports to learn how you can obtain approval history data.
EDITIONS

Report Example: Opportunity Approvals Submitted Within a Date Range Available in: both Salesforce
Classic and Lightning
This sample report displays approval process instances that were submitted within a specified date Experience
range (1) for the Opportunity object (2). The results are sorted by status (3) and include the last
actor (4), submitted date (5), completed date (6), record name (7), approval process instance ID (8), Available in: Enterprise,
and approval process name (9). Performance, Unlimited,
and Developer Editions

624
Automate Your Business Processes Approval History Reports

Report Example: Approvals—Elapsed Times


This sample report displays all approval process instances (1) and groups results by the approval process name (2). The results include
the record name (3), approval process instance ID (4), status (5), submitted date (6), elapsed minutes (7), and completed date (8).

Report Example: Approval Steps—Elapsed Times


This sample report displays all approval process instances (1) and groups results by approval process name (2) and record name (3). The
results are sorted by step name (4) and include step status (5), step start date (6), step elapsed minutes (7), step completed date (8), and
approval process instance ID (9).

625
Automate Your Business Processes Approval History Reports

Notice that the previous sample report doesn't include the approvers for each step and the elapsed time for each approval request. To
get this information, run a SOQL query by using the approval process instance ID from the report. The following sample SOQL query
obtains the ActorID (user or queue that received the approval request) and the ElapsedTimeInHours (elapsed time since
the approval request was sent) for the first pending step in the report.
SELECT ActorId,ElapsedTimeInHours FROM ProcessInstanceWorkitem where processInstanceId =
'04gD0000000LvIV'

626
Automate Your Business Processes Approval History Reports

The sample query has only one result, and you can view that approver's user profile page by appending the resulting ActorID to the
organization's base URL (https://MyDomainName.my.salesforce.com/005D00000015vGGIAY), which gets redirected
to the user profile page.

SEE ALSO:
Approval History Reports

Considerations for Approval History Reports


Understand the limitations and special behaviors when you create or view approval history reports,
EDITIONS
which provide a detailed history of approval processes and steps.
Available in: both Salesforce
Considerations for Approval Processes That Were Completed Before or Classic and Lightning
Experience
Pending During the Summer ’14 Rollout
Available in: Enterprise,
When Summer ’14 became available for your organization, the approval history data was
Performance, Unlimited,
automatically populated for completed and pending approval processes. However, some approval
and Developer Editions
history field values are never populated or are populated only after the approval process instance
is next acted upon—such as when a user approves, rejects, or reassigns an approval request—after
the Summer ’14 rollout.

627
Automate Your Business Processes Approval History Reports

Object When Fields are Populated


Process Instance For approval process instances that were completed before the Summer ’14 rollout, all Process Instance
fields are automatically populated, with one exception: Completed Date is never populated for
approval process instances that were completed before January 1, 2013.
For approval process instances that were pending during the Summer ’14 rollout, all Process Instance
fields are automatically populated, with two exceptions: Completed Date and Last Actor:
Full Name are populated only after the approval process instance is complete.

Process Instance Node Never populated for approval process instances that were completed before the Summer ’14 rollout.
For approval process instances that were pending during the Summer ’14 rollout, all Process Instance
Node fields are populated only after the approval process instance is next acted upon after the Summer
’14 rollout.

Additional exceptions apply to approval history data that is available only via SOQL queries of certain objects. See ProcessInstance,
ProcessInstanceNode, ProcessInstanceStep, and ProcessInstanceWorkitem in the Object Reference for Salesforce.

Considerations for the Sandbox Environment


If you copy approval history data to a sandbox, some field values are overwritten and don’t reflect the actual approval history.

Object Field When an existing process instance or process instance node record is copied
to a sandbox...
Process Instance Submitted This value is overwritten by the date and time when the process instance record is copied
Date to the sandbox.

Submitter: This value is overwritten by the name of the user who copied the process instance record
Full Name to the sandbox.

Process Instance Step Start This value is overwritten by the date and time when the process instance node record is
Node Date copied to the sandbox.

SEE ALSO:
Fields Available for Approval History Reports
Approval History Reports

628
Automate Your Business Processes Manage Multiple Approval Requests

Manage Multiple Approval Requests


Transfer multiple approval requests from one user to another or remove multiple approval requests
EDITIONS
from the approval process.
Available in: both Salesforce
Transfer Pending Approval Requests Classic and Lightning
If users move to a new role before they complete all their pending approval requests, transfer Experience
the remainder to another user. Available in: Enterprise,
Remove Pending Approval Requests Performance, Unlimited,
If you want to clean up old approval requests—such as to delete an approval process—remove and Developer Editions
them from your Salesforce org. After approval requests are removed, the associated records
are unlocked and removed from all approval processes, so they no longer appear on the
approver’s list of pending approval requests.

SEE ALSO:
Considerations for Managing Approvals

Transfer Pending Approval Requests


If users move to a new role before they complete all their pending approval requests, transfer the
EDITIONS
remainder to another user.
1. From Setup, enter Mass Transfer Approval Requests in the Quick Find Available in: both Salesforce
box, then select Mass Transfer Approval Requests. Classic and Lightning
Experience
2. Search for the approval requests to transfer.
3. Select Mass transfer outstanding approval requests to a new user. Available in: Enterprise,
Performance, Unlimited,
4. Look up and select the user to transfer the requests to. and Developer Editions
Make sure that the user can view the records that are associated with the approval requests.

5. Add comments. USER PERMISSIONS


The comments you enter display on the Approval History related list.
To transfer multiple approval
6. Select each approval request that you want to transfer. requests:
• Transfer Leads
7. Click Transfer.
AND
Transfer Record
SEE ALSO:
Remove Pending Approval Requests
Considerations for Managing Approvals
Manage Multiple Approval Requests

629
Automate Your Business Processes Approval Requests for Users

Remove Pending Approval Requests


If you want to clean up old approval requests—such as to delete an approval process—remove
EDITIONS
them from your Salesforce org. After approval requests are removed, the associated records are
unlocked and removed from all approval processes, so they no longer appear on the approver’s list Available in: both Salesforce
of pending approval requests. Classic and Lightning
1. From Setup, enter Mass Transfer Approval Requests in the Quick Find Experience
box, then select Mass Transfer Approval Requests. Available in: Enterprise,
2. Search for the approval requests that you want to remove. Performance, Unlimited,
and Developer Editions
3. Select Mass remove records from an approval process.
4. Add comments.
USER PERMISSIONS
The comments you enter display on the Approval History related list.
To remove multiple approval
5. Select each approval request to remove from the approval process.
requests:
6. Click Remove. • Transfer Leads
AND
SEE ALSO: Transfer Record
Transfer Pending Approval Requests
Considerations for Managing Approvals
Manage Multiple Approval Requests

Approval Requests for Users


Your admin can set up approval processes that let you and other users submit records for approval,
EDITIONS
which results in approval requests.
Available in: both Salesforce
Submit a Record for Approval Classic and Lightning
Depending on your org’s customizations, you can submit a record for approval directly from Experience
that record. Available in: Enterprise,
Withdraw an Approval Request Performance, Unlimited,
If you submitted a record for approval but suddenly need to update information in the record, and Developer Editions
recall the approval request. However, whether you can recall an approval request depends on
how your admin configured the approval process that the record was submitted to.
Respond to an Approval Request
When you receive an approval request, respond to it by approving, rejecting, or reassigning it. Depending on which Salesforce
experience you’re using, you have different options. Approval request comments are limited to 4,000 characters. In Chinese, Japanese,
or Korean, the limit is 1,333 characters.
What Does This Approvals Error Mean?
Here are some errors that you can come across when you submit a record for approval or respond to an approval request.
Approval History Status
To track where a record is in an approval process, view its Approval History related list.
Approval User Preferences
Identify a delegated approver and control whether you receive approval request emails.

630
Automate Your Business Processes Approval Requests for Users

Submit a Record for Approval


Depending on your org’s customizations, you can submit a record for approval directly from that
EDITIONS
record.
1. Go to the record that you want to submit for approval. Available in: both Salesforce
Classic and Lightning
2. Make sure it’s ready to be submitted.
Experience
Before you can submit a record for approval, it must meet the criteria for an active approval
process. If you’re not sure what the requirements are, ask your admin. Available in: Enterprise,
Performance, Unlimited,
3. Click Submit for Approval. and Developer Editions
If an approval process applies to the record, Salesforce begins the approval process. This button
isn’t available after the record has been submitted.
USER PERMISSIONS
To keep tabs on the progress of your submitted approval, we recommend following the approval
To submit a record for
record in Chatter.
approval:
• Read on the record
SEE ALSO:
Withdraw an Approval Request
Approval User Preferences
Approval Requests for Users

Withdraw an Approval Request


If you submitted a record for approval but suddenly need to update information in the record, recall
EDITIONS
the approval request. However, whether you can recall an approval request depends on how your
admin configured the approval process that the record was submitted to. Available in: both Salesforce
1. Go to the detail page for the record associated with the approval request. Classic and Lightning
Experience
2. In the Approval History related list, recall the approval request.
Available in: Enterprise,
Performance, Unlimited,
SEE ALSO:
and Developer Editions
Submit a Record for Approval
Approval User Preferences
USER PERMISSIONS
Approval Requests for Users
To withdraw an approval
request:
• Read on the Record

631
Automate Your Business Processes Approval Requests for Users

Respond to an Approval Request


When you receive an approval request, respond to it by approving, rejecting, or reassigning it.
EDITIONS
Depending on which Salesforce experience you’re using, you have different options. Approval
request comments are limited to 4,000 characters. In Chinese, Japanese, or Korean, the limit is 1,333 Available in: both Salesforce
characters. Classic and Lightning
Experience
Respond from... Lightning Salesforce Classic The Salesforce
Experience Mobile App Available in: Enterprise,
Performance, Unlimited,
An in-app notification and Developer Editions

An email notification
USER PERMISSIONS
The record
To respond to an approval
Chatter request from within
Salesforce:
Home
• Read on the associated
Slack record
To respond to an approval
request from an email:
In-App Notification • API Enabled
Depends on the Receive Approval Request Emails field in your approver
preferences. If notifications are enabled for your org, you receive a notification whenever you
receive an approval request email.
• Respond from the notification if your admin enabled actionable notifications.
• To open the approval request, click the notification.
Email Notification
Depends on the Receive Approval Request Emails field in your approver preferences.
• To open the approval request, click the link in the email.
• Reply to the email if your admin enabled email approval response.
Record
Respond from the Approval History related list.
Chatter
Depends on if your admin has enabled Approvals in Chatter and you haven’t opted out of receiving approval requests through
Chatter posts.
• Respond from the post if your admin enabled actionable notifications.
• Click the name of the record, then respond from the Approval History related list.
Home
Depends on if your admin added the Items to Approve component to your home page. From the Home tab, respond from the Items
to Approve component.

Tip: From this component in Salesforce Classic, you can respond to multiple requests at once.

632
Automate Your Business Processes Approval Requests for Users

Slack
Slack notifications are enabled by default. If your admin hasn't disabled Slack notifications, an approver can respond to a request
from the Messages tab on the Salesforce Digital HQ app in Slack. A Show More link opens the details of the approval request in
Salesforce.

Respond to an Approval Request Via Email


If your admin enabled email approval response, you can approve or reject requests by responding to the email notification. It doesn’t
matter which Salesforce experience or mobile email client you’re using. Delegated approvers can also respond to approval requests
by email.
Troubleshoot Email Responses to Approval Requests
When email responses aren’t working correctly, review these common issues.

SEE ALSO:
Approval User Preferences
Approval Requests for Users

Respond to an Approval Request Via Email


If your admin enabled email approval response, you can approve or reject requests by responding
EDITIONS
to the email notification. It doesn’t matter which Salesforce experience or mobile email client you’re
using. Delegated approvers can also respond to approval requests by email. Available in: both Salesforce
Email approval response works in all languages that Salesforce supports. The response word or Classic and Lightning
phrase is checked using the current user language dictionary. If no matches are found, the response Experience
word or phrase is checked in all other language dictionaries.
Available in: Enterprise,
1. In the first line of your reply to the email notification, enter one of the supported response Performance, Unlimited,
words. and Developer Editions
Periods and exclamation marks are allowed at the end of the word.
USER PERMISSIONS
Approval Words Rejection Words
To respond to an approval
approve reject request via email:
• API Enabled
approved rejected

yes no

2. Optionally, in the second line of your reply, add comments.


3. Send the email.

SEE ALSO:
Approval User Preferences
Approval Requests for Users

633
Automate Your Business Processes Approval Requests for Users

Troubleshoot Email Responses to Approval Requests


When email responses aren’t working correctly, review these common issues.
EDITIONS
I’m not receiving approval requests by email.
Here are a few possible reasons why. Available in: both Salesforce
Classic and Lightning
• Your approval preferences opt you out of approval request emails.
Experience
• Your mail server thinks the approval request email is spam. Contact your email admin, who
can check the logs of all inbound email to see if it’s being delivered, rejected, or marked as Available in: Enterprise,
spam. Performance, Unlimited,
and Developer Editions
• Your email admin has to add the Salesforce email addresses that the approval requests
come from to the allowed email addresses for your mail server.
• Email delivery time can vary based on your ISP or connection.
My response wasn’t delivered.
• An email approval request can only be processed once. If another user has responded to the approval request before you do,
you get an error.
• You must have the “API Enabled” user permission to respond to approval requests by email.
I received an email that said, “The word used to approve or reject the item was not understood.”
Salesforce doesn’t process replies to error emails. Reply again to the original email notification, but this time use one of the supported
response words on page 633.
I received an email that said, “You are not authorized to update the referenced object.”
The approval request email is tied to your email address. You receive this error if you forward the request to another email address
or if your email client lets you respond from multiple email addresses. Reply again to the original email notification, but this time
reply from the same email address that received the email approval request.

SEE ALSO:
What Does This Approvals Error Mean?
Respond to an Approval Request Via Email
Approval Requests for Users

What Does This Approvals Error Mean?


Here are some errors that you can come across when you submit a record for approval or respond
EDITIONS
to an approval request.
Manager undefined Available in: both Salesforce
Classic and Lightning
This approval request requires the next approver to be determined by the Field Name
Experience
field. This value is empty.
Salesforce tried to route the approval request based on a hierarchical field, such as Manager. Available in: Enterprise,
However, the field has no value or specifies an inactive user. This error can occur when someone Performance, Unlimited,
submits a record for approval or when an approver responds to an approval request. and Developer Editions
Required fields are missing: [FieldName].
The approval process includes a field update that fails standard validation rules for the identified
field. This error can occur even if the field isn’t visible on your page layout.

634
Automate Your Business Processes Approval Requests for Users

Note: Salesforce doesn’t check whether field updates pass custom validation rules on fields.

SEE ALSO:
Troubleshoot Email Responses to Approval Requests
Approval Requests for Users

Approval History Status


To track where a record is in an approval process, view its Approval History related list.
EDITIONS
Status Definition Available in: Salesforce
Submitted The record has been submitted for approval. Classic (not available in all
orgs)
Pending The record has been submitted for approval and is awaiting approval or
Available in: Enterprise,
rejection.
Performance, Unlimited,
Approved The record has been approved. and Developer Editions

Rejected The record has been rejected.

Reassigned The record has been submitted for approval but assigned to a different
approver.

Recalled The record was submitted for approval but recalled from the approval
process.

SEE ALSO:
Approvals
Submit a Record for Approval
Respond to an Approval Request
Approval Requests for Users

Approval User Preferences


Identify a delegated approver and control whether you receive approval request emails.
EDITIONS
From your personal settings, enter Approver Settings in the Quick Find box, then
select Approver Settings. No results? Enter Personal Information in the Quick Find Available in: both Salesforce
box, then select Personal Information. Classic and Lightning
Experience
Field Description Available in: Enterprise,
Delegated Your alternate approver. If populated, this user receives the same approval Performance, Unlimited,
Approver requests as you do. Delegated approvers can't reassign approval requests; and Developer Editions
they can only approve or reject approval requests.

Note: Internal Salesforce users are listed by and can be added using
the Delegated Approver lookup field. Use Data Loader and a

635
Automate Your Business Processes Approval Requests for Users

Field Description

comma-delineated (CSV) file to add users with communities licenses as Delegated Approvers. The
CSV uses the CommunityUserId rather than the UserId for DelegatedApproverId.
Communities licenses are used with Experience Cloud sites and legacy portals.

Manager Depending on how your admin sets up approval processes, requests for approval can automatically be
routed to your manager.

Receive Approval Controls whether you receive approval request notifications by email, in the Salesforce mobile app, or in
Request Emails Lightning Experience.
If you select Never, you don’t receive approval request notifications. However, you still receive approval
request emails from a queue, depending on how your admin configured the queue email.

Opt Out of Approval Request Posts in Chatter


By default, after your org enables Approvals in Chatter, you’re notified about approval requests by email and a Chatter post. To stop
seeing the Chatter posts, opt out. If you do opt out, the posts don’t appear in your feed but they do appear in the associated record’s
feed.
What Happens When You Opt Out of Chatter Approval Requests?
By default, when your org has Approvals in Chatter enabled, you receive approval request notifications by email and Chatter. Here’s
what happens when you opt out of the Chatter posts.

SEE ALSO:
Approval Requests for Users
Personalize Your Salesforce Experience

Opt Out of Approval Request Posts in Chatter


By default, after your org enables Approvals in Chatter, you’re notified about approval requests by
USER PERMISSIONS
email and a Chatter post. To stop seeing the Chatter posts, opt out. If you do opt out, the posts
don’t appear in your feed but they do appear in the associated record’s feed. To view an approval request
post for a record:
Available in: both Salesforce Classic and Lightning Experience • Read on the record

Available in: Group, Professional, Enterprise, Performance, Unlimited, Developer, and


Contact Manager Editions

1. In the page banner, click your profile avatar, and select My Settings (Salesforce Classic) or Settings (Lightning Experience).
2. Enter My Feeds in the Quick Find box, then select My Feeds.
3. Deselect Receive approval requests as posts.
You see this setting only when approvals are enabled in your org.

636
Automate Your Business Processes Approval Process Terminology

4. Save your changes.

SEE ALSO:
Approval User Preferences
Personalize Your Salesforce Experience

What Happens When You Opt Out of Chatter Approval Requests?


By default, when your org has Approvals in Chatter enabled, you receive approval request notifications by email and Chatter. Here’s what
happens when you opt out of the Chatter posts.

Available in: both Salesforce Classic and Lightning Experience

Available in: Group, Professional, Enterprise, Performance, Unlimited, Developer, and Contact Manager Editions

• If you opt out while an approval that you’re assigned to is in progress, you see notification posts if you’re following the approval
record.
• If you’re following the approval record, you see approval posts from the record with non-approver content.
• For approval notification posts that you’ve already received, you see non-approver content.
• The Approve and Reject buttons are removed from existing approval posts in your feed.

SEE ALSO:
Approval User Preferences
Opt Out of Approval Request Posts in Chatter

Approval Process Terminology


Salesforce uses this terminology for approval processes.
EDITIONS
Approval Actions
An approval action occurs when all required approvers approved a step. Available in: both Salesforce
Classic and Lightning
Approval Process
Experience
An approval process automates how records are approved in Salesforce. An approval process
specifies each step of approval, including from whom to request approval and what to do at Available in: Enterprise,
each point of the process. Performance, Unlimited,
and Developer Editions
Approval Request
An approval request is an email, Salesforce app notification, Lightning Experience notification,
or Chatter post. The approval request notifies the recipients that a record was submitted for
them to approve.
Approval Steps
Approval steps define the chain of approval for a particular approval process. Each step determines
• Which records can advance to that step
• To whom to assign approval requests
• Whether to let each approver’s delegate respond to the requests

637
Automate Your Business Processes Approval Process Terminology

The first step specifies what to do if a record doesn’t advance to that step. Later steps specify what happens if an approver rejects
the request.
Assigned Approver
The assigned approver is the user responsible for responding to an approval request.
Delegated Approver
A delegated approver is someone appointed by an assigned approver as an alternate for approval requests.

Note: Internal Salesforce users are listed by and can be added using the Delegated Approver lookup field. Use Data Loader
and a comma-delineated (CSV) file to add users with communities licenses as Delegated Approvers. The CSV uses the
CommunityUserId rather than the UserId for DelegatedApproverId. Communities licenses are used with
Experience Cloud sites and legacy portals.
Email Approval Response
Email approval response lets users respond to approval requests by replying to an email notification.
Initial Submission Actions
An initial submission action occurs when a user first submits a record for approval. By default, the record is locked.
Final Approval Actions
Final approval actions occur when all required approvals were obtained.
Final Rejection Actions
A final rejection action occurs when an approver rejects the request and it moves to the final rejection state.
Outbound Message
An outbound message sends information to a designated endpoint, like an external service. You can configure outbound messages
from Setup. Configure the external endpoint and use the SOAP API to create a listener for the messages.
Process Instance
A process instance represents one instance of an approval process. A new process instance is created each time a record is submitted
for approval.
Process Instance Node
A process instance node represents an instance of an approval step. The system creates a process instance node each time a record
enters a step in an approval process. The system doesn’t create a process instance node when the record doesn’t meet the step
criteria or the approval process instance is completed without entering the step.
Recall Actions
A recall action occurs when a submitted approval request is recalled. By default, the record is unlocked.
Record Locking
Record locking prevents users from editing a record, regardless of field-level security or sharing settings. By default, Salesforce locks
records that are pending approval. Only admins can edit locked records.

SEE ALSO:
Approvals
Perform Automated Actions
Set Up an Approval Process

638
Automate Your Business Processes Einstein Next Best Action

Einstein Next Best Action


Display the right recommendations to the right people at the right time with Einstein Next Best
EDITIONS
Action. Create and display offers and actions for your users that are tailored to meet your unique
criteria. Develop a strategy that applies your business logic to refine those recommendations. Your Available in: both Salesforce
strategy distills your recommendations into a few key suggestions, like a repair, a discount, or an Classic and Lightning
add-on service. Display the final recommendations in your Lightning app or Experience Builder site. Experience
Note: Where possible, we recommend building strategies in Flow Builder using the Available in: Essentials,
Recommendation Strategy flow type, but you can also create them in Strategy Builder. Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
Get Started with Einstein Next Best Action
Just getting started with Einstein Next Best Action? Follow these steps to complete each phase
of the Next Best Action setup process, create personalized recommendations for your users,
and put decisions into action.
Einstein Next Best Actions Considerations
Here are some things to keep in mind when working with strategies and recommendations.
Einstein Next Best Action Entitlements
Einstein Next Best Action has usage-based entitlements. All orgs receive a free monthly allowance of Next Best Action requests. If
your usage exceeds your allowance of free monthly requests or any entitlements that you purchase, Salesforce contacts you to
discuss additions to your contract. To track your usage, from Setup, navigate to Company Information.
Create Recommendations
Create offers or actions to recommend to users using Einstein Next Best Action. Recommendations are standard Salesforce records,
similar to accounts and contacts, that are processed by strategies and associated with flows. Strategies determine which
recommendation records are surfaced using business rules, predictive models, and other data sources. The result of this process is
context-specific recommendations that you present to your users.
Strategy Builder
Strategy Builder is a point-and-click process automation tool used with Einstein Next Best Action. Strategy Builder funnels
recommendation records through your business logic to determine which recommendations are surfaced on your record pages.
Display Recommendations
After creating a strategy, choose a page to run your strategy and display your recommendations. You can use a Lightning record
page, an app’s home page, an Experience Cloud site page, a Visualforce page, or an external site, depending on where you want
recommendations to appear.
Report On and Track a Recommendation
Create a custom report type to report on and track recommendation data and strategy metrics. You can see the monthly total
recommendations that a Salesforce org’s strategies served. And you can analyze which recommendations are accepted and rejected,
who responds to them, and more.

SEE ALSO:
Connect REST API Developer Guide: Next Best Action Resources
Unofficial SF: Next Best Action Home
Unofficial SF: How To: Access Unique Community Cloud Features for Next Best Action
Unofficial SF: Deployment Options and Roadmap for Next Best Action

639
Automate Your Business Processes Get Started with Einstein Next Best Action

Get Started with Einstein Next Best Action


Just getting started with Einstein Next Best Action? Follow these steps to complete each phase of
EDITIONS
the Next Best Action setup process, create personalized recommendations for your users, and put
decisions into action. Available in: both Salesforce
Einstein Next Best Action is a solution that uses flows, strategies, and the Recommendation object Classic and Lightning
to recommend actions to users. You can display these recommendations on many different types Experience
of pages, including Lightning pages in your Salesforce org, Experience Cloud sites, or external sites.
Available in: Essentials,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions

Recommendations
Recommendations are displayed to users with the option to accept or reject the recommended action. Each recommendation contains
an image, important text values such as button text and a description, and an assigned flow that runs when a user responds. They can
be stored and referenced in the Recommendation standard object, or they can be manually assembled when building a strategy.

Strategies
Strategies determine which recommendations to display to users, based on your data and business processes. When you set up Einstein
Next Best Action on a page, you assign a strategy to that location, which then defines the recommendations that appear there.
You can control which recommendations are displayed in any situation, even if your org has a large number of recommendation records.
Strategies can filter recommendations based on any available value, including recommendation fields, fields related to the running user,
and fields related to the record that’s currently displayed.

Important: In Flow Builder, you define which recommendations are displayed by making sure that they’re in the
outputRecommendations collection variable at the end of the flow. In Strategy Builder, you define which recommendations are
displayed by making sure that they’re not filtered out when they reach the Output element.
1. Plan Your Recommendations and Automation
Decide where the recommendation appears, who it appears to, and the conditions in which it appears. Create a plan for the automation
that you want to run when a user accepts the recommendation.

2. Build a Flow
In Flow Builder, design and build the flow that runs when a user accepts or rejects the recommendation. You can assign only screen
flows and autolaunched flows to a recommendation. If an inactive or invalid flow is assigned, the recommendation isn’t displayed
to users.

640
Automate Your Business Processes Get Started with Einstein Next Best Action

3. Create Recommendations
Recommendations are standard Salesforce records, similar to accounts and contacts. To create recommendations, you can:
• Create recommendation records on the Recommendation object.
• Build recommendations from other data when creating your strategy. In Flow Builder, use the Recommendation Assignment
element or a custom Apex invocable action.
• Generate recommendations automatically through AI with Einstein Recommendation Builder.

4. Create a Strategy
After you create a flow and have a plan for your recommendation records, use Flow Builder or Strategy Builder to create your strategy.
Where possible, we recommend building strategies in Flow Builder using the Recommendation Strategy flow type, but you can also
create them in Strategy Builder.
Some features can be used only in strategies created in Strategy Builder.
• Limiting repeated showings of some recommendations
• Displaying recommendations on an Experience Cloud site or external site
• Displaying AI-generated recommendations from Einstein Recommendation Builder
To build a strategy in Flow Builder, follow these steps.
a. Go to the Flows page in Setup, and click New Flow.
b. Select the All + Templates tab, and then select the Recommendation Strategy category. Select the
Recommendation Strategy flow type, and click Create.
c. Add Get Records elements to retrieve data from Salesforce records, such as the Recommendations object or an object related
to the currently displayed record. Use condition requirements in the Get Records element to filter which recommendations are
stored in the element’s collection. Or you can build recommendations from other data with the Recommendation Assignment
element or a custom Apex invocable action.
d. Add logic elements to limit the number of recommendations that users see. Use Collection Sort and Collection Filter elements
to arrange and reduce the recommendations from the Get Records collection. If needed, you can also add other Flow elements
such as Decision and Loop to create more complex, branching logic.
e. Add the Assignment element to set recommendations in the outputRecommendations collection. When running a strategy
built in Flow Builder, Einstein Next Best Action displays only recommendation records in the outputRecommendations collection.

5. Display Next Best Actions


After creating a strategy, choose a page to run your strategy and display your recommendations. You can use a Lightning record
page, an app’s home page, an Experience Cloud site page, a Visualforce page, or an external site, depending on where you want
recommendations to appear.
• Einstein Next Best Action Component
Use the Einstein Next Best Action component to display recommendations to users on most Lightning pages within your
Salesforce org, including record pages, home pages, and app pages.

• Suggested Actions Component

641
Automate Your Business Processes Einstein Next Best Actions Considerations

Use the Suggested Actions component to display recommendations on Experience Cloud sites. This component can run only
strategies created in Strategy Builder.

SEE ALSO:
Build a Flow
Create Recommendations
Strategy Builder
Display Recommendations
Launch a Flow When a Recommendation Is Accepted or Rejected
Einstein Next Best Action Component
Suggested Actions
Unofficial SF: How To: Access Unique Community Cloud Features for Next Best Action
Unofficial SF: Building Your Own Next Best Action Front End

Einstein Next Best Actions Considerations


Here are some things to keep in mind when working with strategies and recommendations.
EDITIONS
Einstein Next Best Action relies on flows, recommendations, strategies, and components, and has
standard objects for reporting. Available in: both Salesforce
Classic and Lightning
Experience
Flows
Available in: Essentials,
• All Recommendation objects reference a flow. If you don’t have any flows, you can’t surface a Professional, Enterprise,
recommendation. Performance, Unlimited,
• Strategies only load recommendations with active flows. and Developer Editions

Recommendations
• Consider adding a custom category field to the recommendation object and layout. A category field gives you more control when
loading, sorting, and filtering recommendations and more options when creating flows.
• Create names, descriptions, acceptance labels, and rejection labels that are appropriate for your intended audience.
• Reusing a recommendation name creates a new recommendation. It doesn’t overwrite an existing recommendation. Duplicated
names can cause strategies to display duplicate recommendations to customers.
• All flows, both inactive and active, display in the Action dropdown list. After you save your recommendation, you can see if the flow
is active.
• You can create a recommendation based on a flow that isn’t active, but no strategy loads it until the flow is activated.

Strategies
• All strategies require at least one recommendation.
• In Strategy Builder, you can load and filter the records of a Recommendation object. Or load and filter the records of any object, and
convert them into recommendations at the end of the strategy using the Map element.
• Load elements require at least one criteria.

642
Automate Your Business Processes Einstein Next Best Action Entitlements

• Strategies only load recommendations that are based on active flows.


• The Limit Reoffer element in Strategy Builder allows you to hide a recommendation from all users based on its responses. A
recommendation is hidden if users respond more than a defined number of times within a defined number of days. If you want to
continue to test a recommendation as a flow-entry point, delete individual records from the Recommendations Reaction table with
Rest API calls:
GET /connect/recommendation-strategies/reactions
{ onBehalfOf: “005B00000018jK4IAI” }
//Returns a list of reactions
//For each result, if the reaction matches the strategyId of the strategy you’re testing:
DELETE /connect/recommendation-strategies/reactions/${reactionId}

• Strategy Builder is only available in Lightning Experience.

Tracking and Reporting Reactions


For strategies created in Flow Builder, create custom report types using the Recommendation Strategy Metrics and Recommendation
Responses primary objects. For strategies created in Strategy Builder, create custom report types using the Recommendation Strategy
Metrics and Recommendation Reactions primary objects.
Rights of ALBERT EINSTEIN are used with permission of The Hebrew University of Jerusalem.
Represented exclusively by Greenlight.

SEE ALSO:
Einstein Next Best Action
Write an Expression

Einstein Next Best Action Entitlements


Einstein Next Best Action has usage-based entitlements. All orgs receive a free monthly allowance
EDITIONS
of Next Best Action requests. If your usage exceeds your allowance of free monthly requests or any
entitlements that you purchase, Salesforce contacts you to discuss additions to your contract. To Available in: both Salesforce
track your usage, from Setup, navigate to Company Information. Classic and Lightning
Einstein Next Best Action is automatically enabled for the editions listed in the Required Editions Experience
table.
Available in: Essentials,
Professional, Enterprise,
How To Get It What’s What’s Availability Permission Performance, Unlimited,
Included Counted and Developer Editions
Free org-wide All orgs receive All Next Best Included in None
requests 5,000 Next Best Action and Essentials,
Action strategy Einstein Professional,
requests per Recommendation Enterprise,
month at no Builder requests, Performance,
charge. including tests in and Unlimited
Strategy Builder, Editions
display to
customers, and
repeat displays

643
Automate Your Business Processes Einstein Next Best Action Entitlements

How To Get It What’s Included What’s Counted Availability Permission


triggered by events.

Einstein Next Best Action Provides 10,000 All Next Best Action For purchase in None
Additional Requests SKU additional Next Best requests, including tests Essentials, Professional,
Action requests each in Strategy Builder, Enterprise,
month on an org-wide display to customers, and Performance, and
basis. (Add-on) repeat displays triggered Unlimited Editions
by events.

Service Cloud Einstein Provides unlimited Next Requests made by users For purchase in Unlimited Next Best
SKU Best Action requests for a with this permission Enterprise, Action Strategy
single user. aren’t counted against Performance, and Executions
the monthly entitlement. Unlimited Editions

Lightning Platform Plus Provides unlimited Next Requests made by users For purchase in Unlimited Next Best
Best Action requests for a with this permission Enterprise, Action Strategy
single user. aren’t counted against Performance, and Executions
the monthly entitlement. Unlimited Editions

Next Best Action Request


A request is a call to the Next Best Action engine that causes a strategy to run and return recommendations.

Next Best Action Request


A request is a call to the Next Best Action engine that causes a strategy to run and return
EDITIONS
recommendations.
Each time a page with an Einstein Next Best Action component is loaded or refreshed in a browser, Available in: both Salesforce
Salesforce generates a new request. For example, when a case status changes from New to In Classic and Lightning
Progress, the data change on the page triggers a refresh. This also applies for the Actions & Experience
Recommendations and Suggested Actions components.
Available in: Essentials,
Requests are also made when: Professional, Enterprise,
Performance, Unlimited,
• A field is updated on a record detail page that includes the Next Best Action component.
and Developer Editions
• A user enters data in the Subject or Description field of a site contact support page that includes
the Next Best Action component.
Another way to make a request is to call a Next Best Action REST API resource from your own web app. You can also call Next Best Action
REST API resources from an iOS or an Android app. The app can make requests in response to a custom UI and return recommendations.
Paying customers can see the number of requests their org has made by navigating from Setup to Company Information, Usage-based
Entitlements, Maximum Next Best Action Requests available.

SEE ALSO:
Display Recommendations
Unofficial SF: Building Your Own Next Best Action Front End
Connect REST API Developer Guide: Next Best Action Resources
Einstein Next Best Action Entitlements

644
Automate Your Business Processes Create Recommendations

Create Recommendations
Create offers or actions to recommend to users using Einstein Next Best Action. Recommendations
EDITIONS
are standard Salesforce records, similar to accounts and contacts, that are processed by strategies
and associated with flows. Strategies determine which recommendation records are surfaced using Available in: both Salesforce
business rules, predictive models, and other data sources. The result of this process is context-specific Classic and Lightning
recommendations that you present to your users. Experience
Note: Available in: Essentials,
• Salesforce has both a Recommendation object for Einstein Next Best Action (that’s this Professional, Enterprise,
page) and a Recommendation component for Experience Builder sites. The Performance, Unlimited,
Recommendation component is not related to Next Best Action. and Developer Editions

• If you don't see Recommendations in the App Launcher, in Setup, select Default On in
the Recommendations tab settings for your user profile or permission set. USER PERMISSIONS
• You can load and filter the records of a Recommendation object. Or load and filter the To create or manage
records of any object, and convert them into recommendations at the end of a strategy recommendations:
using the Map element. • Modify All Data

1. In the Recommendations tab, click New Recommendation. OR


Manage Next Best
Action
Recommendations

2. Enter a friendly name (1) and brief description (2) for your recommendation. The description appears on the recommendation that
is surfaced to users.
3. Optionally, click to upload an image (3) that you can display as a header for your recommendation. For best results, use a 1000 by
380 pixel image at 72 DPI, or an image with a similar ratio. You can choose whether the image displays using component properties.
Once uploaded, a thumbnail of your image displays on the Recommendations page. Customers see the full image as a header for
your recommendation in either the Lightning App Builder or Experience Builder component.
4. Enter an acceptance label (4) and a rejection label (5) for the buttons that customers click to, respectively, accept and reject the
recommendation.
5. Create a flow. When a user accepts your recommendation, they are taken to the flow specified in Action (6).
6. Choose the flow that runs when a customer accepts the recommendation (6) and click Save. You can also choose a flow that runs
when a customer accepts or rejects the recommendation. The Action list displays both active and inactive flows. Choosing a flow
that isn't active hides the recommendation. Once you’ve saved your recommendation, you can see if the flow is active from Is Action
Active (7).

645
Automate Your Business Processes Create Recommendations

7. Create a recommendation strategy in Strategy Builder that determines how your recommendations surface.
8. Optionally add a custom Category field to the Recommendation object and the Recommendation Layout. Adding a custom Category
field can simplify loading, filtering, and sorting recommendations in Strategy Builder.

Recommendation Fields
Recommendations are suggested actions that users see and interact with through Einstein Next Best Action strategies. When creating
a recommendation, use these fields to define its look and feel.
Launch a Flow When a Recommendation Is Accepted
Each recommendation is associated with a single flow. By default, Next Best Action launches a flow when a user accepts a
recommendation. The flow then performs an action, such as updating a case or sending an email.
Launch a Flow When a Recommendation Is Accepted or Rejected
Each recommendation is associated with a single flow. By default, Next Best Action launches a flow when a user accepts a
recommendation. The flow then performs an action, such as updating a case or sending an email. But you can also launch a flow
when a user rejects a recommendation, which gives you more flexibility. For example, a flow could run an automated process, write
to another system, or create a reminder email when a recommendation is rejected.

646
Automate Your Business Processes Create Recommendations

Add a Limit Repetitions Element to a Next Best Action Flow


You can add a Limit Repetitions element to your Recommendation Strategy Flow to limit the number of times that the same
recommendation or offer appears on the same record or for the same user during a time period.

SEE ALSO:
Build a Flow
Strategy Builder
Display Recommendations
View and Edit Tab Settings in Permission Sets and Profiles
Get Started with Einstein Next Best Action
Connect REST API Developer Guide: Next Best Action Resources
Unofficial SF: Passing Data from Next Best Action to Flow

Recommendation Fields
Recommendations are suggested actions that users see and interact with through Einstein Next
EDITIONS
Best Action strategies. When creating a recommendation, use these fields to define its look and
feel. Available in: both Salesforce
You can use these methods to create recommendations. Classic and Lightning
Experience
• Assemble recommendations as needed in Flow Builder or Strategy Builder.
• Create recommendations as standard Salesforce records, similar to accounts and contacts, in Available in: Essentials,
the Recommendation object. You can create recommendation records on the Recommendations Professional, Enterprise,
tab in the App Launcher. Performance, Unlimited,
and Developer Editions
• Generate recommendations automatically through AI with Einstein Recommendation Builder.

Image (1)
The image that is shown in the recommendation. To display this image with the Einstein Next Best Action Lightning page component,
select Show Image when configuring the Lightning page component.
Name (2)
The header text at the top of the recommendation. To display this text with the Einstein Next Best Action Lightning page component,
select Show Title when configuring the Lightning page component.
Description (3)
Additional descriptive text displayed in the recommendation. To display this text with the Einstein Next Best Action Lightning page
component, select Show Description when configuring the Lightning page component.

647
Automate Your Business Processes Create Recommendations

Acceptance Label (4)


The text of the button that accepts the recommendation. This option is always displayed.
Rejection Label (5)
The text of the button that rejects the recommendation. To display this option with the Einstein Next Best Action Lightning page
component, select Show Reject Option when configuring the Lightning page component.
Use these fields to define how the recommendation runs.
Action
The flow that runs when a user selects the Accept option. To run this flow when the user accepts or rejects the recommendation,
select Launch Flow on Rejection when configuring the Einstein Next Best Action Lightning page component. If the
referenced flow is inactive, invalid, or has an unsupported Flow Type, the recommendation isn’t displayed to users. The supported
flow types are screen flows and autolaunched flows.

SEE ALSO:
Create Recommendations
Get Started with Einstein Next Best Action

648
Automate Your Business Processes Create Recommendations

Launch a Flow When a Recommendation Is Accepted


Each recommendation is associated with a single flow. By default, Next Best Action launches a flow
EDITIONS
when a user accepts a recommendation. The flow then performs an action, such as updating a case
or sending an email. Available in: both Salesforce
For example, on a case, display a recommendation to the service agent to upsell a premium service Classic and Lightning
to the customer. When the agent accepts the recommendation, an autolaunched flow updates the Experience
case and the customer’s order history and sends a receipt via email.
Essentials, Professional,
Or say that you have an autolaunched flow that sends a templated marketing campaign email to Enterprise, Performance,
a customer. Your service agents have to determine whether your customers are eligible for this Unlimited , and Developer
campaign. Doing so involves several clicks and complex calculations. Instead use Next Best Action Editions
to check the customer’s eligibility and prompt the agent to accept the recommendation and launch
the flow.
USER PERMISSIONS
1. In Flow Builder, configure a flow that’s associated with a recommendation. Be sure to activate
the flow because Next Best Action can’t call an inactive flow from a recommendation. To open, edit, or create a
flow in Flow Builder:
2. Add a flow action. • Manage Flow
3. To add the flow, edit the recommendation. To create and save Lightning
pages in the Lightning App
Builder:
SEE ALSO:
• Customize Application
Launch a Flow When a Recommendation Is Accepted or Rejected
To view Lightning pages in
the Lightning App Builder:
• View Setup and
Configuration
To run a recommendation
strategy on a Lightning
record page:
• Run Flows
OR
Flow User field enabled
on the user detail page

649
Automate Your Business Processes Create Recommendations

Launch a Flow When a Recommendation Is Accepted or Rejected


Each recommendation is associated with a single flow. By default, Next Best Action launches a flow
EDITIONS
when a user accepts a recommendation. The flow then performs an action, such as updating a case
or sending an email. But you can also launch a flow when a user rejects a recommendation, which Available in: both Salesforce
gives you more flexibility. For example, a flow could run an automated process, write to another Classic and Lightning
system, or create a reminder email when a recommendation is rejected. Experience
For example, at a telecommunications company, the admin configures the Next Best Action
Essentials, Professional,
component to display recommendations to its customer service representatives (CSRs). When a Enterprise, Performance,
CSR accepts a recommendation for a customer who wants to purchase a discounted service, a flow Unlimited , and Developer
is launched to calculate the discount. The admin analyzes the reactions to the recommendation, Editions
and is confused about why the CSRs are rejecting it. To help get answers, the admin uses Next Best
Action to launch a questionnaire flow every time the recommendation is rejected.
USER PERMISSIONS
This feature is available for:
• The Einstein Next Best Action component used with Lightning record pages To open, edit, or create a
flow in Flow Builder:
• The Suggested Actions component used in Experience Builder • Manage Flow
• The Actions and Recommendations component used with Lightning console apps To create and save Lightning
To assign a flow that runs when a customer accepts or rejects the recommendation, create an input pages in the Lightning App
variable in the flow to accept the isRecommendationAccepted value. Then add a Decision Builder:
element to the flow that’s based on that value. • Customize Application

1. In Flow Builder, configure a flow that’s associated with a recommendation. Be sure to activate To view Lightning pages in
the Lightning App Builder:
the flow because Next Best Action can’t call an inactive flow from a recommendation.
• View Setup and
2. Create the Boolean isRecommendationAccepted input variable. Configuration
3. Create a Decision element and use the isRecommendationAccepted variable in your To run a recommendation
outcome conditions. strategy on a Lightning
record page:
4. Create a decision outcome for what the flow does when the recommendation is accepted. • Run Flows
5. Create a decision outcome for what the flow does when the recommendation is rejected. OR
Flow User field enabled
on the user detail page

650
Automate Your Business Processes Create Recommendations

6. Add any additional flow elements to handle each outcome path.


7. Add a flow action.
8. To add the flow, edit the recommendation.
9. When you add the Next Best Action component to a Lightning record page, select Launch Flow on Rejection.

651
Automate Your Business Processes Create Recommendations

SEE ALSO:
Launch a Flow When a Recommendation Is Accepted
Flow Resource: Variable
Flow Element: Decision
Einstein Next Best Action Component

652
Automate Your Business Processes Create Recommendations

Add a Limit Repetitions Element to a Next Best Action Flow


You can add a Limit Repetitions element to your Recommendation Strategy Flow to limit the number
EDITIONS
of times that the same recommendation or offer appears on the same record or for the same user
during a time period. Available in: both Salesforce
• You must have a collection of recommendations that have a valid value in the ID or Classic and Lightning
RecommendationKey fields. The RecommendationKey value must be a database ID or have Experience
the syntax DYNAMIC_<custom id>.
Available in: Essentials,
• If you include an Assignment element, from Actions, choose Output from limit. Or you can Professional, Enterprise,
skip this step and add the output from the Limit Repetitions element. Performance, Unlimited,
1. From Setup, in the Quick Find box, enter Flows, and then select Flows. and Developer Editions

2. Open or create a Recommendation Strategy.


USER PERMISSIONS
3. Add a Limit Repetitions element after the collection of recommendations.
4. Enter a Label and an API Name. To create or manage
recommendations:
5. Add a Description. • Modify All Data
6. Search for and select the Recommendation Collection that you want to filter. OR
7. Select the responses to look for, and then enter the number of responses to look for and days Manage Next Best
to look back as whole numbers. Action
Recommendations
8. In Advanced, if you didn’t include an Assignment element, you can search for and select the
collection that includes the limit repetition output.
a. Select Manually assign variables.
b. From the Store Output Variables field, search for and select the output variable.

9. Click Done.

653
Automate Your Business Processes Create Recommendations

10.

Save your work.

Example:
• If you look for one accepted response over 90 days, such as with a password reset recommendation, and the user accepts one
time during 90 days, they don’t see the message again for 90 days. But if the user rejects the recommendation, they see the
message every time they reload the page until they accept it.
• If you look for two accepted or rejected responses during one day, and a user accepts or rejects the recommendation once
each day, every day, then they still see the recommendation.
• If you look for two accepted or rejected responses during one day, and a user accepts or rejects the recommendation twice
on day one, then they don’t see the recommendation on day two. They do see the recommendation again on day three.

If you add an Assignment element after the Limit Repetitions element and change the label for accept or reject, you must update the
limit repetitions output.

SEE ALSO:
Create Recommendations
Display Recommendations

654
Automate Your Business Processes Strategy Builder

Strategy Builder
Strategy Builder is a point-and-click process automation tool used with Einstein Next Best Action.
EDITIONS
Strategy Builder funnels recommendation records through your business logic to determine which
recommendations are surfaced on your record pages. Available in: both Salesforce
Note: Where possible, we recommend building strategies in Flow Builder using the Classic and Lightning
Experience
Recommendation Strategy flow type, but you can also create them in Strategy Builder.
After creating recommendations to filter through your strategy logic, create strategies and learn Available in: Essentials,
how to manage them. Professional, Enterprise,
Performance, Unlimited,
Create a Strategy and Developer Editions
Once you’ve created flows and recommendation records, use Strategy Builder to funnel the
correct recommendations to your users at the right time.
Manage Your Action Strategies
Test, troubleshoot, and create strategies using Strategy Builder management tools.
Create, Package, and Distribute a Strategy Template
Enterprise developers can create and package strategy templates from Developer Edition orgs for use in multiple Salesforce orgs.
And independent software vendors (ISVs) can publish templates on AppExchange for distribution to their subscribers.
Create, Package, and Distribute a Strategy as Your Intellectual Property
Enterprise developers can create and package Next Best Action strategies and strategy templates from Developer Edition orgs for
use in multiple Salesforce orgs. And independent software vendors (ISVs) can publish strategies and templates on AppExchange for
distribution to their subscribers. Strategies not marked as templates in managed packages have IP (intellectual property) protection
and can't be edited or cloned. IP protection safeguards proprietary information in your strategies.
Strategy Elements
Use this page to quickly access a list of Strategy Builder elements and learn how they work together to create unique strategies.
Strategy Connections
Integrate external data and pull in information from other Salesforce systems to create robust strategies that utilize all your data.

655
Automate Your Business Processes Strategy Builder

Create a Strategy
Once you’ve created flows and recommendation records, use Strategy Builder to funnel the correct
EDITIONS
recommendations to your users at the right time.
Before you start creating strategies, make sure that you create flows and recommendation records Available in: both Salesforce
that you can use in your strategy. Classic and Lightning
Experience
1. Open Strategy Builder. From Setup, enter Strategies or Next Best Action in the
Quick Find box, select Next Best Action, and click New Strategy.
Available in: Essentials,
2. Give your strategy a name and a description. Professional, Enterprise,
3. Select a context object from Object Where Recommendations Display. Performance, Unlimited,
and Developer Editions
Note: The object that you choose here provides the context for your entire strategy.
For example, if you plan to use this strategy on Case pages, select Case. When the strategy USER PERMISSIONS
executes and resolves your expressions, the Next Best Action engine interprets the
incoming recordId as a case object. The engine has to know to what type of object the To create or manage action
pages belong to resolve expressions correctly. Linking your strategy to a specific object strategies:
also enables Strategy Builder to provide intelligent assistance in other areas, such as the • Modify All Data
Test feature. OR
Manage Next Best
4. Drag the appropriate elements onto the canvas. Action Strategies
Note: It’s best to start by adding a Load element, as loading recommendations is the To run an action strategy:
first step in any strategy. • Run Flows

5. Order your elements to make sure that recommendations are flowing through the correct OR
branches. Flow User field enabled
on the user detail page
Note: Elements are divided into two main categories: Recommendation Logic and
Branch Logic. Recommendation Logic elements act directly on the recommendations
flowing into the element by filtering, sorting and limiting. Branch Logic elements act as
gates, using context information, such as the recordId of the page the user is viewing, to
decide which sets of recommendations to allow.

6. Save any changes to your strategy.


7. To make sure it’s working as expected, test your strategy.

Note: If your strategy isn’t running properly or you see an unexpected error, try using the Inspector tab to find the problem.

8. Display your strategy using the Suggested Actions component in Experience Builder or the Einstein Next Best Action component in
Lightning App Builder.

656
Automate Your Business Processes Strategy Builder

Tour the Strategy Builder Interface


Before you start building your strategy, learn about the primary pieces of Strategy Builder and how they work together.

SEE ALSO:
Test Your Action Strategies
Inspect Strategy and Element Results
Create a Strategy
Build a Flow

Tour the Strategy Builder Interface


Before you start building your strategy, learn about the primary pieces of Strategy Builder and how
EDITIONS
they work together.
Find Strategy Builder in Setup by typing Strategies or Next Best Action in the Quick Available in: both Salesforce
Find box. Select Next Best Action. Classic and Lightning
Experience

Available in: Essentials,


Professional, Enterprise,
Performance, Unlimited,
and Developer Editions

657
Automate Your Business Processes Strategy Builder

Button Bar (1)


Manage your strategies with basic functions like Test and Save.
• Test runs the most recently saved version of your strategy and displays the recommendations that are surfaced for your users. Testing
your strategy allows you to determine if there are errors that must be fixed and confirms the recommendations that your users see.
• Save your strategies before you test them and before you leave Strategy Builder so you don’t lose your work.
• Save As allows you to duplicate a strategy and your currently saved work.

Elements, Manager, and Inspector Tabs (2)


Use the Toolbox to create the substance of your strategy. Add elements, connect external sources, and troubleshoot errors in your
strategy.
• From the Elements tab, drag new elements onto the canvas and create the building blocks of your strategy.
• From the Manager tab, add new connections from external sources or other Salesforce products.
• Use the Inspector tab to isolate specific elements and troubleshoot errors that appear during testing.

Canvas (3)
The canvas is a visual representation of your strategy. From here, you can rearrange elements and see how your recommendations are
flowing from one branch to the next and finally into the output.

SEE ALSO:
Create a Strategy
Manage Your Action Strategies
Inspect Strategy and Element Results

Manage Your Action Strategies


Test, troubleshoot, and create strategies using Strategy Builder management tools.
EDITIONS

Save Your Action Strategies Available in: both Salesforce


Save your strategies or use Save As to create new a new strategy based on an existing one. Classic and Lightning
Experience
Test Your Action Strategies
Test your strategy within Strategy Builder to see what recommendations display, given different Available in: Essentials,
inputs. Professional, Enterprise,
Performance, Unlimited,
Troubleshoot Your Action Strategies and Developer Editions
Strategies can be complex, which means it’s sometimes difficult to know where you went
wrong when you encounter unexpected results. Use this page to determine the best tool for
troubleshooting your strategy.
Inspect Strategy and Element Results
View the full details of each step of your strategy’s execution from Strategy Builder’s Inspector tab. Trace the path of recommendations
through your strategy and identify problems in individual elements. Debug errors and see how your strategy is working behind the
scenes.

658
Automate Your Business Processes Strategy Builder

Save Your Action Strategies


Save your strategies or use Save As to create new a new strategy based on an existing one.
EDITIONS
Save your new or updated action strategy by clicking Save. Create a strategy based on an existing
one using Save As. Available in: both Salesforce
Classic and Lightning
1. To save your action strategy click Save.
Experience
2. To create an action strategy based on an existing one, click Save As.
Essentials, Professional,
3. Replace the existing name in Name. Enterprise, Performance,
4. Replace the existing API name in API Strategy. Unlimited , and Developer
Editions
You can have duplicate strategy names but we don’t recommend it. The API name must be
unique.
To automatically generate a new API name, delete the existing API name after you rename the USER PERMISSIONS
strategy. Click the Name textbox, and either tab over to or click the API Name textbox. To create or manage action
strategies:
5. Optionally, replace the existing description.
• Modify All Data
6. If you want to base your strategy on a different object, click the Object Where
OR
Recommendations Display textbox and choose a new object.
Manage Next Best
7. Click Done. Action Strategies

To run an action strategy:


SEE ALSO: • Run Flows
Strategy Builder OR
Einstein Next Best Action Flow User field enabled
on the user detail page

659
Automate Your Business Processes Strategy Builder

Test Your Action Strategies


Test your strategy within Strategy Builder to see what recommendations display, given different
EDITIONS
inputs.
In Strategy Builder, you can test the strategies underlying your recommendations. Available in: both Salesforce
Classic and Lightning
1. Create or edit a strategy.
Experience
2. To save your changes, click Save.
Essentials, Professional,
Note: Always save before testing to test the most recent version of your strategy. Enterprise, Performance,
Unlimited , and Developer
3. Click Test. Editions
4. Select an object for the test.
USER PERMISSIONS

To create or manage action


strategies:
• Modify All Data
OR
Manage Next Best
Action Strategies
If you don’t see the object that you want to test the strategy against, close the Test Strategy
window. Select the properties wheel above the left pane. Change the object that the strategy To run an action strategy:
is linked to by selecting an object from Object Where Recommendations Display. If you • Run Flows
don’t see an object listed, the strategy hasn’t been linked to a specific object. OR
5. To test the underlying flow, choose a recommendation. Flow User field enabled
on the user detail page

Note: Images associated with recommendations aren’t displayed when testing in Strategy Builder.

The Test Strategy window doesn’t show all possible error messages. Strategies are executed from right to left, starting at Output. If
a particular Branch Selector expression results in a closed branch, the child elements of that branch (the elements to the left) are
not executed. This process makes strategy evaluation faster, but it also means that any branches with false expressions could have
errors that aren’t exposed. The Test button shows what the user sees. To get a complete view of any errors occurring at run-time,
use the Inspector tab in the Toolbox. Inspector highlights errors from all elements.

SEE ALSO:
Inspect Strategy and Element Results
Strategy Builder

660
Automate Your Business Processes Strategy Builder

Troubleshoot Your Action Strategies


Strategies can be complex, which means it’s sometimes difficult to know where you went wrong
EDITIONS
when you encounter unexpected results. Use this page to determine the best tool for troubleshooting
your strategy. Available in: both Salesforce
If something goes wrong with your strategy, you have several troubleshooting options. Classic and Lightning
Experience
• Start by using the basic test function in Strategy Builder. After you create and save a strategy,
click Test in the menu bar. Available in: Essentials,
• For a more detailed view of your strategy execution, see the Inspector tab in the Strategy Professional, Enterprise,
Builder Toolbox. The Inspector tab lists specific errors and gives you a detailed view of how your Performance, Unlimited,
strategy executes. and Developer Editions

• If you can’t find the problem in the Inspector tab, or you want to troubleshoot for a specific
user, try using the Apex debug log. Next Best Action has a specific debug log category.
• To receive full error reports sent directly to your email, a Chatter post, a text message, or other outlet, try creating a custom notification
flow and a Process Builder trigger. Using a Platform Status Alert Event, you can subscribe to Next Best Action events and respond
when errors occur.

Create a Custom Notification Flow for Next Best Action


Create a trigger in Process Builder to receive direct notifications about errors occurring in your strategies. Launch a flow to send error
information to your desired targets.

SEE ALSO:
Inspect Strategy and Element Results

661
Automate Your Business Processes Strategy Builder

Create a Custom Notification Flow for Next Best Action


Create a trigger in Process Builder to receive direct notifications about errors occurring in your
EDITIONS
strategies. Launch a flow to send error information to your desired targets.
A custom notification flow allows you to choose how you want to be informed when errors happen Available in: both Salesforce
during Next Best Action strategy executions. It consists of two parts. First, a process created in Classic and Lightning
Process Builder that subscribes to the Platform Status Alert Event, which is generated when the Experience
error occurs. Second, a notification flow that passes the information to your intended destination.
Available in: Essentials,
Add input variables to your flow to receive the expected variables. Professional, Enterprise,
1. In Flow Builder, create a flow. You can direct your notifications to different places, including Performance, Unlimited,
Chatter posts, SMS text messages, and emails. Make sure to define input variables for payload and Developer Editions
event fields that you want to use in your notifications. Input variables are flow variable resources,
type text, with Available for Inputs checked.
USER PERMISSIONS
Note: A simple way to create your notification is to create a flow with the Send Email
To create or manage action
core action. From there, manually add the email address where you want the notification strategies:
sent. • Modify All Data
2. In Process Builder, create a process and for The process starts when select A platform event OR
occurs. Manage Next Best
3. Add a trigger. Under Platform Event select Platform Status Alert Event. Action Strategies

4. Select an object that allows you to define matching conditions that produce a single result. To run an action strategy:
• Run Flows
Note: For example, you could choose the User object and set User ID equal to the
OR
Created By ID in the event payload.
Flow User field enabled
5. Add other criteria. on the user detail page
6. Add an immediate action and select Flows. To open, edit, or create a
7. Name your action and select the flow you created in step one. flow in Flow Builder:
• Manage Flow
8. Add mappings to connect data from the payload of your event to flow inputs.
To create, edit, or view
9. Save and activate your process. processes in Process
Builder:
• Manage Flow
SEE ALSO:
AND
Flows
View All Data
Configure the Process Trigger
Object Reference Developer Guide: PlatformStatusAlertEvent

662
Automate Your Business Processes Strategy Builder

Inspect Strategy and Element Results


View the full details of each step of your strategy’s execution from Strategy Builder’s Inspector tab.
EDITIONS
Trace the path of recommendations through your strategy and identify problems in individual
elements. Debug errors and see how your strategy is working behind the scenes. Available in: both Salesforce
When testing your strategy doesn’t return the recommendations you expect, investigate the Classic and Lightning
execution details of the strategy or a selected element using the Inspector tab. Experience

1. Click the Inspector tab. Essentials, Professional,


2. Click Test and select an object. Enterprise, Performance,
Unlimited , and Developer
Note: Provide a sample recordId to test your strategy in the inspector. You can do Editions
so in either of the following ways:
• While Inspector is open, click Test and select a record. The recordId of the selected USER PERMISSIONS
record is pasted into the Record ID field of the inspector. Close the Test window and
click Run in the inspector. To create or manage action
strategies:
• Copy a record ID from the URL of a record page and paste it into the RecordId field
• Modify All Data
manually.
OR
3. Click Run. Manage Next Best
Action Strategies
Note: Inspector can show a single element’s results, or the results for all elements in the
strategy. If you select an element, you see recommendations surfaced by that element. To run an action strategy:
If you have no elements selected, you see recommendations surfaced by the strategy. • Run Flows
OR
Flow User field enabled
on the user detail page

Note: To see accurate results, you have to save your strategy before testing it. If you change the strategy or an element, Run
becomes Save and Run.

4. To scroll right, use the horizontal scroll bar at the bottom of the Inspector pane.

663
Automate Your Business Processes Strategy Builder

5. If you want to view recommendations for a different object, click Test, clear your current selection, and choose a new object from
the dropdown. To update the recommendations in the inspector, click Run.

SEE ALSO:
Test Your Action Strategies
Strategy Builder
Unofficial SF: Reporting and Tracking with Next Best Action

Create, Package, and Distribute a Strategy Template


Enterprise developers can create and package strategy templates from Developer Edition orgs for
EDITIONS
use in multiple Salesforce orgs. And independent software vendors (ISVs) can publish templates
on AppExchange for distribution to their subscribers. Available in: both Salesforce
You distribute changes to strategy templates via a managed package. Subscribers who install a Classic and Lightning
strategy template can open it in Strategy Builder and clone it to customize it for their own use. Experience
When you publish updates to strategy templates via a package upgrade, template updates don't
Available in: Essentials,
affect subscribers' copies. Professional, Enterprise,
1. In Strategy Builder, create the strategy you want to make into a template. Performance, Unlimited,
and Developer Editions
2. Open the strategy’s properties and select Template.

USER PERMISSIONS

To create a strategy:
• Modify All Data
OR
Manage Next Best
Action Strategies

To create a managed
package:
• Create AppExchange
Packages

3. If you need to, create your managed package.


4. Distribute the strategy template in the managed package and let your subscribers know it’s available.

664
Automate Your Business Processes Strategy Builder

Example: Suppose you build and package strategies for insurance companies. Because insurance laws and regulations can vary
by location, your subscribers want the ability to modify your strategies when needed. They can do this using strategy templates
you create.

SEE ALSO:
Create a Strategy
ISVforce Guide: About Managed Packages
Create and Upload a Managed Package

Create, Package, and Distribute a Strategy as Your Intellectual Property


Enterprise developers can create and package Next Best Action strategies and strategy templates
EDITIONS
from Developer Edition orgs for use in multiple Salesforce orgs. And independent software vendors
(ISVs) can publish strategies and templates on AppExchange for distribution to their subscribers. Available in: both Salesforce
Strategies not marked as templates in managed packages have IP (intellectual property) protection Classic and Lightning
and can't be edited or cloned. IP protection safeguards proprietary information in your strategies. Experience
You distribute changes to IP-protected strategies via package upgrades. Subscribers who install an
Available in: Essentials,
IP-protected strategy from a managed package can’t change it or save it as a new Professional, Enterprise,
1. Create your proprietary strategy. Performance, Unlimited,
and Developer Editions
2. If you need to, create your managed package.
3. Add the strategy to the managed package. Strategies not marked as templates in managed
packages are IP-protected. USER PERMISSIONS
4. Distribute the strategy in the managed package and let your subscribers know it’s available. To create a strategy:
• Modify All Data
SEE ALSO: OR
Create a Strategy Manage Next Best
Action Strategies
Create and Upload a Managed Package
ISVforce Guide: Protecting Your Intellectual Property To create a managed
package:
• Create AppExchange
Packages

Strategy Elements
Use this page to quickly access a list of Strategy Builder elements and learn how they work together
EDITIONS
to create unique strategies.
Use elements to create your strategies by opening Strategy Builder and selecting Elements in the Available in: both Salesforce
Toolbox. Drag elements onto the canvas to get started. Classic and Lightning
Experience

Available in: Essentials,


Professional, Enterprise,
Performance, Unlimited,
and Developer Editions

665
Automate Your Business Processes Strategy Builder

Strategy Builder Enhance Element


Get AI-driven predictions from services such as Einstein Discovery and Einstein Prediction Builder to enhance Next Best Action
recommendations with additional information, such as propensity scores. The Enhance element allows you to modify a set of
recommendations on the fly, every time a strategy is executed. These recommendations can be static and live as records in Salesforce,
or dynamic and sourced from external data sources or other Salesforce objects.
Strategy Builder Generate Element
With the Generate element, you can dynamically generate personalized recommendations where a large number of possibilities
makes it inconvenient to create recommendations manually. The Generate element allows you to create in-memory, on-the-fly
recommendations, either from an external data source or from other Salesforce objects.
Strategy Builder Load Element
Load is the first element in a strategy branch. Load and filter the records of a Recommendation object. Or load and filter the records
of any object, and convert them into recommendations at the end of the strategy using the Map element. Your load elements
determine which of your recommendations are evaluated when your strategy executes.
Strategy Builder Filter Element
Create an expression that allows you to block or filter out undesirable recommendations, depending on the context. The expression
is evaluated for every recommendation that passes through the branch.
Strategy Builder Limit Reoffers Element
Determine how often a user sees the same recommendation. You can decide how many times the user must react to a
recommendation and how many days to wait before displaying the recommendation again.
Strategy Builder Map Element
The Map element lets you use formulas to create Recommendation fields and modify existing fields without Apex code. Instead, it
relies on expressions and formulas. Use the Map element to pass data from a Recommendation field with one name to a Flow input
with a different name. Or use it to modify current values for Description, Name, and other fields and personalize them with
context-specific data.
Strategy Builder Sort Element
Choose how recommendations are ordered within a branch and reorder them using Recommendation fields.
Strategy Builder Branch Merge Element
Combine recommendations from multiple branches into a single branch.
Strategy Builder Branch Selector Element
Filter multiple branches through a branch selector and create unique expressions for each branch. If the expression is true,
recommendations in the branch are allowed through and combined into a single branch.
Strategy Builder First Non-Empty Branch Element
The first non-empty branch element allows you to filter branches in the order they appear on the canvas. The first branch that
contains recommendations is allowed through, all other branches are blocked.

SEE ALSO:
Einstein Next Best Action

666
Automate Your Business Processes Strategy Builder

Strategy Builder Enhance Element


Get AI-driven predictions from services such as Einstein Discovery and Einstein Prediction Builder
EDITIONS
to enhance Next Best Action recommendations with additional information, such as propensity
scores. The Enhance element allows you to modify a set of recommendations on the fly, every time Available in: both Salesforce
a strategy is executed. These recommendations can be static and live as records in Salesforce, or Classic and Lightning
dynamic and sourced from external data sources or other Salesforce objects. Experience

Field Description Available in: Essentials,


Professional, Enterprise,
Label The name of the element as it appears on the canvas. Performance, Unlimited,
and Developer Editions
API Name The API name of the element. The API name must be unique.

Description Optional description of the element and how it works within the strategy.

Apex Search or select an Apex action, which calls an Apex class. An Apex class must
Action have a method marked as an invocable method to appear as an Apex action in
declarative tools like Strategy Builder.

Argument Specify one or more parameters for the selected Apex action.

Example: Assume that your company integrates separate data sources from the manufacturers of products your business sells.
Those data sources include information about the current availability of each item (in stock, back ordered, or unavailable). You can
connect an Enhance element to your strategy’s Load or Generate element to provide that information to users in the
recommendation.

Example: You can use the Enhance element to calculate a discount percentage for your customers based on how long your
company has managed their account. Or you can use it to A/B test two branches of recommendations.

667
Automate Your Business Processes Strategy Builder

Example: Suppose you use Next Best Action to provide upsell recommendations. You want to add a 5% discount to your product
recommendations for those customers who’ve been with your company for more than one year. Customers of more than two
years get a 10% discount, customers of more than five years get a 20% discount, and so on. Use the Enhance element to call an
Apex action that performs a SOQL query. The query retrieves the Account age and appends it to the description of all incoming
recommendations.
The strategy used with an Enhance element can be as simple as Load -> Enhance -> Output. All recommendations the Load
element retrieves or loads are passed as a list of recommendations to the underlying invocable method.

When configuring the Enhance element, select Enhance with Discounts Based on Age as the Apex action and specify $Record.id
as the input parameter.

The Enhance element in turn calls the getDiscounts invocable method in the Enhance_GetAccountDiscount
class. Notice how the description of each recommendation has a discount value appended to it (r.Description + ‘
with a 5% discount’).

global class Enhance_GetAccountDiscount {


@InvocableMethod(label='Enhance with Discounts Based on Age' description='Returns
an enhanced set of recommendations with appropriate discounts')
global static List<List<Recommendation>> getDiscounts(List<DataContainer> inputData){

List<Recommendation> recommendations = inputData[0].recommendations;

668
Automate Your Business Processes Strategy Builder

List<List<Recommendation>> outputs = new List<List<Recommendation>>();

Account[] accounts = [SELECT Name, Description,CreatedDate, id FROM Account


WHERE id = :inputData[0].accountId];
Double ageAccountMonths =
accounts[0].CreatedDate.date().monthsBetween(date.today());
Double ageAccount = ageAccountMonths/12;
List<Recommendation> returnedRecommendations = new List<Recommendation>();
for (Recommendation r:recommendations){
if(ageAccount > 1){
r.Description = r.Description + ' with a 5% discount';
}
else if (ageAccount > 2){
r.Description = r.Description + ' with a 10% discount';
}
else if (ageAccount > 5){
r.Description = r.Description + ' with a 20% discount';
}
returnedRecommendations.add(r);
}
outputs.add(returnedRecommendations);
return outputs;

Usage
The Enhance element requires an Apex action marked as an invocable method.
@InvocableMethod(
label='Enhance with Discounts Based on Age'
description='Returns an enhanced set of recommendations with appropriate discounts')

Use the Enhance element in combination with the Strategy Builder Load or Generate element.
The Enhance element can pass any number of inputs to the Apex action. The input parameter must be a list or a list of lists of a user-defined
Apex object (for example, a custom class called DataContainer). The user-defined Apex object must include a
List<Recommendation> variable. The List<Recommendation> variable is automatically defined with the recommendations
that pass into the Enhance element.
global class DataContainer {
@InvocableVariable
public string accountId;

@InvocableVariable
public List<Recommendation> recommendations;
}
________
global static List<List<Recommendation>> invocableMethod(List<DataContainer> inputData)

669
Automate Your Business Processes Strategy Builder

The Enhance element returns a list of recommendations, List<List<Recommendation>>. These recommendation enhancements
exist only in memory and do not persist after the strategy is executed.
global static List<List<Recommendation>> invocableMethod(List<DataContainer> inputData)

SEE ALSO:
Strategy Builder Generate Element
Strategy Builder Load Element
Flow Element: Apex Action

Strategy Builder Generate Element


With the Generate element, you can dynamically generate personalized recommendations where
EDITIONS
a large number of possibilities makes it inconvenient to create recommendations manually. The
Generate element allows you to create in-memory, on-the-fly recommendations, either from an Available in: both Salesforce
external data source or from other Salesforce objects. Classic and Lightning
Experience
Field Description
Available in: Essentials,
Label The name of the element as it appears on the canvas. Professional, Enterprise,
Performance, Unlimited,
API Name The API name of the element. The API name must be unique.
and Developer Editions
Description Optional description of the element and how it works within the strategy.

Apex Search or select an Apex action, which calls an Apex class. An Apex class must
Action have a method marked as an invocable method in order to appear as an Apex
action in declarative tools like Strategy Builder.

Argument Specify one or more parameters for the selected Apex action.

Example: Assume that your company has a large catalog of products and you use a screen flow to recommend accessories to
your customers based on their past product purchases. Instead of creating a single, static recommendation for each individual
accessory, you can maintain that information in the Account or Product object in Salesforce. Or you can store information in external
data sources like Commerce Cloud or a SQL database. Use a Generate element with an Apex invocable action to call the Apex class
and generate accessory recommendations dynamically for your strategy.

Example: Suppose you want to show a service agent a list of key accounts to follow up with after a set number of days has passed
since the previous contact. With the Generate element, you can call an Apex action that makes a SOQL query for Account where
the Owner is the logged-in user (the agent). This identifies the accounts who were last contacted more than, say, 90 days ago.
Next Best Action returns the relevant accounts in the form of recommendations. The strategy can be as simple as the Generate
element with an Output element.

670
Automate Your Business Processes Strategy Builder

When you configure the Generate element, select Accounts to Follow Up Today as the Apex action and specify $User.id as an
input parameter.

The Generate element calls the getAccounts invocable method in the Generate_GetAccountsToFollowUp Apex
class. This retrieves the relevant accounts and creates a list of recommendations. The recommendation description includes the
name of the account (account.Name) and the number of days since the last contact (daysSinceLastContact).
global class Generate_GetAccountsToFollowUp {
@InvocableMethod(label='Accounts to Follow Up Today'
description='Recommend accounts the current user should follow
up on today')
global static List<List<Recommendation>> getAccounts(List<String> inputData){
List<List<Recommendation>> outputs = new List<List<Recommendation>>();
Integer daysSinceLastContact;
Account[] accounts = [SELECT Name, Description, LastContactDate__c, OwnerId
FROM Account WHERE OwnerId = :inputData[0]];
List<Recommendation> recs = new List<Recommendation>();
for (Account account:accounts) {
if (account.LastContactDate__c != null){
daysSinceLastContact =
account.LastContactDate__c.daysBetween(date.today());
if (daysSinceLastContact > 90){
Recommendation rec = new Recommendation(
Name = account.Name,
Description = 'Connect with the ' + account.Name + ' account,
the last interaction was '+ daysSinceLastContact + ' days ago.',
//Pre-req: Create a screen flow with the name simpleFlow

ActionReference = 'simpleFlow',
AcceptanceLabel = 'View'
);

671
Automate Your Business Processes Strategy Builder

recs.add(rec);
}
}
}
outputs.add(recs);
return outputs;
}
}

When you execute the strategy, the resulting recommendation includes the name of the account and the number of days since
the last contact with them.

Usage
The Generate element requires an Apex action marked as an invocable method.
@InvocableMethod(
label='Related Wikipedia Pages'
description='Recommend wikipages that are related to the named input wikipage')

The Generate element can pass any number of inputs to the Apex action, either as lists or a list of lists of primitives, sObjects, and
user-defined Apex objects. To provide more than one input, the input parameter must be a list or a list of lists of a user-defined Apex
object (for example, a custom class called DataContainer).
List<String> relatedTo

OR
global class DataContainer {
@InvocableVariable
public string accountId;
}
____
global static List<List<Recommendation>> invocableMethod(List<DataContainer> inputData)

672
Automate Your Business Processes Strategy Builder

The Generate element returns a list of recommendations. Invocable methods support returning either a list of an sObject type or a list
of lists of an sObject type. Since the Enhance element operates not on a single recommendation but on a list of recommendations, the
method must return a List<List<Recommendation>>.
global static List<List<Recommendation>> invocableMethod(List<DataContainer> inputData)

SEE ALSO:
Strategy Builder Enhance Element
Flow Element: Apex Action

Strategy Builder Load Element


Load is the first element in a strategy branch. Load and filter the records of a Recommendation
EDITIONS
object. Or load and filter the records of any object, and convert them into recommendations at the
end of the strategy using the Map element. Your load elements determine which of your Available in: both Salesforce
recommendations are evaluated when your strategy executes. Classic and Lightning
Load recommendations from the records of any object, either standard or custom. You can use Experience
objects such as Recommendation, Account, Product, and Opportunity when you build strategies
Available in: Essentials,
for recommendations. Choose criteria for when to load a recommendation. Filter out certain records Professional, Enterprise,
from a strategy. Sort the order of your records by choosing a value from the object to sort on. Performance, Unlimited,
A strategy treats another object the same as it does a Recommendation object until the end, when and Developer Editions
it converts it into a recommendation. If you choose an object other than Recommendation, add a
Map element after the Load element. Use the Map element to map fields from the object’s records
to required fields on the Recommendation object.

Field Description
Label The name of the element as it appears on the canvas.

API Name The API name of the element. The API name must be unique.

Description Optional description of the element and how it works within the strategy.

Object The object whose records are loaded, filtered, and converted into recommendations.

Condition Determines the logic that you use to evaluate conditions. Choose All Conditions are Met to load the
Requirements recommendation if it meets all the specified criteria. Choose Any Condition is Met to load the recommendation
if it meets any of the listed criteria.

Field Choose a field from the Recommendation object to evaluate whether the recommendation is loaded into the
strategy.

Operator Choose an operator.

Value Enter a value for your chosen field. Values can be simple numbers, string phrases, or formulas that use Salesforce
formula support. Don’t enclose string or number values with quotes. Picklists aren’t supported.

673
Automate Your Business Processes Strategy Builder

Field Description
Add Condition Creates an extra set of conditions.

SEE ALSO:
Einstein Next Best Action
Create Recommendations
Display Recommendations
Strategy Builder Enhance Element

Strategy Builder Filter Element


Create an expression that allows you to block or filter out undesirable recommendations, depending
EDITIONS
on the context. The expression is evaluated for every recommendation that passes through the
branch. Available in: both Salesforce
Classic and Lightning
Field Description Experience
Label The name of the element as it appears on the canvas. Available in: Essentials,
Professional, Enterprise,
API Name The API name of the element. The API name must be unique.
Performance, Unlimited,
Description Optional description of the element and how it works within the strategy. and Developer Editions

Filter Create an expression that is evaluated for each recommendation that you load
Expression into your strategy. If the expression is true, the recommendation is allowed
through. If false, the recommendation doesn’t progress further through the
strategy. Filter Expression accepts Standard Salesforce formulas. For more
information, see Formula Operators and Functions by Context.

Note: Use $Record to reference fields from the context object. The context object is the object where you intend to surface
your recommendations and can be changed by editing your strategy and choosing an object under Object Where
Recommendations Display. Use plain text field labels to reference Recommendation object fields. Examples: $Record.status
!= 'New', RejectionLabel == ‘No, thanks.’ For more information, see Write an Expression.

Example: Suppose that you want to surface recommendations on the Case object so your service agents can suggest offers to
your customers. If you want to suggest only credit card offers, create a Category field for the Recommendation object. Add a
Credit Card Offer category to your field. Add a filter element and use the formula Category_c = ‘CreditCardOffer’
in Filter Expression.

Usage
Filter is the best way to remove certain recommendations from a strategy branch. Add the element to a branch and create an expression
to evaluate every recommendation that passes through the branch.

674
Automate Your Business Processes Strategy Builder

Write an Expression
Create unique expressions using logic from the Salesforce expression builder to filter recommendations, select or deselect branches,
and determine which recommendations are available for consideration in a strategy.

SEE ALSO:
Einstein Next Best Action
Create Recommendations
Display Recommendations
Formula Operators and Functions by Context
Unofficial SF: Adding $User and $Request to Next Best Action Strategies

Write an Expression
Create unique expressions using logic from the Salesforce expression builder to filter
EDITIONS
recommendations, select or deselect branches, and determine which recommendations are available
for consideration in a strategy. Available in: both Salesforce
Strategy Builder expressions, found on the Filter and Branch Selector elements, use standard Classic and Lightning
Salesforce formula functions. To learn more about creating formulas in Salesforce, see Formula Experience
Operators and Functions by Context.
Available in: Essentials,
Strategies are designed to work with a particular object like Case or Contact. Strategy Builder Professional, Enterprise,
elements use $Record as a placeholder for the actual record that gets passed in when a strategy Performance, Unlimited,
runs. and Developer Editions
1. Select the element you need for your strategy: Filter or Branch Selector.
2. Enter your expression. You can build expressions in two different modes: standard and advanced. Standard is declarative: search
and select to build your formula. Use advanced mode for more complex expressions, when a given operator is unavailable in standard
mode, or when you use concatenation.
3. In standard mode, set up conditions. At run time, the conditions are evaluated in the order you specify.

Column Header Description


Resource Recommendation resource whose value you want to evaluate, like acceptance or rejection label,
action, ID, name, and so on. Say a strategy is associated with a Case. Your resource might be
$Record.Account.Type or $Record.Account.Contact.Name.

Operator Select an appropriate operator for that resource, for example Equals, Does Not Equal,
Starts With, Contains, Less Than Or Equal To, and Is Blank. The available
operators depend on the data types associated with that resource. Data types include text, number,
Boolean, or picklist.

Value Options:
• Select a value that’s appropriate for the recommendation resource and the operator. For example,
if you enter $Record.Status as the resource and Does Not Equal as the operator,
available values are On Hold, Escalated, Closed, and New.
• Manually enter a literal value.
Resource and Value in the same row must have compatible data types.

675
Automate Your Business Processes Strategy Builder

Column Header Description

Note: When you add or subtract a number from a date value, the date adjusts in days, not
hours.

Option Behavior for Decision Outcomes


All Conditions Are Met If one of the conditions is false, the recommendation evaluates the next outcome’s
conditions.

Any Condition Is Met If one of the conditions is true, the recommendation immediately takes this outcome’s
path.

676
Automate Your Business Processes Strategy Builder

Example: Say you create a custom field Has_Mobile_Service__c on the contact record. If you use
$Record.Contact.Has_Mobile_Service__c = false in a Strategy Builder expression, and you’re working with
a case record, the recordID provided with the request replaces $Record when the expression resolves. This is because case
records have a lookup relationship with contacts.
• Reference the context object in your formula using the $Record function.

Example: ISPICKVAL($Record.Account.Tier__c, 'Premium')

Note: The Context object is the object where you plan to surface your recommendations. Choose the Context object, or change
it, by editing your strategy and choosing an object under Object Where Recommendations Display.
• Reference fields from the Recommendation object using the plain text label name. This option is available only in Filter and Load
elements, not Branch Selector elements.

677
Automate Your Business Processes Strategy Builder

Example: AcceptanceLabel = =‘Yes, please’

• Access fields returned from external connections using


$nameOfExternalConnection.dataFromExternalConnection syntax. Manage your external connections through
the Manage tab in the Toolbox.

Example: $GetCreditScoreContext.output >= 760

• Use $Request to access information the user types into forms and use that information to request specific recommendations.
This option is available only on Search and Contact Support pages in Experience Builder sites.

Example: CONTAINS($Request.search, 'paperless billing') || CONTAINS($Request.search,


'order checks') || CONTAINS($Request.search, 'new address')

Example: For multi-select picklist fields, enter values like Includes ($Record.CarType__c, ‘Audi,’‘BMW’)

SEE ALSO:
Einstein Next Best Action
Formula Operators and Functions by Context
Unofficial SF: Adding $User and $Request to Next Best Action Strategies

Strategy Builder Limit Reoffers Element


Determine how often a user sees the same recommendation. You can decide how many times the
EDITIONS
user must react to a recommendation and how many days to wait before displaying the
recommendation again. Available in: both Salesforce
Classic and Lightning
Field Description Experience
Label The name of the element as it appears on the canvas. Available in: Essentials,
Professional, Enterprise,
API Name The API name of the element. The API name must be unique.
Performance, Unlimited,
Description Optional description of the element and how it works within the strategy. and Developer Editions

User Choose a user reaction to base your limits on. For example, if you select User
Reaction Rejects the Recommendation, your element only limits repeat offers after
the recommendation is rejected.

Number of Choose how many times you want the user to react before the recommendation
Reactions is limited.

Time Choose how long the system waits, after the user has reacted the set number
Period in of times, before a repeat offer is surfaced to the same user.
Days

678
Automate Your Business Processes Strategy Builder

Example: Let’s say you have a renewal offer that you want to surface at most once a year. If a user has already accepted the offer
and filled out the renewal, you don’t want to show the same offer again. For this example you would choose User Accepts the
Recommendation for User Reaction, 1 for Number of Reactions, and set the time period for 365 days for an annual renewal.

SEE ALSO:
Einstein Next Best Action
Create Recommendations
Display Recommendations

Strategy Builder Map Element


The Map element lets you use formulas to create Recommendation fields and modify existing fields
EDITIONS
without Apex code. Instead, it relies on expressions and formulas. Use the Map element to pass
data from a Recommendation field with one name to a Flow input with a different name. Or use it Available in: both Salesforce
to modify current values for Description, Name, and other fields and personalize them with Classic and Lightning
context-specific data. Experience
If you load an object other than Recommendation, add a Map element after the Load element and
Available in: Essentials,
before the Output element in your strategy. Use the Map element to map fields from the records Professional, Enterprise,
to required fields on the Recommendation object. For example, map the product Title field to the Performance, Unlimited,
recommendation Name field. Mapping fields converts the filtered records into recommendations and Developer Editions
that are surfaced via the Next Best Action component and your own apps.

Example: You can include the name of a contact in a recommendation, and further
personalize the recommendation with text. Suppose that you have a recommendation with
the description, “Thank you for being a loyal customer. We truly appreciate your business!”
Using the Map element, you can personalize the description. Add the name of the contact
to the description, for example, “Lauren Boyle, Thank you for being a loyal customer. We truly
appreciate your business!”
1. Use a Load element to load all the recommendations you want to change. Or you can
add a Generate element and pass in dynamically generated recommendations.
2. Add a Map element. In the Name field, select Description and in the Value field, enter
this expression:
$Record.Contact.Name+ “, ” + Description. Leave the Type field as
Text.

679
Automate Your Business Processes Strategy Builder

3. Place the “Personalized Thank You” Map element after the Load element. It modifies the descriptions of all recommendations
that pass through it.

4. When you execute the strategy, your recommendations include the contact name for the current case.

Strategy Builder Sort Element


Choose how recommendations are ordered within a branch and reorder them using
EDITIONS
Recommendation fields.
Available in: both Salesforce
Field Description Classic and Lightning
Label The name of the element as it appears on the canvas. Experience

Available in: Essentials,


API Name The API name of the element. The API name must be unique.
Professional, Enterprise,
Description Optional description of the element and how it works within the strategy. Performance, Unlimited,
and Developer Editions
Recommendation Choose a field from the Recommendation object to sort on.
Field

Sort Choose whether you want to sort your recommendations in an ascending or


Direction descending order.

680
Automate Your Business Processes Strategy Builder

Field Description
Sort Empty Recommendations that don’t contain information in the field you chose in Recommendation Field are sorted
Values to Top to the top when selected.

Maximum Limits the number of recommendations allowed to pass through the element.
Recommendations

Usage
Sort the order of your recommendations in a branch by choosing a value from the Recommendation object to sort on. Choose whether
you want to sort in an ascending or descending order, and decide how many recommendations to allow through.

SEE ALSO:
Einstein Next Best Action
Create Recommendations
Display Recommendations

Strategy Builder Branch Merge Element


Combine recommendations from multiple branches into a single branch.
EDITIONS
Field Description Available in: both Salesforce
Label The name of the element as it appears on the canvas. Classic and Lightning
Experience
API Name The API name of the element. The API name must be unique.
Available in: Essentials,
Description Optional description of the element and how it works within the strategy. Professional, Enterprise,
Performance, Unlimited,
Maximum Determines the maximum number of recommendations allowed through the and Developer Editions
Recommendations branch where the sort element is placed.

Usage
Merge multiple branches into a single branch and limit the number of recommendations allowed through the branch with the branch
merge element.

SEE ALSO:
Einstein Next Best Action
Create Recommendations
Display Recommendations

681
Automate Your Business Processes Strategy Builder

Strategy Builder Branch Selector Element


Filter multiple branches through a branch selector and create unique expressions for each branch.
EDITIONS
If the expression is true, recommendations in the branch are allowed through and combined into
a single branch. Available in: both Salesforce
Classic and Lightning
Field Description Experience
Label The name of the element as it appears on the canvas. Available in: Essentials,
Professional, Enterprise,
API Name The API name of the element. The API name must be unique.
Performance, Unlimited,
Description Optional description of the element and how it works within the strategy. and Developer Editions

Condition Create an expression for each branch that flows through the element. If the
expression is true, the recommendations in the branch are allowed through. If
false, the recommendations in the branch don’t progress any further through
the strategy. Condition accepts standard Salesforce formula functions. For more
information, see Formula Operators and Functions by Context.

Note: Use $Record to reference fields from the context object. The context object is the object where you intend to surface
your recommendations and can be changed by editing your strategy and choosing an object under Object Where
Recommendations Display. Example: ISPICKVAL($Record.status, 'New'). For more information, see Write an
Expression.

Example: Suppose that you want to surface recommendations on the Case object so your service agents can suggest offers to
your customers. If a case has been escalated, you want to offer a special discount. To do so you, create a load element that loads
the recommendations associated with your offer. Create a branch selector that only allows recommendations from the branch if
the case has an escalated status. Make your offer load element a child of the branch selector element. In Condition on the branch
selector element, use the following formula: ISPICKVAL($Record.status, 'Escalated').

Usage
Branch selector is an important element when you want to weed out entire branches at once. Unlike a filter element, it can’t filter based
on individual recommendations.

SEE ALSO:
Einstein Next Best Action
Create Recommendations
Display Recommendations
Formula Operators and Functions by Context
Unofficial SF: Adding $User and $Request to Next Best Action Strategies

682
Automate Your Business Processes Strategy Builder

Strategy Builder First Non-Empty Branch Element


The first non-empty branch element allows you to filter branches in the order they appear on the
EDITIONS
canvas. The first branch that contains recommendations is allowed through, all other branches are
blocked. Available in: both Salesforce
Classic and Lightning
Field Description Experience
Label The name of the element as it appears on the canvas. Available in: Essentials,
Professional, Enterprise,
API Name The API name of the element. The API name must be unique.
Performance, Unlimited,
Description Optional description of the element and how it works within the strategy. and Developer Editions

Example: Let’s say you have five different types of credit card offers that could be surfaced to a single user. Although each offer
type is unique and must have its own branch, you only want to surface one type. To do so, filter all of your branches that contain
credit card offers through a first non-empty branch, in priority order from top to bottom. Your element only allows the first branch
that contains recommendations.

Usage
Branches are filtered through the first non-empty branch element in the order that they appear on the canvas, moving from top to
bottom. The element evaluates each branch until it finds one that contains recommendations. When the element recognizes that a
branch contains recommendations, it allows those recommendations through and blocks recommendations from all other branches.

SEE ALSO:
Einstein Next Best Action
Create Recommendations
Display Recommendations

Strategy Connections
Integrate external data and pull in information from other Salesforce systems to create robust
EDITIONS
strategies that utilize all your data.
Available in: both Salesforce
Create an Action Strategy Connection Classic and Lightning
Use Apex actions to integrate external data sources and information from your Salesforce org Experience
into your strategies. Available in: Essentials,
Professional, Enterprise,
SEE ALSO: Performance, Unlimited,
and Developer Editions
Connect REST API Developer Guide: Next Best Action Resources
Unofficial SF: Using Next Best Action with Salesforce Connect

683
Automate Your Business Processes Strategy Builder

Create an Action Strategy Connection


Use Apex actions to integrate external data sources and information from your Salesforce org into
EDITIONS
your strategies.
Use Apex invocable actions to pull sources of data into your strategy. Available in: both Salesforce
Classic and Lightning
1. In Strategy Builder, click the Manager tab.
Experience
2. Click New Connection.
Essentials, Professional,
Enterprise, Performance,
Unlimited , and Developer
Editions

USER PERMISSIONS

To create or manage action


strategies:
• Modify All Data
OR
Manage Next Best
Action Strategies

To run an action strategy:


• Run Flows
OR
3. Enter a label to visually identify the connection (1). Flow User field enabled
on the user detail page
4. Enter an API name. This name is used in Strategy Builder elements that require conditional
statements, such as Branch Selector and Filter (2).
5. Enter a brief description for the connection (3).
6. Choose the action to use in logic elements’ conditions (4).
7. Enter any parameters for the selected action (5) and click Done.
8. Click the connection label to edit its associated information.
9. Click the > to the right of the connection label to edit or view its details or to delete it.
Label
Specifies the label displayed in the Manager pane for your connection.
API Name
Specifies the connection name to use in logic elements’ conditions. For example, $GetCreditScoreContext.output
>= 760.

Note: API Name is set to Label with underscores replacing spaces by default.

Description
Specifies the description shown in the connection details.
Apex Action
Assigns the invocable action that runs when the connection is referenced in elements’ conditions.

684
Automate Your Business Processes Display Recommendations

Argument
Specifies one or more parameters that the selected invocable action requires. This textbox appears only when the action has
one or more arguments.

SEE ALSO:
Strategy Builder
Unofficial SF: Reporting and Tracking with Next Best Action
Unofficial SF: Using Next Best Action with Salesforce Connect

Display Recommendations
After creating a strategy, choose a page to run your strategy and display your recommendations.
EDITIONS
You can use a Lightning record page, an app’s home page, an Experience Cloud site page, a
Visualforce page, or an external site, depending on where you want recommendations to appear. Available in: both Salesforce
Lightning Page (Lightning App Builder) Classic and Lightning
Experience
1. In Lightning App Builder, create, edit, or clone a record page.
2. Drag Einstein Next Best Action from the component list to the location on the page where Available in: Essentials,
you want to display it. Professional, Enterprise,
Performance, Unlimited,
3. Choose an action strategy and the number of recommendations that you want the and Developer Editions
component to display.

Note: If you want to show users flows and quick actions in addition to recommendations,
use the Actions & Recommendations component on your Lightning record page. You
can create an Actions & Recommendations deployment that specifies action strategies
and how you want your recommendations to appear.
An App’s Home Page
1. Create a strategy for the Next Best Action component. Use global variables such as $User.Id when you create the strategy. Use
global variables because the home page isn’t a record page and isn’t associated with objects, like Case, Account, or Product.
2. Navigate to your org’s Home page.
3. Click , and select Edit Page.
4. From the list of Lightning components on the left (1), drag the Einstein Next Best Action component to the home page (2).

685
Automate Your Business Processes Display Recommendations

Experience Builder Site Page (Experience Builder)


1. In Experience Builder, create or edit a site page.
2. Drag Suggested Actions from the component list to the location on the page where you want to display it.
Visualforce Page
Use Lightning Out to add the lightning:nextBestAction component.
Custom Apps
Add Einstein Next Best Action functionality into your app with the global lightning:nextBestAction component.

Einstein Next Best Action Component


Einstein Next Best Action uses strategies that apply your org’s business rules to display context-sensitive suggested offers and actions
on your Lightning record pages.

SEE ALSO:
Suggested Actions
Salesforce Flow for Service and the Actions & Recommendations Component
Lightning Aura Components Developer Guide: Add Aura Components to Any App with Lightning Out (Beta)
Unofficial SF: Triggering a Refresh of the Next Best Action Component
Unofficial SF: Building Your Own Next Best Action Front End
Unofficial SF: Using the NBA Component in a Visualforce Page

Einstein Next Best Action Component


Einstein Next Best Action uses strategies that apply your org’s business rules to display
USER PERMISSIONS
context-sensitive suggested offers and actions on your Lightning record pages.
1. Create a recommendation strategy in Strategy Builder. To create and save Lightning
pages in the Lightning App
2. Drag the Einstein Next Best Action component onto your record page. Builder:
• Customize Application
Note: In Experience Builder, the component is called Suggested Actions.
To view Lightning pages in
3. In the property editor, select the strategy you want to display (1). Enter the maximum number the Lightning App Builder:
of recommendations to display (2) and choose where recommendations open when accepted • View Setup and
Configuration
(3).
To run a recommendation
strategy on a Lightning
record page:
• Run Flows
OR
Flow User field enabled
on the user detail page

686
Automate Your Business Processes Display Recommendations

Title
Displays the title for the component on the Record page.
Hide Einstein Header
Hides the Einstein Recommendations graphical header.
Strategy
Displays all available strategies created in Strategy Builder.
Maximum Recommendations Displayed
Displays up to four recommendations.
Hide Empty Component
Displays the component only when there are recommendations available initially.
Launch Recommended Action In
Specifies whether recommendations open in a display window or a new browser window.
Show Image
Shows images associated with each displayed recommendation. If there isn’t an image, a placeholder displays.
Show Description
Displays the recommendation descriptions.
Show Reject Option
Displays the reject option.
Set Component Visibility
Allows Dynamic Lightning Pages by adding filter conditions and logic to the component properties in the Lightning App Builder.

Example: Here’s how a strategy looks with the Einstein header and no images in the Service console:

687
Automate Your Business Processes Report On and Track a Recommendation

SEE ALSO:
Unofficial SF: Passing Data from Next Best Action to Flow

Report On and Track a Recommendation


Create a custom report type to report on and track recommendation data and strategy metrics.
EDITIONS
You can see the monthly total recommendations that a Salesforce org’s strategies served. And you
can analyze which recommendations are accepted and rejected, who responds to them, and more. Available in: both Salesforce
Salesforce updates recommendation strategy metrics each time a strategy is executed or a Classic and Lightning
recommendation is accepted or rejected. Analyze usage metrics to better understand how your Experience
strategies are performing. Use this knowledge to improve your strategies’ logic and increase their
Available in: Essentials,
effectiveness. Professional, Enterprise,
For example, run A/B tests on two different strategies and compare their relative performance. If Performance, Unlimited,
your service agents accept more recommendations served from Strategy B, use metrics to discover and Developer Editions
why.
1. For complete instructions on creating custom report types, search for Create a Custom Report USER PERMISSIONS
Type in Salesforce Help.
To create, edit and delete
2. For strategy-level data that’s aggregated for each calendar month, use the Recommendation custom report types:
Strategy Metrics primary object. For recommendation-level details, use the Recommendation • Manage Custom Report
Reactions primary object instead. Types
3. Using the Recommendation Strategy Metrics primary object, combine fields from it (like To view recommendation
Recommendation Source ID) and the related strategy (like Context Record Type). Using the metrics data:
Recommendation Reactions primary object, include fields to report on, such as Context Record • Modify All Data or
ID, Created Date, Last Modified Date, Recommendation Score, and Source ID. Manage Next Best
Action Strategies
4. To analyze a strategy’s performance, group your strategy executions by recommendation source
ID, and the number of times a recommendation was served, accepted, and rejected. To compare
performance between two different strategies, group your strategy executions by recommendation source ID. Add useful metadata
to your report, such as recommendation description and create date.
5. Deploy the report types you want to make available to users.

688
Automate Your Business Processes Report On and Track a Recommendation

6. Let users know that they can create reports using these custom report types.

7. Users can also create dashboards from the custom report type.

SEE ALSO:
Create a Custom Report Type
Connect REST API Developer Guide: Recommendation Reaction

689
Automate Your Business Processes Perform Automated Actions

Perform Automated Actions


An automated action is a reusable component that performs some sort of action behind the
EDITIONS
scenes—like updating a field or sending an email. Once you create an automated action, add it to
a process, milestone, or other automated process. Available in: both Lightning
Experience and Salesforce
Action Type Supported In... Classic
Workflow Process Flow Approval Entitlement Flow triggers are available
Rule Process Process in: Salesforce Classic

Email Alert Available in: Enterprise,


Field Update Performance, Unlimited,
and Developer Editions
Flow Trigger Outbound message are
(Pilot) available in: Professional,
(immediate
only) Enterprise, Performance,
Unlimited, and Developer
Outbound Editions
Message Email alerts are available in:
Essentials, Professional,
Task Enterprise, Performance,
Unlimited, and Developer
Editions
Considerations for Automated Actions
Before you start working with automated actions, familiarize yourself with relevant limits and
special behaviors.
Manage Automated Actions in Workflow Rules

Task Actions
Task actions determine the details of an assignment given to a specified user by an automated
EDITIONS
process. You can associate task actions with workflow rules, approval processes, or entitlement
processes. Available in: Lightning
Important: Where possible, we changed noninclusive terms to align with our company Experience and Salesforce
Classic
value of Equality. We maintained certain terms to avoid any effect on customer
implementations. Available in: Enterprise,
From Setup, enter Tasks in the Quick Find box, and select Tasks. Then use these settings Performance, Unlimited,
to configure your task. and Developer Editions

Field Description
Object Select an object for your task. Remember, tasks can only be associated with workflow
rules or approval processes for the same object type. Choose an object that tracks
activities.

Note: Tasks are not available for article types.

690
Automate Your Business Processes Task Actions

Field Description
Assigned to Select an assignee for your task. An assignee can be in the form of a user, role, record owner, record creator, opportunity
team role, or account team role, depending on the type of record you chose.

Note:
• If the assignee of a task is set to the record owner and the owner of a lead or case is a queue, the task is
assigned to the person who triggered the rule.
• If a custom object has a master-detail relationship with a standard object, the owner of the custom object
record is automatically set to the owner of the master standard object record. For example, if a custom
object called “Expenses” has a master-detail relationship with Accounts, the owner of each expense record
is the owner of the account for the expense.
• If the assignee of a workflow task is a role and more than one user belongs to that role, the record owner
becomes the task assignee, regardless of their role. We recommend that you don’t assign tasks to roles
with multiple users. Assigning tasks to roles with one user allows you to easily change the user in that
role without modifying the workflow rule. If the assignee of a workflow task is a role and that role is empty,
the record owner becomes the task assignee, regardless of their role.
• When a lead is converted by someone who isn't the lead owner, all workflow tasks associated with the
lead that are assigned to that user, except email alerts, are reassigned to the lead owner. Workflow tasks
assigned to users other than the lead owner and lead converter aren't changed.

Subject Enter a subject for the task. Distinguish automated tasks from user-created ones by starting the subject with a specific
notation, such as adding (Automated) at the end.

Unique Name Enter a unique name to refer to this component in the API. The requirement for uniqueness is only within the selected
object type. You can have actions of the same type with the same unique name, provided they are defined for
different objects.
The Unique Name field can contain only underscores and alphanumeric characters. It must be unique within the
selected object type, begin with a letter, not include spaces, not end with an underscore, and not contain two
consecutive underscores.

Due Date Choose a due date for the task. Due dates appear in the time zone of the assignee.
Configuring a task’s Due Date to "Rule Trigger Date" sets time triggers and workflow task due dates based on the
date that the workflow time trigger’s action is executed. For example, if the task due date is "Rule Trigger Date plus
10 days" and the time trigger is executed on January 1, Salesforce sets the task due date to January 11.

Status Choose a status for the task.

Priority Choose a priority for the task.

Comments Enter comments for the task.

You may notice that all your tasks include a Created By field. For tasks, this field contains the name of the person who saved the record
that triggered the rule to assign the task.

691
Automate Your Business Processes Email Alert Actions

Tasks don't trigger task-based workflow rules if they’re created automatically, such as by clicking the Send An Email button or by using
the Email to Salesforce BCC address field.

SEE ALSO:
Associate Actions with Workflow Rules or Approval Processes

Email Alert Actions


Email alerts are emails generated by an automated process and sent to designated recipients. These
EDITIONS
actions consist of the standard text and list of recipients for an email. You can associate email alerts
with processes, flows, workflow rules, approval processes, or entitlement processes. They’re also Available in: both Salesforce
available through the Invocable Actions REST API endpoint. Classic and Lightning
From Setup, enter Email Alerts in the Quick Find box, and select Email Alerts. Then Experience
use these settings to configure your email alert. Available in: Essentials,
Tip: Create a standardized letterhead to use for all email templates you use for workflow Professional, Enterprise,
alerts. Performance, Unlimited,
and Developer Editions
Field Description
Description Enter a description.

Unique Enter a unique name to refer to this component in the API. The requirement for
Name uniqueness is only within the selected object type. You can have actions of the
same type with the same unique name, provided they’re defined in different
objects.The Unique Name field can contain only underscores and alphanumeric
characters. It must be unique within the selected object type, begin with a letter,
not include spaces, not end with an underscore, and not contain two consecutive
underscores.

Object If available, choose an object for this email alert.


Salesforce uses this object when generating merge field values for email templates
with workflow rules and approval processes. Also, you can define the recipients of
this email alert using contact and user lookup fields that are relevant to that object.
For example, if you select Contract, you can define the contract signer as a recipient.
The object is read-only if the new email alert is associated with an approval process
or workflow rule for a particular object.

Email Choose an email template. Insert merge fields to reference specific information
Template based on the record that triggers the email alert. For example, insert a merge field
for the opportunity.
Classic Email Templates
Except for {!ApprovalRequest.Comments}, approval merge fields named
{!ApprovalRequest.field_name} in email templates return values only
in approval assignment emails and email alerts for approval processes. When used
in other emails—including email alerts for workflow rules—the approval merge
fields return null.

692
Automate Your Business Processes Email Alert Actions

Field Description
The {!ApprovalRequest.Comments} merge field returns only the most recently entered comment in
emails for an approval step that requires unanimous approval from multiple approvers.
If available, select Protected Component to mark the alert as protected if it’s part of a Managed - Released package.
The Recipient merge field isn’t supported in either Classic or Lightning email templates used for workflows.
Lightning Email Templates
In Lightning email templates, merge fields are resolved for activity-enabled objects only, except Contact and Lead
merge fields. Activity-enabled objects appear in the Related Entity Type field on the email template record home.
Cross-object merge fields aren’t supported. The object specified in the Related Entity Type field must be the object
used in the template’s merge fields. For a workaround, see Cross-object Merge Fields Do Not Work in Email Templates.
There isn’t equivalent support for special merge fields in Classic email templates, such as {!this} or
{!$Setup.LabelName}.
UTF-8 encoding is used on all emails sent through email alerts.

Recipient Type Select who receives this email alert.

Recipients Select who receives this email alert in the Available Recipients list and click Add.
If you change the object after selecting recipients, Salesforce clears the Selected Recipients list.
If your email recipient is a role and that role contains multiple people, Salesforce emails each person in that role.
If your email recipient is a record owner and the owner of the record is a queue, the queue email receives the email
alert. If the queue is set up so that email is sent to all members, queue members are notified as well. If no queue
email is specified, only queue members are notified.

Additional Emails Enter up to five more email addresses for recipients who aren’t Salesforce users, leads, or contacts.

From Email Either the default workflow user or a previously configured and verified organization-wide address. This field lets
Address you use a standard email address for your organization (such as support@company.com) instead of the default
From field, which is the email address of the person who updates the record.
If you select Make this the default From email address for this object's email alerts, this email address overrides
the From Email Address for all email alerts associated with that object. You can still customize individual email
alerts to use a different From Email Address. The From Email Address in a workflow email alert changes to the
current user when the email alert is installed by using a managed or unmanaged package. The From Email Address
doesn't change when using other types of deployment such as Metadata API or change sets.

Note: The daily allocation for emails sent through email alerts is 1,000 per standard Salesforce license per org—except for free
Developer Edition and trial orgs, where the daily workflow email allocation is 15. The overall org allocation is 2,000,000. This
allocation applies to emails sent through email alerts in workflow rules, approval processes, flows, processes, or REST API. Single
emails sent to external email addresses are also limited, and how those limits are enforced depends on when your org was created.

SEE ALSO:
Available Recipient Types for Email Alerts
Daily Allocations for Email Alerts

693
Automate Your Business Processes Email Alert Actions

Available Recipient Types for Email Alerts


When you configure an email alert, you identify who receives the email. The available options vary
EDITIONS
based on your org settings and the object you selected.
Available in: both Salesforce
Recipient Description Classic and Lightning
Type Experience
Account Owner The user listed as the owner of the account itself or the account associated with Available in: Essentials,
the record. Professional, Enterprise,
This option works only for email alerts on accounts, opportunities, cases, Performance, Unlimited,
contacts, contracts, and any custom object that is a child of the account object. and Developer Editions
The associated account must also specify an account owner. If you select another
object type or the associated account doesn’t have an account owner, Salesforce
sends the email alert to the record owner instead.

Account Team All users assigned to a particular account team role.


The Account Team option is always available. However, emails are sent only
when the rule is associated with the account object or its immediate child
objects.

Case Team All users assigned to a particular case team role.

Creator The user who created the record.

Customer Portal All users associated with a Customer Portal.


User

Email Field An email address field on the selected object, such as the Email field on lead
records or custom email fields.

Note: When creating email alerts for campaign members, Email Field
refers to the email field on the lead or contact that the campaign member
is based on.

Opportunity All users assigned to a particular opportunity team role. This option appears
Team only when team selling is enabled.
The Opportunity Team option works only for email alerts configured for
opportunities. It doesn’t work for email alerts configured for child objects of
opportunities.

Owner The record owner.

Partner User All users associated with a partner portal.

Portal Role All users assigned to a particular portal role.

Portal Role and All users assigned to a particular portal role, plus all users in roles below that
Subordinates role.

Public Groups The users in a particular public group.

694
Automate Your Business Processes Field Update Actions

Recipient Type Description


Related Contact An associated contact on the record.
For example, you can select the Customer Signed By field for contracts that contain the name of the contract
signer.

Related Lead or A campaign member’s lead or contact owner.


Contact Owner

Related User An associated user on the record.


For example, contract records have an Activated By field that contains the name of the user that activated the
contract.

Role All users assigned a particular role.

Role and Internal All users assigned a particular role, plus all users in roles below that role, excluding partner portal and Customer
Subordinates Portal users.

Role and Subordinates All users assigned a particular role, plus all users in roles below that role.

User A particular user.

Note: The Recipient merge field isn’t supported in either Classic or Lightning email templates used for workflows.

Field Update Actions


Field update actions let you automatically update a field value. You can associate field updates with
EDITIONS
workflow rules, approval processes, or entitlement processes.

Important: Where possible, we changed noninclusive terms to align with our company Available in: Lightning
value of Equality. We maintained certain terms to avoid any effect on customer Experience and Salesforce
Classic
implementations.
From Setup, enter Field Updates in the Update box, and select Field Updates. Then use Available in: Enterprise,
these settings to configure your field update. Performance, Unlimited,
and Developer Editions
Before you begin, check the type of the field you want to update. Read-only fields like formula or
auto-number fields are not available for field updates.

Field Description
Name Enter a name for this field update.

Unique Name Enter a unique name to refer to this component in the API. The requirement for uniqueness is only within the
selected object type. You can have field updates of the same type with the same unique name, provided they
are defined in different objects. The Unique Name field can contain only underscores and alphanumeric
characters. It must be unique within the selected object type, begin with a letter, not include spaces, not end
with an underscore, and not contain two consecutive underscores.

Description Enter a description for the field update.

Object Select the object whose field you want to update.

695
Automate Your Business Processes Field Update Actions

Field Description
Field to Update Select the field to update. Fields are shown only for the object that you selected. You can select a field on a
related object in a master-detail relationship.
You can use field updates on encrypted custom fields, but the encrypted field isn't available in the formula
editor.

Tip: Avoid associating more than one field update with a rule or approval process that applies different
values to the same field.

Re-evaluate Workflow Select if you want workflow rules on this object to be re-evaluated after the field value is updated. If you select
Rules After Field this option, Salesforce re-evaluates all workflow rules on the object if the field update results in a change to
Change the value of the field, triggering any workflow rules whose criteria are met. For more information, see Field
Updates That Re-evaluate Workflow Rules on page 707.

Specify New Field The value that the field should be updated with. The available options depend on the type of field you are
Value updating. For more information, see Value Options for Field Update Actions on page 696 .

SEE ALSO:
Associate Actions with Workflow Rules or Approval Processes
Cross-Object Field Updates
Considerations for Field Update Actions

Value Options for Field Update Actions


When you create a field update action, specify what the new value of the field should be.
EDITIONS
Available field update options depend on the type of field you’re updating.
Available in: Lightning
• Choose A specific value, and enter the value in the space provided.
Experience and Salesforce
• Choose A blank value (null) if you want Salesforce to remove any existing value and leave Classic
the field blank. This option isn't available for required fields, checkboxes, and some other types
of fields. Available in: Enterprise,
Performance, Unlimited,
• For record owners, choose the user to whom the record should be assigned. For case, lead, and
and Developer Editions
custom object records, you can also choose a queue for this field. Select Notify Assignee
to send an email to the new record owner (option unavailable when user control over task
assignment notifications is enabled).
• For checkboxes, choose True to select the checkbox and False to deselect it.
• For picklists, select a specific value from the drop-down list, or select the value above or below the current value based on the sorting
specified in the picklist definition. If you sort values alphabetically, the values above or below may be different for users in other
languages.
• Choose Use a formula to set the new value to calculate the value based on an expression, merge fields, or other values. For more
information about using formulas in Salesforce, see Calculate Field Values With Formulas.

696
Automate Your Business Processes Outbound Message Actions

Outbound Message Actions


An outbound message sends information to a designated endpoint, like an external service. You
EDITIONS
configure outbound messages from Setup. You must configure the external endpoint and create
a listener for the messages using SOAP API. You can associate outbound messages with flows, Available in: Lightning
workflow rules, approval processes, or entitlement processes. Experience and Salesforce
For example, automatically initiate the reimbursement process for an approved expense report by Classic
triggering an outbound API message to an external HR system.
Available in: Professional,
From Setup, enter Outbound Messages in the Quick Find box, and select Outbound Enterprise, Performance,
Messages. Then use these settings to configure your outbound message. Unlimited, and Developer
Editions
Field Description
Object Choose the object that has the information you want included in the outbound
message

Name Enter a name for this outbound message.

Unique Name Enter a unique name to refer to this component in the API. The requirement for
uniqueness is only within the selected object type. You can have outbound
messages with the same unique name, provided they’re defined for different
objects.
The Unique Name field can contain only underscores and alphanumeric
characters. It must be unique within the selected object type, begin with a letter,
not include spaces, not end with an underscore, and not contain two consecutive
underscores.

Description Enter a description that makes it easy for other users to tell what the outbound
message does.

Endpoint URL Enter an endpoint URL for the recipient of the message. Salesforce sends a SOAP
message to this endpoint.

User to send as Select the Salesforce user to use when sending the message. The chosen user
controls data visibility for the message that is sent to the endpoint

Protected If present, select Protected Component to mark the outbound message as


Component protected in a managed package. Only available in Developer Edition.

Send Session ID To include the Salesforce session ID in the outbound message, select Send
Session ID. Include the session ID in your message if you intend to make API
calls and you don’t want to include a username and password. Never send a
username and password in an unencrypted message, especially in a production
environment. It isn’t secure.
When you select Send Session ID, only HTTPS is supported for the endpoint
URL to ensure secure transmission of the session ID. For managed and
unmanaged packages created before Spring ’19 with this option but without
an HTTPS endpoint, subscribers can still install them. Starting in Spring ’19, you
can’t create packages with insecure outbound message options.

697
Automate Your Business Processes Outbound Message Actions

Field Description
Object fields to Select the fields to include in the outbound message, and click Add.
send

If your endpoint URL uses a client certificate, see Import a Client Certificate for Your Endpoint URL on page 707.

SEE ALSO:
Track the Delivery Status of an Outbound Message
Considerations for Outbound Messages
SOAP API Developer Guide
Associate Actions with Workflow Rules or Approval Processes
Considerations for Outbound Messages

Outbound Message Notifications


You can request that up to five users receive a notification listing all outbound messages that have
EDITIONS
failed for at least 24 hours. A fresh notification is sent every 24 hours until you cancel the request.
Failed messages are deleted from the failed outbound messages related list after seven days. Before Available in: Lightning
they are removed, you can delete them yourself or request that they be retried again. Experience and Salesforce
Classic
Note: If you don’t see the Outbound Message Notifications page, your org doesn’t have
notifications for outbound messages enabled. Contact Salesforce to enable notifications for Available in: Professional,
outbound messages. Enterprise, Performance,
Unlimited, and Developer
Editions
Create an Outbound Message Notification
You can request that up to five users receive a notification listing all outbound messages that
have failed for at least 24 hours. A fresh notification is sent every 24 hours until you cancel the
request.
View an Outbound Message Notification Request

698
Automate Your Business Processes Outbound Message Actions

Create an Outbound Message Notification


You can request that up to five users receive a notification listing all outbound messages that have
EDITIONS
failed for at least 24 hours. A fresh notification is sent every 24 hours until you cancel the request.
1. From Setup, enter Outbound Message Notifications in the Quick Find box, then Available in: Lightning
select Outbound Message Notifications. Experience and Salesforce
Classic
2. Click New.
3. Enter a full username, or click the icon to select it from a list of usernames. Available in: Professional,
Enterprise, Performance,
4. Save the request. Unlimited, and Developer
Editions
Note: If you don’t see the Outbound Message Notifications page, your org doesn’t have
notifications for outbound messages enabled. Contact Salesforce to enable notifications for
outbound messages. USER PERMISSIONS

To create an outbound
message notification:
• Modify All Data

View an Outbound Message Notification Request


From the detail page of an outbound message notification request:
EDITIONS
• Click Edit to change the username for a notification request. This is simpler than deleting the
request and then creating a new one. Available in: Lightning
• Click Delete to delete the notification request. Experience and Salesforce
Classic
• Click Clone to create a new notification request with the same username.
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions

USER PERMISSIONS

To view or edit outbound


message notification
request:
• Modify All Data

699
Automate Your Business Processes Outbound Message Actions

Track the Delivery Status of an Outbound Message


To track the status of an outbound message, from Setup, enter Outbound Messages in the
EDITIONS
Quick Find box, then select Outbound Messages.
• Next items for delivery are awaiting delivery. Available in: both Salesforce
• Oldest failures have not yet been deleted because they have not been delivered and are not 24 Classic and Lightning
Experience
hours old.
• Failed outbound messages failed to be delivered and are no longer being retried. Messages are Available in: Professional,
listed here only if you configure the message when you create it by selecting Add failures Enterprise, Performance,
to failed outbound message related list. If you do not see this related list, Unlimited, Developer, and
it has not been enabled for your organization. Database.com Editions

You can perform several tasks here. Approvals and Milestone


Actions are not available in
• Click any workflow or approval process action ID to view the action that triggered it. Database.com
• Click Retry to change the Next Attempt date to now. This causes the message delivery to be
immediately retried. If you select Retry in the Failed outbound messages related list, the
outbound message moves to the Next items for delivery related list and is retried for another USER PERMISSIONS
24 hours.
To track outbound
• Click Del to permanently remove the outbound message from the queue. messages:
• Modify All Data
Note: If you don’t have this option, your org doesn’t have outbound messages enabled.
Contact Salesforce to enable outbound messages.

Import a Client Certificate for Your Endpoint URL


If the endpoint URL of your outbound message uses a client certificate, import it to put your
EDITIONS
outbound message into action.
1. From Setup, enter API in the Quick Find box, then select API Available in: Lightning
Experience and Salesforce
2. Click Generate Client Certificate.
Classic
3. Save the certificate to the appropriate location.
Available in: Professional,
4. Import the downloaded certificate into your application server and configure your application Enterprise, Performance,
server to request the client certificate. Unlimited, and Developer
Editions

700
Automate Your Business Processes Define a Flow Trigger for Workflow (Pilot)

Define a Flow Trigger for Workflow (Pilot)


Create a flow trigger so that you can launch a flow from workflow rules. With flow triggers, you can
EDITIONS
automate complex business processes—create flows to perform logic, and have events trigger the
flows via workflow rules—without writing code. For example, your flow looks up and assigns the Available in: Salesforce
relevant entitlement for a case. Create a flow trigger to launch the flow whenever a case is created, Classic
so that all new cases are automatically set with a default entitlement.
Available in: Enterprise,
Note: The pilot program for flow trigger workflow actions is closed. If you've already enabled Performance, Unlimited,
the pilot in your org, you can continue to create and edit flow trigger workflow actions. If you and Developer Editions
didn't enable the pilot in your org, use Flow Builder to create a record-triggered flow, or use
Process Builder to launch a flow from a process.
USER PERMISSIONS
To get started using flow triggers, from Setup, enter Flow Triggers in the Quick Find
box, then select Flow Triggers. Before you begin: To view workflow rules and
actions:
• Create and activate the autolaunched flow that you want this workflow action to launch.
• View Setup and
• Create the workflow rule that you plan to add this workflow action to. Configuration
• Understand the special behavior and limitations of flow triggers. See Flow Trigger Considerations To create or change
(Pilot) on page 708. workflow rules and actions:
• Customize Application
Complete these steps to create a flow trigger.
1. From Setup, enter Flow Triggers in the Quick Find box, then select Flow Triggers.
2. Click New Flow Trigger.
3. Select the same object as the workflow rule, and then click Next.
4. Configure the flow trigger.

Field Description
Name Name of the flow trigger.

Unique Name Enter a unique name to refer to this component in the API. The Unique Name field can contain
only underscores and alphanumeric characters. It must be unique within the selected object type,
begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive
underscores.

Protected Component Reserved for future use.

Flow Unique name of the autolaunched flow that this workflow action launches.

Set Flow Variables Whether to pass values into the flow’s variables.

5. If you select Set Flow Variables, specify their names and values.
Click Set Another Value to set up to 25 variables.

Field Description
Name Select the name of the flow variable.
Only variables that allow input access can be selected.

701
Automate Your Business Processes Define a Flow Trigger for Workflow (Pilot)

Field Description
Value For a flow variable, you can:
• Enter a literal value.
• Click , select a field, and click Insert.
For a record variable, you can:
• Click , select a record, and click Insert.
To help you distinguish between records and fields, all record options are marked with an
asterisk (*) and appear at the top of each list.

• Enter {!this} to use the current values of the record that was created or edited to cause
the workflow rule to fire.
• Enter {!old} to use the most recent previous values of the record that was edited to cause
the workflow rule to fire.
In other words, {!old} identifies the same record as {!this} but uses the record’s values
from immediately before it was edited to cause the workflow rule to fire.

Note:
• If the record was newly created, {!old} is null.
• Unlike {!this}, {!old} can’t be selected by clicking . Manually enter
{!old} in the Value column.

6. To put the flow trigger in test mode, select Administrators run the latest flow version.
When selected and an admin triggers the workflow rule, the flow trigger launches the latest version of the flow. For all other users,
the flow trigger always launches the active version of the flow.
The same values are passed into the flow variables whether the flow trigger launches the active or latest flow version.

7. Click Save.
Don’t forget to associate the flow trigger to a workflow rule.

SEE ALSO:
Flow Trigger Considerations (Pilot)

702
Automate Your Business Processes Considerations for Automated Actions

Considerations for Automated Actions


Before you start working with automated actions, familiarize yourself with relevant limits and special
EDITIONS
behaviors.
Available in: Lightning
Considerations for Field Update Actions Experience and Salesforce
Learn how to use field update actions to their full potential in workflow. Classic

Considerations for Outbound Messages Available in: Enterprise,


Review the considerations for using outbound message actions before implementing them in Performance, Unlimited,
your workflows. and Developer Editions

Flow Trigger Considerations (Pilot)


Flow trigger workflow actions have special behaviors and limitations.

SEE ALSO:
Daily Allocations for Email Alerts

Considerations for Field Update Actions


Learn how to use field update actions to their full potential in workflow.
EDITIONS
[other]: Where possible, we changed noninclusive terms to align with our company value
of Equality. We maintained certain terms to avoid any effect on customer implementations. Available in: Lightning
Experience and Salesforce
When creating field updates for workflow rules or approval processes, consider the following: Classic

Available in: Enterprise,


Field Update Processing Performance, Unlimited,
• Field updates occur before email alerts, tasks, and outbound messages. and Developer Editions

• Field updates occur after case assignment, lead assignment, and auto-response rules.
• Field updates function independently of field-level security. Therefore, a workflow rule can update fields even though they are hidden
on the user's page layout.
• The result of a field update is unpredictable when a single workflow rule includes multiple field updates that apply different values
to the same field.
• Field updates may affect the information in a related list. For example, if a field such as the Amount or Close Date of an
opportunity is set to be updated, it will affect the Stage History related list on opportunities.
• If a user gets a field update error when saving a record, you can use the debug log to see which field update failed. The debug log
stops when a failure occurs.
• For reminder fields on tasks and events:
– Field updates can set the reminder for a task or event but they can't use the due date of a task or the scheduled time of an event.
– Formulas for date/time values are calculated in days. Divide the value by 1440—the number of minutes in a day—to express
the value in minutes. For example, the formula Now()-7 means seven days ago, while Now()-7/1440 means seven
minutes ago.

• If your organization uses multiple currencies, currency fields are updated using the record's currency. If you choose to update a field
based on a formula, any values in your formula are interpreted in the currency of the record.
• Field updates are tracked in the History related list if you have set history tracking on those fields.

703
Automate Your Business Processes Considerations for Automated Actions

• Workflow rules and some processes can invalidate previously valid fields. Invalidation occurs because updates to records based on
workflow rules and also on process scheduled actions don’t trigger validation rules.
• If you have person accounts enabled, you can use the Is Person Account field as part of the evaluation criteria for workflow
rules. However, because the Is Person Account field is read-only, any field updates set up to modify it will fail.

Tip: Salesforce processes rules in the following order:


1. Validation rules
2. Assignment rules
3. Auto-response rules
4. Workflow rules (with immediate actions)
5. Escalation rules

Notes on Cross-Object Field Updates


• For all custom objects and some standard objects, you can create workflow and approval actions where a change to a detail record
updates a field on the related master record. Cross-object field updates work for custom-to-custom master-detail relationships,
custom-to-standard master-detail relationships, and a few standard-to-standard master-detail relationships. For more information,
see Cross-Object Field Updates on page 11.

• Approval processes can't use cross-object field update actions.


• An approval process can specify a field update action that reevaluates workflow rules for the updated object. If, however, the
re-evaluated workflow rules include a cross-object field update, those cross-object field updates are ignored.
• To create workflow rules so that case comments or emails automatically update fields on associated cases, select Case Comment
or Email Message in the Object drop-down list when creating a new workflow rule and select Case in the Field to Update list.
Email-to-Case or On-Demand Email-to-Case must be enabled for your organization to use the Email Message in a workflow rule.
When cases are updated by an email-triggered workflow rule, the updated case can trigger:
– Workflow rules
– Validation rules
– Updates to roll-up summary fields
– Escalation rules
– Apex triggers
– Entitlement processes
The updated case can't trigger:
– Assignment rules
– Auto-response rules

Field Update Actions and Custom Fields


• Before changing a custom field’s type, make sure it isn’t the target of a workflow field update or referenced in a field update formula
that would be invalidated by the new type.
• You can't delete a custom field that is referenced by a field update.
• You can use field updates on encrypted custom fields, but if you try to use a formula to set the new value, the encrypted field isn't
available in the formula editor.

704
Automate Your Business Processes Considerations for Automated Actions

Field Update Actions on Opportunities and Contracts


• You can define field updates for the Stage field on opportunities, but be aware of how this field affects the Type and Forecast
Category fields.
• You can define field updates using the Amount field on opportunities but it will only apply to those opportunities that don't have
products. Adding products to an opportunity changes the Amount field to a read-only field that is automatically calculated and
not affected by that field update.
• You can define field updates for the Status field on contracts. However, the value of this field may affect the value of the Status
Category field as well.
• Avoid creating a field update for contracts or orders that changes the Status field to any value other than Approved.

Field Update Action Limitations


• The results of a field update can't trigger additional rules such as validation, assignment, auto-response, or escalation rules.
• The results of a field update can trigger additional workflow rules if you have flagged the field update to do so. For more information,
see Field Updates That Re-evaluate Workflow Rules on page 707.
• Field updates that are executed as approval actions don’t trigger workflow rules or entitlement processes.
• These fields aren’t available for field update actions:
– Read-only fields like formula or auto-number fields
– The Language picklist field on multilingual solutions
– Some activity fields, such as Related To and Private

• Email message workflow rules can only be associated with field updates.
• If a field update references a specific user, you can't deactivate that user. For example, if your field update is designed to change the
owner of a record to Bob Smith, change the field update before deactivating Bob Smith.
• You can update long text area fields, but the option to insert A specific value restricts you to entering up to the maximum
amount of characters allowed in the destination field.
• You can't make a field universally required if it's used by a field update that sets the field to a blank value.
• Workflow rules that update owners don’t also transfer associated items. To ensure transfer, click Change next to the owner’s name
in a record and make your transfer selections.

Cross-Object Field Updates


For all custom objects and some standard objects, you can create actions where a change to a detail record updates a field on the
related master record. Cross-object field updates work for custom-to-custom master-detail relationships, custom-to-standard
master-detail relationships, and a few standard-to-standard master-detail relationships.
Field Updates That Re-evaluate Workflow Rules
If Re-evaluate Workflow Rules After Field Change is enabled for a field update action, Salesforce re-evaluates
all workflow rules on the object if the field update results in a change to the value of the field.

SEE ALSO:
Cross-Object Field Updates

705
Automate Your Business Processes Considerations for Automated Actions

Cross-Object Field Updates


For all custom objects and some standard objects, you can create actions where a change to a detail
EDITIONS
record updates a field on the related master record. Cross-object field updates work for
custom-to-custom master-detail relationships, custom-to-standard master-detail relationships, and Available in: Lightning
a few standard-to-standard master-detail relationships. Experience and Salesforce
Classic
[other]: Where possible, we changed noninclusive terms to align with our company value
of Equality. We maintained certain terms to avoid any effect on customer implementations. Available in: Enterprise,
For example, in a custom recruiting application, create a workflow rule that sets the status of an Performance, Unlimited,
application (the master object) to “Closed” when a candidate (the detail object) accepts the job. and Developer Editions
Or, for standard objects, create a rule to change the status of a case from “Awaiting Customer
Response“ to “In Progress” when a customer adds a case comment.

Custom Object to Custom Object


Cross-object field updates are supported for all custom objects that are children of custom objects in a master-detail relationship.

Custom Object to Standard Object


Cross-object field updates are supported for custom objects that are children of certain standard objects in a master-detail relationship.
The standard objects which support cross-object field updates from custom objects are:
• Account
• Asset
• Campaign
• Case
• Contact
• Contract
• Contract Line Item
• Entitlement
• Opportunity
• Order
• Question
• Quote
• Service Contract
• Solution

Standard Object to Standard Object


Cross-object field updates are supported for standard objects that are children of standard objects in a master-detail relationship. However,
only these standard-to-standard relationships are supported.
• Case Comments updating Case
• Email updating Case

Tip: To create workflow rules so that case comments or emails automatically update fields on associated cases, select Case
Comment or Email Message in the Object drop-down list when creating a new workflow rule and select Casein the Field

706
Automate Your Business Processes Considerations for Automated Actions

to Update list. Email-to-Case or On-Demand Email-to-Case must be enabled for your organization to use the Email Message
in a workflow rule.

• Opportunity Product updating Opportunity

Note: Cross-object field updates to a parent opportunity's Amount and Quantity fields only work if the opportunity has
no opportunity products associated with it.

• Opportunity updating Account—Supported for both business accounts and person accounts.

Note: If you have workflow rules on converted leads and want to use cross-object field updates on the resulting accounts and
opportunities, you must enable the lead setting Require Validation for Converted Leads.
Standard-to-standard cross-object field update actions:
• Can’t be used in, or assigned to, approval processes.
• Update a parent record even if the user doesn’t have edit access to it.

Note: If you have Apex code that updates parent fields in the same relationships as a cross-object field update action, consider
replacing your code with cross-object field updates. Otherwise, both will fire, and since workflow rules run after Apex triggers, the
workflow field update will override any change made by your Apex code.

SEE ALSO:
Considerations for Field Update Actions
Object Relationships Overview

Field Updates That Re-evaluate Workflow Rules


If Re-evaluate Workflow Rules After Field Change is enabled for a field
EDITIONS
update action, Salesforce re-evaluates all workflow rules on the object if the field update results in
a change to the value of the field. Available in: Lightning
• If the field update changes the field’s value, all workflow rules on the associated object are Experience and Salesforce
re-evaluated. Any workflow rules whose criteria are met as a result of the field update will be Classic
triggered. Available in: Enterprise,
• If any of the triggered workflow rules result in another field update that’s also enabled for Performance, Unlimited,
workflow rule re-evaluation, a domino effect occurs, and more workflow rules can be re-evaluated and Developer Editions
as a result of the newly-triggered field update. This cascade of workflow rule re-evaluation and
triggering can happen up to five times after the initial field update that started it.
• Make sure that your workflow rules aren’t set up to create recursive loops. For example, if a field update for Rule1 triggers Rule2, and
a field update for Rule2 triggers Rule1, the recursive triggers may cause your organization to exceed its limit for workflow time triggers
per hour.
• In a batch update, workflow is only retriggered on the entities where there is a change.
• Only workflow rules on the same object as the initial field update will be re-evaluated and triggered.
• Only workflow rules that didn’t fire before will be retriggered.
• Cross-object workflow rules aren’t candidates for re-evaluation.
• Cross-object field updates that cause a field value to change don’t trigger workflow rule re-evaluation on the associated object.
• An approval process can specify a field update action that reevaluates workflow rules for the updated object. If, however, the
re-evaluated workflow rules include a cross-object field update, those cross-object field updates are ignored.
• Time-dependent actions aren't executed for a reevaluated workflow rule in the following situations:

707
Automate Your Business Processes Considerations for Automated Actions

– The reevaluated workflow rule’s immediate actions cause the record to no longer meet the workflow rule criteria.
– An Apex after trigger that is executed as a result of a workflow or approvals action causes the record to no longer meet the
workflow rule criteria.

SEE ALSO:
Considerations for Field Update Actions

Considerations for Outbound Messages


Review the considerations for using outbound message actions before implementing them in your
EDITIONS
workflows.
When creating outbound messages for workflow rules or approval processes, consider the following: Available in: Lightning
Experience and Salesforce
• A single SOAP message can include up to 100 notifications. Each notification contains an ID
Classic
that uniquely identifies a record, and a reference to the data in the record. If the information in
the record changes after the notification is sent, but before the notification is delivered, only Available in: Professional,
the updated information is delivered. If the record is deleted before the notification is delivered, Enterprise, Performance,
the notification contains no data. Unlimited, and Developer
• Messages are queued until they are sent, to preserve message reliability. Editions

• If the endpoint is unavailable, messages stay in the queue until sent successfully or until they
are 24 hours old. After 24 hours, messages are dropped from the queue.
• If a message can't be delivered, the interval between retries increases exponentially, up to a maximum of two hours between retries.
• Messages are retried independent of their order in the queue. This might result in messages being delivered out of order.
• You can't build an audit trail using outbound messages. While each message should be delivered at least once, it might be delivered
more than once. Also, it might not be delivered at all if delivery cannot be done within 24 hours. Finally, as noted above, the source
object might change after a notification is sent but before it is delivered, so the endpoint will only receive the latest data, not any
intermediate changes.

Flow Trigger Considerations (Pilot)


Flow trigger workflow actions have special behaviors and limitations.
EDITIONS
Note: The pilot program for flow trigger workflow actions is closed. If you've already enabled
the pilot in your org, you can continue to create and edit flow trigger workflow actions. If you Available in: Salesforce
didn't enable the pilot in your org, use Flow Builder to create a record-triggered flow, or use Classic
Process Builder to launch a flow from a process. Available in: Enterprise,
Understand these considerations before you create flow triggers or add them to workflow rules. Performance, Unlimited,
and Developer Editions
• Flow triggers are available only for workflow rules. You can’t use them as actions elsewhere,
for example, in approval processes.
• Flow triggers are available on most—but not all—objects that are supported by workflow rules. You can see the list of supported
objects when you create a new flow trigger. From Setup, enter Flow Triggers in the Quick Find box, then click Flow
Triggers.
• Only active, autolaunched flows can be launched by flow triggers. However, if a flow trigger is in test mode, admins run the latest
flow version while other users run the active flow version.
• Flows that are launched from workflow rules are run in system context, which means that user permissions, field-level security, and
sharing rules aren’t taken into account during flow execution.

708
Automate Your Business Processes Considerations for Automated Actions

• If a flow trigger fails at run time, the user who created or edited the record to meet the workflow rule criteria won’t be able to save
the record. To troubleshoot run time issues, see the flow action events in the Workflow category of debug logs, which show the
flow version and the values passed into flow variables.
• A flow trigger can set the values of up to 25 variables in the flow, with the following limitations.
– Flow triggers can’t use multi-select picklist fields to set flow variables.
– When a flow trigger uses a currency field to set a flow variable, only the amount is passed into the flow. Any currency ISO code
or locale information is ignored. If your organization uses multiple currencies, the flow trigger uses the amount in the currency
of the record that contains the specified currency field.
– Flow triggers can’t pass values into record collection variables in flows.

• Always keep one version of the flow active if it’s referenced by an active workflow rule’s flow trigger.
• Once you activate a workflow rule using the flow trigger, don’t modify or add a version of the flow to include screens or other
elements that would violate the run restrictions for an autolaunched flow. If you modify a flow to no longer be autolaunched, it can’t
be launched by flow triggers. To work around this situation, you can save the non-autolaunched flow as a new flow and change the
new flow to become autolaunched. Then update the flow triggers to launch the new flow.
• Flow triggers aren’t available as time-dependent workflow actions. You can add flow triggers to workflow rules only as immediate
workflow actions.
• When the system executes a workflow rule with multiple flow triggers, those flows aren’t run in any particular order.
• In a transaction, flow triggers are executed after all workflow field updates, including any Apex triggers and standard validations that
are executed as a result of those workflow field updates. After executing flow triggers, the system executes escalation rules.
• Flows that are launched from workflow rules are governed by the per-transaction limits already enforced by Apex.
• When flows are launched from workflow rules that are triggered by bulk loads or imports, the flows’ data manipulation language
(DML) operations are executed in bulk to reduce the number of calls required and to optimize system performance. The execution
of any of the following flow elements qualifies as a DML operation: Create Records, Update Records, or Delete Records.
For example, suppose that you use Data Loader or the Bulk API to update 50 records, and those updates meet the criteria of a
workflow rule with a flow trigger action. In response, the system executes 50 instances of the flow within the same transaction. Each
instance of a running flow is called an interview. The system attempts to execute each DML operation across all the interviews in
the transaction at the same time. Suppose that five of those interviews are executing the same branch of the flow, which has an
Update Records element called “SetEntitlement.” The system waits for all five interviews to reach that element, and then executes
all five record updates in bulk.

• Flow triggers aren’t available in change sets.


• Flow triggers aren’t packageable.

709
Automate Your Business Processes Modify Process Automation Settings

Modify Process Automation Settings


Enable or disable features related to flows, processes, workflow rules, and approval processes.
EDITIONS
User Permissions Needed Available in: Lightning
To edit process automation settings: Customize Application Experience and Salesforce
Classic

Processes and flows are


• Identify Your Salesforce Org’s Default Workflow User available in: Essentials,
• Override the Sender for Email Approval Notifications Professional, Enterprise,
Performance, Unlimited,
• Let Users Respond to Approval Requests via Email
and Developer Editions
• Let Users Pause Flow Interviews
Approvals and Workflow are
• Restrict Who Can Resume Shared Flow Interviews available in Enterprise,
• Enable Lightning Runtime for Custom Buttons and Links Performance, Unlimited,
• Require Access to Automation Home Charts (Beta) and Developer Editions

• Control What Happens When a Flow Tries to Set Values for Read-Only Fields
• Control Who Receives Flow and Process Error Emails
• Deploy Processes and Flows as Active

710
INDEX

Next Best Action, Strategy Builder, Action Strategies 656


A Next Best Action, Strategy Builder, Manage Strategies 658
add Einstein Next Best Actions to Experience Builder site pages
Next Best Action, Strategy Builder, Platform Status Alert Event 662
686
Next Best Action, Strategy Builder, Strategy Connections 683
Next Best Action, Strategy Builder, Tour the Interface 657
E
Einstein Next Best Action, NBA 644 S
Einstein Next Best Action, NBA, Strategy Builder 639
Strategy Builder Branch Merge Element; Next Best Action 681
Einstein Next Best Action, Strategy Builder, Troubleshoot 661
Strategy Builder Branch Selector Element; Next Best Action 682
Strategy Builder Enhance Element; Next Best Action 667
F Strategy Builder Filter Element; Next Best Action 674
Flow Strategy Builder First Non-empty Branch Element; Next Best Action
delivering to users 155 683
delivering to users, external 182, 184 Strategy Builder Generate Element; Next Best Action 670
delivering to users, internal 161, 171 Strategy Builder Limit Reoffers Element; Next Best Action 678
embedding in Visualforce pages 171, 184 Strategy Builder Load Element; Next Best Action 673
launching from processes 185 Strategy Builder Map Element; Next Best Action 679
process action 185 Strategy Builder Sort Element; Next Best Action 680
sharing 155, 161, 171, 184 Suggested Action component 686
N V
NBA, Einstein Next Best Action, strategy builder, elements 665 Visualforce
NBA, Einstein Next Best Action, Strategy Builder, Expressions 675 embedding flows 171, 184
nba, einstein next best action, strategy builder, recommendations Voice
655 create permission set 164
Next Best Action, Setup, Implementation 640

711

You might also like