How to trigger task that are for a post date ?

IceIronDragon
Tera Guru

Hello everyone,

I have a Catalog that might have a task or action in future like 11 months from now .

How can we achieve it , I know scheduled job or workflow can create a task after 11 months depending on the date but whats the performance impact and is there a better alternatives to it ? 

6 REPLIES 6

SumanthDosapati
Mega Sage
Mega Sage

@IceIronDragon 

Do you want to keep the catalog task open for 11 months?

If yes, keep in mind about about number of open tasks piling up. You can use wait for duration in your flow and achieve it.

If No, you can create a scheduled job. It again depends on number of expected tasks. Thousands of jobs in a day might affect performance. Less number should be fine.

 

Accept the solution and mark as helpful if it does, to benefit future readers.
Regards,
Sumanth

pavani_paluri
Giga Guru

Hi @IceIronDragon 

 

Your requirement can be achieved in below ways:

 

OptionsProsConsComments
Scheduled Job / Workflow TimerSimple, nativeRisk of overload in sys_trigger, less resilientOkay for small volumes
Flow Designer Wait for conditionNo-code, clean UINot ideal for long durations or high volumeBetter for < 6 months or low frequency
Daily Scheduled job with conditionScalable, robust, easy to manageSlightly more complex logicBest for large scale, long-term scheduling

 

Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Pavani P

 

GlideFather
Tera Patron

HI @IceIronDragon 
Flow or scheduled job - both of them must be running daily to check if the desired time has already passed.

In scheduled job I don't see any worries from the performance perspective.

Then you can create an event and once the scheduled job will match the 11 months, then it will fire that event and according to it you can do the next steps (send notification etc).

 

For testing purposes you can set it to a few minutes to verify that.

 

BTW: recommended to execute these kind of scripts at early morning or late night hours (unless you have users from different locations - think twice when it is the most suitable time, eventually run it weekly on weekends but it will not be exactly 11 months it will be 11 months +- 6 days :))..

Also if you want to only check whether there are some records, in the scheduled job, use GlideAggregate it is like glideRecord but it doesn't update, solely checking how many records are found under specific conditions.

GlideAggregate is also minimising the required performance, as "it only counts" the amount of records, not checking any other queries...

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


IceIronDragon
Tera Guru

@GlideFather  @pavani_paluri  @SumanthDosapati  Thanks for the response, so I am hearing scheduled job should do the trick, question is RITM will get reopened with its appropriate task in 11 months ?  or how do you guys navigate reopening of the RITM after 11 months ? Also, I would like to hear about the complex logic for scheduled job that you guys would recommend ?