Salesforce Orchestration Flow | Create Record Triggered Orchestration Flow in Salesforce

The flows are the most powerful automation tool provided by Salesforce. They can be used to perform various tasks, such as field updates, sending emails, sending custom notifications, and more.

In this Salesforce tutorial, we will learn about Create Record Triggered Orchestration Flow in Salesforce. In this article, we will see the record trigger orchestration flow and when we can use it.

Additionally, we will see how to create record trigger orchestration flow in Salesforce with real-time scenarios and step-by-step explanations.

Record Triggered Orchestration Flow in Salesforce

Record Trigger Orchestration Flow launches when a record is created or updated. An orchestration lets you create a multi-step, multi-user process. Usually, we use an Apex trigger to achieve this task, but now we can also use the flow.

Orchestration is a sequence of different stages with multiple actions and elements inside, and therefore, Record-Trigger Orchestration is a kind of flow that will execute or invoke when the record is created or update the record on the basis that certain stages will be executed.

Let’s take an example: the relationship manager will be present when you open an account in the bank. Once the account is opened, you need to deposit some amount into it, which the cashier will do. Then again, as the cashier fills out the information for the deposit amount, the transaction record should be created in the transaction object.

This whole process can be automated with the help of Record Trigger Orchestration Flow by putting different stages and by putting elements into those different stages

Create Record Triggered Orchestration Flow in Salesforce

Using the above example and the following steps, we can create a record trigger orchestration flow in Salesforce.

Prerequisites:

1. We need to create two custom objects named Bank Account_c and Transactions_c.

  • Bank Account: It will be holding the information of bank account holders.
  • Transactions: It will hold the information on transactions that the bank holders have done.
See also  How to Use Lightning Email Templates in Salesforce Flow

Create Record Trigger Orchestration Flow

2. Log in to the Salesforce Org. -> Click on the Setup. -> Home Tab. -> Search for Flows. You will see an option under Process Automation. -> Click on Flows.

  • Click on the New Flow button to create a new flow.
  • Here, we are using Record Trigger Orchestration Flow. Select it and click the Create button.

3. In our scenario, the flow should trigger when the user creates a new bank account. That’s why I have selected the User in the Object field. In Configure Trigger, I have selected A Record is Created because when we update the record, the flow should trigger.

  • According to our scenario, we will not have any conditions right now, so we don’t need to Set Entry Conditions.
Create Record Triggered Orchestration Flow in Salesforce

4. Now, we will add some elements to the flow. For that, click on the + Add Element icon. Here, you will see there are only two particular kinds of elements, which are Stage and Decision.

As you select Stage Element and click on the Add Step option, you will see the following two kinds of steps:

  • Background Step: Whatever operations can be done in the background, like creating and updating a records, or sending an email, all are background operations.
  • Interactive Step: whenever we put a screen on the user’s UI, that will be the interactive step.

5. Before moving ahead, as per our scenario, whenever the bank account is created, the information should be transferred to the cashier. Here, the cashier should be able to see a particular screen on which they can fill out the required information, and a transaction record should be created related to the account.

  • To create a screen, we need to create a Screen Component, which will define some field information like Amount(Currency Field) and Date/Time. That information will be put in by the cashier. Here I have already created a screen component with the following fields.
Record Triggered Orchestration Flow in Salesforce
  • Now, we need to create a New Resource for storing the Bank Account ID. In the resource type, you need to select Variable, enter API Name, and select Data Type as Text. We will use the API Name as a value for the next element and make this resource Available for Input.
  • Once the cashier provides that information, we need to create a transaction record by clicking on the Create Records element.
See also  Auto-Deactivate Users with Schedule-Triggered Flow in Salesforce

In the Object field, we need to select which object’s record we are creating. Here, we are creating the Transaction_c object’s record.

Then, in the Field option, we need to select the transaction field, and in the Value field, we need to select the screen element value, which we get from the screen component.

Field (Transaction Object)Value
Enter AmountAmount (From Screen Component).
Account_cbankAcountId (From Variable Resource).
The Account_c field is the Lookup field that describes the relation between the Bank Account and the Transaction object.
Record Triggered Orchestration Flow in Salesforce example
  • I have saved this flow named Cashier Screen Flow and Activated the flow. We will apply this flow in the Record Trigger Orchestration Flow.

6. Then, to automate the process, we need to add stages to the flow. For that, click on the Stage Element, and before selecting the step, we need to enter the Label for the stage. Here, I have entered the Account Opening Stage. API Name will automatically populate.

  • Then, we need to select When to Complete the Step. Here, we will Select this Condition-> whenever all steps have been marked Complete. The stage mark is complete.
Create the Record Triggered Orchestration Flow in Salesforce

7. Now, we need to Add Step to the Stages Element so that, as per the scenario, when the account is created, the items should be transferred to the cashier. So the cashier is able to enter the necessary details, and a transaction record will created.

  • For that, we need to add an Interactive Step. Enter the Label for the step. API Name will automatically populate. Then apply the following CoditionWhen the stage starts, the step starts to start the step.
  • Then, in the Action to Run, we need to select the Screen Flow that we created for the cashier. Here, I have selected Cashier Screen Flow. As we select screen flow, we need to select input values. Here, we need to select $Record > Bank Account_c > Record ID.
How to Create Record Triggered Orchestration Flow in Salesforce
  • Now, we need to select Assignee Type. I have selected User, which means this screen will be visible to the user we will select in the next option. Here, select a User with a Salesforce Licence.
  • Then select where we want to happen this interactive screen. Here, I have selected Bank Account Record.
  • When the screen flow is completed, this step also gets marked as complete.
Creates Record Triggered Orchestration Flow in Salesforce

8. After setting up all labels and conditions, click the Save button to save the flow. For that, we need to enter the Flow Label. The API Name will automatically populate as we click the text box. The Description is optional; we can introduce our flow Shortly.

  • After Saving the flow, click on the Debug button. Then click on the Activate button; always remember to debug the flow before activating it. It’s good practice to use flow.
How to Create Record Triggered Orchestration Flow in Salesforce

This is how we can Record Triggered Orchestration Flow in Salesforce.

See also  Email-to-Lead Using Salesforce Flow - Complete Guide

Conclusion

I hope you have gotten an idea about record trigger orchestration flow in Salesforce. In this article, we have seen the record trigger orchestration flow and when we can use it. Additionally, we have seen how to create record trigger orchestration flow in Salesforce with real-time scenarios and step-by-step explanations.

You may like to read: