Applies to:
- Plan - Any plan can edit existing alerts. Creating alerts requires Starter with on-demand usage enabled, Pro, or Enterprise.
- Deployment - Any
- Use case - Check for missing logs during business hours.
Summary
Use a cron schedule to restrict a time-window alert to business hours. This is useful when the alert checks for missing logs and you expect little or no traffic overnight.What is happening
Each scheduled check looks back over the configured window. If traffic starts at 8:30 AM and the window is 30 minutes, schedule the first check for 9:00 AM so the entire window falls within business hours.Fix or suggestion
Use the alert editor
- Open the automation in the alert editor.
- Open Advanced settings.
- Under Evaluation schedule, choose Cron.
- Enter a five-field numeric cron expression and set the IANA timezone.
- Save the automation.
Use the API
Create an alert withPOST /v1/project_automation. To change an existing schedule, send PATCH /v1/project_automation/{project_automation_id} with the full existing config object and the new config.window.schedule.
This example checks every five minutes from 9:00 AM through 4:55 PM Pacific time, Monday through Friday. It sends a webhook when the previous 30 minutes contain zero logs. Replace both occurrences of PROJECT_ID with your project ID and WEBHOOK_URL with your webhook endpoint.
Cron syntax constraints
- Use five numeric fields only.
- Use numeric weekdays (for example
1-5for Monday–Friday). Named weekdays likeMON-FRIare not accepted. timezonemust be an IANA name or omitted to use UTC.
How to confirm it worked
In a test project, pause logging for a full window during scheduled hours and confirm your webhook receives a firing notification. In the payload, check thatdetails.time_start and details.time_end cover the expected 30-minute window.
Notes
See the Create project automation API reference for the fullWindowedAutomationConfig schema and all schedule fields.