Hi,
I was wondering if it is possible to trigger API/workflows from the server.
I want to schedule a workflow to delete old data every 1 of the month.
Now I was wondering if I can trigger this event by looking at the server date instead of trigger it from the user side. I try to avoid multiple request to trigger same event.
I tried to use the recurring event but you need to trigger it from the user side and since multiple users can trigger it at same time it creates issues with the schedule, it dose not seams to work the way I intend or I do not know how to use it properly . If i could trigger it based on the sever date or just by setting up the start date I believe that it would work properly.
If any of you have any suggestions please leave a comment
Thank you very much
You can schedule a backend workflow to run on the 1st of each month - just schedule it to run initially on the 1st of the next month (i.e. current date, plus 1 month, rounded down to month) then have it schedule itself to run again on the current date plus 1 month).
Or you can set up a recurring backend workflow and scheduled it to run monthly, starting on the 1st of the next month.
Just remember that you’ll have to set it to run initially in your dev and live versions separately.
I see what you’re saying and it will work just fine.
I’m thinking to create an admin page from where I can trigger and setup a bunch of other actions that will probably be needed in the future.
Thank you very much
Yes, you should have a system/admin page on your app, only accessible by admin users, where you can set up and manage backend system tasks like scheduling server actions and workflows.
Then just trigger it from there - once it’s running that’s it.
If you ever need to cancel it you can do it in your app settings logs panel, or you can build an interface to manage/cancel/reschedule backend tasks into your admin page (you’d need to store the workflow ID somewhere for that).
Guys thank you very much for the quick and educational reply.
I searched for this info in many other forum topics and no one provide a straight forward explanation. This is simple and clean
Hope that this topic will provide clarification for many other users
Thank you very much