> ## 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 the schedules you own on an Agent
duvo agents schedules list <agent-id> --all-users           # list every member's schedules, with who created each one
```

By default a listing returns only the schedules **you** own, whatever your role. `--all-users` widens it to every team member's schedules on the Agent and adds a `CREATED BY` column naming the person who set each one up — useful for auditing an Agent several people share. It needs an elevated team role; without one the command fails with a permissions error and you should run the plain listing instead.

An all-users listing is bounded, which is beyond what any Agent reaches in normal usage. If the Agent does hold more schedules than one response can return, the command prints a warning under the table and the rows shown are the oldest by creation date, so don't read a warned listing as a complete audit.

### 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
duvo agents triggers delete <agent-id> <trigger-id>                         # delete a trigger and its filter config
```

<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.

  Pausing and deleting are different: `--disabled` keeps the trigger and its filter config so you can switch it back on (in the dashboard it stays listed, switched off), while `delete` removes it for good. `triggers list` reports the IDs `delete` takes.
</Note>

## Slack channel triggers

A Slack channel trigger starts a Run when a message is posted in a channel you're watching. Unlike the event triggers above, an Agent can watch many channels at once, so these are created one per channel with their own commands.

The Slack workspace has to be connected to the Agent first — `slack-triggers workspaces` lists the ones you can watch, and creating a trigger for any other workspace is rejected.

```bash theme={"dark"}
duvo agents slack-triggers workspaces <agent-id> --revision <revision-id>      # which Slack workspaces this Agent can watch
duvo agents slack-triggers list <agent-id>                                     # list your Slack channel triggers for an Agent
duvo agents slack-triggers create <agent-id> \
  --channel C0123ABCD --channel-name support-inbox                             # watch every message in a channel
duvo agents slack-triggers create <agent-id> \
  --channel C0123ABCD --channel-name support-inbox \
  --keyword invoice --keyword refund                                           # watch only messages containing a keyword
duvo agents slack-triggers create <agent-id> \
  --channel C0123ABCD --channel-name support-inbox \
  --workspace T0123ABCD --connection <connection-id>                           # pick the workspace and the Connection to run it off
duvo agents slack-triggers update <trigger-id> --keyword urgent                # change which messages match
duvo agents slack-triggers update <trigger-id> --all-messages                  # go back to watching every message
duvo agents slack-triggers update <trigger-id> --disable                       # pause without deleting
duvo agents slack-triggers update <trigger-id> --enable                        # resume
duvo agents slack-triggers delete <trigger-id>                                 # delete the trigger
```

<Tip>
  Copying a set of channels onto a new Agent is a loop over `create` — one call per channel:

  ```bash theme={"dark"}
  for channel in C0123ABCD:support-inbox C0456EFGH:billing-alerts; do
    duvo agents slack-triggers create <agent-id> \
      --channel "${channel%%:*}" --channel-name "${channel##*:}"
  done
  ```
</Tip>

<Note>
  An Agent can carry one trigger per channel, so `create` fails if you're already watching that channel. Private channels need the Duvo Slack app invited to the channel, and `--private` marks the trigger accordingly.
</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>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.