+ Start a Discussion

Internal Salesforce.com 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 Salesforce.com 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 salesforce.com error/Gack (https://developer.salesforce.com/blogs/engineering/2015/02/gack.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+SforceBlog+%28Salesforce+Developers+Blog%29)