> AI agents: this is one page from Mammoth Analytics documentation. The index of all pages as Markdown is https://mammoth.io/docs/llms.txt. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get Markdown.

# mammoth automation

> All 13 mammoth automation commands with examples, arguments and confirmation flags: Create and manage automations.

> Generated from mammoth-cli 2.4.2, released 2026-11-02: `mammoth schema list`, `mammoth capability list` and the CLI's own `--help`. Do not edit by hand; run `npm run docs:capabilities`.

Create and manage automations. 13 commands.

Every command also takes the [global flags](https://mammoth.io/docs/build/cli/global-flags/) (`--output`, `--yes`, `--confirm`, `--dry-run`, `--input`, `--profile`, ...), which are not repeated below. `--input` takes a JSON or YAML document of the input fields; `mammoth schema get COMMAND_ID` prints a command's full input schema.

**Confirmation.** Commands marked `--yes --confirm TARGET` or `--yes` always need those flags, even at a terminal: they never prompt. Commands marked "`--yes` or prompt" ask at an interactive terminal (table output, no `--no-input`) and otherwise need `--yes`. `--dry-run` skips confirmation and sends nothing.

## Summary

| Command | What it does | Effect | Confirmation |
|---|---|---|---|
| [`automation capabilities`](#mammoth-automation-capabilities) | List every task, trigger, option and file format automations support. | Read | — |
| [`automation create`](#mammoth-automation-create) | Create an automation. Name comes from a positional or the 'name' field. | External effect | `--yes` |
| [`automation delete`](#mammoth-automation-delete) | Permanently delete one automation by id. Prompt or '--yes' required. | Destructive | `--yes` or prompt |
| [`automation folders`](#mammoth-automation-folders) | List every folder a consolidation automation watches. | Read | — |
| [`automation get`](#mammoth-automation-get) | Get one automation by id. Automation id is positional. | Read | — |
| [`automation list`](#mammoth-automation-list) | List all automations in the active workspace/project. | Read | — |
| [`automation restore`](#mammoth-automation-restore) | Restore one trashed automation. Automation id is positional. | Benign mutation | — |
| [`automation runs`](#mammoth-automation-runs) | List an automation's latest runs, newest first, each with its files. | Read | — |
| [`automation trash`](#mammoth-automation-trash) | Move one automation to trash (reversible). Automation id is positional. | Benign mutation | — |
| [`automation update`](#mammoth-automation-update) | Apply JSON-patch operations to one automation, or add or remove its datasets. | External effect | `--yes` |
| [`automation route order`](#mammoth-automation-route-order) | Set the order a file meets a watched folder's own rules in. | Benign mutation | — |
| [`automation route preview`](#mammoth-automation-route-preview) | Show where files dropped in a watched folder would go. | Read | — |
| [`automation run-file add-anyway`](#mammoth-automation-run-file-add-anyway) | Append a file a run skipped as a duplicate to its destination after all. | Benign mutation | `--yes` or prompt |

## automation commands

### mammoth automation capabilities

List every task, trigger, option and file format automations support.

```bash
mammoth automation capabilities
```

- **Effect:** Read, scope `project` · **Confirmation:** none
- **Preconditions:** Read-only. Lists everything an automation supports, straight from the server: tasks (each with task_type, summary, required_fields, optional_fields, options = accepted values per field, formats_in and formats_out = file formats it reads or writes) and conditions (the triggers: condition_type, summary, fields, options). Answer "can an automation do X?" (a PDF, an email attachment, a schedule) from this, never from memory. Then create with `automation create`.
- **Id:** `automation.capabilities` · **Result:** `AutomationCapabilitiesResult` · **Backed by:** SDK `mammoth.api.automations.AutomationsAPI.capabilities`, API `GET /workspaces/{workspace_id}/projects/{project_id}/automations/capabilities` (GetAutomationCapabilities)

### mammoth automation create

Create an automation. Name comes from a positional or the 'name' field.

```bash
mammoth automation create 'Revenue report' --input '{"description": "Quarterly revenue summary", "tasks": [{"task_type": "run_data_retrieval", "details": {"ds_details": [{"ds_id": 42}]}}]}' --yes
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `NAME` | positional | no | — | `str` | Name of the new automation; or pass it via the 'name' input field. Or the `name` input field. |
| `name` | `--input` field | no | — | `str` |  |
| `description` | `--input` field | yes | — | `str` |  |
| `tasks` | `--input` field | yes | — | `list[AutomationTaskSpec]` |  |
| `conditions` | `--input` field | no | — | `list[AutomationConditionSpec]` |  |
| `condition_mode` | `--input` field | no | `and` | `AutomationConditionMode` | One of `and`, `or`. |

- **Effect:** External effect, scope `project` · **Confirmation:** always `--yes`, even at a terminal
- **Preconditions:** B15 AUTOMATION_EXTERNAL_EFFECTS: run `automation capabilities` first: it lists every task, trigger, option and file format in and out (PDF included). Task models can pull cloud files and send email; requires connector/email allowlists and dedicated fixtures. Delete old rows on a schedule with task apply_retention_policy (datasource_id, rule_type time_based, count_based or condition_based). The CLI sets require_approval=true on a retention task that omits it (the route defaults to false, an unattended hard delete); require_approval=false with the delete action needs --yes --confirm unattended-delete. An emailed file is task send_an_alert with attachments.dataview_ids: each selected view is emailed as a CSV file. The combined row count of all attached views must stay within 100,000 -- over that, the automation is refused (and a run that grows past it fails).
- **Id:** `automation.create` · **Result:** `AutomationCreateResult` · **Backed by:** SDK `mammoth.api.automations.AutomationsAPI.create`, API `POST /workspaces/{workspace_id}/projects/{project_id}/automations` (CreateAutomation)

### mammoth automation delete

Permanently delete one automation by id. Prompt or '--yes' required.

```bash
mammoth automation delete 123 --yes
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `AUTOMATION_ID` | positional | yes | — | `int` | ID of the automation. |

- **Effect:** Destructive, scope `project` · **Confirmation:** `--yes`, or answer the prompt at an interactive terminal
- **Preconditions:** Immutable ID confirmation.
- **Id:** `automation.delete` · **Result:** `AutomationDeleteResult` · **Backed by:** SDK `mammoth.api.automations.AutomationsAPI.delete`, API `DELETE /workspaces/{workspace_id}/projects/{project_id}/automations/{automation_id}` (DeleteAutomation)

### mammoth automation folders

List every folder a consolidation automation watches.

```bash
mammoth automation folders
```

- **Effect:** Read, scope `project` · **Confirmation:** none
- **Preconditions:** Read-only. Every folder a consolidation automation watches, its rules in order, and the files on their way or waiting on a person.
- **Id:** `automation.folders` · **Result:** `AutomationFoldersResult` · **Backed by:** SDK `mammoth.api.automations.AutomationsAPI.watched_folders`, API `GET /workspaces/{workspace_id}/projects/{project_id}/automations/folders` (GetWatchedFolders)

### mammoth automation get

Get one automation by id. Automation id is positional.

```bash
mammoth automation get 123
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `AUTOMATION_ID` | positional | yes | — | `int` | ID of the automation. |

- **Effect:** Read, scope `project` · **Confirmation:** none
- **Preconditions:** Some servers answer this with HTTP 500 and an empty body for an automation that automation create just returned. The automation exists; this is a server error, so do not retry more than once.
- **Id:** `automation.get` · **Result:** `AutomationGetResult` · **Backed by:** SDK `mammoth.api.automations.AutomationsAPI.get`, API `GET /workspaces/{workspace_id}/projects/{project_id}/automations/{automation_id}` (GetAutomation)

### mammoth automation list

List all automations in the active workspace/project.

```bash
mammoth automation list
```

- **Effect:** Read, scope `project` · **Confirmation:** none · **Pages:** `single_page`
- **Id:** `automation.list` · **Result:** `AutomationListResult` · **Backed by:** SDK `mammoth.api.automations.AutomationsAPI.list`, API `GET /workspaces/{workspace_id}/projects/{project_id}/automations` (GetList)

### mammoth automation restore

Restore one trashed automation. Automation id is positional.

```bash
mammoth automation restore 123
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `AUTOMATION_ID` | positional | yes | — | `int` | ID of the automation. |

- **Effect:** Benign mutation, scope `project` · **Confirmation:** none
- **Preconditions:** Required inputs: AUTOMATION_ID.
- **Id:** `automation.restore` · **Result:** `AutomationRestoreResult` · **Backed by:** SDK `mammoth.api.automations.AutomationsAPI.restore`, API `POST /workspaces/{workspace_id}/projects/{project_id}/automations/{automation_id}/restore` (RestoreAutomation)

### mammoth automation runs

List an automation's latest runs, newest first, each with its files.

```bash
mammoth automation runs 123 --input '{"limit": 10}'
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `AUTOMATION_ID` | positional | yes | — | `int` | ID of the automation. |
| `limit` | `--input` field | no | — | `int` |  |

- **Effect:** Read, scope `project` · **Confirmation:** none
- **Preconditions:** Read-only. Newest first, each run with its files; `limit` is capped at 50 by the server.
- **Id:** `automation.runs` · **Result:** `AutomationRunsResult` · **Backed by:** SDK `mammoth.api.automations.AutomationsAPI.runs`, API `GET /workspaces/{workspace_id}/projects/{project_id}/automations/{automation_id}/runs` (GetAutomationRuns)

### mammoth automation trash

Move one automation to trash (reversible). Automation id is positional.

```bash
mammoth automation trash 123
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `AUTOMATION_ID` | positional | yes | — | `int` | ID of the automation. |

- **Effect:** Benign mutation, scope `project` · **Confirmation:** none
- **Preconditions:** Required inputs: AUTOMATION_ID.
- **Id:** `automation.trash` · **Result:** `AutomationTrashResult` · **Backed by:** SDK `mammoth.api.automations.AutomationsAPI.trash`, API `POST /workspaces/{workspace_id}/projects/{project_id}/automations/{automation_id}/trash` (TrashAutomation)

### mammoth automation update

Apply JSON-patch operations to one automation, or add or remove its datasets.

```bash
mammoth automation update 123 --input '{"patch": [{"op": "replace", "path": "details", "value": {"name": "Daily revenue export"}}]}' --yes
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `AUTOMATION_ID` | positional | yes | — | `int` | ID of the automation. |
| `patch` | `--input` field | yes | — | `list[AutomationPatchItem]` |  |
| `add_datasets` | `--input` field | no | — | `list[int]` |  |
| `remove_datasets` | `--input` field | no | — | `list[int]` |  |

- **Effect:** External effect, scope `project` · **Confirmation:** always `--yes`, even at a terminal
- **Preconditions:** Changes a live automation (run, status, retention approval): read it first (`automation get`). Needs --yes. Each patch item is op + path + value: `command` + `run` (run now), `replace` + `status` (`suspend` or `resume`), `replace` + `details` (an object with at least one of name, description, tasks, conditions). Paths are details, run, status, approve_retention, reject_retention. On a data-refresh automation, --input with add_datasets and remove_datasets (lists of dataset ids) changes its datasets without a patch list.
- **Id:** `automation.update` · **Result:** `AutomationUpdateResult` · **Backed by:** SDK `mammoth.api.automations.AutomationsAPI.update`, API `PATCH /workspaces/{workspace_id}/projects/{project_id}/automations/{automation_id}` (UpdateAutomation)

## automation route

### mammoth automation route order

Set the order a file meets a watched folder's own rules in.

```bash
mammoth automation route order 123 --input '{"automation_ids": [12, 11]}'
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `FOLDER_RESOURCE_ID` | positional | yes | — | `int` | ID of the folder resource. |
| `automation_ids` | `--input` field | yes | — | `list[int]` |  |

- **Effect:** Benign mutation, scope `project` · **Confirmation:** none
- **Preconditions:** `automation_ids` names the folder's own rules, first rule first; files dropped after the change meet them in that order.
- **Id:** `automation.route.order` · **Result:** `AutomationRouteOrderResult` · **Backed by:** SDK `mammoth.api.automations.AutomationsAPI.set_route_order`, API `PUT /workspaces/{workspace_id}/projects/{project_id}/automations/route-order` (SetRouteOrder)

### mammoth automation route preview

Show where files dropped in a watched folder would go.

```bash
mammoth automation route preview 123 --input '{"names": ["sales_2026-10.csv"]}'
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `FOLDER_RESOURCE_ID` | positional | yes | — | `int` | ID of the folder resource. |
| `names` | `--input` field | no | — | `list[str]` |  |
| `draft` | `--input` field | no | — | `dict[str, any]` |  |

- **Effect:** Read, scope `project` · **Confirmation:** none
- **Preconditions:** Read-only. Lists the folder's rules (its own, then inherited) and where files of the given `names` would go; a `draft` rule also says how many recent files it would take.
- **Id:** `automation.route.preview` · **Result:** `AutomationRoutePreviewResult` · **Backed by:** SDK `mammoth.api.automations.AutomationsAPI.preview_routes`, API `POST /workspaces/{workspace_id}/projects/{project_id}/automations/route-preview` (PreviewRoutes)

## automation run-file

### mammoth automation run-file add-anyway

Append a file a run skipped as a duplicate to its destination after all.

```bash
mammoth automation run-file add-anyway 123 --yes
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `RUN_FILE_ID` | positional | yes | — | `int` | ID of the run file. |

- **Effect:** Benign mutation, scope `project` · **Confirmation:** `--yes`, or answer the prompt at an interactive terminal
- **Preconditions:** Appends a file a run skipped as a duplicate to its destination dataset; find the run file id with `automation runs`.
- **Id:** `automation.run-file.add-anyway` · **Result:** `AutomationRunFileAddAnywayResult` · **Backed by:** SDK `mammoth.api.automations.AutomationsAPI.add_run_file_anyway`, API `POST /workspaces/{workspace_id}/projects/{project_id}/automations/run-files/{run_file_id}/add-anyway` (AddRunFileAnyway)

---
Source: https://mammoth.io/docs/build/cli/automation.md · Updated: 2026-11-02
