ServiceNow Learning 53: Close an incident after 10 days via Flow Designer ServiceNow.

Shamma Negi
Kilo Sage
Kilo Sage

Hi All,

 

Here is a great example how to handle the below scenario via flow designer:

 

Example: Close an incident if it has been in the resolved state for 10 days

In this example, a flow starts when the incident state changes to Resolved.

Flow trigger
 
ShammaSalhotra_4-1699272101936.png

 

 

 

Example: Wait 10 days after the last update to a record

In this example, the flows waits for 10 days after the incident record has been resolved.

Wait for Duration flow logic
 
ShammaSalhotra_5-1699272141791.png

 

 

 

Example: Update a record after 10 days

In this example, the flows closes the incident record 10 days after it was resolved.

Action used to close the incident
 
ShammaSalhotra_6-1699272171301.png

Hope this helps you.
I hope this article helpful. Please mark it as helpful and bookmark if you like it.

Thanks,
Shamma

 

Regards,Shamma Negi
9 REPLIES 9

Peter Bodelier
Giga Sage

Hi @Shamma Negi 

 

I wouldn't recommend doing it this way.

It's leaving flows running unnecessarily long.

 

I would rather use a daily flow to check which records can be closed.

 


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

Yeah agree for normal situations but it is helpful in below scenarios

 

Daily flow causes memory issue when the table volume is huge as you have to check each records before updating.

 

Flow do not recommend running daily flow on huge volume data. We have already faced this issue. Flow do not recommend running on huge data it prefers you to run individually or on less sets of data So that flow won't get executed more time and eventually it won't consume more node memory.Hope this helps. 

 

Thanks, 

Shamma

 

Regards,Shamma Negi

Hi @Shamma Negi 

 

If you configure your flows correctly it won't run on a huge data set on a daily basis.

If in any case you would need to do it on a larger set, you can always query your data in a scheduled script, and call a flow for each record separately.

 

That being said, apart from running imports with flow designer on millions of records (which is a number you're never going to get for checking on to be closed records), I've never seen any performance degradation with flow designer at all.

 

Apart from that, you can also assign a priority to flows. So if this flow would for some reason have to go through millions of records, assign a lower prio, to make sure it doesn't interfere.

 


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

In my current project wherein, I have come across such scenario wherein I had to set the Invoice Status on some conditions on daily basis based on their previous history records, so I did the daily flow which checks the previous history and then update on Invoice hence we got a recommendation from team to do the following hence based on my real time experience I am sharing this:

Note: I am having more than 200,000 invoices in my Invoice table which gets increased everyday with huge number.

 

If in any case you would need to do it on a larger set, you can always query your data in a scheduled script and call a flow for each record separately.

 

I agree with you that if it is a larger set of data then we always should do a scheduled job and then write the scripts there and this is what I followed in my project.

 

This article is based on what is recommended on ServiceNow docs. Please have a look.

 

Wait for a duration flow logic (servicenow.com)

 

Hope this answers your question.

 

Also, thanks for suggesting the assigning priority to a flow. Could you show some light on it. How do we do that and how it is useful. I am happy to learn more about it.

 

Thanks,

Shamma

 

Regards,Shamma Negi