Skip to main content
Recurring work such as daily briefs, queue triage, repository syncs, health checks, and reports should use the same runtime as on-demand runs. AgentOS stores schedules and run history in the platform database, invokes existing agent, team, or workflow endpoints, and lets agents manage schedules through SchedulerTools.
The scheduler runs inside the AgentOS process and polls agno_schedules every scheduler_poll_interval seconds. Keep at least one scheduler-enabled runtime running continuously. Due jobs retry failures up to each schedule’s max_retries, and every attempt is persisted. The scheduler fires a due job by calling its endpoint over HTTP, against http://127.0.0.1:7777 by default. That matches the default serve() port. Set scheduler_base_url to match when you serve on a different host or port; otherwise schedules fire against the wrong URL.

Two ways to create schedules

Agent Managed

Give an agent SchedulerTools and it can schedule its own work via chat:
The Scheduler Tools Agent example is a runnable version of this pattern.

Manually Registered

For schedules that should always exist (the daily digest, the hourly sync, the nightly cleanup), create them in your app’s lifespan via ScheduleManager:
if_exists="update" makes restarts idempotent by updating the existing schedule. Pass "skip" to preserve manually edited schedules or "raise" (the default) to surface accidental name collisions. This is the pattern Coda uses for daily digest and repo sync.

Schedule a workflow

Schedules invoke endpoints. Point a schedule at /workflows/<id>/runs when recurring work has multiple steps, branches, or review loops. See Workflow Automation and Workflows.

Schedule runs and observability

When a schedule fires, AgentOS:
  1. Looks up the schedule in agno_schedules and claims it through a database-backed lease.
  2. Calls the configured endpoint (POST /agents/<id>/runs, POST /teams/<id>/runs, or POST /workflows/<id>/runs) over HTTP via httpx.AsyncClient. This is the same path an external caller would take, including auth headers.
  3. Records the schedule attempt in agno_schedule_runs with status, timings, the underlying run_id and session_id when returned, and any error. The target component persists its run according to its database configuration. Traces require tracing to be enabled.
Schedule runs are queryable from agno_schedule_runs. When the target component persists sessions and AgentOS tracing is enabled, the linked run also appears in session and trace views. This Postgres query lists runs fired in the last 24 hours:
The ai. prefix is the schema PostgresDb creates its tables in by default (override with PostgresDb(db_schema=...)). Timestamps on schedule runs are stored as epoch seconds (BigInt). For the trace of a specific scheduled run, follow the run_id from agno_schedule_runs back to agno_traces. See Observability for the full data model.

Scheduler in HA

Every replica can run the scheduler loop safely on the backends that implement the scheduler’s claim methods: Postgres, SQLite, and MongoDB. Due schedules are claimed through an atomic database-backed lease. The first replica to claim a due job runs it; the others skip. Deployment configuration can pin scheduler polling to a dedicated replica. See Scheduler for tuning details.