# Schedule work with routines

> Turn on a template, make a routine on a schedule, run it now, pause it or give it to another teammate.

A routine is work that a teammate does by itself, on a schedule. This guide shows how to switch on a template, make
your own routine, run it now, pause it, and give it to another teammate.

## Before you begin

- Owners and admins make and change routines, because each run uses the AI plan of your organization.
- Members, approvers and viewers read every routine. Guests do not see Routines or the Calendar.
- The teammate needs a connected AI plan. See [Connect your AI plan](/docs/ai-plan).
- Some templates wait for a service that the role reads, such as Stripe or PostHog.

## How a routine works

A routine belongs to one teammate. It has a title, instructions and a schedule. At each time of the schedule, the
teammate does the instructions in a run.

- Each routine has one task on the board. Each run puts its answer on that task as a comment.
- A routine posts each result to its own conversation with the teammate, or it runs quietly.
- A routine does one run at a time. If the last run did not end, Troopy skips that time.
- While the task of the routine waits in Needs you, the routine does not run. Answer the question on the task, and
  the routine continues.

The Routines page also lists the work that starts when something happens: a trigger. See
[Start work when something happens](/docs/triggers).

## Find your way on the Routines page

Open **Routines** in the sidebar. Under it, the sidebar shows **Your routines** and **Templates**.

| Part                                       | What it shows                                                               |
| ------------------------------------------ | --------------------------------------------------------------------------- |
| **Proposed by your teammates**             | The routines that teammates proposed. Each one waits for an owner or admin. |
| **Up next**                                | The next 4 runs, with a link to the **Calendar**.                           |
| **All**, **On**, **Off**, **Needs a look** | Filters by state. **Off** is a paused routine or a template row.            |
| **Any start**                              | A menu that shows routines **On a schedule** or **When something happens**. |
| **Everyone**                               | A menu that shows the routines of one teammate.                             |
| **Search routines**                        | A search box. It shows when the list has more than 8 rows.                  |
| A card for each teammate                   | Its routines and triggers, then its paused ones, then its templates.        |
| A grey row                                 | A template that the teammate does not have yet. Its switch turns it on.     |
| **Without a teammate**                     | The triggers whose teammate left the troop.                                 |

A card shows 3 rows at first: each routine that exists, then templates while there is room. To see the other
templates, select the line under the rows, such as **Show 2 more templates**.

**Needs a look** shows a routine that did not start the last time. It also shows a trigger that waits for its secret,
and a trigger whose teammate left.

## Switch on a template

A template is a ready routine of a role, with its instructions and a default time. You can change both after you
switch it on.

1. **Find the template**

   On **Your routines**, find the grey row in the card of the teammate. Or open **Templates** for every role.

2. **Read what it does**

   Select the row. The dialog shows **How it works** and **What you get**. **The whole page, with a sample** opens
   more.

3. **Switch it on**

   Select **Switch it on**, or use the switch of the row. The routine gets the time zone of your browser.

On the **Templates** page, **Switch it on** also hires the role when nobody in your troop has it. A template that waits
for a service shows **Connect Stripe first**, or the name of its service. That link opens **Settings** >
**Apps**.

These routine templates come with Troopy:

| Role                 | Routine templates                                                                           |
| -------------------- | ------------------------------------------------------------------------------------------- |
| Chief of Staff       | Weekly brief, Brain tidy-up, Memory review, Project updates, Morning briefing, Weekly recap |
| Content writer       | Weekly article                                                                              |
| Social media manager | Weekly post plan, Content calendar                                                          |
| Outreach manager     | Weekly lead watch, Sort replies, What worked                                                |
| Competitor watcher   | Competitor watch                                                                            |
| Churn watcher        | Customer brief, Churn report, Overdue invoices                                              |
| Product analyst      | Weekly product check                                                                        |
| Growth analyst       | Weekly report, Lead research                                                                |
| Assistant            | Inbox triage, Follow-up finder, Vendor renewals, Meeting prep, Supplier chasing             |

