Login
Free Sign Up
Docs
/

Object - Remove

Type identifier: object:remove Category: Object Operations

Description

Removes Records that match filter criteria. Supports querying by any property and removes matching Records along with their relationships. Returns the removed Records for downstream processing.

Input Handles

Handle

Data Type

Required

Description

trigger

trigger

Yes

Initiates the remove operation

<variableId>

Varies

Varies

Dynamic handles for filter variables

Input Handle Details

Variable Handles

Input handles are dynamically generated based on the variables configuration:

  • Handle ID: Variable's id property
  • Type: Defined by the variable's type configuration
  • Notes:

    • Variables are used in filter expressions
    • Default variable is id for Record ID lookup

Output Handles

Handle

Data Type

Description

success

trigger

Triggered when removal succeeds

error

trigger

Triggered on any error

removed

object/array

The removed Record(s) with metadata

Output Handle Details

removed

  • Type: Object (if firstOnly) or Array (if multiple)
  • Includes:

    • All Record properties
    • id: Record ID
    • schemaId: Schema ID
    • createdAt: Creation timestamp
    • updatedAt: Last update timestamp
    • createdById: Creator ID
    • updatedById: Last updater ID
  • Notes: File entries are augmented with Record context

Configuration Options

Property

Type

Required

Default

Description

label

string

Yes

"Object - Remove"

Display label for the node

schemaId

string

Yes

""

CUID2 of the Schema to query

variables

array

No

ID variable

Variable definitions for filtering

filter

object

No

ID equals

Filter criteria for Record selection

firstOnly

boolean

No

true

Return single Record vs array

limit

number

No

1

Maximum Records to remove

offset

number

No

undefined

Skip N Records before removing

order

"asc" / "desc"

No

"desc"

Sort order for selection

orderBy

string

No

"createdAt"

Property to sort by

Configuration Details

variables

  • Type: array
  • Default: Single id variable with string type
  • Notes:

    • Each variable creates an input handle
    • Used to populate filter expressions
    • Built-in spaceIdentityId always available

filter

  • Type: object
  • Structure:

    {
      "path": "propertyName",
      "type": "property",
      "value": { "type": "contextValue", "valueId": "variableId" },
      "operator": "eq"
    }
  • Notes: Supports complex nested filters with AND/OR logic

Behaviour

Error Handling

Scenario

Behaviour

Schema not found

Sets error result, triggers error

Invalid filter

Triggers error

Examples

Remove by ID

{
  "type": "object:remove",
  "data": {
    "label": "Remove User",
    "schemaId": "user-schema-uuid",
    "variables": [
      {
        "id": "id",
        "type": { "name": "id", "type": "string", "required": true }
      }
    ],
    "filter": {
      "path": "id",
      "type": "property",
      "value": { "type": "contextValue", "valueId": "id" },
      "operator": "eq"
    },
    "firstOnly": true,
    "limit": 1
  }
}

Remove by Status

{
  "type": "object:remove",
  "data": {
    "label": "Remove Expired Orders",
    "schemaId": "order-schema-uuid",
    "variables": [
      {
        "id": "status",
        "type": { "name": "status", "type": "string", "required": true }
      }
    ],
    "filter": {
      "path": "status",
      "type": "property",
      "value": { "type": "contextValue", "valueId": "status" },
      "operator": "eq"
    },
    "firstOnly": false,
    "limit": 100
  }
}

Remove With Complex Filter

{
  "type": "object:remove",
  "data": {
    "label": "Cleanup Old Records",
    "schemaId": "log-schema-uuid",
    "filter": {
      "type": "and",
      "filters": [
        {
          "path": "processed",
          "type": "property",
          "value": { "type": "literal", "value": true },
          "operator": "eq"
        },
        {
          "path": "createdAt",
          "type": "property",
          "value": { "type": "contextValue", "valueId": "cutoffDate" },
          "operator": "lt"
        }
      ]
    },
    "firstOnly": false,
    "order": "asc",
    "orderBy": "createdAt"
  }
}