# Always on: routines and background work

> How agents keep working when nobody is connected, with routines on a schedule, background tasks and long-running services.

An instance never sleeps. Closing the dashboard, your laptop or the mobile app does not stop the agent: it
keeps running the work you gave it.

## Routines (Mue)

A **routine** is work the agent does on a schedule:

- **once**, at a given time ("tomorrow at 9, check whether the client replied");
- **regularly**, with a schedule and a time zone ("every weekday at 8 in Paris time, send me my agenda").

When a routine runs, it either:

- **wakes the agent** in a conversation with the instructions you gave, so it can think, use its tools and
  report back; or
- **runs a script without AI**, which costs no model usage. A script can wake the agent only when it finds
  something worth looking at: the cheapest way to watch a website, a mailbox or an API.

You do not need to write routines yourself. Ask the agent: "remind me on Friday", "check every hour whether
the price dropped". It creates the routine, and you see all of them, with their past runs, on the
**Routines** page of the agent's app.

Limits:

- routines that wake the agent run at least 15 minutes apart, at most 2 at a time, and up to 60 minutes per
  run;
- a routine that fails 3 times in a row is paused and the agent tells you.

## Background tasks and sub-agents (Mue)

During a conversation, a Mue agent can start long tasks in the background and run several sub-agents in
parallel, then report back when they finish. A progress card shows where the work stands.

If the instance restarts during a turn (an update, a repair), the agent resumes the interrupted turn by
itself.

## Long-running services

An agent can run its own services on its machine: a web app, a bot, a queue worker. They keep running while
the instance runs.

- After a **restart** of the instance, services the agent started by hand are not started again
  automatically. A Mue agent writes down how to start them, and checks them before relying on them.
- To expose a web service, see [public URLs](network.md#public-urls).

## Hermes

Hermes has its own scheduled jobs, and it runs on an always-on instance too, so its jobs keep running when
you are away.

## Good practices

- Put the steps that need no judgement in a **script**, and let the AI handle only what needs it.
- Prefer one routine that checks several things to many routines that each wake the agent.
- Keep an eye on the instance's [usage cap](usage-caps.md) if routines use the cloud browser or Molted Flash
  often.
