Skip to main content
James K.k a posé une question dans #Salesforce Platform

I’m working with a Salesforce Flow that processes a relatively large number of records, and I’m looking for ways to improve its performance and reliability. 

 

The Flow currently performs several record queries and updates during execution. As the amount of data increases

,

the Flow takes longer to complete and can sometimes approach Salesforce governor limits. 

 

What are some recommended approaches for optimizing a Flow in this situation? For example, would reducing Get Records operations, using collections more effectively, or moving some logic to Apex help? 

 

I’d appreciate any practical suggestions or best practices for designing scalable Salesforce Flows. 

 

#Salesforce Platform  #*saleforce Platform Basic* - Understand The Salesforce Architecture  #Flows  #Slack Developers  #Automation

4 réponses
  1. 16 oct., 13:30

    The first thing to check is whether the Flow is querying or updating records inside a loop. That can quickly become a problem as record volumes grow. 

     

    A few things that usually help: 

     

    • Move Get Records and Update Records operations outside loops wherever possible.
    • Use record collections to process multiple records together instead of updating them one at a time.
    • Filter queries carefully and retrieve only the fields and records you need.
    • If the logic involves complex processing or large data volumes, consider Apex or Batch Apex. Salesforce Flow isn’t always the best fit for every workload.

    One other thing to consider: if a significant part of the Flow handles lead-to-account matching or lead assignment, you may be able to move that responsibility to a dedicated tool rather than maintaining all the logic in Flow. LeadAngel, for example, handles lead-to-account matching, deduplication, and lead routing alongside Salesforce. That won't fix inefficient Flow queries directly, but it may help simplify the routing and matching logic your team needs to maintain. 

     

    I’d start by checking the Flow’s debug details and identifying which queries or updates are consuming the most resources before deciding whether to refactor it or move part of the processing to Apex. 

0/9000