For the complete documentation index, see llms.txt. This page is also available as Markdown.

Document Delete

Remove temporary or sensitive documents in bulk.

Document Delete removes one or many documents in a single step. Its main job is cleaning up — temporary working copies and sensitive files that shouldn't outlive the process that needed them.

It deletes in batches and reports per item, so a partial failure is visible rather than silent.

How it works

  1. Input resolution — uses $input (the previous skill's output) and $secret (vault secrets).

  2. Processing — expects an array of document descriptors:

    • Verifies ownership for source: "conversation" items.

    • Checks bucket ACLs for source: "storage" items.

    • Redacts IDs in logs.

  3. Execution — blocking. Returns only after every item is processed.

  4. Response — collects a per-item result array plus deletedCount and failedCount.

Worked example: securely deleting customer PII after archival

A workflow collects sensitive customer documents — ID proofs, financial statements — for a loan application. Once the agent has processed them and the final version is archived in the compliance system, the temporary copies sitting in the conversation cache and working storage should not remain.

The problem. Documents used during processing linger in temporary storage. Tracking and deleting them by hand invites compliance risk and unnecessary storage cost.

The approach. End the workflow with a Document Delete skill. Pass the documentId values carried forward from Document Upload, set each item's source to where the copy lives, and the cleanup happens as part of the process rather than as a chore someone remembers later.

Then branch on failedCount: anything other than zero means a copy survived, which for PII is a result the workflow should act on rather than log.

Listing the documents to delete and their source
Document Delete batch processing

Configuration reference

Field
Type
Required
Description

items

array

Documents to delete.

Each item (DocumentRef):

Property
Type
Required
Notes

documentId

string

ID returned by Upload or Fetch.

source

conversation | storage

Where the document resides.

storagePath

string | null

when source='storage'

Optional; defaults to the root directory.

Output

Field
Type
Always
Description

deletedCount

number

How many documents were successfully deleted.

failedCount

number

How many deletions failed.

items

array

Per-item status, in the order you supplied.

statusCode

number

Overall status.

Each item (DeleteResultItem):

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 this item failed.

Errors

Condition
Node status
Notes

Some items fail

207

4xx/5xx on each failed entry. Branch on failedCount.

All items fail

400

deletedCount = 0, failedCount >= 1.

Success

200

Per item 204. deletedCount >= 1, failedCount = 0.

Invalid config shape

400

The skill refuses to run.

Security

  • $secret bearer tokens are never logged.

  • Document IDs and storage paths are redacted in logs.

  • Conversation ownership is checked to block cross-tenant deletes.

Testing in isolation

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

  • MethodPOST

  • Body:


To add this skill to an agent, see Adding a Skill to the Agent.

Last updated