Skip to main content
Version: Next

TaskSchedule

TaskSchedule

Represents a task schedule configuration.

Tasks can be scheduled using either cron expressions or specific dates/timestamps. The timezone is optional and defaults to the system timezone.

Signature
type TaskSchedule = | {
/** Schedule type using cron expressions */
type: 'cron';
/** Optional timezone for the cron schedule (e.g., 'UTC', 'America/New_York') */
timezone?: string;
/** Cron expression (e.g., '0 0 * * *' for daily at midnight) */
value: string;
}
| {
/** Schedule type using a specific date or timestamp */
type: 'date';
/** Optional timezone for the date schedule */
timezone?: string;
/** Date object or Unix timestamp in milliseconds */
value: Date | number;
}