Schedules
Automate background agent execution with cron schedules, one-time triggers, overlap prevention, and dedicated occurrence auditing.
Schedules enable Service to dispatch prompts or structured payloads to agents automatically—either at a future timestamp or recurring on a timetable. Whether generating daily engineering summaries, auditing system logs overnight, or dispatching customer reports, schedules operate independently in the background on your distributed workers.
Create and manage a schedule
You can create and test a recurring schedule directly in Console:
- Navigate to Schedules → Create schedule.
- Name the schedule (e.g.,
Daily Morning Standup Report). - Select Recurring and provide a 5-field cron expression (e.g.,
0 9 * * 1-5for 09:00 AM Monday through Friday) alongside your target IANA time zone (e.g.,America/New_YorkorAsia/Shanghai). - Click Preview next times to inspect the next 5 calculated execution instants in both local and UTC times.
- Select the target agent, choose whether to pin a specific revision or follow the latest default, and enter the prompt instructions (e.g., "Synthesize the previous day's git commits and open PRs into team highlights.").
- Under Delivery target, choose whether each occurrence creates a New thread each time (recommended for standalone reports) or Reuses one thread (for continuous long-term logs).
- Save the schedule. New schedules begin in a
pausedstate. - Click Run once to trigger an immediate manual test run. Inspect the output to verify tool calls and responses.
- Click Enable to activate automatic cron execution.
Service schedules enforce strict overlap prevention: if a prior occurrence has pending or unfinished work when the next cron tick arrives, Service skips the new occurrence with reason overlap.
One-time schedules
For tasks that need to run exactly once at a designated future time (e.g., deploying an approved schema change during a scheduled maintenance window):
- Choose One time in the schedule creation modal.
- Select your future date and target time.
- Save the schedule and enable it.
- Once the target time arrives, Service dispatches the task, marks the schedule state as
completed, and records the execution result.
Temporary submission failures can retry within the maximum lateness window (default 300 seconds). The deadline and attempt limit bound those retries; they do not guarantee execution.
Read the result
Each time a schedule fires, Service creates an Occurrence record tracking the lifecycle of that specific trigger:
| Occurrence status | Meaning |
|---|---|
pending | Intent saved; submission has not completed |
submitted | Message saved in Inbox, possibly queued or executing |
completed | The trigger's run finished; inspect its execution outcome |
failed | Submission was rejected or exhausted its attempts |
skipped | Overlap or the lateness deadline prevented submission |
cancelled | Pending intent was cancelled by a schedule change |
Click any occurrence row in the schedule history table to inspect the generated output, review exact tool arguments, or follow the complete execution trace in Debug view.
Submission failures
Temporary submission failures retry with bounded exponential backoff and respect Retry-After, up to the occurrence deadline and attempt limit. Expired occurrences become skipped; exhausted retries become failed. Persistent authority or target failures can automatically pause the schedule. Invalid input and unexpected internal errors fail only the current occurrence, leaving future triggers enabled. Inspect reason and last_error in the occurrence history.
A submitted occurrence means its message reached Inbox, including when it is queued behind an active run. Execution failure does not resubmit that message.
Use the HTTP API
Schedules can be created, updated, and dispatched programmatically via the Service API.
Submit POST /api/v1/schedules with an idempotency key:
{
"name": "Daily Morning Standup Report",
"schedule": {
"type": "cron",
"expression": "0 9 * * 1-5",
"timezone": "America/New_York"
},
"target": {
"mode": "new_thread",
"session_id": null
},
"invocation": {
"agent_id": "agent_reporter_123",
"agent_revision_id": null,
"payload": {
"content": [
{
"type": "text",
"text": "Generate the morning engineering summary."
}
]
}
}
}The response returns the schedule ID and its current ETag:
{
"id": "sched_abc123",
"name": "Daily Morning Standup Report",
"state": "paused",
"created_at": "2026-11-20T10:00:00Z"
}To trigger a manual test dispatch immediately via the API:
curl -X POST "${A13N_SERVICE_URL%/}/api/v1/schedules/sched_abc123/dispatch" \
-H "Authorization: Bearer $A13N_API_KEY" \
-H "If-Match: $SCHEDULE_ETAG" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{}'Common schedule management endpoints:
| Action | HTTP Request |
|---|---|
| Get schedule details | GET /api/v1/schedules/{id} |
| Update configuration | PATCH /api/v1/schedules/{id} (requires If-Match) |
| Enable schedule | POST /api/v1/schedules/{id}/enable |
| Pause schedule | POST /api/v1/schedules/{id}/pause |
| Archive schedule | DELETE /api/v1/schedules/{id} |
| List occurrences | GET /api/v1/schedules/{id}/occurrences |
Reuse an environment and browser across firings
Reuse the same workspace files and browser sign-in while keeping each firing's conversation history separate. Set target.mode to new_thread, then merge these fields into invocation in the creation request. Replace the example IDs with existing resources in the same workspace. You can select either resource on its own.
{
"environments": [{"name": "workspace", "environment_id": "env_0123456789abcdef01234567"}],
"browser_binding": {"browser_id": "browser_0123456789abcdef01234567"}
}Dispatch once manually and open the occurrence's first Run. Check environment_mounts and browser_binding for the selected resource IDs. Service checks resource IDs, status and access when it dispatches the occurrence. If the ID cannot be resolved, the resource was released or access was revoked, check the failure reason on the occurrence.
By default, threads share the browser profile and sign-in state, and each thread manages its own tabs. For target.mode: "thread", bind the resources on the target thread and omit these two initial fields.
Observe live state and load history
To observe execution progress in real time as scheduled tasks fire, connect to the session stream:
GET /api/v1/sessions/{session_id}/streamThe SSE stream broadcasts schedule and occurrence lifecycle updates alongside live token chunks. For automated alerting, configure a Webhook subscribed to the schedule_occurrence.completed event to deliver reports directly to Slack, email, or internal monitoring systems.