FlowAPI Error: Subflow does not exist within application scope: global: no thrown error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2020 09:31 AM
Hello All,
I've built a subflow within Flow Designer and I'm attempting to trigger the subflow via the FlowAPI with a background script. I keep getting the following error: "The subflow named: docusign does not exist within application scope: global: no thrown error"
I have changed the name of the SubFlow a few times to see if that would help. Below is the code I'm using to attempt to trigger the subflow:
(function () {
try {
var template = new GlideRecord('sn_docusign_spoke_docusign_templates');
template.get('941a08771bc4e8101024a641b24bcbda');
var inputs = {};
//......
//Input values
// Execute Synchronously: Run in foreground.
outputs = sn_fd.FlowAPI.executeSubflow('global.docusign', inputs);
gs.log(outputs);
} catch (ex) {
var message = ex.getMessage();
gs.error(message);
}
})();
I have tried multiple methods within the scoped FlowAPI and get the same message.
Thanks in advance!
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2021 01:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2021 07:21 AM
Hi Hetal,
I was able to resolve this issue. It turns out that when using the flow API, you must call a flow or subflow by its Internal Name. This field is auto populated on the sys_hub_flow table when the record is inserted.
If you update the flow or subflow name in flow designer after it is initially created, the 'internal_name' does not get updated on the table. You need to navigate to the 'sys_hub_flow' table and see what the value is for the 'internal_name' field. Use this in your script leveraging the flow API. Alternatively you can update the 'internal_name' field.
Hope this helps!