How to call subflow in scheduled job

Supriya Mane
Tera Contributor

Hi Al,,

How to call sub flow in scheduled job i have called but showing error in log flow does not exists but i am giving same flow name.

try {

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

} catch (ex) {

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

}
4 REPLIES 4

Ankur Bawiskar
Tera Patron

@Supriya Mane 

when you open subflow, you get option to Create code snippet

use that and it generates the script and then use it in your scheduled job

 

AnkurBawiskar_0-1786954291991.png

 

AnkurBawiskar_1-1786954291967.png

 

 

AnkurBawiskar_2-1786954304405.png

 

 

AnkurBawiskar_4-1786954319147.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

I am using same only.

SupriyaMane_0-1786954690512.png

 

@Supriya Mane 

what error it throws?

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

Supriya Mane
Tera Contributor

SupriyaMane_0-1786957481706.png