Cortex recurring tasks
Status: Ready
Truth label: Current
Audience: Fleet operator
Reader outcome: Use cortex recurring tasks in Cortex, with every control, its verification, and its limits stated.
Last verified: 2026-09-13
Open Manage Cortex > Manage recurring tasks, the Work schedules table's
Manage button, or #manage=recurring-tasks-btn. Schedule the task above
copies the task form into the editor, including its brief, method selection,
execution settings and worker pin. Session, parent and resume identities are
removed because each occurrence creates independent work.
Review and save
Choose a project, cadence, IANA timezone, task instructions, brief and overlap policy. New Cortex schedules use the browser's timezone. Check an execution setting to keep it in the template; unchecked settings inherit current operator and project defaults at task creation. The editor accepts a retained writing context snapshot and includes it in each created task. This preserves supplied voice and influence context; it does not change chat settings or learning consent.
Preview shows upcoming appointments with UTC and local offsets, the next stored appointment, project status and the resolved task request. Save requires that preview, an unchanged definition revision and unchanged resolved defaults. Previews expire after ten minutes. A newly reviewed appointment that has already passed must be previewed again. Editing task content preserves the existing next appointment; changing cadence or timezone computes a new appointment.
A paused or archived project can have its schedule edited. It cannot receive a new scheduled task. Pausing an orphaned schedule remains available even if its project or method is no longer available.
History restores a definition into the editor for review and saves it as a new revision. Clone creates a new ID and starts paused. Import loads a definition for review; imported history is reference material, not restored execution state. Export includes the saved definition, all its versions and the currently loaded occurrences, with explicit total and completeness fields. Load more history before exporting when more than fifty occurrences exist.
Agent turns are unlimited for each occurrence. Older saved or imported templates may contain max_iterations; it is discarded during validation and does not constrain new tasks.
Time and overlap
every 90m,every 6h, andevery 2dmeasure elapsed time. Intervals must be between one minute and one year. Missed intervals preserve the original phase.daily 08:00andweekly sun 08:00follow the selected timezone's calendar. A repeated daylight-saving hour fires at its first occurrence only. A missing wall time advances to the first valid local minute.- Legacy clients that omit timezone retain server-local time, shown as
local. Choose an IANA timezone in Cortex to make the intended location explicit. - One catch-up records one occurrence covering the missed range. It never replays every historical appointment. Interval ranges include exact counts; calendar ranges retain their endpoints without inventing a count.
- Skip late records a skip when the original appointment is over 120 seconds late. The timer checks every thirty seconds, so appointments are not exact-time delivery guarantees.
- Skip overlap records the reason when earlier work is active or waiting.
- Keep one waiting run coalesces later appointments into the first waiting run. That run keeps its original template; each coalesced decision remains inspectable.
- Queue holds at most one hundred future occurrences per schedule. It creates one task at a time, in occurrence order. Further appointments record capacity skips. Completed, failed and cancelled tasks release the next waiting task.
Defaults resolve again when a waiting occurrence becomes a task. Its template revision and supplied writing snapshot stay fixed. Each created task retains the actual resolution and default revisions. A schedule does not claim that an inherited model name pins model weights or that a writing snapshot freezes every external source file.
Run, pause and inspect
Run saved schedule now uses a retry identity, follows the saved project and overlap rules, and preserves the next calendar appointment. Manual runs are available for paused schedules. They can be queued if earlier work is active.
Pausing holds waiting occurrences and leaves created tasks alone. A project pause also holds existing waiting work; new appointments record a project block. Resume can produce one catch-up according to the saved policy. Cancel a waiting occurrence in its history card. Once a task exists, manage it through Open task.
Each history card retains timing, template revision, full template, outcome, reason, task identity and creation context. The task status shown in Cortex is a current lookup. It is not a frozen terminal-result judgment. Deleting a schedule cancels waiting occurrences, keeps created tasks and archives the schedule for inspection/export in this same editor. A deleted ID cannot be reused.
Storage and compatibility
Definitions, versions, occurrences and migration/archive metadata live in the existing Forge SQLite database. Appointment creation and task creation share a transaction, with an inner savepoint for recoverable task-validation failures. Concurrent timer calls therefore cannot create two tasks for one appointment.
The first schedule access migrates valid legacy schedules.json records once.
It preserves IDs, retained next appointments and the original JSON file. Naive
legacy dates keep their server-local meaning. Invalid legacy data aborts the
migration atomically with a visible error; no rows are partially imported. A
migration marker prevents deleted schedules from reappearing from the retained
JSON. The module constructor performs no import-time data access.
Operator-reviewed cursors, result summaries and whole workflows are supported below. Automatic source polling remains separate work. Authentic voice quality still requires operator judgments through the writing evaluation workflow.
The timezone implementation uses Python’s zoneinfo database selection. The declared tzdata dependency supplies an IANA database on systems without one.
Verification
Focused tests exercise duplicate ticks, restart, template/default timing, all three overlap policies, queue capacity, cancellation, project pause/deletion, failed task rollback, review conflicts, legacy migration and daylight-saving boundaries. The isolated Cortex browser workflow covers editing, import/export, preview, manual runs, cancellation, version restoration, cloning, archived inspection and reload. No live operator schedules or worker runs were changed.
Review recurring results and retain progress
Choose Review recurring result beside a created occurrence. Cortex shows its task output, exact output digest, criterion acceptance and the previous retained cursor. Where a prior accepted result exists, it also shows a bounded text comparison. A text change is separate from the operator's meaningful-change judgment.
Choose accepted with changes, accepted unchanged, or rejected. Enter the last successful source position, optional source fingerprint, retained summary and review explanation. These source fields are supplied by the operator. They are not inferred from a task's exit status. Completed tasks with output can advance the cursor; tasks with structured criteria also require current acceptance. Failed, unfinished or rejected work cannot advance it. Repeated delivery of the same review request returns the recorded decision. Stale output/cursor edits and attempts to advance from an older occurrence are rejected.
The next dispatched occurrence can receive the last reviewed cursor and summary in its instructions and frozen writing context. Waiting tasks receive the latest reviewed cursor at dispatch. Supply the last reviewed cursor and summary to future tasks controls this behavior per schedule template. Existing writing choices and the task's separate goal/criteria remain intact. A cursor from a different project is never carried into the new project.
Manage retained cursor and result reviews opens history independently of an occurrence. Edit or clear the fields, explain the change, and save a manual override. Restoring a historical cursor opens it in the editor and saves a new version. A manual override does not accept task output. Export retains cursor versions and reviews. Deleted schedules retain their history for inspection and export but reject cursor changes.
The current cursor remains a record of the earlier review. Later task edits do not rewrite its historical summary. Review the correction or explicitly reset it before future reuse. This workflow advances an operator-reviewed source position. Automatic provider cursors, research-run scheduling and external notification delivery remain separate follow-through. Older result-history pagination is also still open.
Recurring workflows
Choose Workflow stages under Run type. Select a managed or bundled workflow, use its current revision, enter the shared goal, and optionally override worker, engine, verification command or QA rework budget. The writing-context snapshot is supplied to every stage. Preview resolves the complete chain before saving.
Saving retains the reviewed stage definitions as a workflow snapshot. A template's later edits do not change this schedule or its waiting occurrences. Use current template revision selects its current content for a new preview and save, including bundled templates whose numeric revision remains zero. A content hash distinguishes those versions. Historical schedule definitions can restore their own retained stage snapshot. Importing a definition on another schedule requires its template content to be available there; imported execution history does not grant an executable snapshot.
Retiring the source workflow prevents new scheduled launches. Previously created stages remain available. Waiting occurrences that cannot launch retain the failure reason. Pause the schedule while addressing that condition, then use a new Run now request after correcting it. Repeating the same manual request returns its original occurrence, including a retained failure.
Each occurrence creates one session and the ordered stage tasks together in Forge SQLite. A failed stage creation rolls back the session, tasks and workflow records; the recurrence still retains its failed occurrence. Overlap policies wait on every required stage, including stages returned to pending by QA rework. The occurrence view links each stage and shows its current status.
Recurring-result review uses the final stage's output and checks the whole chain. Every required stage must complete. Applicable criteria need current acceptance. Missing stages and missing frozen criterion evidence prevent advancing the cursor. The review digest includes intermediate results, attempts and acceptance evidence, so changing an earlier result invalidates a stale review. An accepted cursor and summary reach every stage of the next occurrence. This remains operator-reviewed progress; the scheduler does not infer source coverage or meaningful changes.
Session storage
Sessions now share the Forge transaction with their workflow tasks. On first access,
valid legacy sessions/sessions.json records import once, preserving IDs, status and
timestamps. The original file is retained unchanged and does not overwrite later SQL
edits or resurrect deleted sessions. Validation finishes before any records import.
Malformed or conflicting legacy records leave the import incomplete and report a
repair error. The existing Cortex session rename, completion and deletion controls
operate on current SQL state. Merely importing the service module does not access
session storage. Repairing malformed legacy files in Cortex remains follow-through.