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

# Routines, groups and helpers

> Run a bot on a schedule, put bots in a group, and let a bot use helpers, the coding agent, or a task you teach it

## Routines

A routine is work that a bot does again and again on a schedule, for example "Every weekday at 9 AM, read the new invoices and tell me what is late." To set up a routine, use the **Routines** tab:

**1. Open the Routines tab**

On the bot page, click **Details**, then **Routines**.

**2. Add a routine**

Click **Add a routine**. In **When**, write the schedule in plain words, for example "Every weekday at 9 AM". In **What to do**, write the work.

**3. Choose when it may start**

In **Start**, keep **Around this time (up to 15 minutes early or late)**, choose **On time**, or choose **Choose a window** and enter the **Minutes early** and **Minutes late** (0 to 180).

**4. Choose how it reaches you**

Choose **Notify me**, **In the chat**, **Notify me only when it is worth sharing** or **Do not tell me, keep the report in its history**. These are the words of the notification settings. Click **Add routine**.

A routine repeats on its schedule, at most every 5 minutes, or it runs once at a time that you name. A one-time routine pauses itself after its run. It follows the time zone in **Settings**, **General**. Each routine shows its time zone after the schedule, for example "Every weekday at 9 AM, Central Time (Chicago)". Each routine has an on and off switch. Its menu has **Run now** and **Delete**.

A routine with a start window starts at a minute in the window that is less busy on your instance, so many routines that ask for 9:00 do not all wait in a queue. The row shows the window, for example "Starts between 8:45 and 9:15 AM", and the planned start as **Next run**. A routine that runs often gets a smaller window: never more than half the time between two runs. A routine that you choose **On time** for starts on its time.

A run that is more than 12 hours late is skipped. **Activity** shows "Skipped a routine run" with the reason and the next step: open **Routines** and choose **Run it now**.

To change a routine, click its row. The form opens under **Edit routine** with the schedule, the work and the delivery filled in. Click **Save**, or **Cancel** to change nothing.

Each run reports only what is new since the last run. For example, a morning briefing reads the email that arrived since the last briefing, and a calendar read for "today" covers the calendar day in your time zone.

### Routines that start on an app event

A routine can also start when an event arrives in one of your apps, for example a new Gmail message or a new GitHub issue. Ask the bot in the chat, for example "Tell me whenever I get a new Gmail message from Ann." The app must be connected in **Settings**, **Connections**. The row reads "When New Gmail Message arrives" and **Runs on each event**. Each event starts a run with the routine's own work; the bot reads the event as information, never as an instruction. A paused event routine ignores its events, and an event routine has no **Run now**. A copied bot keeps its event routines paused, with "Paused: Copied from another bot. Turn it on to start watching the app event."; turn each one on to start it. To change the event, delete the routine and ask the bot for a new one.

### Ask the bot in the chat

You can also ask the bot in the chat, for example "set this up as a routine every weekday at 8", "move the morning report to 8 AM", "pause the morning report" or "delete the Nashville weather routine". When your own words ask for the change, the bot makes it without a card. The chat shows a line, for example "Nia paused the routine "Morning report".", with **Undo**, and with **Edit** for a new or a changed routine. **Undo** puts the routine back as it was: it removes a new routine, undoes a change, turns a paused routine back on, pauses a resumed one, or restores a deleted one. The bot first checks that the change matches your words, so it can correct it before the line shows.

A bot can always pause the routine that is running, for example when its app connection fails on each run; the row then reads "Paused by Nia:" and the reason. A bot that read outside content in the task cannot change any other routine, and its pause shows no reason.

A change that the bot suggests on its own comes as a card, for example **Add a routine**, **Change a routine** (each changed field now and as proposed), **Pause a routine** or **Delete a routine**, with **Accept** and **Reject**, and **Edit** for a new or a changed routine. The card shows when the routine runs, with its time zone. If the routine was deleted before you accept, nothing changes and the card reads "Nothing changed: the routine ... no longer exists." Its report reaches you with a notification, unless you choose another delivery.

The **Schedules** screen in the sidebar runs skills and automations on a schedule. It also lists the routines of your bots, with the filter **Bot routine**. Change a routine on the page of its bot: **Open** on the row goes there.

