## What a project's automations can use (tenant:forge:read)

`GET /api/forge/v1/projects/{key}/automations/catalog`

Module: Forge · operationId: `getForgeAutomationCatalog` · Tag: Automations · Auth: access token (`Authorization: Bearer <accessToken>`)

Requires `tenant:forge:read` and a project the caller sees. The catalogue of the builder – the shape of flows' catalogue, cut down to what runs immediately – forge's item events with their payload schemas, the actions with an immediate implementation, the node and trigger kinds of the inline profile, the expression namespaces and functions, the limits, and per action the parameters the builder prefills (`defaults`).

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `key` | path | string | yes | Project key (e.g. APP) |

### Responses

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

Fields of the 200 answer:

- `defaults` (object, required): Per action key, the parameters the builder prefills when the action is added: the ones that address the item the event is about
- `functions` (array of string, required): The functions of the expression language
- `kinds` (array of object, required): The node kinds that run immediately, with their default ports and fields
  - `fields` (array of AutomationField, required): Fields the inspector edits
    - `path` (string, required): Dotted below the node or trigger
    - `type` (string, required): Editor type of the field
    - `options` (array of string): Allowed values of a choice field
    - `when` (object): The field applies only while the sibling field has one of the values
      - `equals` (array of string): Values of the sibling field for which this field applies
      - `field` (string): The sibling field
  - `name` (string, required): Node kind
  - `ports` (array of string, required): Default output ports of the kind
  - `retry` (boolean, required): Always false – an immediate automation is not retried
- `limits` (object, required): Limits of immediate automations
  - `maxDepth` (integer, required): How deep automations start each other
  - `maxNodes` (integer, required): The most nodes of an immediate automation
  - `maxPerEvent` (integer, required): The most automations one event starts
- `modules` (array of object, required): forge's flows manifest, cut down to the actions with an immediate implementation: `nodes` (key, labels, parameter and output schemas) and `events` (type, labels, payload schema)
  - `events` (array of object): The events a trigger can listen to
  - `module` (string): Module of the manifest
  - `nodes` (array of object): The actions with an immediate implementation
  - `revision` (string): Revision of the manifest
  - `version` (integer): Manifest format version
- `namespaces` (array of string, required): The names expressions read
- `profile` (string, required): The validation profile: always `inline` (runs immediately) (one of `inline`)
- `retryFields` (array of AutomationField, required): Always empty
  - `path` (string, required): Dotted below the node or trigger
  - `type` (string, required): Editor type of the field
  - `options` (array of string): Allowed values of a choice field
  - `when` (object): The field applies only while the sibling field has one of the values
    - `equals` (array of string): Values of the sibling field for which this field applies
    - `field` (string): The sibling field
- `triggers` (array of object, required): The trigger kinds a definition may use here (forge - event only; nothing starts an automation by hand) with their fields
  - `fields` (array of AutomationField, required): Fields the inspector edits
    - `path` (string, required): Dotted below the node or trigger
    - `type` (string, required): Editor type of the field
    - `options` (array of string): Allowed values of a choice field
    - `when` (object): The field applies only while the sibling field has one of the values
      - `equals` (array of string): Values of the sibling field for which this field applies
      - `field` (string): The sibling field
  - `name` (string, required): Trigger kind

Example 200 answer:

```json
{
  "defaults": {
    "forge.item.add_label": {
      "key": "{{ trigger.data.projectKey }}",
      "number": "{{ trigger.data.number }}"
    },
    "forge.item.transition": {
      "key": "{{ trigger.data.projectKey }}",
      "number": "{{ trigger.data.number }}"
    }
  },
  "functions": [
    "len",
    "any",
    "all",
    "hasPrefix",
    "hasSuffix",
    "lower",
    "upper",
    "now"
  ],
  "kinds": [
    {
      "fields": [
        {
          "path": "condition",
          "type": "condition"
        }
      ],
      "name": "if",
      "ports": [
        "true",
        "false",
        "error"
      ],
      "retry": false
    },
    {
      "fields": [
        {
          "path": "action",
          "type": "action"
        },
        {
          "path": "params",
          "type": "params"
        }
      ],
      "name": "action",
      "ports": [
        "main",
        "error"
      ],
      "retry": false
    }
  ],
  "limits": {
    "maxDepth": 4,
    "maxNodes": 25,
    "maxPerEvent": 20
  },
  "modules": [
    {
      "events": [
        {
          "label": {
            "de": "Element angelegt",
            "en": "Item created"
          },
          "type": "forge.item.created"
        },
        {
          "label": {
            "de": "Alle Unteraufgaben erledigt",
            "en": "All children done"
          },
          "type": "forge.item.children_done"
        }
      ],
      "module": "forge",
      "nodes": [
        {
          "access": "write",
          "key": "forge.item.transition",
          "label": {
            "de": "Status wechseln",
            "en": "Change status"
          }
        },
        {
          "access": "write",
          "key": "forge.item.add_label",
          "label": {
            "de": "Label hinzufügen",
            "en": "Add label"
          }
        },
        {
          "access": "write",
          "key": "forge.item.assign",
          "label": {
            "de": "Zuständige Person hinzufügen",
            "en": "Add assignee"
          }
        },
        {
          "access": "write",
          "key": "forge.comment.add",
          "label": {
            "de": "Kommentar hinzufügen",
            "en": "Add comment"
          }
        }
      ],
      "revision": "3f9c2a17",
      "version": 1
    }
  ],
  "namespaces": [
    "trigger",
    "nodes",
    "vars",
    "error",
    "run"
  ],
  "profile": "inline",
  "retryFields": [],
  "triggers": [
    {
      "fields": [
        {
          "path": "event",
          "type": "event"
        },
        {
          "path": "filter",
          "type": "condition"
        },
        {
          "path": "includeAutomated",
          "type": "boolean"
        }
      ],
      "name": "event"
    }
  ]
}
```

### Example request

```bash
curl -X GET 'https://api.mbcom.cloud/api/forge/v1/projects/string/automations/catalog' \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```
