Hi I'm running into the following error when my scheduled flow does an Apex Action
The number of results does not match the number of interviews that were executed in a single bulk execution request.
The purpose of my apex callout is to take the Placement record that triggered the flow and locate all associated grandchild (Protest) records and return them so I can check if any are active and perform some additional logic. It's very possible that the one Placement can have multiple grandchild records and I need them all. I only run into the error when a Placement has 2+ Protests, if there's 0 or 1, there's no error.
Here is my code
@InvocableMethod(label = 'Get Protest From Placement' description = 'Query all protests associated to a Placement. Return the list of protests associated to a Placement.')
public static List<Protest__c> getProtestsFromPlacement(List<Id> placementIdList) {
//created to hold return list of protests records
List<Protest__c> protestsToReturnList = new List<Protest__c>();
//query for associated protests
List<Protest__c> protestsList = [SELECT Id, Closed__c From Protest__c WHERE Placement_Requirement__r.Placement__c IN :placementIdList];
for(Protest__c protests: protestsList) {
protestsToReturnList.add(protests);
}
return protestsToReturnList;
}
How can I fix this error? Thanks