Generate a running sum every 5 minutes
Recipe ToolsMarketing
What it does
When the Clock triggers on a 5-minute schedule, this automation counts from 1 to 100 and adds each number to a running total. The final sum is logged to the Job report so someone can review the outcome.
Who it's for
Operations teams who need to run periodic calculations and log the outcomes for monitoring.
Apps used
How teams use this
Track periodic calculation results
Run the count and sum every 5 minutes and log each result to the Job report. This creates a record of all calculations over time without any other changes needed.
Adjust the count range
Change the loop to count from 1 to a different number, such as 50 or 200, so the automation fits a different calculation need. Only the repeat count changes.
Send the sum to another system
Add a step after the loop to send the final sum to a database or webhook so the result is stored outside the Job report. Include a condition to only send when the sum meets a threshold.
How it works
- Start on a 5-minute schedule. The Clock starts this automation every 5 minutes so the count and sum run at regular intervals without manual intervention.
- Initialize counter and sum variables. Create a counter variable set to 0 and a sum variable set to 0 so the loop has starting values for the calculation.
- Loop through numbers 1 to 100. Repeat 100 times, incrementing the counter by 1 each iteration and adding that number to the running sum so all values are included.
- Log the final sum result. After the loop finishes, log the final sum to the Job report so the outcome is recorded and visible for review.