# Routines

> Any agent's routines: scheduled ones, rules for when something happens in an app, suggestions, history, and approving routines an agent proposes.

A routine is work an agent does by itself: on a schedule, such as *Every weekday at 8:30, find up to 10 new leads that match my ideal customer.*, or when something happens in one of its apps. Everything an agent does by itself is on its **Routines** page; its **Settings** say how it behaves and what it may use. Most suggested routines wait until you select **Turn on**; a few turn on by themselves once the app they need is connected. A routine you add yourself starts on.

Open the agent and select **Routines** under **Customize**. The page shows **Scheduled**, then **When something happens**, then **Turn on what works without keys** when it applies, then suggested routines. Every scheduled routine is also on Tasks, in its *Repeating* view, with the whole squad's.

## Scheduled

The agent's routines, with **Routine**, **When**, **Next run**, **Last 5 runs** (**Last run** when the server's routine engine is off; *Not run yet* for a new routine) and **On · actions**: the on/off switch, **Run now** and a gear button that opens the routine's settings (its name followed by *settings*, such as *Weekly leads settings*: the schedule and wording). Turning a routine off keeps its time and brief, and shows **Off** with who paused it and when. With none yet, the agent works only when you or Ava give it a task.

## When something happens

Rules that start the agent when something happens in one of its apps, such as a new deal in your CRM: *when* an event *in* an app, *ask* the agent *to* use one of its skills. Events within a minute become one run, and anything the agent drafts from an event waits for your OK.

1. **Add a rule**

   Select **Add a rule**.
2. **Pick the event**

   In **When something happens in**, pick the app, then **The event**, and fill any details the event offers.