> [!TIP]
> Home shows the templates that are not on yet, under **Routines to hand over**. See [Use Home](/docs/home).

## Make a routine

1. On **Routines**, select **New routine**.
2. Under **On a schedule, for**, select the teammate.
3. In **Title**, type a short name, such as "Friday wrap-up".
4. In **Instructions**, write what to do each time: the goal, the steps, and where the result goes.
5. Set **Repeats**, the time, and the days under **On**.
6. Under **When it finishes**, select **Notify me** or **Run quietly**.
7. Select **Create routine**.

Write the instructions as a brief to a teammate. See [Give your troop work that it can finish](/docs/give-work).

### Choose when it runs

| **Repeats**                            | When it runs                                                                                |
| -------------------------------------- | ------------------------------------------------------------------------------------------- |
| **Once a day**                         | One time on each day under **On**, at the time in **At**. The default is weekdays at 09:00. |
| **Every 15 min** to **Every 12 hours** | From the time in **Starting at** until midnight, on each day under **On**.                  |
| **Custom (cron)**                      | On a cron expression of five fields, in the place of the days and the time.                 |

The choices of **Repeats** are every 15 minutes, every 30 minutes, hourly, and every 2, 3, 4, 6 or 12 hours. The form
says how many times a repeating routine runs each day.

A cron expression has five fields: minute, hour, day of the month, month and day of the week. A field takes numbers,
`*`, lists, ranges and steps. Troopy does not read names, such as `MON`, or `@daily`. The form shows the next 3 runs
of the expression.

| Expression     | When it runs                         |
| -------------- | ------------------------------------ |
| `0 7 * * 1`    | Mondays at 07:00                     |
| `30 8 * * 1-5` | Weekdays at 08:30                    |
| `0 9 1 * *`    | The first day of each month at 09:00 |
| `*/30 * * * *` | Every 30 minutes                     |

A new routine gets the time zone of your browser. When you change a routine, it keeps its own time zone. Thus its runs
stay at the same hour for each person.

### Choose where the results go

- **Notify me** posts each result to the conversation of the routine. Select **Results** to open it.
- **Run quietly** keeps each result in its run, with no message. The run still puts its answer on the task.

## Run, pause, change or delete a routine

Owners and admins open the menu of a routine with the button with three dots on its row. The menu has these actions:

| Action                       | What it does                                                                |
| ---------------------------- | --------------------------------------------------------------------------- |
| **Run now**                  | Starts one run at once. The row says **Starting**, then **Started**.        |
| **Edit**                     | Changes the title, the instructions, the schedule and where the results go. |
| **Duplicate**                | Opens a new routine for the same teammate, with the same values.            |
| **Hand to another teammate** | Gives the routine and its task to another teammate.                         |
| **Its runs**                 | Opens the routine with its recent runs.                                     |
| **Delete**                   | Deletes the routine, after a question.                                      |

The switch on the row pauses the routine, or turns it on again. A paused routine keeps its settings.

When you hand a routine to another teammate, its next run starts a new conversation with that teammate. The routine
keeps its template only when the new teammate has the same role. **Hand to another teammate** shows only when the troop
has two teammates or more.

When you delete a routine, its task on the board ends. Its conversation and its past runs stay. A routine from a
template comes back as a grey template row, switched off.

## Read the results of a routine

Select a routine to open it. The dialog shows the instructions and these facts:

| Fact         | What it says                                                        |
| ------------ | ------------------------------------------------------------------- |
| **Schedule** | When it runs, and its time zone.                                    |
| **Next run** | The time of the next run, or **Paused**.                            |
| **Last run** | The time of the last run, or **Not yet**.                           |
| **Results**  | **Open the conversation**, **None yet**, or **Quiet: in its runs**. |

**Recent runs** lists the last 6 runs, each with a mark: done, failed, or at work. Select a run to read its steps. See
[See what your troop did](/docs/activity).

