Flow types, before-save vs after-save, $Record__Prior, bulkification, fault paths, scheduled paths, invocable Apex and Flow vs Apex - with examples.
By Bhanu Pratap SinghLast reviewed 2026-10-2518 min read14 questions6 Beginner6 Intermediate2 Advanced
Level
Flow is now the first tool Salesforce expects you to reach for: Workflow Rules and Process Builder are retired, and every new admin and developer role asks about it. These are the Flow questions that come up again and again, each answered the same way - what it is, why it matters, an example, and the short version to say out loud.
Q1BeginnerFlow basics
What is Flow, and what are the types of flow?
1What it is
Flow is Salesforce's point-and-click automation tool. You build logic from elements - get records, decide, loop, assign, create and update - on a canvas instead of writing code. There are five types, told apart by what starts them.
2Why it matters
Choosing the type is the first design decision, and it decides what the flow can do: only a screen flow can show a form, and only a record-triggered flow runs on its own when data changes.
3Example
4In short - say this in the interview
Flow is no-code automation. Screen flows run when a user clicks, record-triggered flows when a record is saved, schedule-triggered flows at a set time, platform event-triggered flows when an event arrives, and autolaunched flows when Apex, a button or another flow calls them.
Common mistake
Calling every flow "a Process Builder". Process Builder is a retired, separate tool.
Likely follow-ups
Which type would you use for a guided form on a record page?
Can an autolaunched flow show a screen? (No.)
Q2BeginnerRecord-triggered
What is the difference between a before-save and an after-save record-triggered flow?
1What it is
A before-save flow ("Fast Field Updates") runs before the record is written and can only change fields on that same record. An after-save flow ("Actions and Related Records") runs after the save, when the record has its Id, and can work with other records and run actions.
2Why it matters
Before-save flows need no extra DML, so Salesforce says they are up to 10 times faster. After-save flows are needed for anything beyond the record itself - related records, emails, approvals, subflows.
3Example
Before-save
After-save
Optimize for
Fast Field Updates
Actions and Related Records
Change the triggering record
Yes, free - just assign
Only with an Update Records element (extra DML)
Create or update other records
No
Yes
Send email, call a subflow or Apex action
No
Yes
Record Id on create
Not yet
Yes
4In short - say this in the interview
Before-save changes the same record with no DML and is the fastest option. After-save runs once the record is saved, so it can update related records and run actions.
Common mistake
Using an after-save flow with Update Records to set a field on the same record. It costs a DML and saves the record again - use before-save.
Likely follow-ups
Which runs first, a before-save flow or a before trigger? (The flow.)
Can a record-triggered flow run on delete? (Yes - it runs before the record is deleted.)
Q3IntermediateRecord-triggered
What are $Record and $Record__Prior, and how do you run a flow only when a field changes?
1What it is
$Record is the record that started the flow, with its new values. $Record__Prior holds the values from before the update, so the flow can compare old and new - the Flow version of Trigger.old.
2Why it matters
Most automation should run when something changes, not on every save. Without the comparison, a flow that sends an email when a deal is won sends it again every time the won deal is edited.
3Example
Entry condition: Stage just became Closed Won · Formula
The simpler way, with no formula: set the entry conditions to Stage Equals Closed Won and choose "Only when a record is updated to meet the condition requirements". The flow then runs once, when the record moves into the condition - not on every later edit.
4In short - say this in the interview
$Record is the record now, $Record__Prior is how it was before the update. Use them, or the "only when updated to meet the condition requirements" option, so the flow runs on the change and not on every save.
Common mistake
Choosing "every time a record is updated and meets the condition" for a one-time action like an email or a task.
Likely follow-ups
Is $Record__Prior available on create? (No - there is no prior version.)
What is ISCHANGED's equivalent in Apex?
Q4IntermediateDesign
When would you use Flow, and when Apex?
1What it is
Flow first for most record automation, approvals, guided screens and simple integrations; Apex when the logic is complex, the data volume is large, or you need something Flow cannot do well.
2Why it matters
Admins can read and change a flow without a developer, so it is cheaper to maintain. But a flow with hundreds of elements is harder to test and debug than the same logic in a tested Apex class.
3Example
Choose Flow when...
Choose Apex when...
Field updates and related records on save
Complex logic: nested conditions, many objects, heavy maths
Guided forms and wizards (screen flows)
Large volumes: thousands of records, Batch Apex
Admins need to own and change it
Fine control of the transaction, errors and retries
Simple callouts through actions
Complex integrations, custom REST services
Scheduled reminders and follow-ups
Unit tests with assertions are a must
The best answer is often both: a flow for the business steps, calling an invocable Apex method for the one hard part.
4In short - say this in the interview
Use Flow first - it is faster to build and admins can maintain it. Move to Apex for complex logic, big data volumes, or fine control of errors and testing - and combine them with invocable Apex.
Common mistake
Answering "Apex is always better" or "Flow is always better". Interviewers want the trade-off.
Likely follow-ups
How many record-triggered flows should one object have?
Who maintains automation in your current team?
Q5IntermediatePerformanceGovernor limits
Do flows hit governor limits? How do you bulkify a flow?
1What it is
Yes. A flow runs inside the same transaction as Apex and shares its limits: every Get Records is a SOQL query and every Create, Update or Delete Records is a DML statement.
2Why it matters
Salesforce bulkifies record-triggered flows automatically: when 200 records are saved, the same element is grouped across all 200 flow runs, so one Get Records still costs one query. But an element inside a Loop runs once per item, and breaks the limits just like SOQL in an Apex loop.
3Example
✗ Wrong: query and save inside the loop
Loop over Contacts
├─ Get Records: the contact's Account <- one query per contact
└─ Update Records: the Account <- one DML per contact
✓ Right: query once, save once
Get Records: all the Accounts you need <- one query
Loop over Contacts
└─ Assignment: change values, add to a collection
Update Records: the whole collection <- one DML
Flows share governor limits with Apex. Record-triggered flows are bulkified by the platform, but never put Get Records or Create, Update or Delete Records inside a Loop - collect into a collection and act once after it.
Common mistake
Thinking flows are free because they are no-code. They count against the same 100 queries and 150 DML statements.
Likely follow-ups
How would you find which flow used the queries? (Debug logs.)
What is a collection variable?
Q6IntermediateError handling
How do you handle errors in a flow?
1What it is
With a fault path: a separate connector from an element (Get, Create, Update, Delete Records, actions) that the flow follows if that element fails. {!$Flow.FaultMessage} holds the error text.
2Why it matters
Without a fault path, a failed element shows the user a generic "An unhandled fault has occurred" message and emails the admin. With one, you can log the error, show a clear message or try another route.
3Example
A fault path on Create Records
Create Records: Invoice
├─ success ──> next step
└─ fault ────> Create Records: Error_Log__c
Message = {!$Flow.FaultMessage}
──> Screen: "We could not create the invoice. The team has been told."
4In short - say this in the interview
Add a fault connector to every element that can fail, log {!$Flow.FaultMessage} to an error object, and show the user a clear message instead of an unhandled fault.
Common mistake
Leaving fault paths off and relying on the "unhandled fault" emails nobody reads.
Likely follow-ups
Can a before-save flow have a fault path? (It has no elements that need one.)
How do you roll back changes in a screen flow? (Roll Back Records element.)
Q7BeginnerDesign
What is a subflow, and why use one?
1What it is
A flow called from another flow with the Subflow element. It takes input variables, does its job, and can return output variables.
2Why it matters
The same logic - creating a case, sending a notification, calculating a discount - is built once and reused by many flows. Change it in one place instead of in ten.
A subflow is a reusable flow called from other flows, with inputs and outputs - build shared logic once and reuse it.
Common mistake
Copying the same ten elements into every flow that needs them.
Likely follow-ups
What must a variable be marked as to pass into a subflow? (Available for input.)
Can a before-save flow call a subflow? (No.)
Q8IntermediateRecord-triggeredAsync
What are scheduled paths and the Run Asynchronously path?
1What it is
Extra paths on an after-save record-triggered flow that run later. A scheduled path runs at a time relative to the save or to a date field. The Run Asynchronously path runs right after the transaction commits, in the background.
2Why it matters
They replace time-based workflow: "remind the owner 3 days before the close date" needs no scheduled Apex. The asynchronous path is where callouts and slow actions go, so they do not slow down the user's save.
3Example
Path
Runs
Example
Run Immediately
In the same transaction
Update related records
Run Asynchronously
Just after commit, in the background
Call an external API
Scheduled path
At a set time, for example 3 days before Close Date
Reminder task to the owner
On an update-triggered flow, scheduled paths need the entry option "Only when a record is updated to meet the condition requirements" - otherwise every edit would schedule another run.
4In short - say this in the interview
Scheduled paths run an after-save flow's actions at a set time relative to the save or a date field; the asynchronous path runs them in the background right after commit - the place for callouts.
Common mistake
Building a scheduled Apex job for a simple "X days before" reminder.
Likely follow-ups
What happens to a pending scheduled path if the record no longer meets the conditions?
How are scheduled paths processed? (In batches - 200 records by default.)
Q9IntermediateFlow and Apex
How do you call Apex from a flow?
1What it is
Mark a public static method with @InvocableMethod. It then appears in Flow Builder as an Action. It takes a List and returns a List, so it is bulk-safe by design.
2Why it matters
It lets a flow do the one thing Flow is bad at - a complex calculation, a tricky query, a callout - while the rest of the process stays point-and-click.
3Example
DiscountAction.cls · Apex
publicwithsharingclassDiscountAction {
publicclassRequest {
@InvocableVariable(required=true) publicId opportunityId;
}
publicclassResult {
@InvocableVariablepublicDecimal discount;
}
@InvocableMethod(label='Calculate Discount' description='Works out the discount for an opportunity')
publicstaticList<Result> calculate(List<Request> requests) {
Set<Id> ids = newSet<Id>();
for (Request r : requests) ids.add(r.opportunityId);
Map<Id, Opportunity> opps = newMap<Id, Opportunity>(
[SELECTAmountFROMOpportunityWHEREIdIN :ids]); // one query for allList<Result> results = newList<Result>();
for (Request r : requests) {
Result res = newResult();
Opportunity o = opps.get(r.opportunityId);
res.discount = (o != null && o.Amount > 100000) ? 10 : 0;
results.add(res); // same order as requests
}
return results;
}
}
4In short - say this in the interview
@InvocableMethod turns an Apex method into a Flow action. It takes and returns a List - one entry per flow interview - so query once for all of them and return results in the same order.
Common mistake
Querying inside the loop over requests. When 200 records fire the flow, the method gets all 200 in one call.
Likely follow-ups
How many invocable methods can one class have? (One.)
How do you call a flow from Apex? (Flow.Interview.)
Q10AdvancedDesignOrder of execution
If an object has several record-triggered flows, which runs first?
1What it is
You set it. Each record-triggered flow has a Trigger Order value from 1 to 2,000; flows on the same object and timing run from lowest to highest. Flow Trigger Explorer shows them all in order.
2Why it matters
When two flows change the same field, or one depends on another's result, the order decides the outcome. Without a set order, the result can change from one release to the next.
3Example
Before-save flows run before Apex before triggers; after-save flows run after Apex after triggers.
Within each timing, flows with a Trigger Order of 1 to 1,000 run first, lowest number first.
Then flows with no Trigger Order, then those from 1,001 to 2,000.
Two flows with the same number run in alphabetical order of their API name.
4In short - say this in the interview
Set a Trigger Order from 1 to 2,000 on each record-triggered flow and check it in Flow Trigger Explorer. Before-save flows run before before triggers; after-save flows run after after triggers.
Common mistake
Building a new flow for every requirement until one object has twenty, all touching the same fields.
Likely follow-ups
How many record-triggered flows per object would you aim for?
Where do flows sit in the order of execution?
Q11BeginnerScreen flows
Where can you use a screen flow?
1What it is
A screen flow shows forms to a user. You can place it on a Lightning record or home page, launch it from a quick action or button, add it to a utility bar, put it on an Experience Cloud site, or embed it in an LWC.
2Why it matters
Screen flows replace many small custom pages: guided case creation, onboarding checklists, a "log a call" wizard - built by an admin, with no code.
Pass recordId in as an input variable so the flow knows which record it was opened from.
4In short - say this in the interview
Screen flows can go on record and home pages, quick actions, the utility bar, Experience Cloud sites and inside LWC - pass recordId in so the flow knows its context.
Common mistake
Forgetting that a screen flow runs as the user by default, with their permissions - unless the flow is set to system context.
Likely follow-ups
How do you build a custom screen component? (An LWC exposed to lightning__FlowScreen.)
What does the Roll Back Records element do?
Q12AdvancedSecurity
Does a flow run in user mode or system mode?
1What it is
It depends on the type and the setting. Record-triggered and schedule-triggered flows run in system context. Screen and autolaunched flows run in user context by default, and can be set to system context, with or without sharing.
2Why it matters
A screen flow in system context without sharing can read and change records the user cannot see - useful for a controlled action, dangerous if it shows data on screen.
3Example
How the flow runs
Object and field permissions
Record sharing
User context (a screen flow launched by a user, by default)
The user's
The user's
System context with sharing
Ignored
The user's - only records they can see
System context without sharing
Ignored
Ignored - all data
Record- and schedule-triggered flows
Ignored
Ignored - always system context
4In short - say this in the interview
Record- and schedule-triggered flows run in system context. Screen and autolaunched flows run as the user by default, and can be switched to system context with or without sharing - choose without sharing only on purpose.
Common mistake
Setting a screen flow to system context without sharing to "fix" a permission error.
Likely follow-ups
What is the Apex equivalent of system context with sharing?
How do you give one screen flow extra access safely?
Q13BeginnerDebugging
How do you debug a flow?
1What it is
With the Debug button in Flow Builder, which runs the flow and shows every element, decision and variable value; with debug logs for record-triggered flows in a real save; and with the fault emails and Paused and Failed Flow Interviews page.
2Why it matters
Flows fail quietly inside a save shared with Apex and other flows. Knowing where to look is the difference between a five-minute fix and a lost afternoon.
3Example
Flow Builder → Debug: choose a test record, tick "Run flow as another user" if permissions matter, and read the step-by-step output.
A debug run can use rollback mode, so its changes are undone and no test data is left behind.
In a real save, open a debug log with the Workflow category set to FINER to see each flow element run.
Check Setup → Paused and Failed Flow Interviews for flows that stopped.
4In short - say this in the interview
Use the Debug button in Flow Builder, debug logs for record-triggered flows, and the fault emails and failed interviews page in Setup.
Common mistake
Testing a flow only as a System Administrator, who can see everything.
Likely follow-ups
How do you test a flow automatically? (Flow tests, or Apex tests that save records.)
Do flows count toward Apex code coverage? (No.)
Q14BeginnerMigration
How do you move Workflow Rules and Process Builder to Flow?
1What it is
With the Migrate to Flow tool in Setup, which converts a workflow rule or process into a record-triggered flow, then you test it, activate the flow and deactivate the old automation.
2Why it matters
Salesforce ended support for Workflow Rules and Process Builder at the end of 2025. Old automation still runs, but it gets no fixes, and every org is expected to move.
3Example
Inventory every workflow rule and process per object.
Run Migrate to Flow on each one, and combine logic for the same object where it makes sense.
Move field updates on the same record to before-save flows.
Test in a sandbox with bulk data, then activate the flow and deactivate the old rule in the same release.
4In short - say this in the interview
Use the Migrate to Flow tool, consolidate per object, put same-record updates in before-save flows, test with bulk data, then switch over in one release.
Common mistake
Leaving the old rule active next to the new flow - both run, and every update happens twice.
Likely follow-ups
What cannot be migrated automatically?
How would you migrate an object with 15 processes?
Answers describe documented behaviour, checked against the sources listed. Platforms change between releases - confirm limits and versions before an interview.