+ Start a Discussion
Andrew GAndrew G 

Process Builder & DML & SOQL query limits question

Hi all

I understand the concepts and best practice for process builders, but i want to deepen my understanding.
This help file:
"Each Create a Record action uses one DML statement. Each Quick Action action uses one DML statement. Each Update Records action uses one SOQL query and one DML statement. "

With reference to the terms "Quick Action" and "Update Records", what is the difference? Is a Quick Action an update to the record that starts the process builder, and an Update Records is an update to a related record? (hence the SOQL to find the record, before we update it  - the DML)

Am I to assume that the Update Record action consumes one SOQL because I need to find the record first?  Does the SOQL occur if the Update Record is happening to the record that started the Process Builder? 

Consider this Process Builder :
User-added image

Do I assume that in Decision Point 1 , since I am doing 3 x Immediate Actions (IA) with each being an Update , that this Decision Point will result in 3 x DML and 3 x SOQL ?  Or is an update to the record which started it a Quick Action and hence only 3 x DML?

Next question to consider, if I have criteria around a IA which is an update, and the IA does not meet that criteria, and therefore does not execute the update, does this count as a SOQL?  but obviously no DML.

This is in consideration that I have inherited a process builder which is getting a too many SOQL query or CPU timeout errors.  I have reviewed the process builder, but before i start a rebuild (it is quite complex), i just want to get some clarity.

VinayVinay (Salesforce Developers) 
Hi Andrew,

Best way to debug too many SOQL query or CPU timeout errors,  Firstly, Set up the Debug Logs and Debug Levels filter in “Finer” level for Workflows and replicate the issue.

Below are flow debug events.
> WF_FLOW_ACTION_BEGIN indicates that the flow transaction is started.
> WF_FLOW_ACTION_END indicates that the flow transaction is ended.
> FLOW_CREATE_INTERVIEW_BEGIN event creates our process to execute. It includes our process’ number which is automatically appended to the end of our process name.
> FLOW_CREATE_INTERVIEW_END event indicates our process name.
These two events are used to create our process.
> FLOW_START_INTERVIEW_BEGIN event indicates that it is beginning of the process.

Review below links for more information on how to Debug Process Builder. 


Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Vinay Kumar