Implementing Scheduled Tasks with Different Start Times

I have various tasks and processes that need to be executed at specific intervals throughout the day. However, I require flexibility in scheduling these tasks to accommodate different start times based on their dependencies and requirements. For example, I may need one task to start at 12:30 to prepare data for subsequent processes starting at 1:00. How to achieve the implementation of scheduled tasks with different start times within my application? Specifically, I would like to understand if this functionality is supported by Atlassian’s Forge scheduling mechanisms or if there are any recommended approaches or best practices for achieving this requirement.

Hello @snehilsankalp

Yes, Forge supports scheduling events in a number of ways.

Refer to this documentation.

Hey @snehilsankalp

The best thing you can do at the moment is set the most granular schedule trigger (hourly) and have logic that checks your schedule and decides whether it should run the function or not.

So, for example if it runs at 12:15 it might check your schedule to see if anything is needed in the next hour, it would see yes something is needed for 1:00 so it would perform the function. When it runs again the next hour at 1:15 it might see that it isn’t needed and it will just exit without doing anything.

I realise that might not quite satisfy your use case if you need it to run at 12:30 exactly but that is the best you can do with Forge scheduled triggers at the moment.

2 Likes

But is there an alternative method to schedule a task to run at 12:30 or another specific time? For instance, if I need to perform operations on a board’s tickets at a designated time or periodically check certain conditions, what approach should be taken? @AdamMoore

No, sorry Forge doesn’t support scheduled triggers that run at an exact time. The only workaround would be integrating with a remote service that handles the schedule and perhaps calls into your Forge app via a web trigger.

Thanks for the clarification @AdamMoore ! Since Forge doesn’t directly support scheduled triggers, integrating with a remote service sounds like a plausible workaround. As I’m considering AWS for this, could you advise on the best practices and potential pitfalls? Also, do you have any documentation or resources that could guide me through the integration process?