Approach for Forge scheduled trigger of async events

Hi Everyone,
I am building a Forge app, which will create Jira issues based on hourly, daily, and weekly schedules. We have 2 ways to do it:

  1. Use scheduled trigger feature of Forge with the key, function, and interval mentioned in manifest.yml file.
  2. Use setInterval in the forge UI of the app and invoke a function from the front end based on configured interval.

Do above both ways of implementing a scheduler are correct?
What is the recommended way to implement the scheduler feature?

Hi @SagarGujarati,

For sure go with an option 1 since it guarantees your function will be executed at the given interval. Since option 2 involves client side scripts to be up to running it will be very tricky to make a proper scheduling since it may be run from a few tabs by a few users or don’t work at all e.g. if the browser crashes the tab or your Internet connection goes down.

Thanks,
Vitalii

1 Like