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

# Scheduling and Triggers

> Start Runs automatically on a schedule or in response to events and Cases, using the Duvo CLI.

A Run doesn't have to be started by hand. The CLI lets you set up three ways for an Agent to start work on its own: on a recurring **schedule**, when an external **event** fires, or when a new **Case** lands on a Queue.

## Schedules

A schedule fires against an Agent's live Setup on a recurring cadence — daily, on workdays, weekly, monthly, or a custom cron expression.

```bash theme={"dark"}
duvo agents schedules list <agent-id>                       # list schedules for an Agent
```

### Create a schedule

<CodeGroup>
  ```bash Daily theme={"dark"}
  duvo agents schedules create <agent-id> \
    --frequency daily \
    --timezone America/New_York \
    --time 09:00                                              # every day at 9am New York time
  ```

  ```bash Weekly theme={"dark"}
  duvo agents schedules create <agent-id> \
    --frequency weekly \
    --timezone Europe/London \
    --day monday \
    --time 08:30                                              # every Monday at 8:30am London time
  ```

  ```bash Monthly theme={"dark"}
  duvo agents schedules create <agent-id> \
    --frequency monthly \
    --timezone UTC \
    --day-of-month 1 \
    --time 06:00                                              # the 1st of every month at 6am UTC
  ```

  ```bash Custom cron theme={"dark"}
  duvo agents schedules create <agent-id> \
    --frequency custom \
    --timezone UTC \
    --cron "0 */4 * * *"                                      # custom cron: every 4 hours
  ```
</CodeGroup>

| Flag                 | Description                                                           |
| -------------------- | --------------------------------------------------------------------- |
| `--frequency`        | Required. One of `daily`, `workday`, `weekly`, `monthly`, or `custom` |
| `--timezone`         | Required. IANA timezone (e.g. `America/New_York`)                     |
| `--time <HH:MM>`     | Time of day, 24-hour. Required for daily, workday, weekly, monthly    |
| `--day <day>`        | Day of week for weekly schedules                                      |
| `--day-of-month <n>` | Day of month (1–31) for monthly schedules                             |
| `--cron <expr>`      | Cron expression. Required for custom schedules                        |
| `--disabled`         | Create the schedule paused (default: enabled and running)             |
| `--no-recurring`     | Retire the schedule after its first run (default: recurring)          |

### Update or delete a schedule

```bash theme={"dark"}
duvo agents schedules update <agent-id> <schedule-id> --time 10:00     # change the time
duvo agents schedules update <agent-id> <schedule-id> --disable        # pause the schedule
duvo agents schedules update <agent-id> <schedule-id> --enable         # resume it
duvo agents schedules update <agent-id> <schedule-id> --one-shot       # run once, then retire
duvo agents schedules delete <agent-id> <schedule-id>                  # delete (prompts unless -y)
duvo agents schedules delete <agent-id> <schedule-id> --yes            # delete without prompting
```

<Note>
  `update` also accepts `--timezone`, `--day`, `--day-of-month`, `--cron`, and matching `--clear-*` flags to remove a field. Run `duvo agents schedules update --help` for the full set.
</Note>

## Case triggers

A Case Trigger connects an Agent to a Queue so it automatically picks up new Cases as they arrive. For background on the Queue system, see [Queue](/user-guide/assignment-features/case-queue).

```bash theme={"dark"}
duvo agents case-triggers list <agent-id>                                   # list triggers and their IDs
duvo agents case-triggers get <agent-id> <trigger-id>                       # show details for one trigger
duvo agents case-triggers create <agent-id> --queue <queue-id> --enabled    # create a trigger (omit --enabled to create it disabled)
duvo agents case-triggers update <agent-id> <trigger-id> --enable           # enable an existing trigger
duvo agents case-triggers update <agent-id> <trigger-id> --disable          # disable an existing trigger
duvo agents case-triggers update <agent-id> <trigger-id> \
  --queue <queue-id>                                                        # switch the queue the trigger listens to
duvo agents case-triggers update <agent-id> <trigger-id> --concurrency 1    # run Cases one at a time (sequential)
duvo agents case-triggers update <agent-id> <trigger-id> --clear-concurrency # use the platform default (parallel) again
duvo agents case-triggers delete <agent-id> <trigger-id>                    # delete the trigger
duvo agents case-triggers preview <agent-id> --queue <queue-id>             # check whether a queue already has an active trigger
```

<Note>
  Only the person who set up a trigger or a team Builder or admin can disable it or change its queue. Disabled triggers stay attached to the Agent but stop dispatching new Runs until re-enabled.
</Note>

<Note>
  `--concurrency` only accepts `1` (run Cases one at a time). Use `--clear-concurrency` to fall back to the platform default, which runs Cases in parallel. Raising a Queue's parallel limit above the platform default is configured by Duvo and can't be set from the CLI or API.
</Note>

## Event triggers

An event trigger starts a Run automatically when an external event fires — an email arrives, a Linear issue is created, a file changes in Google Drive, and so on. The Connection must already be set up for the Agent before you can add a trigger for it.

```bash theme={"dark"}
duvo agents triggers list <agent-id>                                        # list your triggers for an Agent
duvo agents triggers types <agent-id>                                       # list available trigger types per Connection
duvo agents triggers set <agent-id> \
  --integration gmail --trigger-type email_received                         # create or update a trigger (enabled by default)
duvo agents triggers set <agent-id> \
  --integration gmail --trigger-type email_received \
  --filter-config '{"from":"boss@acme.com"}'                                # add an integration-specific filter
duvo agents triggers set <agent-id> \
  --integration gmail --trigger-type email_received --disabled              # pause a trigger without removing it
```

<Note>
  Each Connection has at most one event trigger per Agent, so `set` creates the trigger the first time and updates it after that. Use `triggers types` to discover the `--integration` and `--trigger-type` values a Connection supports.
</Note>

## Related

<CardGroup cols={2}>
  <Card title="Managing Agents" href="/cli/managing-assignments">
    Create and configure the Agents these triggers and schedules fire
  </Card>

  <Card title="Starting Runs" href="/cli/running-jobs">
    Start and monitor Runs by hand
  </Card>

  <Card title="Cases and Queues" href="/cli/cases-and-queues">
    Inspect the Cases a Case Trigger picks up
  </Card>
</CardGroup>
