function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Internal Error Invoking a Flow with Apex

Has anyone run into issues invoking a flow using apex? The logs show that the flow is being started and populated but at the end of the log files it says Internal Error.

Code to start the flow:
//get the subscriptions
List<Subscription__c> subscriptions = [select id, expiry_date__c, recordTypeId, Renewal_Status__c from subscription__c where id = 'a09S0000006EQ6CIAW'];

//create the flow parameter
Map<String, Object> myMap = new Map<String, Object>();
myMap.put('SelectedSubscriptions', subscriptions);

//launch the flow
Flow.Interview.Subscription_Debug_Flow myFlow = new Flow.Interview.Subscription_Debug_Flow(myMap);

I have a custom button which launches the flow from the UI when a subscription has been selected.  This works perfectly and no errors are generated so I know it can't be an issue with the flow itself as it does work.
Best Answer chosen by Christine_K
If you are getting Internal salesforce error, then please raise support case with salesforce to get more details. Check here about Internal error/Gack (