Schedules
A schedule stores a run request (input, optional conversation, previous_response_id, context_management, and metadata) plus a timing rule, and starts a normal agent run each time the rule fires. The page calls one firing a tick.
Create a schedule
201 Created with a schedule object (sched_...) in status active. A 502 means nothing was saved; retry the create.
The schedule object picks the kind:
timezone defaults to UTC and only affects cron. run_at and start_at are absolute instants: write them with an offset or a trailing Z.
input takes the same shapes as a run: a string, or an array of input items. metadata is a string map; every run the schedule starts gets it, plus agent_schedule_id.
A schedule remembers the identity that created it, including X-On-Behalf-Of, and every run it starts executes as that identity. Runs from a schedule created for an end user are listed under that end user’s run scope; org admins also see them in the team-wide run list.
List, retrieve, and update
schedule re-creates the timer and sets status back to active, even if the schedule was paused. Changing any other field leaves the timer and the status alone.
A 502 from an update means the new spec was saved but the timer may not have been replaced; the status is unchanged. Repeat the update until it returns 200.
Pause, resume, and delete
{ "object": "agent.schedule.deleted", "id": "sched_123", "deleted": true }. Delete succeeds even when the scheduler is unreachable; a timer left behind that way is harmless. A repeated DELETE returns 404.
Delete an agent’s schedules before you delete the agent. Deleting the agent does not delete its schedules, and afterwards they cannot be reached, because a schedule is only addressable through /agents/{agent_id}/schedules/....
How runs are recorded
- Each tick creates a normal agent run, so it appears in the agent’s run history with
metadata.agent_schedule_idset. - After the run, the schedule’s
last_run_at,last_run_id, andrun_countare updated. A run that fails at the gateway is still recorded as a run (withstatus: "failed") and still counts. - There is no per-schedule run listing. To see a schedule’s runs, list the agent’s runs with the same
X-On-Behalf-Ofthe schedule was created with and keep the ones whosemetadata.agent_schedule_idmatches. The console does the same to label a run as “schedule”.
Durability and failure
- Pause and resume act on the timer named by
temporal_schedule_id; when that field isnull, they return409. - If a tick fires while the previous run is still executing, that tick is dropped rather than queued. Expect gaps in
run_counton long-running agents with short intervals. - Missed ticks are backfilled for up to 10 minutes after their scheduled time, for example after a service restart. Older misses are dropped.
- A tick that fails before its run is recorded is retried, up to 3 attempts. A retry can duplicate a run if the failure happened after the gateway accepted the request. A run that reaches the gateway and fails is recorded as failed and is not retried.
- A tick does nothing when the schedule is not
active, or its agent has been deleted.