FlowAPI Error: Subflow does not exist within application scope: global: no thrown error

Braden Semonovi
Tera Contributor

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!

6 REPLIES 6

Inactive_Us1878
Kilo Explorer
Hi Braden Were you able to resolve this issue I am facing similar issue Regards Hetal

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!