Skip to main content

schedule

A reusable schedule definition.

Primary Key:Checks:
  • schedule_has_trigger - ((run_after_schedule_id IS NOT NULL) OR ((cron IS NOT NULL) <> (interval_type IS NOT NULL)))
  • schedule_interval_positive - (("interval" IS NULL) OR ("interval" > 0))
  • schedule_interval_type_and_interval_set_together - ((interval_type IS NULL) = ("interval" IS NULL))
  • schedule_minutes_sets_minutes_are_from_completion_time - ((interval_type = 'minutes'::claims.schedule_interval_type) = (minutes_are_from_completion_time IS NOT NULL))
  • schedule_monthly_sets_days_of_month - ((interval_type = 'monthly'::claims.schedule_interval_type) = ((days_of_month IS NOT NULL) AND (cardinality(days_of_month) >= 1)))
  • schedule_on_days_sets_time_of_day - ((interval_type = ANY (ARRAY['daily'::claims.schedule_interval_type, 'weekly'::claims.schedule_interval_type, 'monthly'::claims.schedule_interval_type])) = ((times_of_day IS NOT NULL) AND (cardinality(times_of_day) >= 1)))
  • schedule_weekly_sets_days_of_week - ((interval_type = 'weekly'::claims.schedule_interval_type) = ((days_of_week IS NOT NULL) AND (cardinality(days_of_week) >= 1)))
Foreign Keys:Indexes:
ColumnData TypeNullableIndexedDescription
schedule_idbigintNoYesSnowflake ID for the schedule.
run_after_schedule_idbigintYesYesOptional link to another schedule that this one runs after. When set, interval_type/interval/cron may all be null, meaning this schedule runs immediately after the referenced schedule's job completes.
crontextYesNoOptional standard cron expression. Mutually exclusive with interval_type: a schedule uses either the structured interval columns or a cron expression, not both.
interval_typeschedule_interval_typeYesNoThe unit for `interval`: minutes, daily, weekly, or monthly. Null when the schedule is cron-based or only runs after another schedule.
intervalbigintYesNoRun every N units of `interval_type`. Must be > 0. Null exactly when interval_type is null.
minutes_are_from_completion_timebooleanYesNoSet when interval_type = 'minutes': if true, the next run is scheduled the specified number of minutes after the last job completes; otherwise, intervals are measured from the last scheduled time. NULL on non-minutes schedules.
days_of_weekday_of_week_type[]YesNoSet when interval_type = 'weekly'
days_of_monthclaims.day_of_month_type[]YesNoSet when interval_type = 'monthly' days of month as 1..31. NULL otherwise.
times_of_dayclaims.time_of_day_type[]YesNoClock times the schedule runs at, applies to daily, weekly, and monthly intervals.
last_ran_attimestamp with time zoneYesNoThe last time the schedule was ran. Important for accounting for service restarts that may otherwise break consistent scheduling timing (e.g. with minutes_are_from_completion_time).
created_bybigintNoYesA foreign key to the login row for the user that created the schedule.
created_attimestamp with time zoneNoNoThe time the schedule was created.