Skip to main content

ScheduledJob

Persistent scheduled job configuration.

Stores cron job definitions that are loaded by the worker
process at startup, enabling dynamic job scheduling.

Attributes:
name: Unique job identifier
function: Dotted path to job function (e.g., 'myapp.jobs.send_email')
cron_expression: Cron syntax string (e.g., '0 9 * * *')
enabled: Whether the job is active
last_run: Timestamp of last execution (updated by worker)
next_run: Timestamp of next scheduled run (calculated)

Source: scheduled_job.py

Fields

FieldTypeRequiredDescriptionValidators
namestrUnique job identifierminLen: 1, maxLen: 255
functionstrDotted path to job function (e.g., 'myapp.jobs.send_email')minLen: 1
cron_expressionstrCron syntax (e.g., '0 9 * * *' for daily at 9 AM)minLen: 1
enabledboolWhether the job is active and should be scheduled-
last_rundatetimeNoneTimestamp of last execution (set by worker)
next_rundatetimeNoneTimestamp of next scheduled run (calculated)

Permissions

RoleCreateDeleteReadWrite
Admin
Employee
Manager

Configuration

SettingValue
SubmittableFalse
Track ChangesTrue

Controller

Controller hooks are implemented in *_controller.py files. Available lifecycle hooks:

  • validate() - Called before save, raise exceptions for validation errors
  • before_insert() - Called before inserting a new document
  • after_insert() - Called after successfully inserting
  • before_save() - Called before saving (insert or update)
  • after_save() - Called after saving
  • before_delete() - Called before deleting
  • after_delete() - Called after deleting