How to run multiple javascript snippets in ServiceNow with delay between each

northfdl54937
Tera Contributor

After a patch or family upgrade, i have found serveral things i have to get back to normal..  I did this manually in the beginning, but now i have scripts that do each task for me.  I now want to automate better.  I am looking for a way to run the first script, then wait, then run the next script, then the next, etc. I actually tried a powershell script to run each javascript script, but seems i have errors on GlideRecord, GlideSystem, etc.  

 

I appreciate the help you can give !!

 

 

2 REPLIES 2

Sohithanjan G
Kilo Sage
Kilo Sage

Hi @northfdl54937 , 

You can run your scripts in your custom flow actions, with the help of Flow Designers adding a Wait for Duration btw each action. 

FYI 

https://docs.servicenow.com/csh?topicname=flow-logic-wait-for-a-duration.html&version=latest

 

 

Please mark as Accepted Solution if this solves your query and HIT Helpful if you find my answer helped you. This will help other community mates too..:)

I haven't figured out how to do that actually...   could you provide steps on how you think it would be done?   I have 8 scripts that i would love to run with a timer in between, so that the gs.info comes in in the specified order.  I can't see how that would be done in flow designer...