1.3 KiB
1.3 KiB
Automation Jobs Model Protocol
Scope
This document defines the automation_jobs data contract used by backend API payloads,
scheduler computation, and Flutter settings pages.
Canonical Fields
id: UUIDowner_id: UUIDtitle: stringconfig: objectinput_template: stringenabled_tools: string[]context: objectsource:latest_chatwindow_mode:day | numberwindow_count: int
schedule: objecttype:daily | weeklyrun_at: objecthour: int (0-23)minute: int (0-59)
weekdays: int[] (only for weekly; Monday=1 ... Sunday=7)
timezone: IANA timezone stringnext_run_at: timestamptz (UTC), scheduler due cursorlast_run_at: timestamptz | nullstatus:active | disabledcreated_at: timestamptzupdated_at: timestamptz
Scheduling Semantics
- Scheduler scans only by
next_run_at <= now_utc. - Scheduler calculates subsequent
next_run_atfromconfig.schedule + timezone. run_atandschedule_typetop-level columns are deprecated and removed.
Compatibility Strategy
- Strategy: migration-required change.
- Existing rows must be migrated by backfilling
config.schedulefrom legacyrun_at/schedule_typebefore dropping those columns. - Clients must send schedule data through
config.scheduleonly.