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

# Automations

> Create and manage Automations, the containers that group the Agents and Queues of one process, with the Duvo CLI.

An Automation groups the Agents and Queues that run one process, and is what the Duvo app shows for that process. Once your team has moved to Automations, every new Agent and Queue belongs to one, and `duvo automations` is how you create and inspect them from the terminal.

<Note>
  On a team that hasn't moved to Automations, these commands return a 403 error: "This team hasn't moved to Automations, so it has no automations to work with." Agents and Queues on those teams stand alone and are created without `--automation-id`.
</Note>

## Create an Automation

```bash theme={"dark"}
duvo automations create --name "Inbox Zero" --json
```

Creating an Automation also creates its first Agent. The `--json` response carries both IDs, `automation.id` and `first_agent_id`. Set up that first Agent rather than creating a second one.

## Create Agents and Queues inside it

Pass `--automation-id` when you create a Queue or another Agent:

```bash theme={"dark"}
duvo queues create --name "Inbox triage" --automation-id <automation-id>
duvo agents create --name "Inbox triager" --input "Triage each new email…" \
  --automation-id <automation-id>
```

| Command | Without `--automation-id` |
| - | - |
| `duvo queues create` | Returns a 409 error: "This team has moved to Automations, so a new agent or queue must be created inside one." |
| `duvo agents create` | Succeeds, and creates a new Automation named after the Agent. |

To keep a process together, pass the same `--automation-id` to every Agent and Queue in it. To add an Agent or Queue that already exists, use `add-agent` or `add-queue`.

## List and inspect Automations

```bash theme={"dark"}
duvo automations list                      # every Automation, with Agent and Queue counts
duvo automations get <automation-id>       # one Automation
duvo automations current <automation-id>   # the Agents, Queues, triggers and schedules it runs now
duvo automations flow <automation-id>      # how its Agents and Queues hand work to each other
```

Add `--json` to any command for machine-readable output.

## Change an Automation

```bash theme={"dark"}
duvo automations rename <automation-id> --name "Inbox Zero (EU)"
duvo automations duplicate <automation-id>                 # "clone" is an alias
duvo automations add-agent <automation-id> <agent-id>
duvo automations add-queue <automation-id> <queue-id>
duvo automations remove-agent <automation-id> <agent-id>   # deletes the Agent
duvo automations remove-queue <automation-id> <queue-id>   # deletes the Queue
duvo automations delete <automation-id>                    # prompts for confirmation
```

`duplicate` creates "Copy of \<name>" with the live Agents, Queues and routing. Your own triggers and schedules are copied switched off; Cases and Run history are not copied.

<Warning>
  `remove-agent` and `remove-queue` delete the Agent or Queue, not only its membership. `delete` stops the Automation's Agents and Queues from dispatching. All three prompt for confirmation; pass `--yes` to skip the prompt in scripts.
</Warning>

## Recommended build order

When you build a process from the CLI, each step depends on the one before it:

1. **Connections.** Check `duvo connections list --type <slug>` for every service the Agents use, and connect what is missing. See [Managing Connections](/cli/managing-connections).
2. **Automation.** `duvo automations create --name <name> --json`.
3. **Queues.** `duvo queues create --automation-id <automation-id>`, then a Case schema and labels. See [Cases and Queues](/cli/cases-and-queues#case-schemas).
4. **Agents.** Create the remaining Agents with `--automation-id`, attach their integrations, pin a Connection to every slot that needs one, and link them to their Queues with `duvo queues link-agent`. Pass `--enable-trigger` when you link a consumer; without it, its Case trigger starts switched off.
5. **Policy.** Answer the questions the Agents read. See [Policy](/cli/policy).
6. **Case triggers on.** Run `duvo agents case-triggers list <agent-id> --json` for each consumer and check that `enabled` is `true`. If it is `false` and `pending_change` is set, your team saves Automation changes to a draft, and the trigger only switches on when someone clicks **Make active** in the Automation's header in the Duvo app. Until then, a test Case stays Pending.
7. **Test Run.** `duvo runs start --agent <agent-id>`, or add one test Case to the Queue, and check the result.
8. **Schedule, created paused.** Create it with `--disabled` and an explicit timezone, then turn it on once the test Run is right:

```bash theme={"dark"}
duvo agents schedules create <agent-id> --frequency workday --time 07:30 \
  --timezone Europe/Prague --disabled
duvo agents schedules update <agent-id> <schedule-id> --enable
```

Approval requests from a scheduled Run go to the person who created the schedule. See [When to Ask a Human](/best-practices/when-to-ask-a-human).

## Related

<CardGroup cols={2}>
  <Card title="Policy" icon="sliders-horizontal" href="/cli/policy">
    The typed setup answers an Automation's Agents read at run time.
  </Card>

  <Card title="Cases and Queues" icon="inbox" href="/cli/cases-and-queues">
    Case schemas, Case search, and Queue labels.
  </Card>
</CardGroup>


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