Skip to main content

@conductor/payload

Payload CMS plugin for Conductor. Provides operations for querying and mutating Payload collections.

Installation

Configuration

Environment Variables

Required:
  • PAYLOAD_API_URL - Payload CMS API URL
Optional:
  • PAYLOAD_API_KEY - Payload API Key for authentication

Operations

payload:find

Query documents from a Payload collection. Config:
  • collection (string, required) - Collection slug
  • where (object, optional) - Query conditions
  • depth (number, optional) - Population depth
  • limit (number, optional) - Results limit
  • page (number, optional) - Page number
  • sort (string, optional) - Sort field
  • select (array, optional) - Fields to select
Returns:
  • docs (array) - Documents
  • totalDocs (number) - Total document count
  • limit (number)
  • page (number)
  • totalPages (number)
  • hasNextPage (boolean)
  • hasPrevPage (boolean)
Example:

payload:findById

Get a single document by ID. Config:
  • collection (string, required) - Collection slug
  • id (string, required) - Document ID
  • depth (number, optional) - Population depth
Example:

payload:create

Create a new document. Config:
  • collection (string, required) - Collection slug
  • data (object, required) - Document data
  • depth (number, optional) - Population depth
  • draft (boolean, optional) - Create as draft
Example:

payload:update

Update an existing document. Config:
  • collection (string, required) - Collection slug
  • id (string, required) - Document ID
  • data (object, required) - Document data
  • depth (number, optional) - Population depth
  • draft (boolean, optional) - Save as draft
Example:

payload:delete

Delete a document. Config:
  • collection (string, required) - Collection slug
  • id (string, required) - Document ID
Example:

Complete Example