I'm evaluating Mitch Spano's trigger framework that includes the ability to invoke Flows alongside Apex actions (with neat features for ordering, bypassing, etc).
With record-triggered flows, you write the flow as if it's dealing with a single record at a time, and Salesforce handles bulkification of SOQL and DML for you. I'd like to know if that still holds true when I use this framework.
I found the section of code in the trigger framework that invokes Flows. It uses Invocable Actions like this:
public virtual List<Invocable.Action.Result> invokeAction(
String flowApiName,
List<Map<String, Object>> inputs
) {
Invocable.Action action = Invocable.Action.createCustomAction(
TriggerActionConstants.FLOW_STRING, // "Flow"
flowApiName // e.g. "My_Flow"
);
action.setInvocations(inputs);
return action.invoke();
}
Based on context, I can see that inputs
is a List<Map<String, Object>>
that might look something like this (if it were a JSON string):
[
{
"record": { "Id": "001AA00001AbcdeAAA", "Name": "Alphabet" }
"recordPrior": { "Id": "001AA00001AbcdeAAA", "Name": "Google" }
},
{
"record": { "Id": "001AA00001ZyxwvAAA", "Name": "Meta" }
"recordPrior": { "Id": "001AA00001ZyxwvAAA", "Name": "Facebook" }
},
]
Documentation on Invocable.Action
is sparse, to say the least. So as an example: if my flow includes a single query for more data, and I perform a bulk update on 100+ records, will I incur the "Too many SOQL queries" error (given a governor limit of 100 SOQL queries per transaction)?