Workflow - run queries every x seconds

I am using the Retool Workflow to repeat some jobs. Some of the jobs need to be run every x seconds. I know that the cron does not natively support 'per x second' intervals, and the workaround is to use a sleep command(php - How to setup CRON job to run every 10 seconds in Linux? - Stack Overflow).

Currently, I am using the MySQL sleep command for this purpose. For example, for a job that needs to be run every 10 seconds, I use 'SELECT SLEEP(10)' and then copy and paste the job like below:

However, I am copying and pasting the job 6 times, which is totally against the DRY (Don't Repeat Yourself) principle. I haven't found a way to 'reuse' the query that needs to be run every x seconds.

Is there a more concise way to achieve this?

Hey @seokjungms — happy to help here! The latest versions of Workflows should now include a way to set this in the Start block. Hope this helps!

Hi @seokjungms wanted to share that our docs also cover how to set up Retool Workflows triggers, and you can also post to the newly-created Workflows section of this forum to share feedback and get more direct help with Workflows, should you need it. :slight_smile:

1 Like