Reference · Tools

Cockpit

Interact with a self-hosted Cockpit CMS instance for managing collections, forms, and singletons

Action Development v1

The Cockpit node connects your BusyBot workflows to a self-hosted Cockpit CMS instance. You can create and update collection entries, query collections with MongoDB-style filters and pagination, submit form data, and retrieve singleton content. A practical use case: automatically push product records from a spreadsheet into a Cockpit collection on a schedule.

Node type
Action
Parameters
15
Outputs
Output, Error
Credentials
Cockpit API

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

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool requires Cockpit API credentials. See the Credentials Guide for setup instructions.

Resources

ResourceValue
Collectioncollection
Formform
Singletonsingleton

Operations

Each resource offers its own set of operations.

ResourceOperationValueDescription
CollectionCreate an EntrycreateCreate a collection entry
CollectionGet Many EntriesgetAllGet many collection entries
CollectionUpdate an EntryupdateUpdate a collection entry
FormSubmit a FormsubmitStore data from a form submission
SingletonGetgetGet a singleton

Parameters

Collection: Create an Entry

ParameterTypeRequiredDefaultDescription
CollectionstringYesName of the collection to operate on. You can find collection names in your Cockpit CMS admin panel under Collections. Supports expressions.
JSON Data FieldsbooleanNofalseWhether new entry/form fields should be set via the value-key pair UI or JSON.
Entry Data (dataFieldsJson)jsonNoEntry/form data to send as JSON. (shown when JSON Data Fields is true)
Entry Data (dataFieldsUi)fixedCollectionNo{}Entry/form data to send as field name/value pairs. (shown when JSON Data Fields is false)
— NamestringNoName of the field. Supports expressions.
— ValuestringNoValue of the field. Supports expressions like {{ $json.title }}.

Collection: Get Many Entries

ParameterTypeRequiredDefaultDescription
CollectionstringYesName of the collection to operate on. You can find collection names in your Cockpit CMS admin panel under Collections. Supports expressions.
Return AllbooleanNofalseWhether to return all results or only up to a given limit.
LimitnumberNo100Max number of results to return. (shown when Return All is false)
OptionscollectionNo{}Additional query options for filtering and sorting results.
— FieldsstringNoComma-separated list of fields to include in results. Supports expressions.
— Filter QueryjsonNoFilter query in MongoDB/Mongolite format (e.g. {“name”: “Jim”}). Supports expressions.
— LanguagestringNoReturn normalized language fields for this locale. Supports expressions.
— PopulatebooleanNotrueWhether to resolve linked collection items.
— RAW DatabooleanNofalseWhether to return the data exactly as received from the API (non-simplified).
— SkipnumberNo0Number of entries to skip (for manual pagination).
— Sort QueryjsonNoSort query in MongoDB/Mongolite format (e.g. {“price”: -1}). Supports expressions.

Collection: Update an Entry

ParameterTypeRequiredDefaultDescription
CollectionstringYesName of the collection to operate on. You can find collection names in your Cockpit CMS admin panel under Collections. Supports expressions.
Entry IDstringYesThe _id of the entry to update. Supports expressions like {{ $json._id }}.
JSON Data FieldsbooleanNofalseWhether new entry/form fields should be set via the value-key pair UI or JSON.
Entry Data (dataFieldsJson)jsonNoEntry/form data to send as JSON. (shown when JSON Data Fields is true)
Entry Data (dataFieldsUi)fixedCollectionNo{}Entry/form data to send as field name/value pairs. (shown when JSON Data Fields is false)
— NamestringNoName of the field. Supports expressions.
— ValuestringNoValue of the field. Supports expressions like {{ $json.title }}.

Form: Submit a Form

ParameterTypeRequiredDefaultDescription
FormstringYesName of the form to submit data to. You can find form names in your Cockpit CMS admin panel under Forms. Supports expressions.
JSON Data FieldsbooleanNofalseWhether new entry/form fields should be set via the value-key pair UI or JSON.
Entry Data (dataFieldsJson)jsonNoEntry/form data to send as JSON. (shown when JSON Data Fields is true)
Entry Data (dataFieldsUi)fixedCollectionNo{}Entry/form data to send as field name/value pairs. (shown when JSON Data Fields is false)
— NamestringNoName of the field. Supports expressions.
— ValuestringNoValue of the field. Supports expressions like {{ $json.email }}.

Singleton: Get

ParameterTypeRequiredDefaultDescription
SingletonstringYesName of the singleton to retrieve. You can find singleton names in your Cockpit CMS admin panel under Singletons. Supports expressions.

All Operations

ParameterTypeRequiredDefaultDescription
Max ConcurrencynumberNo10Maximum 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 / OperationOutput
Collection createOne item carrying the saved entry, including the _id Cockpit assigned to it.
Collection updateOne item carrying the saved entry.
Collection getAllFans 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 submitOne item carrying Cockpit’s response to the submission.
Singleton getOne 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:

{
  "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:

{
  "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:

{
  "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:

{
  "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:

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

Read a singleton:

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

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

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

Run a multi-condition query over articles:

{
  "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:

{
  "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

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes 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.

Frequently asked questions

How do I update an existing collection entry instead of creating a new one?

Create and update share the same endpoint in Cockpit. To update, supply the Entry ID field alongside your entry data — Cockpit will overwrite that specific entry rather than insert a new one. Omit the Entry ID and Cockpit treats the request as a create.

Can I use JSON to pass entry data, or do I have to use name/value rows?

You can use either, but not both at once. When JSON Data Fields is enabled, only the JSON field is read and the name/value rows are ignored. When it is off, only the name/value rows are used. If the JSON is malformed, the item fails with an error message identifying the field.

How do I filter and sort collection results?

Filter Query and Sort Query both accept MongoDB-style JSON syntax. For example, use {"price": {"$gt": 10}} to filter and {"created": -1} to sort descending by creation date. Both fields must contain valid JSON — an invalid value will cause the item to fail.

What happens when I enable Return All, and does Limit still apply?

With Return All enabled, the node fetches every matching entry from Cockpit and the Limit field is ignored. If you want a specific page of results, turn Return All off and combine Limit with Skip to control which slice of records is returned.

What credentials does this node require, and where does the token get sent?

The node uses Cockpit API credentials, which consist of an API access token for your self-hosted Cockpit instance. Cockpit passes this token as a query parameter on each request, so make sure your instance's API access is enabled and the token has the appropriate collection or form permissions.

Build with the Cockpit node

Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need Cockpit API credentials first.

Open BusyBot

Last updated . Spotted something wrong? Tell us.