Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

6.6 KB
Raw Blame
---
title: "Routines"
icon: "clock"
description: "Run an agent on a schedule or when activity happens in your workspace."
---

<div className="routine-preview" role="img" aria-label="New routine. Name, instructions, Sonnet 5.5, Add trigger, Runs hidden, Add apps, Start enabled, and Create routine.">
  <div className="routine-card">
    <div className="routine-head">
      <svg width="16" height="16" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M12 3.5a8.5 8.5 0 1 0 .01 0M12 7v5.25l3.5 2" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" /></svg>
      <span>New routine</span>
      <svg width="16" height="16" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="m6 6 12 12m0-12-12 12" stroke="currentColor" strokeWidth="2" strokeLinecap="round" /></svg>
    </div>
    <div className="routine-name">Routine name</div>
    <div className="routine-prompt">What should this routine do? Type @ to add context…</div>
    <div className="routine-chips">
      <span>
        <svg width="14" height="14" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M10.5 3.5C12 9.25 13.25 10.5 19 12c-5.75 1.5-7 2.75-8.5 8.5C9 14.75 7.75 13.5 2 12c5.75-1.5 7-2.75 8.5-8.5Z" stroke="currentColor" strokeWidth="2" strokeLinejoin="round" /></svg>
        Sonnet 5.5
        <svg width="12" height="12" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="m6.75 9.5 5.25 5 5.25-5" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" /></svg>
      </span>
      <span>
        <svg width="12" height="12" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M12 5v14M5 12h14" stroke="currentColor" strokeWidth="2" strokeLinecap="round" /></svg>
        Add trigger
      </span>
      <span>
        <svg width="14" height="14" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M4 4l16 16M9.25 6.15A9.87 9.87 0 0 1 12 5.75c5.95 0 9.25 6.25 9.25 6.25a17.77 17.77 0 0 1-2.5 3.35M6.1 7.9A18.67 18.67 0 0 0 2.75 12s3.3 6.25 9.25 6.25a10.63 10.63 0 0 0 4.05-.85" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" /></svg>
        Runs hidden
      </span>
      <span>
        <svg width="14" height="14" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M9 4v4M15 4v4M7 8h10v4a5 5 0 0 1-10 0V8ZM12 17v3" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" /></svg>
        Add apps
      </span>
    </div>
    <div className="routine-foot">
      <span className="routine-switch"><span className="routine-switch-track"></span>Start enabled</span>
      <span className="routine-submit">Create routine</span>
    </div>
  </div>
</div>

A routine is a saved prompt that an [agent](/product/agents) runs on a schedule or in response to workspace activity.

## Creating a routine

1. Open **Routines** in the Agents sidebar and click **Create Routine**.
2. Enter a name and instructions. Instructions support @mentions.
3. Select the model or agent from the first chip below the prompt.
4. Click **Add trigger**. A routine runs when any of its triggers fires.
5. Click **Create routine**. **Start enabled** is on by default.

## Triggers

A trigger is when the routine runs. The saved prompt does nothing until one fires, which is how the agent keeps working after you close the conversation. A routine can have more than one, and it runs when any of them fires. Click a trigger chip to edit it. Choose **Remove trigger** to delete it.

### Email

**New email received** runs when mail arrives in your inbox. Use it for work that starts in email, such as filing a receipt, drafting a reply, or turning a request into a task, while the message is still new. Spam, trash, drafts, and mail imported from the past do not start it.

### Channels

- **Channel created** — a channel you can access is created
- **Message sent in channel** — someone sends a message in a channel you choose
- **@ mentioned in channel** — you are @mentioned in a channel you choose

### Documents

- **Document created** — a document you can access is created
- **Document deleted** — a document you choose is deleted

### Tasks

- **Task created** — a task you can access is created
- **Status changed**, **Priority changed**, or **Any property changed** — a task you choose changes

### Calls

- **Call started** — a call you start begins. The routine gets the call and who has joined.
- **Call ended** — a call you joined ends. The routine gets the participants and the transcript.

Message, mention, deletion, and task triggers can be limited to specific channels, documents, or tasks, or left open to everything you can access. Changes made by agents and bots do not fire triggers.

### Scheduled

**Add trigger → Scheduled** supports **Hourly**, **Daily**, **Weekly**, **Monthly**, and **Custom** (cron). Schedules can also be typed in plain English, for example **every weekday at 9am**.

**Run once** runs the routine one time, for example **tomorrow 9am** or **in 2 hours**.

Recurring schedules use the time zone they were created in. One-time runs use your browser's local time.

## Managing routines

**Routines** in the Agents sidebar lists your routines with creator, status, model, and **Enabled** toggle. Press <kbd>cmd</kbd>\+<kbd>f</kbd> to search by name, creator, or model.

**Overview** shows a routine's instructions, model, triggers, and next scheduled run. Changes save automatically. **Run now** runs the routine immediately, including when it is disabled.

**Run options** enables or disables the routine and copies its prompt. The menu next to the routine name duplicates or deletes it.

## Run history

**Run History** lists past runs with outcome, duration, and start time. Click a run to open its agent conversation. A notification appears on [Home](/product/home) when a run finishes.

## On a team

A routine belongs to one person. On a team it still belongs to its creator. Only they can open it, edit it, enable it, run it, or see its history. It runs with their permissions. **New email received** watches their inbox, and **@ mentioned in channel** matches mentions of them.

**Share as template**, in the menu next to the routine name, lets a teammate activate their own copy. That copy is a separate routine, owned by them, and it runs with their permissions. A routine that was never shared tells teammates it belongs to someone else.

## MCP

Agents and [MCP clients](/AI/mcp/overview) manage routines with [`CreateRoutine`](/AI/mcp/tools/create-routine), [`ListRoutines`](/AI/mcp/tools/list-routines), [`ReadRoutine`](/AI/mcp/tools/read-routine), and [`UpdateRoutine`](/AI/mcp/tools/update-routine).