Salesforce Flow

Salesforce Flow, is a tool with low code or low code used to automate complex business processes.

Scenarios with Implementation

Screen Flow : CRUD Operation In Salesforce Flow.

Screen Flow : Show all account related opportunity in flow – Send email to selected opportunity.

Screen Flow : Create a flow – Suppose that there is field on Account as – Status – Options(Selected,Rejected) and there is field on Contact – Status – Options(Selected,Rejected) when we make change on account status field all related Contact Status field should be updated.

Record Trigger Flow : Automatically send email to related Contact on creation of new Case.

Screen Flow : How to use Lookup in Screen flow.

Screen Flow : Create a flow that creates a case with user entered information like case origin, status, Account, Contact, type, etc and after creation of case post to chatter. Add flow to the home page.

Screen Flow : Create a flow that creates an Account with user entered information like first name, last name, phone number, Email id, Address, etc and Check phone number contains country code or not and the number is valid no or not. If not then show the error.

Screen Flow :Create a flow to automate If lead source equals ‘Web’, annual revenue is greater than 15K and website is not null then update lead status as ‘Working – Contacted’.

Screen Flow : If a case has been open for more than 3 days with ‘Not Started’ status then an email should be sent to the Case Manager.

Screen Flow : With the help of screen flow if case is created and if you want to assign this case to any user or queue based on some criteria like record type of case or any other criteria if possible. 

Record Trigger Flow : By using record trigger flow call apex method whenever Account field get updated.

Screen Flow : Show N number of case records in screen flow using data table. On the next screen allow user to update/ change selected record case owner. 

Record Trigger Flow : By With record trigger flow if case is rejected or pending then you can post it on chatter with reason for rejection or pending.

About Salesforce Flow

Salesforce Flow is the main automation tool on the Salesforce platform. It lets admins and developers build business logic with a visual designer instead of writing code. Flow replaces the older Workflow Rules and Process Builder, which Salesforce has retired, so new automation should be built with Flow.

Types of flows

  • Screen Flow: shows screens to a user and collects input. Use it for guided forms, wizards and quick actions. Several scenarios above are Screen Flows.
  • Record-Triggered Flow: runs automatically when a record is created, updated or deleted. It can run before the record is saved (fast field updates on the same record) or after it is saved (create related records, send emails, call actions).
  • Schedule-Triggered Flow: runs at a set time and frequency on a batch of records, for example a nightly clean-up.
  • Autolaunched Flow: has no screen and no trigger of its own. It is started from another flow, from Apex, or from a button, and is useful for reusable logic.
  • Platform Event-Triggered Flow: starts when a platform event message is received.

Flow or Apex?

Start with Flow when the logic is a straightforward set of conditions, updates and notifications, because it is faster to build and easier for admins to maintain. Choose Apex when you need complex calculations, heavy data processing, callouts with special handling or logic that is easier to test and version as code. Many projects use both: a Flow for the main process and an invocable Apex action for the hard part.

Best practices

  • Give every flow, element and variable a clear name, and add descriptions.
  • Keep one record-triggered flow per object and trigger type where you can, and use entry conditions so the flow runs only when needed.
  • Do not put Get Records, Create, Update or Delete elements inside a loop. Collect the records in a collection and run one DML element after the loop.
  • Use fault paths so errors give a clear message instead of failing silently.
  • Test with a single record and with many records, and use the Debug option before you activate.
  • Remember the governor limits, which also apply to flows: the same limits as Apex run in the same transaction.

Use the scenarios above to practice, then try rebuilding the same logic as an Apex trigger to understand the trade-offs. This comparison is a common interview question.