I have a flow that returns the List to the Apex class. The apex class is the REST API that try to convert the output as JSON it returns null, so I have tried to iterate the list to assign the another wrapper to convert that as string.
List<CustomWrapper> lstWrapper = ( List<CustomWrapper> )contFlow.varOutput;
It throws following error:
System.QueryException: Dynamic query yields incompatible SObject type java:interaction.engine.interview.FlowApexObject for loop variable of type CustomWrapper
It works fine when I pass the output as List of sObjects.