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

# tenet flows

> YAML automation — cron triggers, event patterns, agent spawns

Flows are YAML-defined automations that run on schedules or in response to events. They're the "if this then that" for your agent pipeline.

## Usage

```bash theme={null}
tenet flows list              # Show all flows and their status
tenet flows run <name>        # Run a flow manually
tenet flows enable <name>     # Enable a flow
tenet flows disable <name>    # Disable a flow
```

## Writing a Flow

Flows live in `.tenet/flows/`. Each is a YAML file:

```yaml theme={null}
# .tenet/flows/nightly-improve.yaml
name: nightly-improve
description: Run improvement agents overnight

trigger:
  cron: "0 2 * * *"     # 2 AM daily

steps:
  - name: run-agents
    run: tenet peter autoresearch --rounds 5

  - name: check-results
    run: tenet morning
```

## Trigger Types

| Trigger  | Example         | Description                     |
| -------- | --------------- | ------------------------------- |
| `cron`   | `"0 2 * * *"`   | Schedule (cron syntax)          |
| `event`  | `"eval:scored"` | MAP event bus pattern           |
| `manual` | —               | Only runs via `tenet flows run` |

## Event Triggers

React to system events:

```yaml theme={null}
trigger:
  event: "eval:scored"
  filter:
    agent: "test-coverage"
    delta_gt: 0.01

steps:
  - name: celebrate
    run: echo "Test coverage improved!"
```

## Flow Options

| Field        | Description                                     |
| ------------ | ----------------------------------------------- |
| `cooldown`   | Minimum time between runs (e.g., `"1h"`)        |
| `timeout`    | Max run time before killing (e.g., `"30m"`)     |
| `on_failure` | What to do on error: `ignore`, `retry`, `alert` |

## See Also

* [Flows Guide](/guides/flows) — detailed guide with examples
* [Event Bus](/hub/events) — MAP event system
* [Peter Parker](/agents/peter-parker) — agent orchestrator
