Could I execute a scheduled job from flow designer

JLeong
Mega Sage

Hi guys,

I have a flow designer that creates an incident when a specific transform map fails. But instead of creating an incident right away, I would like to re-process it or re-execute the scheduled job. Is there a way to call the UI Action or is there another way 

Thanks in advance.

Regards.

1 ACCEPTED SOLUTION

Marcin20
Mega Guru

Hi,

 

You can use the custom Flow Action with the Script Step.

In the Script Step the scheduled job can be invoked i.e. like in this thread:

UI Action button to run a Scheduled Job? - Developer Community - Question - ServiceNow Community

The Script Step is executed server-side, so the similar code as above can be directly placed there.

 

Best Regards,

Marcin

 

If my answer helped you in any way, please mark this answer as helpful and correct.

 

 

View solution in original post

5 REPLIES 5

Marcin20
Mega Guru

Hi,

 

You can use the custom Flow Action with the Script Step.

In the Script Step the scheduled job can be invoked i.e. like in this thread:

UI Action button to run a Scheduled Job? - Developer Community - Question - ServiceNow Community

The Script Step is executed server-side, so the similar code as above can be directly placed there.

 

Best Regards,

Marcin

 

If my answer helped you in any way, please mark this answer as helpful and correct.

 

 

Thanks Marcin!

Hello is there any way to executed schedule import in flow designer. I have tried using custom action hers is script below but it is executed multiple execution for that scheduled import.

12.png11.png

This script worked for me from workflow on scheduled import execution:

 

var exportGr = new GlideRecord("scheduled_import_set");
exportGr.addQuery("sys_id", "scheduled_import_sys_id_here");
exportGr.query();
if (exportGr.next()) {
var import_sys_id = gs.executeNow(exportGr);
// SncTriggerSynchronizer.executeNow(exportGr);

}

 

Built the workflow based on this post: Data load and transform via Catalog Item