Document Delete Node

The Document Delete Node removes one or many documents in a single step, enabling bulk-cleaning of temporary or sensitive files.

How It Works

  1. Input Resolution: Uses $input (previous node output) and $secret (vault secrets).

  2. Request/Processing: Expects an array of document descriptors.

    1. Verifies ownership for source: "conversation" items; checks bucket ACLs for source: "storage".

    2. Redacts IDs in logs.

  3. Execution Model: Blocking – returns only after all items are processed.

  4. Response Handling:

    1. Collects a per-item result array (items[]), plus deletedCount and failedCount.

    2. If any delete fails, the node still returns 200 OK to let the workflow branch on partial success.

Configuration Schema

Field

Type

Required

Description

items

array

List of documents to delete.

DocumentRef Schema (for items array)

Property
Type
Required
Notes

documentId

string

ID returned by Upload or Fetch nodes.

source

conversation | storage

Where the document resides.

storagePath

string | null

Cond.

Optional when source: "storage"; defaults to root directory.

Output Schema

Field
Type
Always
Description

deletedCount

number

How many documents were successfully deleted.

failedCount

number

How many deletions failed.

items

array

Per-item status (order matches input).

statusCode

number

Status per document (e.g., 200, 404, 403).

DeleteResultItem Schema (for items array)

Property
Type
Description

documentId

string

Echo of the input ID.

deleted

boolean

true if removed.

statusCode

number

Upstream response (204, 404, 403,...).

error

string | null

Error message if status = error.

Error Handling

Condition

Effect on Node

Per-item statusCode / error.code

Notes

Some items fail

207

4xx/5xx in each failed items[]

Workflow can branch on failedCount.

All items fail

400

4xx/5xx

deletedCount = 0, failedCount >= 1.

Success

200

204

deletedCount >= 1, failedCount = 0.

Invalid config shape

400

Node refuses to run.

Single-Node Test API

For testing a node in isolation (e.g., via the UI "Test" button or a dedicated API), the following endpoint is used:

  • Path: /skill-runtime/workflows/nodes/DocumentDelete/execute

  • Method: POST

  • Purpose: Execute one node in isolation.

  • Request Body :

{

"nodeType": "DOCUMENT_DELETE",

"config": { /* refer to configuration schema */ },

"input": { /* becomes $input */ }

}

Security Notes

  • $secret bearer tokens are never logged.

  • Document IDs and storage paths are redacted in logs.

  • Node checks conversation ownership to block cross-tenant deletes.

Document Delete Node Batch Processing

Last updated