3. **Say what to do**

   In the *Ask … to* field (it shows the agent's name), choose one of its approved skills (*No approved skills yet* until it has one). With more than one project, pick which one too. Under **What to do with each event**, add a note if you like, such as *Write a short pre-meeting note for the deal's owner*.
4. **Save it**

   Select **Save rule**.

With none yet the box says *No rules yet.* A rule that's turned off shows an *Off* tag. Each rule can be removed on its own (*Rule removed.*). **Recent events** lists what came in, each **Queued**, **Ran** or **Dropped**. The agent needs an app before it can have rules: until it has one, the box says *Give … an app first in …'s Settings › Apps; its events show here.*, with the agent's name and a link to that tab (for Ava, to **Settings** → **Apps**). Apps are given in [Apps and access](/docs/agents/apps_and_access#manage-apps).

## Turn on what works without keys

This card lists the agent's suggested routines that need no app, account or key and aren't on yet, each with its schedule: *Nina can do these on a schedule without any app connected. Paid steps use your plan's allowance.* One button turns them all on, such as *Turn on all 2*, or **Turn it on** for one. Nothing turns on until you select it, and the card hides when none are left. The same card shows on the agent's [chat page](/docs/agents/agent_page).

## Suggested routines

Routines the agent offers that aren't on yet. **Turn on** starts one as it is; **Set up** opens it in the form below, filled in, and saving turns it on. A suggestion that needs an app shows **Connect** until the app is connected.

Some suggestions are on by default: they read *On by itself once X is connected* (with the app's name), and connecting that app in the project turns them on, with no press. Each then works like any routine: what it drafts follows the levels you set for the agent. Turning one off, or deleting it, is remembered: connecting again never turns it back on, and **Turn on** brings it back when you want it. A suggestion that reads the app every run says so on its row, such as *Reads X every run (paid X reads)*: those reads count toward your usage.

## Add or edit a routine

Select **New routine**, or the gear button on a routine. A routine you add with **Add routine** starts on.

| Field | What it sets |
| --- | --- |
| **Name** | Optional; named from what it does if left empty |
| **Who** | The agent that does it, or *Let Ava pick* to have your chief of staff choose each time |
| **Skill** | Which of the agent's approved skills it uses; with *Let Ava pick* it reads *Ava picks* |
| *What it does* | What should happen each time, in your words (required). *Ideas* fill it from a skill |
| **Repeat** | **Every day**, **Weekdays**, **Some days**, **Every few hours**, **Monthly**, **Once** or **Custom** |
| **If a run is missed** | *Run once when back, up to 3 h late* (the default), or **Skip it** |
| **Then** | Another agent that runs next and gets the results, or *Nothing else* |
| **Time zone** | Your project's time zone, shown with its name (such as *Europe/London*), or any other |

A line under **Repeat** shows when it runs and the next two runs. **Once** runs once, then shows as done. **Once** and **If a run is missed** are offered only when the server's routine engine is on. Select **Add routine** or **Save**; changes apply from the next run and the history stays.

## A routine's page

Select a routine's name. The header has the on/off switch, **Run now** and **Edit**; **More** holds **Delete routine**, which asks first. Deleting keeps past runs in history; to stop it for now, turn it off instead.

| Card | What it shows |
| --- | --- |
| **When** | The schedule, the next runs, and what happens to a missed run |
| **Starts on** | The schedule, a URL (your site, Zapier), an app event, or **Run now** |
| **Carries to the next run** | The note the last run left for the next one. **Clear note** to start fresh |
| *What Rio does* (with the agent's name) | The routine's brief |
| **Limits** | Today's runs and minutes, against the agent's daily limits if you set any (else *no daily limit*) |

**History** lists every run: when, what started it (schedule, catch-up, **Run now**, a URL or an app event), the result and what happened. Filter by **All**, **Ran**, **Skipped** or **Failed**; each row opens its run ([Runs](/docs/agents/runs)).

## Start a routine from a URL

Your site, Zapier or a script can start a routine by calling a web address.

1. **Open the trigger**

   On the routine's page, select **+ Add a trigger** on the **Starts on** card (shown when the routine can take a URL). A dialog titled *Add a trigger* and the routine's name opens with **A URL** picked.
2. **Turn it on**

   Select **Turn on**. *The URL is on. Copy the token now.*
3. **Copy the URL and token**

   Use **Copy** beside the **URL** and under **Token · shown once**: *Copy it now; we keep only a hash. A new token stops the old one at once.* **Example** shows a call you can paste into a script.

Once it's on, the card's link reads **URL trigger: token or turn off** and opens the same dialog, with **Turn off** and **New token**.

- The text you send is data: the agent reads it as something from outside, never as instructions.
- A routine can be started this way 30 times an hour; over that, the URL answers with when to try again. Starts count against the agent's runs a day, if you set a limit.
- Anything that goes outside is still a draft for your OK, as you set it.

## Routines an agent proposes

In a chat, an agent can set up a routine for itself: a new one, a change, a pause or turning one back on. Ava can do the same for any agent: ask her, for example, *have Theo find 5 new leads every Monday at 9*, and the routine card comes from her. These are the agent's own changes, so its **Own changes** level in [Apps and access](/docs/agents/apps_and_access#general) decides who approves them. On **Let agent decide** (the default), the agent applies one it judges routine and tells you in the chat; the others wait for you.

A card that waits shows when the routine runs, what it does, about how many runs it uses and what happens if a run is missed. Runs are counted a day (out of the agent's daily runs, when it has a limit), or a week or a month for a routine that runs less often, such as *About 1 run a week*. The same details show in its review (from Home's **Needs you**, or the pop-up on Tasks), with **Agent** naming the one that runs it, for example *Nina · proposed by Ava*. Answer with:

| Card | Buttons |
| --- | --- |
| *New routine* | **Start it**, **Edit first** (change it in the form, then start it) or **Not now** |
| *Change routine* | **Apply** or **Keep as is** |
| *Pause* | **Pause it** or **Keep it** |
| *Resume* | **Turn it on** or **Keep it off** |

Set **Own changes** to **Requires approval** to have every one wait for you, or to **Auto run** to have the agent make them without asking.

## When it stops

- A routine runs at most once an hour; a faster custom schedule can't be saved.
- If you set daily limits on the agent, each run counts against its runs and minutes ([Agent settings](/docs/agents/agent_settings#daily-limits)); there are none by default. A run waits while the agent is off.
- Each action in a run follows its own mode, so drafts still come to **Needs you**.

## Who can

Any signed-in person (not an API key) in the project can turn routines on, add, edit, run and delete them, and add or remove rules for when something happens.
