Hi - how can I keep one workflow running continuously? My goal is to keep two data sources always approximately in sync (within a minute or so).
it should keep running in a continuous loop, without stopping
if it does stop for some reason, upon restarting the server, ideally it would restart.
I’ll build in delays etc so there’s no worry about DDOSing myself
I don’t mind manually starting the workflow after a restart, if that’s the only time it needs to be manually started. It seems like if I close my browser tab after starting the execution, it does keep running…
If I create a Cron to run the process every X minutes, is there a way to prevent it from running multiple processes in parallel, if one is already running?
I imagine I could track the start time of each execution and then force it to stop after 55 seconds, and then launch a new Cron every 60 seconds. Is there a better way though?
Hi Shrey - thank you SO much for the thoughtful and helpful reply! This makes sense and I agree this should work in cases where my workflow has “normally” stopped itself and thus set the runstatus to false.
However, I’m not sure this is solving my issue, but I could be missing something. I can already create an infinite loop so that my workflow in theory should never stop (using the wait timer). I’m more concerned about situations where my workflow crashed unexpectedly. In these cases, I think your code would never set the runstatus to false?
It seems there is no way to check if something is “currently running”? If no, I could probably use your code in combination with some last-run-timestamps from my side…