Run JavaScript code on a 5-minute schedule
Recipe ToolsMarketingDeveloper Tool
What it does
When the clock triggers every 5 minutes, this automation runs JavaScript code in Js Eval. Someone can schedule routine logic to run at regular intervals without manual intervention.
Who it's for
Engineering teams who need to run scheduled JavaScript logic without deploying to a server.
How teams use this
Poll an API on a schedule
Use JavaScript to call an external API every 5 minutes and process the response. The automation handles the timing so someone does not have to check manually.
Aggregate data at regular intervals
Run JavaScript that computes KPIs or combines data every 5 minutes. The schedule ensures consistent results without someone monitoring the process.
Add conditional logic to the code
Include if-then statements in the JavaScript so the automation only runs specific logic when a condition is met. The schedule stays the same and only the code logic changes.
Change the interval to run hourly
Adjust the clock trigger from 5 minutes to 60 minutes so the JavaScript runs less often. The code stays the same and only the frequency changes.
How it works
- Start on a 5-minute interval. The clock starts this automation every 5 minutes so the JavaScript runs at regular, predictable times without someone having to initiate it.
- Run the JavaScript code. Js Eval executes the JavaScript code each time the clock triggers. The results are available to later steps in the automation.