Flow Designer Do the following until error help

gjz
Mega Sage

The business requirement in my company is to allow fulfillers to create catalog tasks (sc_tasks) for any requested item if something out of the ordinary outside of the normal workflow needs to be done.  This is working in workflows by a "wait for condition" step with a script to check for open sc_tasks. 

 

I'm trying to convert the workflows to flows, but I'm having trouble replicating this particular step and am receiving an error - I need help, please!

 

I've created a custom action that runs the script to check for open sc_tasks that returns 'false' if there are tasks and 'true' if there are not.  It's backwards to me, but that's how it is in the workflows.  The custom action works fine when tested.

 

First, I tried the "wait for condition" in Flow, but that didn't work so based on information I found through the community and You Tube videos, I tried "do the following until".  I'm getting an error and I've wrapped the error in a try/catch loop but it still isn't working and I can't figure out why.  Can someone help?  Is there a better way to accomplish the business requirement? 

 

Logic for Do the following until:

1. Run the Wait for Manual Tasks action

2. Log the value returned from the action

3. If the value returned from the action is true, close the requested item.

gjz_0-1696000525801.png

Here is what I see in the execution - and I don't know how to interpret the error, it doesn't make sense to me.

gjz_1-1696000656690.png

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Sandeep Rajput
Tera Patron
Tera Patron

@gjz From the second screenshot it is evident that the Do until the following action ran for 1000 iterations and simply crashed as it has reached the max limit allowed by the property sn_flow_designer.max_iterations.

 

Screenshot 2023-09-29 at 9.12.02 PM.png

No matter what limit you set on this property it will simply be exhausted unless you put a wait timer in your flow, which will allow the Do until following action to wait for some time and try checking the task status again.

 

Here, I have added a wait timer in my flow.

 

Screenshot 2023-09-29 at 9.18.41 PM.png

Screenshot 2023-09-29 at 9.19.26 PM.png

Here, I used a wait time of half an hour, similarly, you can choose to decide how frequently you would like to check your task status. This will prevent the Do until following action to exhaust the iteration limit quickly.

 

Hope this helps.

View solution in original post

4 REPLIES 4

Vishal Birajdar
Giga Sage

Hi @gjz 

 

Below link might help you...!!

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0815159

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

Sandeep Rajput
Tera Patron
Tera Patron

@gjz From the second screenshot it is evident that the Do until the following action ran for 1000 iterations and simply crashed as it has reached the max limit allowed by the property sn_flow_designer.max_iterations.

 

Screenshot 2023-09-29 at 9.12.02 PM.png

No matter what limit you set on this property it will simply be exhausted unless you put a wait timer in your flow, which will allow the Do until following action to wait for some time and try checking the task status again.

 

Here, I have added a wait timer in my flow.

 

Screenshot 2023-09-29 at 9.18.41 PM.png

Screenshot 2023-09-29 at 9.19.26 PM.png

Here, I used a wait time of half an hour, similarly, you can choose to decide how frequently you would like to check your task status. This will prevent the Do until following action to exhaust the iteration limit quickly.

 

Hope this helps.

Sandeep, thanks for confirming my suspicion.  It's really unfortunate that the Wait for Condition and Do the following until are not nearly as robust as the Wait for condition in workflows.  It would be nice if you could control the next iteration in the Do the following until without having to add Wait for a duration of time.

 

I tried it with a timer, it works.

I have been in the similar situation when I used Do until following for the first time it was quite frustrating for me initially as there was no solution available. Figured out this wait timer approach on my own and it simply worked well for me.