<!-- BusyBot node reference — https://busybot.net/tools/cockpit/ -->

> Node: Cockpit (`cockpit`) · Action · v1
> Category: Development · Credentials: Cockpit API (`cockpitApi`)
> Updated: 2026-08-16

# Cockpit

> Manage collections, forms, and singletons in Cockpit CMS

## Overview

Cockpit CMS is a self-hosted headless content management system. This tool allows you to create and update collection entries, query collection data with filtering/sorting/pagination, submit form data, and retrieve singleton content. Cockpit uses a MongoDB-style query language for filtering and sorting. Authentication is via API access token passed as a query parameter.

**Category:** Development  
**Tool Name:** `cockpit`  
**Version:** 1

**Appearance:** Icon: `lucide-LayoutDashboard` | Color: `#000000`

## Node Type

**Action** — processes input items and produces output

## Input / Output

| Direction | Port(s) |
|-----------|--------|
| Input | `Input` |
| Output | `Output`, `Error` |

## Credentials

This tool requires **Cockpit API** credentials.
See the [Credentials Guide](https://busybot.net/credentials/cockpit-api/) for setup instructions.

### Resources

| Resource | Value |
|----------|-------|
| Collection | `collection` |
| Form | `form` |
| Singleton | `singleton` |

### Operations

Each resource offers its own set of operations.

| Resource | Operation | Value | Description |
|----------|-----------|-------|-------------|
| Collection | Create an Entry | `create` | Create a collection entry |
| Collection | Get Many Entries | `getAll` | Get many collection entries |
| Collection | Update an Entry | `update` | Update a collection entry |
| Form | Submit a Form | `submit` | Store data from a form submission |
| Singleton | Get | `get` | Get a singleton |

### Parameters

#### Collection: Create an Entry

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Collection | `string` | Yes | — | Name of the collection to operate on. You can find collection names in your Cockpit CMS admin panel under Collections. Supports expressions. |
| JSON Data Fields | `boolean` | No | `false` | Whether new entry/form fields should be set via the value-key pair UI or JSON. |
| Entry Data (`dataFieldsJson`) | `json` | No | — | Entry/form data to send as JSON. _(shown when JSON Data Fields is `true`)_ |
| Entry Data (`dataFieldsUi`) | `fixedCollection` | No | `{}` | Entry/form data to send as field name/value pairs. _(shown when JSON Data Fields is `false`)_ |
| — Name | `string` | No | — | Name of the field. Supports expressions. |
| — Value | `string` | No | — | Value of the field. Supports expressions like {{ $json.title }}. |

#### Collection: Get Many Entries

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Collection | `string` | Yes | — | Name of the collection to operate on. You can find collection names in your Cockpit CMS admin panel under Collections. Supports expressions. |
| Return All | `boolean` | No | `false` | Whether to return all results or only up to a given limit. |
| Limit | `number` | No | `100` | Max number of results to return. _(shown when Return All is `false`)_ |
| Options | `collection` | No | `{}` | Additional query options for filtering and sorting results. |
| — Fields | `string` | No | — | Comma-separated list of fields to include in results. Supports expressions. |
| — Filter Query | `json` | No | — | Filter query in MongoDB/Mongolite format (e.g. {"name": "Jim"}). Supports expressions. |
| — Language | `string` | No | — | Return normalized language fields for this locale. Supports expressions. |
| — Populate | `boolean` | No | `true` | Whether to resolve linked collection items. |
| — RAW Data | `boolean` | No | `false` | Whether to return the data exactly as received from the API (non-simplified). |
| — Skip | `number` | No | `0` | Number of entries to skip (for manual pagination). |
| — Sort Query | `json` | No | — | Sort query in MongoDB/Mongolite format (e.g. {"price": -1}). Supports expressions. |

#### Collection: Update an Entry

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Collection | `string` | Yes | — | Name of the collection to operate on. You can find collection names in your Cockpit CMS admin panel under Collections. Supports expressions. |
| Entry ID | `string` | Yes | — | The _id of the entry to update. Supports expressions like {{ $json._id }}. |
| JSON Data Fields | `boolean` | No | `false` | Whether new entry/form fields should be set via the value-key pair UI or JSON. |
| Entry Data (`dataFieldsJson`) | `json` | No | — | Entry/form data to send as JSON. _(shown when JSON Data Fields is `true`)_ |
| Entry Data (`dataFieldsUi`) | `fixedCollection` | No | `{}` | Entry/form data to send as field name/value pairs. _(shown when JSON Data Fields is `false`)_ |
| — Name | `string` | No | — | Name of the field. Supports expressions. |
| — Value | `string` | No | — | Value of the field. Supports expressions like {{ $json.title }}. |

#### Form: Submit a Form

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Form | `string` | Yes | — | Name of the form to submit data to. You can find form names in your Cockpit CMS admin panel under Forms. Supports expressions. |
| JSON Data Fields | `boolean` | No | `false` | Whether new entry/form fields should be set via the value-key pair UI or JSON. |
| Entry Data (`dataFieldsJson`) | `json` | No | — | Entry/form data to send as JSON. _(shown when JSON Data Fields is `true`)_ |
| Entry Data (`dataFieldsUi`) | `fixedCollection` | No | `{}` | Entry/form data to send as field name/value pairs. _(shown when JSON Data Fields is `false`)_ |
| — Name | `string` | No | — | Name of the field. Supports expressions. |
| — Value | `string` | No | — | Value of the field. Supports expressions like {{ $json.email }}. |

#### Singleton: Get

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Singleton | `string` | Yes | — | Name of the singleton to retrieve. You can find singleton names in your Cockpit CMS admin panel under Singletons. Supports expressions. |

#### All Operations

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Max Concurrency | `number` | No | `10` | Maximum number of items to process concurrently. |

## Output Data

The Cockpit response is **merged onto the input item's JSON** — incoming fields pass through and stay addressable downstream, and binary data is forwarded unchanged. Entry and singleton fields sit at the top level of the item, not under a wrapper property.

| Resource / Operation | Output |
|----------------------|--------|
| Collection `create` | One item carrying the saved entry, including the `_id` Cockpit assigned to it. |
| Collection `update` | One item carrying the saved entry. |
| Collection `getAll` | **Fans out** — one output item per entry, each merged onto the input item's JSON. A query that matches nothing produces no output items at all. |
| Form `submit` | One item carrying Cockpit's response to the submission. |
| Singleton `get` | One item carrying the singleton's content. |

`getAll` is the only operation that changes the item count, so a node downstream of it sees one item per entry rather than one per input item.

Reference the returned fields downstream by expression, e.g. `{{ $json._id }}` or `{{ $json.title }}`.

## Usage Examples

- Get all entries from a Cockpit collection
- Create a new blog post in the posts collection
- Update an existing collection entry by ID
- Submit data to a Cockpit form
- Retrieve homepage singleton content

## Example Configuration

Create an entry, supplying the fields as JSON:

```json
{
  "type": "cockpit",
  "parameters": {
    "resource": "collection",
    "operation": "create",
    "collection": "products",
    "jsonDataFields": true,
    "dataFieldsJson": "{\"name\": \"{{ $json.name }}\", \"price\": 29.99, \"description\": \"A great product\"}"
  }
}
```

Create the same entry using name/value field rows instead:

```json
{
  "type": "cockpit",
  "parameters": {
    "resource": "collection",
    "operation": "create",
    "collection": "products",
    "jsonDataFields": false,
    "dataFieldsUi": {
      "field": [
        { "name": "name", "value": "{{ $json.name }}" },
        { "name": "price", "value": "29.99" },
        { "name": "description", "value": "A great product" }
      ]
    }
  }
}
```

Update an existing entry by its `_id`:

```json
{
  "type": "cockpit",
  "parameters": {
    "resource": "collection",
    "operation": "update",
    "collection": "products",
    "id": "{{ $json._id }}",
    "jsonDataFields": true,
    "dataFieldsJson": "{\"price\": 34.99, \"description\": \"Updated description\"}"
  }
}
```

Query a collection with field selection, a filter and a sort:

```json
{
  "type": "cockpit",
  "parameters": {
    "resource": "collection",
    "operation": "getAll",
    "collection": "products",
    "returnAll": false,
    "limit": 50,
    "options": {
      "fields": "name,price,description",
      "filter": "{\"published\": true, \"price\": {\"$gt\": 10}}",
      "sort": "{\"created\": -1}",
      "populate": true,
      "rawData": false,
      "skip": 0
    }
  }
}
```

Submit a form:

```json
{
  "type": "cockpit",
  "parameters": {
    "resource": "form",
    "operation": "submit",
    "form": "contact",
    "jsonDataFields": true,
    "dataFieldsJson": "{\"name\": \"{{ $json.name }}\", \"email\": \"{{ $json.email }}\", \"message\": \"{{ $json.message }}\"}"
  }
}
```

Read a singleton:

```json
{
  "type": "cockpit",
  "parameters": {
    "resource": "singleton",
    "operation": "get",
    "singleton": "site-settings"
  }
}
```

Pull an entire collection, five input items at a time:

```json
{
  "type": "cockpit",
  "parameters": {
    "resource": "collection",
    "operation": "getAll",
    "collection": "products",
    "returnAll": true,
    "maxConcurrency": 5
  }
}
```

Run a multi-condition query over articles:

```json
{
  "type": "cockpit",
  "parameters": {
    "resource": "collection",
    "operation": "getAll",
    "collection": "articles",
    "returnAll": true,
    "options": {
      "filter": "{\"published\": true, \"category\": \"technology\", \"created\": {\"$gte\": \"2024-01-01\"}}",
      "sort": "{\"created\": -1, \"title\": 1}",
      "fields": "title,excerpt,created,author"
    }
  }
}
```

Build a newsletter signup from upstream data using field rows:

```json
{
  "type": "cockpit",
  "parameters": {
    "resource": "form",
    "operation": "submit",
    "form": "newsletter",
    "jsonDataFields": false,
    "dataFieldsUi": {
      "field": [
        { "name": "email", "value": "{{ $json.email }}" },
        { "name": "interests", "value": "technology,design" },
        { "name": "frequency", "value": "weekly" }
      ]
    }
  }
}
```

### Error Handling

| Mode | Behavior |
|------|----------|
| **stop** | Halts workflow on first error |
| **continue** | Skips failed items, passes successful ones through |
| **errorPort** | Routes failed items to Error output port |

## Tips

Cockpit CMS tool for managing collections, forms, and singletons in a self-hosted headless CMS.

### Behavior notes

- **Create and update share one endpoint.** Update is a create that carries an `_id`; supply Entry ID and Cockpit overwrites that entry rather than adding a new one.
- **Entry Data comes from one source at a time.** With JSON Data Fields on, only the JSON field is read; with it off, only the name/value rows are read. Malformed JSON fails the item with a message naming the field.
- **Filter Query and Sort Query use MongoDB syntax**, e.g. `{"price": {"$gt": 10}}` and `{"created": -1}`. Both must be valid JSON or the item fails.
- **Fields is a comma-separated allowlist.** Naming fields drops `_id` from the response unless you list it explicitly.
- **RAW Data turns simplification off.** By default Cockpit returns a simplified shape; switch RAW Data on to receive the response exactly as the API produced it.
- **Skip is manual pagination.** Combine it with Limit when you want a specific page; with Return All on, Cockpit returns everything and Limit is ignored.