how to trigger flow via business rule

Mark Wood
Tera Contributor

Hello Experts,

I want to trigger flow by flow designer can anyone please tell me how can we trigger flow by writing the script in the business rule?

thank you.

7 REPLIES 7

Usually I don't trigger Flows from Business rules, if needed I usually create a SubFlow to trigger from a Business rule if needed.

But if you would trigger a Flow (that has it's own trigger) from a Business rule, I guess it would run twice, since invoked twice. (once from it's trigger, and once from the business rule).
(I have not tested this scenario, so cannot confirm at the moment)

LJ_23
Tera Contributor

how would you create a subflow to trigger from business rule? I am trying to generate a trigger within my business rule to create a knowledge article 3 days after an incident has been resolved business rule1.png2.png3.png4.pngbusiness rule1.png2.png3.png

Abhijit
Tera Expert

You can call 

 

var result = sn_fd.FlowAPI.getRunner() .flow('<flow name>') .inForeground() .timeout(12000) .run();

gs.info(result.debug());

 

if your flow is accepting input, you need to pass by initiating inputs object

 var inputs = {};

inputs['sys_id'] = '57af7aec73d423002728660c4cf6a71c';  

 

add .withInputs(inputs) parameter to runner method sn_fd.FlowAPI.getRunner() .flow('<flow name>') .inForeground() .timeout(12000) .run();