Routines
A routine puts an agent on a schedule. Give it a prompt and a schedule, and the agent does the work every time it comes round: a morning summary of your calendar, a weekly check of what’s stalled, a reminder on Saturday at 9.
Open Routines in the sidebar (press G then R).
What a routine is
| Part | What it is |
|---|---|
| Agent | Which agent does the work |
| Prompt | What the agent should do each time, up to 2,000 characters |
| Schedule | How often it runs: an interval, a cron expression, or once at a set time |
| Label | A short name for the routine. It fills in from your prompt; edit it if you like |
Creating a routine
In Cohort
- On Routines, click New Routine (or press
NthenRanywhere). - Choose the Agent.
- Write the Prompt. Be specific: “Summarize anything urgent in today’s calendar and open tasks, in five bullets” works better than “check things”.
- Set the Schedule:
- Interval: every so many minutes, hours, or days. The shortest is one minute.
- Cron expression: a standard five-field cron expression, such as
0 9 * * 1-5for weekdays at 9:00. The form previews the next five runs.
- Check the Label and save.
By asking an agent
Ask in chat or on a channel: “Every weekday at 8, send me a summary of my day”, or “On Friday at 5, send me this week’s numbers”. The agent creates the routine for you. This is also how you make a one-time routine: it runs once at the time you asked for, then switches itself off. One-time routines appear in your list with their date.
Where results go
A routine’s result goes to the people who follow the routine. After a run, your inbox gets one item for each routine you follow:
- If the agent already sent the result somewhere, such as a text to your phone, the item says where it went.
- Otherwise the item shows the first line of the result and opens the full result on the routine’s page, under Recent runs.
- If the run had a problem or failed, the item says that instead.
What a run makes
A routine keeps what its runs make. When a run produces a file (a report, an image, a spreadsheet) or writes a Google Doc, it is attached to the routine and listed under that run on the routine’s page, under Recent runs. No task is made for a run. Where your workspace has the Wire, it also appears there, linking back to the routine and the run.
The same privacy rule applies as for results: if you can’t read a routine’s results, you don’t see what its runs made either.
When a run needs you
A run that failed, couldn’t do its job (for example, a connection it needs isn’t set up), or whose agent asks a person to decide or do something opens a task. The task is assigned to the routine’s owner: the person who created it, or the workspace owner for a routine an agent created. It is an ordinary task, so you work on it, comment on it and close it like any other.
- The task explains what is needed and links to the run. What the run said is read on the run itself, on the routine’s page.
- If the next run needs the same thing while that task is still open, it adds a comment to the task instead of opening another one.
- Once you close the task, the next run with the same problem opens a new one.
- A run that went fine never opens a task.
The owner hears about the run through its task, so they don’t also get the routine’s own inbox item for it. Other people who follow the routine still do. Each run on the routine’s page links the task it opened.
If there was nothing to report, you get no item and no notification. This lets a routine like “tell me only if something changed” stay quiet. Every run, quiet or not, is listed on the routine’s page under Recent runs.
The person who created a routine follows it automatically (for a routine an agent created, that’s the workspace owner). Anyone can follow or unfollow a routine from its page with Run updates.
Routine results are not posted to the Wire. The Wire is for things agents make. When a run produces something to keep, such as a document or an image, the agent publishes that to the Wire itself.
In a workspace with more than one person, the results of a routine that an agent created (for example, one you asked for in a private chat) can be read only by the people who follow it. Results of a routine a person created can be read by everyone in the workspace.
Managing routines
The Routines page shows a table and a month calendar of upcoming runs. Calendar feeds you’ve added appear on the calendar too.
From the table, or from a routine’s own page:
| Action | What it does |
|---|---|
| Pause / Resume | Stop a routine from running without deleting it, and start it again |
| Run Now | Run it immediately, whatever its schedule |
| Edit | Change the agent, prompt, schedule, or label |
| Delete | Remove it for good |
A routine’s page also shows its recent runs and its upcoming ones. Each recent run shows the first line of what the agent reported; choose Show result to read it in full. If the last run failed or needs attention, the routine is flagged so you can see why.
Routines use credits like any other work. When credits run low, scheduled routines pause first so your conversations keep working. See Credits and Allowances.
From the API
Create and manage routines with the Routines API. Getting a single routine returns the full result of its latest run.