> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getthread.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Routines

> Set up routines in Custom Analytics to run instructions on a schedule, or when something happens, and deliver the results by email, Slack, or webhook.

> [!NOTE]
>
> Custom Analytics is currently in a **closed beta**.

A routine asks a question for you, on a schedule or when something happens. Each time it runs, the agent works through your instructions against the latest refreshed data and sends the results where you choose.

That's the difference from a scheduled delivery. A [scheduled delivery](https://docs.getthread.com/analytics/downloading-alerts-scheduling.md) sends the same document every time. A routine works through your instructions fresh each time.

## Two ways a routine can run

* **On a schedule.** Good for regular updates.
* **When something happens.** The routine checks for a condition you describe and acts when it's met. Good for exceptions. The Routines list shows these as **Conditional**.

## Ideas to start with

* *"Summarize last week's ticket volume by client and call out any client that jumped more than 50%."*
* *"Tell me how many tickets were opened last week and which boards fell behind."*
* *"Check open tickets and summarize the count by board."*

## Create a routine

1. Select **Routines** in the left navigation, then select **New**.
2. Give it a **Name** and write its **Instructions**. You can also choose the data to use, or pick **Auto-select a topic**.
3. Set the **Trigger** (see below).
4. Choose where to **Deliver to**: **Email** (your own email by default), **Slack**, **Webhook**, or **No delivery**.
5. Select **Save routine**. A green banner confirms **Routine created**.

The routine runs with your data permissions.

![The new routine dialog with Name, Instructions, Auto-select a topic, Trigger, and Deliver to, with Cancel and Save routine buttons](https://mintcdn.com/thread/SfVqAOd3oM4mTHUi/images/analytics/custom-analytics-routine-create.png?fit=max\&auto=format\&n=SfVqAOd3oM4mTHUi\&q=85\&s=7cc5ef6b0c6e70b5bf69919c98d3b2db)

### Trigger options

| Trigger | What you set |
| - | - |
| **On a schedule** | How often it **Runs** (**Daily**, **Weekly**, **Monthly**, or **Custom**), the days, the time (**At**), and the timezone (**Times are in**). New routines start on weekdays at 9:00 am. |
| **When something happens** | What to **Watch for** (use **Test condition** to try it), and how often it **Checks** (**Daily**, **Weekly**, **Monthly**, or **Custom**). |

Scheduled runs happen within 15 minutes of the time you set.

## Manage your routines

The **Routines** page lists each routine's **Name**, **Type**, **Last run**, and **Last run status**. Use **Find a routine** to search, and **Status: Any** to filter.

From a routine's **⋮** menu, you can **Edit**, **Duplicate…**, **Run**, **Pause**, or **Delete…** it.

![The Routines page with the Routine created banner, the Find a routine search, the Status: Any filter, and a new weekly routine in the list](https://mintcdn.com/thread/SfVqAOd3oM4mTHUi/images/analytics/custom-analytics-routines-list.png?fit=max\&auto=format\&n=SfVqAOd3oM4mTHUi\&q=85\&s=d3b68185582b7a867d2604a29845f50d)

## How routines run

* Results go to the destination you chose. With **No delivery**, check **Last run** and **Last run status** on the Routines page.
* Magic Analytics refreshes daily, so a routine works from data that's about a day behind.


## Related topics

- [Assign and schedule](https://docs.getthread.com/start-here/roles/dispatcher/assign-and-schedule.md)
- [Custom Analytics: getting started](https://docs.getthread.com/analytics/custom-analytics.md)
- [Common questions](https://docs.getthread.com/get-started/common-questions.md)