Owners and admins also see **Pause** or **Resume**, and **Run now**. **Open in Name's settings** opens the settings of
the teammate, where its **Routines** section shows each routine whole.

When a run of a routine ends or fails, the bell tells the person who made the routine. Without that person, it tells
the owners and admins. See [Choose your notifications](/docs/notifications).

## See the routines on the Calendar

Open **Calendar** in the sidebar. It shows the routines on a schedule in your time zone.

- **Week** shows each run of a routine of one run a day on a grid of hours. The runs that ended show their mark.
- **Month** shows 3 runs on each day, then **+N more**.
- **Agenda** lists the routines by how often they run: **Every day**, **Weekdays**, **Weekly**, **Some days** and
  **Custom**.
- A routine that repeats in a day is not on the grid. It shows on the strip **Runs continuously**, over the grid.
- Select the name of a teammate to hide its routines, or to show them again.
- Select a routine to open the same dialog as on Routines.

## Let a teammate propose a routine

You can ask a teammate for a routine in a chat, such as "every Monday at 8, send me the numbers". The teammate
proposes a routine for its own work. Only the Chief of Staff proposes work for another teammate.

The proposal makes nothing until an owner or admin approves it. It waits under **Proposed by your teammates** on
Routines, and in Needs you. The card says the routine in plain words: the teammate, the times and the instructions.

- The routine belongs to the person who approves it.
- A proposed routine with no time zone gets the time zone of the workspace. If the workspace has none, it gets the time
  zone of the person who approves it in the app. An approval from Telegram or the API gives UTC.
- No standing rule approves a proposal. See [Stay in control of your troop](/docs/control).

Troopy refuses some proposals before a person sees them:

- a routine that runs more often in a day than its teammate can
- the same proposal again, while the first one waits
- a second routine for the same work from another teammate
- a proposal from work that an event from outside started

## Limits

| Limit                         | Value                                                      |
| ----------------------------- | ---------------------------------------------------------- |
| Routines in a workspace       | 30, on a schedule. Triggers have a limit of their own.     |
| Title                         | 60 characters                                              |
| Instructions                  | 1,000 characters                                           |
| Shortest gap between runs     | 15 minutes                                                 |
| Runs of a teammate in a day   | 200 by default, and 500 at most. Owners and admins set it. |
| Runs of one routine at a time | 1                                                          |
| Recent runs in the dialog     | 6                                                          |

All the runs of a teammate count toward its limit of runs in a day, from routines, chats and tasks. See
[Limits and defaults](/docs/limits).

## Problems

| Message                                                                 | Why                                                          | What to do                                              |
| ----------------------------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------- |
| That runs N times a day, and Name can do M runs a day.                  | The schedule runs more often than the limit of the teammate. | Pick a longer gap or a later start, or raise the limit. |
| Name is still on the last run of Routine.                               | The last run did not end.                                    | Wait for the run to end, or stop it on its run page.    |
| Routine needs you: answer it on its task, and it carries on.            | The task of the routine waits for a person.                  | Answer the question on the task.                        |
| Connect Stripe first. The Churn watcher reads it.                       | The template needs a service that is not connected.          | Connect the service in **Settings** > **Apps**.         |
| Pick at least one day                                                   | No day is selected under **On**.                             | Select one day or more.                                 |
| That is not a cron expression that runs.                                | The expression has a wrong field, or it never runs.          | Write five fields, like `0 7 * * 1`.                    |
| Only owners and admins can change routines: each run uses your AI plan. | You are not an owner or admin.                               | Ask an owner or admin.                                  |

A row with **Last time:** and a reason shows why the last run did not start. The routine tries again at its next
time.

## Related

- [Start work when something happens](/docs/triggers)
- [Add and manage skills](/docs/skills)
- [Stay in control of your troop](/docs/control)
- [Use Home](/docs/home)
- [Choose your notifications](/docs/notifications)
