Skip to main content
Matteo Rossi a posé une question dans #Salesforce Developer

I’m working on a Salesforce org with several Flows, Apex triggers, and scheduled automations. As the amount of data grows, some processes are taking longer to complete and a few users are seeing delays during record updates. I’d like to understand which areas I should check first, such as Flow design, Apex execution, SOQL queries, or automation order. What tools or best practices do you recommend for finding the main performance bottleneck? 

 

#Salesforce Developer  #Automation

2 réponses
  1. 2 sept., 11:11

    Hi Matteo , 

    The best approach is to measure first and optimize the actual bottleneck rather than focusing on only Flow or Apex.

    I would start with Salesforce Debug Logs and reproduce the slow record update. Then check:

    1. CPU time – Look for high CPU consumption across the complete transaction.
    2. SOQL queries – Avoid SOQL queries inside loops and make sure queries are selective.
    3. DML operations – Bulkify inserts, updates, and deletes instead of performing DML repeatedly inside loops.
    4. Flows – Check for unnecessary Get Records, Update Records, and large loops. Move queries outside loops and perform collection-based updates.
    5. Apex triggers – Ensure triggers are bulkified and avoid repeated queries or DML.
    6. Automation order – Review all Flows and Apex that execute during the same transaction because multiple automations can contribute to the same CPU and governor limits.
    7. Scheduled automation – Review the volume of records processed and consider Batch Apex or other asynchronous processing for large workloads.
0/9000