Scheduled Functions
Scheduled Functions allow you to execute your edge functions on a predetermined schedule. This enables automated tasks, periodic data updates, and scheduled maintenance operations without manual intervention.
Getting Started
To schedule an edge function:
- Navigate to “Compute > Scheduled Execution” in the QuantCDN dashboard
- Click “Create New Schedule”
- Select an existing edge function to schedule
- Configure the schedule settings
Schedule Configuration
Quick Schedules
For convenience, we provide several preset schedules which you may select from the “Quick Schedule” dropdown menu.
Custom Schedules (Cron Expressions)
For more precise control, use cron expressions. A cron expression consists of six required fields, separated by white space:
Field | Values | Wildcards |
---|---|---|
Minutes | 0-59 | , - * / |
Hours | 0-23 | , - * / |
Day-of-month | 1-31 | , - * ? / L W |
Month | 1-12 or JAN-DEC | , - * / |
Day-of-week | 1-7 or SUN-SAT | , - * ? L # |
Year | 1970-2199 | , - * / |
Example Cron Expressions
0 10 * * ? *
- Run at 10:00 AM (UTC) every day15 12 * * ? *
- Run at 12:15 PM (UTC) every day0 18 ? * MON-FRI *
- Run at 6:00 PM (UTC) Monday through Friday0/15 * * * ? *
- Run every 15 minutes0/5 8-17 ? * MON-FRI *
- Run every 5 minutes Monday through Friday between 8:00 AM and 5:55 PM (UTC)
Request Configuration
When setting up a scheduled function, you can configure how it will be triggered:
HTTP Method
Choose the HTTP method for the scheduled execution:
- GET
- POST
- PUT
- DELETE
Headers
Define custom headers that will be sent with each execution. Common uses include:
- Authentication tokens
- API keys
- Content-Type specifications
Example:
Request Body
For POST, PUT, or DELETE methods, specify the request body using key-value pairs. The data will be automatically formatted and sent to your function during execution.
Example Use Cases
Scheduled Functions are ideal for:
- Periodic data synchronization
- Regular cache invalidation
- Automated report generation
- Database maintenance
- Content updates
- Health checks
- Automated backups
- Data aggregation
- Log rotation
- Cleanup tasks
Monitoring
All scheduled executions are logged in the QuantCDN dashboard, where you can monitor:
- Execution status
- Response codes
- Execution duration
- Error messages
- Last run time
- Next scheduled run time