Bulk-safe, error-aware, debuggable
Keep data elements out of loops, handle faults, use flow tests, and name things clearly. These habits separate dependable automation from fragile automation.
- BulkCollections, filters, transforms and limits.
- ErrorsFault paths and logging.
- QualityDebugging, flow tests and naming.
Flows share the same governor limits as Apex, so a badly built flow can break saves for everyone. These questions check that you build bulk-safe flows, handle errors gracefully and can debug when something goes wrong.
1. Why must you avoid Get, Create or Update Records inside a loop?
Loop pattern
Processing many records?
- Bad: data element inside the loopOne query or DML per record → hits 100 SOQL / 150 DML limits
- Good: Assignment inside the loopAdd each changed record to a collection variable
- Then one Update Records after the loopA single DML for the whole collection
2. Which elements reduce the need for loops?
Collection Filter (keep records matching conditions), Collection Sort, Transform (map one collection to another), and Update Records with conditions (update all records matching criteria without fetching them first). Fewer loops means simpler, faster flows.
3. What are fault paths and why use them?
A fault path is a connector that runs when a data element or action fails — for example a validation rule blocks an update. Use it to log the error ($Flow.FaultMessage), show a friendly message on a screen, or notify an admin. Without fault paths, users see a generic “unhandled fault” error and admins get a cryptic email.
4. How do you debug a flow?
Debugging steps
- ReproduceNote the record, user and inputs
- Debug in Flow BuilderRun with inputs, step by step, rollback mode
- Read the pathWhich decisions and values were taken
- Check errorsFault emails, debug logs, Flow Error Logs
- Fix & testNew version, flow tests, then activate
5. What are flow tests?
Built-in tests for record-triggered flows: you define the triggering record (and prior values for updates) and assertions on the outcome, then run them in Flow Builder or as part of deployments. They protect flows from regressions like Apex tests do.
6. Which limits apply to flows?
Flows run inside the transaction and share Apex governor limits: 100 SOQL (Get Records) and 150 DML statements per transaction, 2,000 executed elements per flow interview (older limit, removed in recent releases but large loops still cost CPU time), and CPU time. Schedule-triggered and async paths get their own transactions.
7. What naming and documentation practices help?
Name flows by object and purpose (Opportunity_AfterSave_ClosedWonTasks), give every element a clear label and description, keep one record-triggered flow per purpose with entry conditions, and record flow ownership. Future you — and the interviewer — will thank you.
8. How do you make flows safe for bulk data loads?
Assume 200 records at a time: no data elements in loops, use entry conditions to skip unnecessary records, move heavy work to scheduled or asynchronous paths, and test with a bulk data load in a sandbox before going live.
Remember
Key points
- No data elements in loops
Assign, then one DML.
- Fault path on every data element
Log and inform users.
- Same limits as Apex
Flows share the transaction.
- Flow tests
Regression safety for record flows.
Interview drill
Follow-up questions
What the interviewer asks after your first answer. Turn on practice mode, answer each one aloud, then reveal.
-
1 What is rollback mode in flow debugging? Basic
A debug option that runs the flow and rolls back any data changes, so you can test safely in a sandbox or even production.
-
2 How do you log flow errors for admins? Intermediate
On fault paths, create a custom Error Log record with the flow name, record Id and $Flow.FaultMessage, or publish a platform event that a logging flow handles.
-
3 Why can an Update Records with conditions be better than a loop? Intermediate
It updates all matching records in one DML without querying and looping, using fewer elements and limits.
-
4 How do you deploy flows safely? Basic
Build in a sandbox, add flow tests, deploy with change sets, DevOps Center or the CLI, and activate the new version in production after verification.
-
5 What causes “The flow tried to update these records: null”? Intermediate
An Update Records referencing a variable that was never set (for example a Get Records that found nothing). Check for null with a Decision first.
-
6 How many active record-triggered flows should an object have? Advanced
As many as needed but organised: focused flows with tight entry conditions and explicit trigger order are fine; avoid duplicated logic and conflicts.