Daily delete schedule

Hey all,

I’m wanting to set up a daily schedule at 3am to scan the database and delete any post older than 1 year either via the creation date in the database or another date field that is available.

I have read a lot of forums on this to try and figure it out and saw that you can create the item you can create a workflow in +1 year to delete it. But I feel after a years worth of database creations that may flood the bubble app with a huge amount of scheduled workflows to delete something in 1 year.

So I wanted to set it up that the tasks just runs daily and looks for anything 1 year old.

Where I get slightly confused is the “TIP” in the documentation that something has to trigger the schedule which is a bit annoying as nothing triggering this workflow it just needs to happen daily.

If I was to set up a button on our administrative page to simply start the daily schedule I could do that but once pressed does it matter / change the schedule if it is pressed again and would it need to be pressed again after I deploy a new live update?

Seems like a pretty simple feature but I just can’t get my head around it.

Also in the schedule it will need to delete it from the database and in a google sheet via API call ready set up

you would have to press the button in production again (two separate databases, websites(dev branch, prod))

If you “click” the button again two loops will run

if you want to schedule once per day at a certain time you could do rounded down to day or change hours minutes and seconds to what equals 3am at your current date time

the approach with the trigger is the right way to do it

you could create an database field eg is running with a boolean yes/no to terminate the workflow globally with terminate workflow only when yes/no or save the workflow id the terminate by workflow Id (whatever you prefer and fits best for your use case)

You can if you want to additionally create an “log” that’s a list of texts or an Database item by create thing and log wit the workflow has run so you can check on your admin page

lemme know if that helps