---
name: routines-adjust
description: "Adjust an existing Introspection routine from how its runs have done: change how often or on which events it runs, change its prompt, or pause it. Use when a routine finds nothing, misses things or reports the wrong things."
metadata:
  min-cli-version: "0.85.0"
  next: ""
---

# Routines: adjust

Tune a routine that already exists, from what its runs have shown.

## 1. Find the routine

```sh
introspection routines list --query "[].[id, name, enabled]"
```

If more than one could match the request, ask which.

## 2. Read how it has done

Each run is a task carrying the routine's id, and a run that found nothing is marked `no_reply`. An event run also carries the trigger, event type and delivery that started it:

```sh
introspection tasks list --query "[?routine_id=='<id>'].[id, created_at, metadata.routine_trigger.event_type, metadata.routine_run.outcome]"
```

Read the last few results that weren't quiet before proposing a change. For a triggered routine, read its triggers too:

```sh
introspection routines triggers list <id>
```

## 3. Propose a change

Propose a change from what its runs showed, and agree it with the person:

- **Too often:** most runs end `no_reply`, or report the same thing again. Run it less often (hourly to daily, daily to weekly), or pause it, saying how many of its recent runs found nothing.
- **Too rarely:** something it should have caught waited for its next run. Run it more often, or narrow its prompt to what matters.
- **Reporting the wrong things:** its reports aren't acted on. Narrow the prompt to what the reader acts on.
- **A trigger fires on noise:** most of its runs end `no_reply`. Narrow its event types or filter (fewer channels, one branch, a `payload.<field>` value), or remove that trigger.
- **A trigger misses events:** an expected event started nothing. Check that the resource is bound to this project and the filter admits it. Events that arrive while the trigger's last run is still going are skipped as `trigger_busy`.
- **A parameter comes through `null`:** the task's `metadata.unresolved_parameters` names it. `@parameters.<key>` reads only the body's top-level keys: compare the prompt's names against a real body (`parameters.json` in a recent run's files), and have the run read a nested value from that file instead.

## 4. Change it

Change its prompt, schedule or timezone, or pass `--disable` to pause and `--enable` to resume:

```sh
introspection routines update <id>
```

A trigger is changed by removing it and adding it again with the new flags, and stopped by removing it:

```sh
introspection routines triggers remove <id> <trigger-id>
introspection routines triggers add <id> --connector <slug> --event-type <type> --filter <KEY=VALUE>
```

The flags, and what each provider's events and filters are, are in routines-schedule's event triggers reference. After a change to a trigger or to the prompt's `@parameters.<key>`, run it by hand with a real event's body before it fires again:

```sh
introspection routines run <id> --parameters '<JSON object>'
```

A project's default routines can only be paused, not deleted.

## 5. Read it back

```sh
introspection routines get <id>
```

Tell the person what changed, and when it next runs or what starts it.

## Guardrails

- **The person decides** a routine's schedule, triggers and prompt; you propose them.
- **Never delete a routine:** pause it.

## Done when

- The routine is as agreed, and the person knows when it next runs.
