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

# Routines

> Decide when your agents work by themselves, with Autopilot, a schedule, a webhook or an event from your apps

A routine is a moment an agent starts work by itself (see [Agents](/agents/introduction)). Each start is a run, a chat you can open and join. An agent can have up to 10 routines.

You can see every routine in one place from **Routines** in the sidebar, or the routines of one agent on that agent's **Routines** tab.

## Kinds of routines

| Routine | When it runs | Good for |
| :- | :- | :- |
| **Autopilot** | The agent decides by itself when to run next | Ongoing work with no fixed rhythm, like watching for quiet deals |
| **On a schedule** | Daily, weekly, monthly or a custom time | Briefings, reports, reminders |
| **Webhook** | Another app sends a request to a web address you give it | A new order or a form reply in another tool |
| **From your apps** | An event in one of your connected apps | Reacting to something as soon as it happens |

## Add a routine

<Steps>
  <Step title="Open the agent's Routines tab">
    Go to **Agents**, open your agent and click **Routines**. Make sure the agent has instructions first: every run follows them.
  </Step>

  <Step title="Pick when it runs">
    Click **Add trigger** and choose **Autopilot**, **Webhook**, **On a schedule** or an event under **From your apps**.
  </Step>

  <Step title="Add extra instructions (optional)">
    Use **Extra instructions** for anything specific to this routine, on top of the agent's own instructions. Leave it empty and the agent does its usual job.
  </Step>

  <Step title="Save">
    Click **Save routine**. The routine shows its next run, or what it is waiting for. Use the routine's switch to turn it off and on.
  </Step>
</Steps>

### Autopilot

The agent picks its own next run time at the end of each run, from 5 minutes to 30 days later. You can guide the timing in its instructions, like "check again every morning".

If a run ends without picking a time, the agent tries again a day later. After 3 misses in a row, the routine is switched off and shows **Paused**.

### On a schedule

Pick **Every hour**, **Every day**, **Every weekday**, **Every week**, **Every month** or **Custom schedule**, then the time. The time zone starts as yours and you can change it. When it differs from yours, the routine also shows the time for you.

**Custom schedule** takes a cron expression with five parts: minute, hour, day, month and weekday. For example, `0 9 * * 1` runs every Monday at 9:00.

### Webhook

Save the routine to get its **Webhook URL**, then paste it in the other app. Every request to that address starts a new run. The request can include `text` with the task and `files` with links to up to 10 files.

Keep the URL private: anyone with it can start a run. If it leaks, click **Regenerate URL**. The old address stops working right away.

### From your apps

Pick an event from one of your connected apps. Each event starts a run. If an app sends more than 60 events in an hour, the extra ones are skipped.

If the app you need has no event, a schedule can check it for you instead, as often as you need.

## Same chat or a new chat

Each routine has a **Chat** setting:

* **New chat each run**: every run starts an empty chat. This is the default for schedules, webhooks and app events.
* **Same chat**: every run continues one chat and sees what came before. This is the default for Autopilot.

## Run a routine now

Click **Run now** on a routine to start a run right away, whatever its schedule. Routines started by an app event can't be run by hand. Click **View runs** to see past runs.

## Private routines

You can also set up a routine for yourself, without an agent. On the **Routines** page, click **Create private routine**, write what each run should do, and pick when it runs. Only you can see these routines and their runs, under **Your private routines**.

You can also ask for one in your organization chat, like "run this every Friday at 9", and it shows up here as a routine.

## FAQ

<AccordionGroup>
  <Accordion title="Can a routine run wait for my approval?">
    No. Routine runs never wait for approvals, since nobody is there to answer. If a run needs something only you can give, like a connection, it shows up in [Tasks](/guides/tasks).
  </Accordion>

  <Accordion title="My Autopilot routine shows Paused">
    The agent ended 3 runs in a row without picking its next run time. Check that its instructions say when to run again, then turn the routine's switch back on.
  </Accordion>

  <Accordion title="My webhook stopped working">
    The URL may have been regenerated. Copy the current **Webhook URL** from the routine and update it in the other app.
  </Accordion>

  <Accordion title="What happens to past runs when I delete a routine?">
    The routine stops right away. Past runs stay in the **Runs** list, but you can no longer filter them by this routine.
  </Accordion>
</AccordionGroup>


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