flow not triggering.

Hrishabh Kumar
Giga Guru

I have created a flow with "Scheduled trigger" and an custom action to execute when flow is triggerd.

 

Trigger

flowTrigger.PNG

 

Action

flowAction.PNG

 

Run fix Script is a custom scripted action

customAction.PNG

 

1) I have not created any input or output variable. I have only added the script in the steps section. 

    the script is 

(function execute(inputs, outputs) {
// ... code ...
 var orcat = new GlideRecord("cmdb_ci_db_mssql_database");
//orcat.addEncodedQuery("install_status=1^last_discovered<javascript&colon;gs.beginningOfLast7Days()^support_group=10a31fbfdb056a002cfef7adae961991");
orcat.addEncodedQuery("name=1C8RIB_Crimea");
orcat.query();
gs.log("flow designer one total: " + orcat.getRowCount());
while (orcat.next()) {
 	gs.log("flow designer one status of "+ orcat.name + " is: "+ orcat.install_status);
    orcat.setValue('install_status', '2');
    orcat.update();
 	gs.log("flow designer one working fine");
}
})(inputs, outputs);

  

But the Flow is not getting triggered?

 

3 REPLIES 3

Sandeep Rajput
Tera Patron
Tera Patron

@Hrishabh Kumar Did you test the flow using the test button available on the flow, does it print the logs during the test run? Also, do you have this flow in Global scope or a scoped application? If this is part of Scoped application then gs.log will not work there.

It is working when I manually test the flow, but it does not trigger automatically.

Try changing the trigger condition to run it every minute save the changes and activate it. Ideally the flow should run every minute if it does restore the trigger condition back to your previous settings if it doesn't then convert your flow to a subflow and trigger it using a scheduled job which runs daily at your specified time.