Generate a random number on schedule

Recipe ToolsMarketingDeveloper Tool

What it does

When the Clock triggers every 5 minutes, this automation runs JavaScript code to generate a random number. The result is logged to the job report so someone can track the output over time.

Who it's for

Engineering teams who need to test random number generation or validate scheduling logic.

How teams use this

Test scheduling and code execution

Run this automation every 5 minutes to verify that the schedule works and JavaScript code executes as expected. The logged numbers confirm both the timing and the generation logic.

Validate random distribution over time

Let the automation run for hours or days and review the job report to check if the random numbers show a normal distribution. This helps confirm the code is working correctly.

Add a range constraint to the random number

Modify the JavaScript code to generate random numbers only within a specific range, such as 1 to 100. The logging step stays the same and captures the constrained output.

How it works

  1. Start on a 5-minute schedule. The Clock triggers this automation every 5 minutes without any manual input needed.
  2. Generate a random number in Js Eval. Execute JavaScript code to generate a random number and store the result for the next step.
  3. Log the result to the job report. Write the random number to the job report so the output is recorded and visible in the automation history.