Skip to main content
Hyrex supports scheduling tasks to run at regular intervals using cron expressions.

Basic Cron Task

Define a scheduled task using the cron configuration:

Cron Expression Format

Hyrex uses standard 5-field cron expressions:

Common Patterns

Cron Validation

The TypeScript SDK validates cron expressions when tasks are registered:

Cron Task Examples

Heartbeat Monitor

Data Cleanup

Scheduled Reports

Data Sync

Cron with Other Features

Cron with Retries

Cron with Workflows

Monitoring Cron Tasks

Track cron execution through Hyrex Studio:
  • View scheduled tasks and their cron expressions
  • Monitor execution history
  • Check for missed executions
  • Review task success/failure rates

Best Practices

  1. Use Descriptive Names
  2. Set Appropriate Timeouts
  3. Handle Overlapping Executions
  4. Log Cron Executions

Limitations

  • No seconds precision: Cron expressions use 5 fields (minute precision)
  • Fixed schedule: Cannot dynamically change cron expression after registration
  • No timezone support: Cron runs in server timezone
  • Platform mode: Cron scheduler doesn’t run when using HYREX_API_KEY (platform handles scheduling)

Next Steps

Tasks

Configure scheduled tasks

Monitoring

Monitor cron executions

Retries

Handle cron task failures