Flow need to wait everymonth on particluar date

nandini29
Tera Expert

Hi All

There is scenario where after flow is triggered, flow should wait untill 25th of everymonth, How we can achieve this in flow designer?
Could someone provide response on this?Thanks in advance

Thanks,
Nandini

3 REPLIES 3

Dr Atul G- LNG
Tera Patron

Hi @nandini29 

 

https://www.servicenow.com/community/servicenow-ai-platform-articles/flow-designer-making-the-flow-w...

 

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

 

****************************************************************************************

Regards

Dr. Atul G. - Learn N Grow Together ServiceNow Techno - Functional Trainer

LinkedIn: https://www.linkedin.com/in/dratulgrover

YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG

******************************************************************************************

Ehab Pilloor
Mega Sage

Hi @nandini29,

Have a script in a Flow Variable to fetch 25th of very month and return the date.

var now = new GlideDateTime();
var target = new GlideDateTime();

// Set target to the 25th of the current month
target.setDayOfMonth(25);

// If the 25th has already passed, move to next month
if (target.compareTo(now) <= 0) {
    target.addMonthsLocalTime(1);
    target.setDayOfMonth(25);
}

return target.getValue();

Use the wait-for-duration activity, change the duration type to relative duration, and then used 1 second after the flow variable value to make the flow until the specified time and then triggered the next action. 

EhabPilloor_0-1786530087958.png

 

Its best if you trigger Flow from Scheduled Job which has low code setting for running on 25th of every month.

 

 

Please Accept this response as Solution if it assisted you with your question & Mark this response as Helpful.

 

Kind Regards,

Ehab Pilloor

HarishKumar6668
Tera Guru

Hi @nandini29 ,

Could you clarify whether you want the flow to execute repeatedly on the 25th of every month after it is triggered, or whether it should wait until the next upcoming 25th of the month after the flow is triggered i.e execute only once?

Thanks,
Harish