Job scheduling and automation. Config: services/scheduler/config.yaml
Help:
{ "command": "core playbooks show domain_scheduler-jobs" }viasystemprompt_helpRequires: Active session -> See Session
Configure Jobs
Edit services/scheduler/config.yaml:
scheduler:
enabled: true
timezone: "UTC"
jobs:
- name: publish_pipeline
schedule: "0 */6 * * *"
enabled: true
description: "Publish content changes"
timeout_seconds: 300
- name: cleanup_sessions
schedule: "0 0 * * *"
enabled: true
description: "Clean up expired sessions"
timeout_seconds: 60
- name: cleanup_anonymous_users
schedule: "0 2 * * *"
enabled: true
description: "Remove anonymous users older than 30 days"
timeout_seconds: 120
- name: database_cleanup
schedule: "0 3 * * 0"
enabled: true
description: "Database maintenance"
timeout_seconds: 600
- name: analytics_aggregate
schedule: "0 */1 * * *"
enabled: true
description: "Aggregate analytics data"
timeout_seconds: 120
Cron Format
┌───────────── minute (0 - 59)
│ ┌───────────── hour (0 - 23)
│ │ ┌───────────── day of month (1 - 31)
│ │ │ ┌───────────── month (1 - 12)
│ │ │ │ ┌───────────── day of week (0 - 6, Sunday = 0)
* * * * *
| Expression | Description |
|---|---|
* * * * * |
Every minute |
0 * * * * |
Every hour |
0 0 * * * |
Daily at midnight |
0 */6 * * * |
Every 6 hours |
0 0 * * 0 |
Weekly on Sunday |
0 0 1 * * |
Monthly on 1st |
Monitor Jobs
{ "command": "infra jobs list" } { "command": "infra jobs status publish_pipeline" } { "command": "infra jobs history publish_pipeline" } { "command": "infra logs --context scheduler --limit 50" }
Run Manually
{ "command": "infra jobs run publish_pipeline" } { "command": "infra jobs run publish_pipeline --verbose" }
Create Custom Job
jobs:
- name: custom_sync
schedule: "0 */2 * * *"
enabled: true
description: "Custom sync operation"
timeout_seconds: 180
config:
source: "external_api"
batch_size: 100
{ "command": "infra jobs list" } { "command": "infra jobs run custom_sync" }
Enable/Disable Jobs
Disable:
jobs:
- name: publish_pipeline
enabled: false
Enable:
jobs:
- name: publish_pipeline
enabled: true
{ "command": "infra jobs list" }
Common Schedules
| Use Case | Expression |
|---|---|
| Every 5 minutes | */5 * * * * |
| Every 15 minutes | */15 * * * * |
| Every hour | 0 * * * * |
| Every 4 hours | 0 */4 * * * |
| Daily midnight | 0 0 * * * |
| Daily 3 AM | 0 3 * * * |
| Weekly Sunday | 0 0 * * 0 |
| Monthly 1st | 0 0 1 * * |
Built-in Jobs
publish_pipeline:
- name: publish_pipeline
schedule: "0 */6 * * *"
description: "Publish content changes"
cleanup_sessions:
- name: cleanup_sessions
schedule: "0 0 * * *"
description: "Clean up expired sessions"
database_cleanup:
- name: database_cleanup
schedule: "0 3 * * 0"
description: "Database maintenance"
Configuration Reference
jobs:
- name: job_name
schedule: "0 * * * *"
enabled: true
description: "Description"
timeout_seconds: 300
config:
key: value
| Field | Required | Description |
|---|---|---|
name |
Yes | Unique identifier |
schedule |
Yes | Cron expression |
enabled |
Yes | Active state |
description |
No | What job does |
timeout_seconds |
No | Max execution time |
config |
No | Job-specific settings |
Troubleshooting
- Job not running:
{ "command": "infra jobs list" }, checkenabled: true - Job fails:
{ "command": "infra logs --context scheduler --level error" },{ "command": "infra jobs history <job_name>" } - Job times out: Increase
timeout_secondsin config
Quick Reference
| Task | Command |
|---|---|
| List | infra jobs list |
| Status | infra jobs status <name> |
| Run | infra jobs run <name> |
| History | infra jobs history <name> |
| Logs | infra logs --context scheduler |
Related
-> See Scheduler Service