Scripting in Wait for Condition Flow Designer without Record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2025 03:14 AM
Hi,
Can we add scripting in "wait for condition" Action in flow designer without adding the record.
As my requirement is to continuously look up records from Assessment Instance table, until atleast one assessment got completed. For this if I use "look up records" action in Do the following loop, it is throwing iteration error (max iteration limit reached). Any other method possible for this?
or can I script it in "wait for condition" Action.
Thank you,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2025 06:22 AM
For your Wait for Condition, you would need a record to set up conditions to be met. If you are hitting your max iteration while in your Do the following Until loop, then you could add a Wait for a Duration of Time, under the flow logic section. While your do while loop is running, after it runs through one iteration, have it wait some time, like 10 mins for example, before repeating another iteration. This will slow down how quickly the iterations are run through before reaching the Max iteration limit. Also, there is a system property to increase the max iterations
Workflow Studio flow system properties
Here is a screenshot on the relevant section.
I would recommend reading about it before making changes though in the docs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2025 07:17 AM
Thank you for you reply @Zach Koch ,
But as per my requirement I can't use "wait for duration of time". Because I need to wait until atleast one assessment got completed, and even need to wait for several days. and just after completion of assessment, i need to create task. so "wait for duration of time" option won't work for me.
Also, I can't change system property. it won't be allowed.
Also, I can't create another field also to use as a flag. it won't be allowed as per requirements.
So please suggest me another solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2025 08:03 AM
Hi @VullankiL ,
If your requirement is to look up records from Assessment Instance table, until atleast one assessment got completed, then you can try a script for this through business rule that will check when a assessment is completed and based on that the BR will trigger an event. You can then use the event created in your flow designer. (You will add an action/script in flow designer that will check if the event you created has been fired in the event log table, if yes then you can create a task). Feel free to reply if you need further assistance with this approach.
Further info on how to create an event through a BR can be found under this thread- https://www.servicenow.com/community/developer-forum/how-to-trigger-an-event-from-business-rule/m-p/...
If this information helped resolve your issue, please mark the response as helpful.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2025 08:30 AM
Thank you for your reply @harshita malhot ,
As you mentioned, if I need to check whether the event fired in event log table or not. Then also, I need to repeatedly check again and again until it got fired, for that I need to keep it in "do the following until" loop again. So again it will through "maximum iteration limit reached" error.
Can you please suggest me any solution for this?