Cron
Synopsis
Cron-based execution allows targets and routes to run at specific times using cron expressions. Instead of running continuously, the component will only process data when the cron schedule condition is met.
Schema
Targets
targets:
- name: <string>
type: <string>
properties:
cron: <string>
# target-specific properties
Routes
routes:
- name: <string>
source: <string>
destination: <string>
properties:
cron: <string>
Configuration
| Field | Required | Default | Description |
|---|---|---|---|
cron | N | - | Cron expression defining when the component should execute |
Details
The cron field accepts standard cron expressions to control when a target or route executes. This is useful for scenarios where you want to:
- Process data at specific times of day
- Run components during off-peak hours
- Align execution with business schedules
- Reduce resource consumption by limiting execution windows
- Create time-based routing logic
When a cron schedule is configured, the component will only process queued data when the current time matches the cron expression. Between scheduled executions, data accumulates in the queue and is processed during the next scheduled window.
Cron Expression Format
Standard cron format with five fields:
┌───────────── minute (0-59)
│ ┌───────────── hour (0-23)
│ │ ┌───────────── day of month (1-31)
│ │ │ ┌───────────── month (1-12)
│ │ │ │ ┌───────────── day of week (0-6, Sunday=0)
│ │ │ │ │
* * * * *
Special Characters
*- Any value,- Value list separator-- Range of values/- Step values
Time Zone
All cron expressions are evaluated in the system's local timezone.
Target Examples
Every Hour
Execute target at the start of every hour... | |
Business Hours Only
Execute every 30 minutes between 9 AM and 5 PM on weekdays... | |
Daily at Midnight
Execute once per day at midnight... | |
Multiple Times Per Day
Execute at 6 AM, 12 PM, and 6 PM every day... | |
Every 15 Minutes
Execute every 15 minutes throughout the day... | |
Weekly on Mondays
Execute every Monday at 9 AM... | |
Month End
Execute on the last day of every month at midnight... | |
Night Processing
Execute every 2 hours during night time (10 PM to 6 AM)... | |
Weekends Only
Execute every 4 hours on Saturday and Sunday... | |
Specific Day of Month
Execute on the 1st and 15th of every month at noon... | |
Route Examples
Business Hours Routing
Route data to a specific target only during business hours... | |
Daily Archive Route
Route data to archive storage once per day at midnight... | |
Weekend Backup Route
Route data to backup target only on weekends... | |
Peak Hours Dual Routing
Send data to multiple targets during peak hours for redundancy... | |
Hourly Aggregation Route
Route aggregated data every hour while streaming raw data continuously... | |
Common Patterns
| Pattern | Expression | Description |
|---|---|---|
| Every minute | * * * * * | Run every minute |
| Every 5 minutes | */5 * * * * | Run every 5 minutes |
| Every 10 minutes | */10 * * * * | Run every 10 minutes |
| Every 30 minutes | */30 * * * * | Run every 30 minutes |
| Every hour | 0 * * * * | Run at the start of every hour |
| Every 2 hours | 0 */2 * * * | Run every 2 hours |
| Every 6 hours | 0 */6 * * * | Run every 6 hours |
| Daily at midnight | 0 0 * * * | Run once per day at midnight |
| Daily at noon | 0 12 * * * | Run once per day at noon |
| Weekly (Monday) | 0 0 * * 1 | Run every Monday at midnight |
| Monthly (1st) | 0 0 1 * * | Run on the 1st of each month |
| Weekdays only | 0 9 * * 1-5 | Run weekdays at 9 AM |
| Weekends only | 0 9 * * 0,6 | Run weekends at 9 AM |
Usage Notes
- Cron takes precedence over interval if both are configured
- Data queues up between scheduled executions
- First execution occurs at the next matching time after component initialization
- Failed executions do not trigger immediate retries, they wait for the next scheduled time
- Use cron for predictable, time-based execution patterns
- For high-frequency or continuous processing, omit cron or use interval instead
- Multiple routes can have different cron schedules, creating time-based routing logic
Troubleshooting
Component Not Executing
Check that:
- Cron expression is valid
- System timezone matches your expectations
- Component status is enabled
- Queue contains data to process
Missed Executions
If executions are being skipped:
- Verify the cron expression matches your intended schedule
- Check system logs for errors during execution attempts
- Ensure previous execution completed before next scheduled time
Timezone Issues
All cron schedules use the system's local timezone. If your logs show unexpected execution times:
- Verify system timezone configuration
- Consider adjusting cron expression to match your timezone
- Document timezone expectations in component descriptions