Scheduling a flow for every 1st of February and 1st of August

Wasd123
Tera Expert

What is the best way to schedule a flow twice a year on exact dates and time? The flow should be triggered on every 1st of Feburary and 1st of August. As the flow trigger itself does not allow to set it up in this way, should I create a scheduled job to trigger it on those dates (and if yes, how?) or what would be the best solution?

1 ACCEPTED SOLUTION

Brian Lancaster
Tera Sage

Schedule the flow to run on the 1st of every month. Then you may need a custom action to return true or false to verify the month. Then have an if statement to continue the flow if the action return true or just end it.

View solution in original post

2 REPLIES 2

Brian Lancaster
Tera Sage

Schedule the flow to run on the 1st of every month. Then you may need a custom action to return true or false to verify the month. Then have an if statement to continue the flow if the action return true or just end it.

reddysurendra
Giga Guru

Hi Wasd123,

you can run flow on 1st of every month and use below custom action 

I have got similar requirement to create a task on 1st day of every quarter

Solution:
I have created a custom action with below fields and script
fields:-
Input - input_date  (date/time)
Output - monthNumber (integer)

script:-

(function execute(inputs, outputs) {
    var date = new GlideDateTime(inputs.input_date);
    // Extract the month number (0-based in GlideDateTime, so add 1)
    var monthNumber = date.getMonthUTC(); // getMonthUTC()
 
    // Populate the output field with the month number as an integer
    outputs.month_number = monthNumber;
})(inputs, outputs);



Later I have used if condition to check the month number =1,4,7,10

Regards
Reddy Surendra