Flow Action with Wait and Retry features

jakejeon
Tera Contributor

Hi there,

 

I'm planning to create a custom Flow Action that runs once. If it fails, it should wait for 4 hours and then retry once more. If it still fails after the retry, it should return a failure output. the number of retry should be configurable.

 

However, I'm struggling with how to implement the 4-hour wait and how to loop within the Action.

 

Any suggestion to overcome these problems? 

3 REPLIES 3

Mark Manders
Mega Patron

Create a flow variable for the number of retries. Depending on where you want to 'configure' this, you can do it in the flow itself, use system properties, or some field on a record and just do a lookup to is.

You can then add a counter variable to count the number of times the action is called and stop is when your counter has reached the set variable.
This can be set with the 'do the following until' flow logic. Your 'until' is the successful run or the number of retries and your 'do the following' is the wait action and the custom flow action.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Anil Nemmikanti
Giga Guru

AnilNemmikanti_0-1749805270848.png


As your requirement is dynamic and Custom Flow action will not be suitable because "Do the fallowing until" action is not available in Custom actions.

So suggest to create the flow as per screen shot and use it as Sub Flow when ever required. Create variable and use it Until condition to manage the iterations.

Ankur Bawiskar
Tera Patron
Tera Patron

@jakejeon 

you can follow approach shared by @Mark Manders 

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