Create Routine
routine_create · Tools · Agents
Wake a session on a schedule with an instruction to carry out
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
instruction | string | Yes | What the woken agent does on each run, written as an instruction for that moment. |
name | string | Yes | Short name the user sees in the routines list, such as "Morning email". |
rule | string | Yes | An iCalendar RRULE without the "RRULE:" prefix, such as FREQ=DAILY, or FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR for weekdays. The time of day comes from starts_at, so leave out BYHOUR and BYMINUTE unless it runs several times a day. COUNT or UNTIL ends it. |
session_id | string | No | Id of the session to wake, from session_list or agent_session_create. Use null for this session. Do not invent it. |
starts_at | string | Yes | The first run, which also sets the time of day: RFC 3339 with an offset (2026-11-04T07:30:00+01:00), or a local time without one (2026-11-04T07:30) read in timezone. If it is in the past, the routine starts at its next occurrence after now. |
timezone | string | No | IANA timezone the schedule follows, such as Europe/Stockholm, so 07:30 stays 07:30 across daylight saving. Use null for the workspace timezone. |
Routine Create Tool#
Sets up a routine: an instruction delivered to an agent session on a schedule. At each run the session wakes with the instruction as a <system origin="Routine · <name>"> message and carries it out with its tools.
When to Use#
The agent uses this when the user wants something done regularly ("every weekday at 07:30, go through my email and tell me what needs a reply"). For one check later today, use timer_set. A main agent can also give a routine to a session it opened for a teammate, so that session wakes on the schedule.
Parameters#
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | yes | Short name shown in the routines list |
instruction |
string | yes | What the woken agent does on each run |
rule |
string | yes | iCalendar RRULE without the RRULE: prefix, e.g. FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR |
starts_at |
string | yes | First run and time of day: RFC 3339 with an offset, or a local time without one read in timezone |
timezone |
string or null | no | IANA timezone the schedule follows; null is the workspace timezone |
session_id |
string or null | no | Session to wake; null is the calling session. A caller that is not a session must pass one |
Returns#
| Field | Type | Description |
|---|---|---|
routine |
object | The routine, with next_runs (UTC), next_runs_local (in its timezone) and finished |
next_action |
string | What to tell the user about the schedule |
warning |
string or null | Advice to shorten the instruction when the stored instruction is over 300 words; null otherwise. The routine is saved as written. |
Notes#
- A routine does not run when it is created. Its first run is the first occurrence at or after
starts_at, or the next one after now whenstarts_atis past. - The agent confirms the schedule in its reply, in words and with the timezone.
- For a brief, wrap-up or review, the instruction says what it covers, and the built-in Briefing skill carries how to write it.
- The rule is expanded in the timezone from the anchor, so a 07:30 routine stays at 07:30 across daylight saving.
- A bad rule, an unknown timezone, an unreadable
starts_at, a rule that never fires, or an archived or unknown session is refused with a message saying what to fix.