Generate hour values from Ruby seconds on schedule
Recipe ToolsMarketingDeveloper Tool
What it does
When a schedule triggers every 5 minutes, this automation runs Ruby code to convert seconds into hour format. The converted value is logged to the job report so someone can verify the transformation completed.
Who it's for
Engineering teams who need to transform time values on a recurring schedule without manual intervention.
How teams use this
Track elapsed time in reports
Convert seconds from a timer or log into readable hour format every 5 minutes so reports show time in a standard unit. The team sees consistent formatting without extra steps.
Monitor API response times
Run the conversion on a schedule to transform API latency data from seconds into hours for dashboard display. Only the data source changes while the logic stays the same.
Add timezone offset to conversion
Extend the Ruby code to include a timezone parameter so the hour value accounts for regional differences. The schedule and logging remain unchanged.
How it works
- Trigger every 5 minutes. The Clock schedule fires at the specified interval to start this automation and pass the current timestamp to the next step.
- Execute Ruby code to convert seconds. Workato Custom Code runs Ruby code that takes a seconds value and converts it to hour format for use in downstream steps or reports.
- Log the result to job report. Workato Custom Code writes the converted hour value to the job report so someone can track when the conversion ran and what the output was.