So the way Process Builder "bulkifies" the records is that it actually runs X interviews each for the loaded records. So if you load 100 records, PB is running 100 interviews with 1 record each and NOT 1 interview with the 100 records.
This is why you see 1 record in the Log. It has always been an issue that the Debug Logs are pretty much useless in this scenario because it will either jumble everything up so there is no way you can see a linear flow OR it drops all the records and shows you just 1.
Since you mentioned something about rolling up the values it sounds like you need to have the 100 records go through together as in a Collection variable. You can do this 1 of 2 ways.
A. Instead of having the PB actually fire the flow for the loaded records, you would have it flag a field in each of the records "Update Me". Then you have a scheduled flow execute that finds all the "Update Me" records, puts them into an Sobject Collection, then loops through and does what you want it to do. You'd want your DML updates at the very end to update all records at once. You CANNOT do this in your current process. There is no way to collect the records from the PB and pass them to the flow in an Sobject Collection this way.
B. Use an Invocable Apex Class at the start of the Flow. This is one of the areas where the flow "stops" and bulkifies the records again. So in the case where the 100 interviews are running, you can actually stop them all using the Invocable Apex, pass them to the Apex, put them into your own List variable, and pass that variable back to the Flow as an Sobject Collection of 100 records, then run as in A.
*Note: I have used option B for 2 yrs now to resolve this issue
I put an example of the Invocable for the Case object below. You can change the object OR now that flow accepts dynamic Apex to some degree you can modify this to accept any object.
public with sharing class CaseBulkifyClass {
@InvocableMethod(label='Collect Bulkified Records')
public static List<List<Case>> gatherRequests(Request[] requests) {
// Gather bulkified records from Flow
Map<Id, Case> parents = new Map<Id, Case>();
for(Request request : requests) {
parents.put(request.recordId, null);
}
parents = new Map<Id, Case>([
SELECT Id, hdone__Identifier__c, Status, ClosedDate, hdone__hidden_CaseEdit__c, hdone__Flow_Status__c
FROM Case
WHERE Id IN :parents.keySet()
]);
// Flows must return List<List> for Sobject Collections. This is returned as Sobject Collection to Flow
List<List<Case>> responseColl = new List<List<Case>>();
// Add all of the values to an initial List
List<Case> responseList = new List<Case>();
responseList.addAll(parents.values());
System.debug('Size of ResponseList ' + responseList.size());
// Adds actual values we will use to the List of List
responseColl.add(responseList);
System.debug('Return responseColl size ' + responseColl.size());
// Initialize a new list which will return empty to ensure return same number of interviews back to Flow
List<Case> emptyList = new List<Case>();
// Iterate through number of interviews - 1 and assign to empty list
for (Integer i=0; i<responseList.size()-1; i++){
responseColl.add(emptyList);
}
return responseColl;
}
public with sharing class Request {
@InvocableVariable(label='Record ID' required=true)
public Id recordId;
@InvocableVariable(label='Object API Name' required=false)
public String objectName;
@InvocableVariable(label='Parent ID' required=false)
public Id parentId;
}
}
One more caveat is that if you leave this as is you will get an error "# of Flow Interviews does not match....". This is because the Flow started with 100 interviews, Apex collected them and passed back 1 variable with 100 records...so where are the other 99 interviews? Apex actually will pass back 1 with 100 records and 99 with 0 records. So you need a decision element after the Apex class that says "If collection variable is null, exit flow, else continue." Then you'll be set.