ScheduledJob
Persistent scheduled job configuration.
Stores cron job definitions that are loaded by the workerprocess 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
Section titled “Fields”| Field | Type | Required | Description | Validators |
|---|---|---|---|---|
| name | str | ✓ | Unique job identifier | minLen: 1, maxLen: 255 |
| function | str | ✓ | Dotted path to job function (e.g., ‘myapp.jobs.send_email’) | minLen: 1 |
| cron_expression | str | ✓ | Cron syntax (e.g., ‘0 9 * * *’ for daily at 9 AM) | minLen: 1 |
| enabled | bool | Whether the job is active and should be scheduled | - | |
| last_run | None | Timestamp of last execution (set by worker) | - | |
| next_run | None | Timestamp of next scheduled run (calculated) | - |
Permissions
Section titled “Permissions”| Role | Create | Delete | Read | Write |
|---|---|---|---|---|
| Admin | ✓ | ✓ | ✓ | ✓ |
| Employee | ✓ | |||
| Manager | ✓ | ✓ | ✓ |
Configuration
Section titled “Configuration”| Setting | Value |
|---|---|
| Submittable | False |
| Track Changes | True |
Controller
Section titled “Controller”Controller hooks are implemented in *_controller.py files.
Available lifecycle hooks:
validate()- Called before save, raise exceptions for validation errorsbefore_insert()- Called before inserting a new documentafter_insert()- Called after successfully insertingbefore_save()- Called before saving (insert or update)after_save()- Called after savingbefore_delete()- Called before deletingafter_delete()- Called after deleting