TaskSchedule
A TaskSchedule creates Tasks on a cron-based schedule from a template task. Use this to automate recurring work like daily reports, periodic data processing, or scheduled monitoring runs.
Defining a TaskSchedule
apiVersion: orloj.dev/v1
kind: TaskSchedule
metadata:
name: weekly-report
spec:
task_ref: weekly-report-template
schedule: "0 9 * * 1"
time_zone: America/Chicago
suspend: false
starting_deadline_seconds: 300
concurrency_policy: forbid
successful_history_limit: 10
failed_history_limit: 3Key Fields
| Field | Description |
|---|---|
task_ref | Reference to a Task with mode: template. |
schedule | Standard 5-field cron expression. |
time_zone | IANA timezone (defaults to UTC). |
concurrency_policy | forbid prevents overlapping runs. |
starting_deadline_seconds | Maximum lateness before a missed trigger is skipped. |
suspend | Set to true to pause scheduling without deleting the resource. |
How It Works
When the cron fires, the scheduler:
- Checks
concurrency_policy-- ifforbidand a previous run is still active, the trigger is skipped. - Checks
starting_deadline_seconds-- if the trigger is later than the deadline, it is skipped. - Creates a new Task from the template, inheriting all
specfields from the referenced task. - The new task enters
Pendingand follows the normal Task lifecycle.
Related
- Task -- the tasks that schedules create
- TaskWebhook -- trigger tasks from external events
- Resource Reference: TaskSchedule