How to call subflow in scheduled job

Supriya Mane
Tera Contributor

Hi All,

How to call subflow in scheduled job i have call subflow in sheduled job but it is showing error flow does not exist. same flow name i am using.

try {

    gs.info('ADR Email Flow started');

    sn_fd.FlowAPI.getRunner()
        .subflow('global.adr_email_flow')
        .inBackground()
        .run();

    gs.info('ADR Email Flow triggered successfully');

} catch (ex) {

    gs.error('ADR Email Flow Error: ' + ex.getMessage());

}
3 REPLIES 3

CheduluriMahesh
Kilo Expert

Hi,

The error usually occurs when the value passed to .subflow() is not the actual API Name of the subflow or the scope is incorrect.

A few things to verify:

Make sure you're using the Subflow API Name, not the display name.
Check if the subflow is in Global scope. If it's in a scoped application, use <scope_name>.<subflow_api_name>.
Ensure the subflow is Published and not in Draft state.
Try running the same code from Scripts - Background to confirm the issue is not specific to the Scheduled Job.
You can also open the published subflow and copy the API name/code snippet directly from the More Actions menu to avoid any typo or scope-related mistakes.

In most cases, correcting the scope/API name resolves the "flow does not exist" error.

Sanjay191
Kilo Patron

Hi @Supriya Mane

Check the Subflow API Name, Application Scope, and Active status—use the exact API name, not the display name (e.g., global.adr_email_flow).
If still failing, run the same script in Scripts – Background; if it fails there too, the issue is with the subflow name/scope/access, not the Scheduled Job.

Please refer the below screenshots as well to check flow api name 

Sanjay191_0-1786953939608.png

 

Sanjay191_1-1786953977727.png

 

If you found my response helpful and it answered your question, please consider marking it as the accepted solution and giving it a thumbs up. It helps others in the community find the solution more easily.

Thank you!

 


 

SupriyaMane_0-1786954623307.png

I am using same which mentioned here