how to call the subflows in Business Rule Condition
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2022 04:28 AM
Hi ,
On the business rule , if we need to add the wf_activity we put the condition like below.
Condition : current.wf_activity.name=='XXXXXXXx'
whereas if we need to add the subflows on the condition what to do?
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2022 04:33 AM
Hi refer the example here
https://developer.servicenow.com/dev.do#!/reference/api/quebec/server/sn_fd-namespace/ScriptableFlowAPI#ScriptableFlow-startFlow?navFilter=startflow
Regards
Harish
Harish

Community Alums
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2022 04:35 AM
Hi,
You can call workflow/subflow using below code :
var gr = new GlideRecord('wf_workflow');
gr.addQuery('name', 'Restart Linux Server');
gr.query();
if (gr.next()) {
var wf = new Workflow();
var workflowId = '' + gr.sys_id;
var vars = {};
wf.startFlow(workflowId, current, current.operation, vars);
}
action.setRedirectURL(current);
Mark my answer correct & Helpful, if Applicable.
Thanks,
Sandeep