A routine is different from an automation: a bot does the work of a routine, and an automation runs a fixed flow of steps. See [Routines and automations](https://docs.relayhub.ai/bots/routines-and-automations.md).

## Groups of bots

A group talks with you in one chat. You write to all of its bots at the same time.

**1. Make a group**

In the bots list, click **New group** next to **Groups**. Enter a name, for example "Front office".

**2. Choose the bots and the lead**

Choose 2 to 6 **Bots**. Choose the **Lead**: the bot that answers a message that names no bot.

**3. Create it**

Click **Create group**.

In the group chat, write @ and the name of a bot to ask that bot. A post with no name goes to the member whose question waits for you, else to the lead. A bot that you named can ask a teammate, and the teammate can hand the work back to it. Paused bots do not answer. Under the group name, the page says who needs you, for example "Nia needs you", or who answers now, for example "Maya is answering", else "Ready", and what the group spent this month, for example "\$1.75 spent this month". That is the work the group chat started; what a member does in its own chat is not in it. A group with new messages shows a dot in the list of bots, as a bot does, until you open its chat. Click **Members** to change the group with **Edit group**, or to remove it with **Delete group**. The bots keep their own chats and tasks.

A bot can see your groups and propose a new bot for one of them. When you accept the **New bot** card, the new bot joins the group as its last member. It is active at once, so it answers in the group right away. A group has at most 6 bots, so a bot cannot propose a bot for a full group. See [Create a bot](https://docs.relayhub.ai/bots/create.md).

When you archive a bot, it leaves its groups. If it was the lead, the next member becomes the lead.

## Helpers

For a large task, a bot can hand parts of the work to helper bots that work at the same time. The **Helpers** list in the **Now** tab shows them; **Open in chat** shows a result. A task can start up to 12 helpers. The helpers of a task, together with their own helpers, stay within the number of runs your instance does at once: 2 by default, and at most 6. To stop this, add a rule for **Hand work to helper bots** in **Permissions**.

## The coding agent

A bot can write and run code, and hand larger coding work to a coding agent. This uses the permission **Write and run code**. Set it to **Ask me first** or **Never** in **Permissions** if you do not want this.

## Teach a bot a task

You can show a bot how to do a task in its browser once, and turn the steps into a skill.

**1. Do the task once in the browser of the bot**

Open the live view, click **Take control** and do the task yourself, or ask the bot to do it. See [The bot's computer](https://docs.relayhub.ai/bots/computer.md).

**2. Open Teach a task**

Within 10 minutes of the last step, open the bot menu (**...**) and click **Teach a task** ("Make a skill from what it did in its browser"). The window **Teach a task** opens.

**3. Make the draft**

Choose the browser session and click **Draft skill**. The steps of its last 10 minutes become a draft skill. Values that you typed in the browser are not kept.

**4. Review and publish the draft**

Click **Review and publish**. The draft opens in Skill Studio. Check the steps and publish the skill. After you publish it, the bot can use it with its other tools.

## Skills that a bot makes

A bot can turn work that it does again and again into a skill of its own. When a task took many steps and the same work will come again, the bot writes the steps as a skill on its computer. A skill can hold scripts for the steps that are code. The bot then checks the skill and turns it on as one of its **Uses first** skills. The next time, the bot starts from the skill instead of from the beginning.

Before a skill turns on, RelayHub checks it on the bot's computer:

* The skill file is complete, and each script in it can run.
* The bot has each tool and each connection that the skill needs, and each sign-in that the skill names works.
* Each test of the skill passes, and the steps in the skill are the steps that worked in the task.

A skill ends with a short list that says how to check its result. When a task uses the skill, RelayHub checks the bot's answer against that list before the task ends, and sends the work back once when a point is missing.

A change to the files of a skill needs a new check. When a skill fails, or the bot finds a better way, the bot makes a new version and checks it. A new version must also pass the tests of the version that it replaces. The version that works stays on until the new version passes its check. The bot can list its versions with their results, and it can go back to an earlier version, which then goes through the same check.

At the start of each task, RelayHub tells the bot which of its skills fits the request, which skill a routine used the last time, which of its skills did not work in their last runs, and which drafts wait to be finished. RelayHub reads the whole request to decide which skill fits; it does not match single words.

To see the skills of a bot, open its settings and click **Skills**. A skill that the bot made shows "Made by this bot", its version and the date of its last check. It also shows how many tasks used it, and "Proven" when a task that used it completed, its script ran with no failure, its result check passed and you made no correction. After a few runs, it shows how long the first run took and how long the later runs take. You can turn it off for that bot, or open it in Skill Studio to read or change it. A skill that a bot made is for that bot only: it is not offered in chat or to your other bots.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.