Flow Interview Questions
What are Salesforce Flows?
Salesforce Flow is an automation tool that allows users to easily create and optimize
business processes without any coding skills. With Flow, you can gather and update
data, automate approval workflows, create records, and perform various tasks
seamlessly.
When to use Flow
If the requirement involves straightforward automation, such as:
Updating a field based on certain criteria.
Sending email alerts.
Performing basic calculations.
Automating record creation, updates, or deletions
When we don’t use Flow.
If the requirement involves following things
Complex Business Logic: Flows struggle with deeply nested loops, recursion, or
advanced algorithms that require Apex-level processing.
Large Data Volumes: They are limited by governor limits and are not ideal for bulk
data operations, like processing thousands of records in a single execution.
Integration Needs: While Flows support external services, they lack the flexibility of
Apex for dynamic integrations or advanced API handling.
Advanced Error Handling: Flows provide basic fault paths, but detailed error
logging or retry mechanisms are better implemented in Apex.
Complex Data Manipulations: Tasks like JSON parsing, advanced string
manipulation, or multi-object traversals are better suited for Apex.
Where we can place the flow in Salesforce?
We can place a flow in a number of locations, including
Lightning pages
Home Page
Experience Builder page
Custom Lightning components
Visualforce pages
Web tabs
Custom buttons and links
What are the different types of Flows in Salesforce
Screen Flow- An interactive Flow that collects user input or displays data
Record-Triggered Flow- Automatically runs when a record is created, updated, or
deleted.
Schedule-Triggered Flow- Executes at a specific time or on a recurring schedule.
Platform Event-Triggered Flow- Runs when a platform event message is received.
Autolaunched Flow- Runs automatically when invoked by another process, such as
a trigger, Apex, or Process Builder.
Flow Orchestration- Allows you to automate complex, multi-step business
processes involving multiple users or systems.
Difference between Before save flow and After save flow?
Before-save Flow is a trigger that is performed before an operation – such as an
insert, update, delete, etc. You can use such a Flow to check or change values
before data is updated or inserted in the database.
After-save Flow trigger, on the other hand, is executed after an operation – such as
an insert, update, etc. You can use such a Flow to update data in related objects or
send an email alert.
How to migrate process builder to flow?
Salesforce has migrate to flow tool that can help to convert process builder process
to flow
What is a Subflow?
A sub-flow is another flow that forms within the primary Flow. It promotes modular
design by allowing the creation of reusable components and logic by encapsulating
them in different Flows and managing them as sub-flows.
It allows complex logic to be reused across multiple Record-Triggered Flows without
having to be rebuilt each time.
Can we call subflow from before save flow?
No, its only available in after save flow
What are the main components of a Flow?
Elements:
Interaction Elements(Screen),
Logical Element(Assignment,Loop,Decision),
ActionElement(get,create,update,sublow,delete).
Resources:
Used to store the data within the Flow
These are the formulas, variables, constants,Collections,TextTemplate
Connectors:
These define how elements will be connected to complete a path.
What are advantages of flow over apex?
It has drag-and-drop functionality
Low-Code Platform
It has Pre-Built Elements and Templates
Easily develope and deploy
No need coding knowledge to develope
No need to worry about code maintance
No need to write testclass
What are all limitation of flows?
Total SOQL Queries per Transaction (Limit: 100)
Total DML Statements per Transaction (Limit: 150)
Total Records Retrieved by SOQL Queries(Limit:50000)
Total Number of Records Processed by DML(10000)
Maximum CPU Time on the Salesforce Servers(10seconds)
Maximum Number of Executed Elements at Runtime per Flow(20000)
Maximum 50 version per flow
Active 2000 flow per flow type.
What are all best practice should follow in flow?
No DML Statement in Loops
Make use of Subflows
Don’t Hardcode IDs
Always have fault path after get,update,create,delete elements
Always check for null after get element
How to handle the Error in flow?
You can handle the error by using fault path.
When error occurs the flow can be directed to fault path where you can define how
the error can be handle like send email or custom error message.
By using {$Flow.FaultMessage} we can retrieve error message
Can we restore the deleted flow?
No, Once a flow is deleted, it’s permanently removed from your Salesforce
organization.
How to Run a Flow in which mode?.
By default, Screen Flow runs in user mode. But Salesforce provides an ability to runs
it in system mode.
Record-Trigged Flow always runs in system mode.
Scheduled-Trigged Flow always runs in system mode
How to change the context of screen Flow?
Click Show Advanced > How to Run the Flow, then you have two extra options –
System Context with or without sharing.
Can you Debug Flow As Another User?
You can test or troubleshoot a flow as another user in flow without having to login as
that user. First, you need to enable the Enable Let admins debug flows as other
users feature in Process Automation Settings. Note: You must have Manage Flow
and View All Data permissions to impersonate other users during a Flow debug run.
Then, check the option Run flow as another user and select the user you want to
impersonate.
How to check flows which have failed in salesforce?
By using Setup-> Process Automation->‘All Failed Flow Interviews List View’. This
list view will show a list of any Screen Flow, Record-Triggered Flow, or Schedule-
Triggered Flow that runs into issues, as well as any Autolaunched flows that aren’t
triggered.
What is Collection Filter?
The Collection Filter is used to create a new collection variable that contains a
filtered subset of an original collection’s contents
What are $Record and $Record__Prior in Flow?
In Flow, $Record represents current values of record $Record__Prior that holds the
values of record before the update, which is useful for comparing the old values to
the new ones in $Record.
How to pass a record id to flow from Lightning record Page
To pass a record ID from a Lightning record page to a flow in Salesforce, you
can create a flow variable and select the Pass all field values from the record into
this flow variable option
Click New Resource
Select Variable as the resource type
Enter an API name
Select the object to pass the record ID to
Check the Available for Input checkbox
Click Done
On the app builder page, drag and drop the Flow element
Select the relevant flow to display
Select Pass all field values from the record into this flow variable
We cannot variable from App Page or Home Page
What is the transform element in Salesforce Flow?
The Transform element in Flow is used to map and convert source data to target
data. It can be utilized in screen flows, auto-launched flows without triggers, and
record-triggered flows.
How can we see screen components based on certain logic?
All screen flow components can also have their visibility set based on customized
logic by using Set component visibility option
Can we Flow Call apex?
Yes, we can call Apex from a flow in Salesforce:
Create an invocable method in the Apex class
Add the @invocableMethod annotation to the method
Add an Apex Action to your flow
Select the invocable method
Set the input and output parameters
What are all key consideration we have to keep in mind while calling apex from
flow?
Each class can only have one invocable method
The method must be static and public or global
The method's class must be an outer class
The method can only have one parameter
The parameter's data type must be a list
The method's return data type must also be a list
Can Apex Call autolaunched flow?
Yes, Apex can call a flow in Salesforce: To call a flow from Apex, you can create an
instance of the FlowInterview object using
the Flow.Interview.flowName syntax. Then, use the start() method to trigger the
flow. You can retrieve flow variables for a specific flow in Apex using
the getVariableValue method in the Flow.Interview Apex class
Can Flow call from LWC?
Yes ,Steps to call a Salesforce Flow from LWC:
Create a new Flow or use an already created Flow.
Create a LWC Component
Pass the Flow name in the <lightning-flow> tag.
Can LWC call from Flow?
Yes, we can call Lightning Web Components (LWCs) from flows in Salesforce,
starting with the Winter 2023 release
Add a lightning_FlowScreen target to the LWC's meta file. You can also
use @api in the LWC's JavaScript to expose attributes.
Is it possible to do HTTP callouts from flow?
Yes we can do
To do an HTTP callout from Flow, you can:
Create a permission set
Create an External Credential
Create an External Credential Principle
Create a Named Credential
Map External Credential Principle and Permission set
Create Salesforce Flow using “Create HTTP callout” element
Test Salesforce Flow to check HTTP Callout
Can we Log Emails Sent with the Send Email Action?
Yes users can now send emails using the “Send Email” action, and these emails will be
automatically logged in the Activity Timeline of the recipient records. Recipient records
include leads, contacts, and person accounts. This makes it easier to keep track of email
communication with individual people.
What is Repeater component in screen flow?
It’s a Summer 24 releaseThe repeater is a component you can add to your screen
element that houses various data entry components. The component comes with two
buttons: Add and remove. When the user clicks the add button, the component
displays another set of input fields. When the user clicks the remove button the
component removes one set of fields on the bottom. Using this component, the user
can enter information into multiple record fields on the same screen .
Usecase Create multiple Contact records
Can we add Google Map in address field in flow?
Yes we can do. It’s a Summer 24 release.
What frequencies can we set in Schedule Triggered Flow?
Schedule Triggered Flow can be triggered at the frequency of once, daily and
weekly.
Thank You