Consider this Apex method, is it correct?

public static void processLead(List<Lead> theLeadList) {
    System.assert(theLeadList.size() == 1);

Does Process builder pass in a single object in a list to the invocable method if I specify that parameter 'theLeadList' is the main object passed to the process?

Or do I have to handle an arbitrary list size in the method?

1 Answer 1


Because salesforce groups invocations of the process builder - say you edit 5 records in one transaction, all these records will get passed to your invocable method.

So yes, you have to handle arbitrarily large data sets.

You really need to treat it as very similar to trigger code, which also is passed lists of records that have been modified.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .