SubFlow on Server side Script

ServiceNowEmp
Giga Expert

Is it possible to call subflow/flow from Server side script?

2 ACCEPTED SOLUTIONS

Ravi Gaurav
Giga Sage

Hi @ServiceNowEmp 

 

ServiceNow has provided "FlowAPI" class to call Flow/Subflow/Actions by using scriping. However, this can only be called from Server side scriping. So, when we want it to be called from Client side, we can use GlideAjax to invoke server side script which will trigger Flow/Subflow/Actions.


Let me know if you need sample script

View solution in original post

var inputs = {};
inputs['current'] = current; // GlideRecord of table:
inputs['table_name'] = 'incident';

// Execute the global flow called test_flow
sn_fd.FlowAPI.executeFlow('global.test_flow', inputs);

This script initializes an input object, sets the current record and table name, and then triggers a global Flow Designer flow named test_flow using the sn_fd.FlowAPI.executeFlow() method.

View solution in original post

4 REPLIES 4

Ravi Gaurav
Giga Sage

Hi @ServiceNowEmp 

 

ServiceNow has provided "FlowAPI" class to call Flow/Subflow/Actions by using scriping. However, this can only be called from Server side scriping. So, when we want it to be called from Client side, we can use GlideAjax to invoke server side script which will trigger Flow/Subflow/Actions.


Let me know if you need sample script

Yes Please script will help !!

 

var inputs = {};
inputs['current'] = current; // GlideRecord of table:
inputs['table_name'] = 'incident';

// Execute the global flow called test_flow
sn_fd.FlowAPI.executeFlow('global.test_flow', inputs);

This script initializes an input object, sets the current record and table name, and then triggers a global Flow Designer flow named test_flow using the sn_fd.FlowAPI.executeFlow() method.

ServiceNowEmp
Giga Expert

Thanks @Ravi Gaurav  that worked for me !!