Run flow only on Demand via script

ShAn21
Tera Guru

Hi Folks,

 

Is there any way we can put trigger conditions so that it never triggers by itself but only via script?

I dont wanna use 'Run Once' option. Is there any way?

 

Can we keep a flow in draft and then run via script? Is that possible or ay best practice constraints?

 

Thanks

1 ACCEPTED SOLUTION

I think the best way is to create a subflow as it does not have trigger condition and then call it in fix script.

 

Thanks

View solution in original post

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

@ShAn21 

Flow should be activated and not in draft state.

make it run once and the use below script to trigger it whenever you wish

Triggering a flow with a script 

check these links as well if you wish to send inputs to flow

Trigger Flow from script with inputs 

How to launch a flow from a script 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar 

Run Once will ask for a time as mandatory and as soon as its deployed it will run right if we choose past date?

I dont want it to run by itself at all.

 

Thanks

@ShAn21 

what's the business use-case to use flow?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Its kind of one time script to reconcile the data. Its easier to configure it via flow than a fix script.

So I have done it via flow and will run the flow via fix script as an when needed. the first time run time is still not finalized.