## List the last executions of an automation (desk access; a space the caller sees)

`GET /api/desk/v1/automations/{id}/runs`

Module: Desk · operationId: `listDeskAutomationRuns` · Tag: Automation · Auth: access token (`Authorization: Bearer <accessToken>`)

Scope `tenant`: everyone with desk access. Scope `space:<id>`: whoever sees the space (a space the caller does not see, or an unknown one, is 404; a malformed scope 400 `scope`). Newest first; the log keeps the last 50 executions of an automation – what triggered it (`subject` is the ticket's id), the outcome, the failing node with its error, the duration.

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `limit` | query | integer |  | (default `50`; max 50) |
| `scope` | query | string | yes | Whose automations: `tenant` (every space) or `space:<space id>` |
| `id` | path | string (uuid) | yes |  |

### Responses

- **200** The executions (`application/json`)
- **400** Error (`application/json`)
- **404** Error (`application/json`)

Fields of the 200 answer:

- `items` (array of AutomationRun, required)
  - `automationId` (string (uuid), required): Automation that ran
  - `createdAt` (string (date-time), required): When the run happened
  - `depth` (integer, required): 1 when a person's (or another service's) change started it, n when automations started each other
  - `durationMs` (integer, required): Duration of the run in milliseconds
  - `id` (string (uuid), required): Id of the run
  - `outcome` (string, required): skipped: a limit stopped it (too many automations for one event) (one of `succeeded`, `failed`, `skipped`)
  - `steps` (integer, required): The number of nodes that ran
  - `triggerKind` (string, required): event: started by an event; manual: started by a person on a ticket (one of `event`, `manual`)
  - `version` (integer, required): The version of the automation that ran
  - `actorKind` (string): Who made the triggering change (person, integration, assistant, automation, system, scm)
  - `errorCode` (string): Failed runs: the stable code, e.g. `transition_not_allowed`, `invalid`, `out_of_scope`, `expression`, `invalid_definition`, `action_failed`
  - `errorMessage` (string): Why the run failed (only on failure)
  - `event` (string): The event type that started it
  - `node` (string): The id of the node that failed
  - `startedBy` (string): The person or actor behind the triggering change
  - `subject` (string): What the event was about: the item's id
- `total` (integer)

Example 200 answer:

```json
{
  "items": [
    {
      "actorKind": "person",
      "automationId": "8c5d6e7f-9a0b-4c1d-8e3f-5a6b7c8d9e01",
      "createdAt": "2026-11-17T12:05:01Z",
      "depth": 1,
      "durationMs": 21,
      "event": "desk.item.created",
      "id": "9e6f7a8b-0c1d-4e2f-9a4b-6c7d8e9f0a01",
      "outcome": "succeeded",
      "startedBy": "elias.gruber@muster-it.example",
      "steps": 1,
      "subject": "4a1b2c3d-5e6f-4a7b-8c9d-1e2f3a4b5c02",
      "triggerKind": "event",
      "version": 1
    }
  ],
  "total": 1
}
```

### Example request

```bash
curl -X GET 'https://api.mbcom.cloud/api/desk/v1/automations/3f2b8c1e-7d4a-4e9b-9c2a-5b1d6e8f0a12/runs?scope=tenant' \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```
