1.5 KiB
1.5 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: stringbootstrap_key: string | null (引导配置键,用于标识预设任务模板)is_system: boolean (bootstrap_key != null时为true,只读派生字段)config: objectinput_template: stringenabled_skills: string[] (calendar | contacts | memory)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.