document/delete FormID 20309
Permanently delete a single document by its _id. The index and all other documents are unaffected. Routes to the error port if the document does not exist.
When to Use
- Record removal: A product is discontinued, a user account is deleted, or an order is cancelled — remove the corresponding Elasticsearch document to keep the search index in sync with the source system.
- GDPR / right to erasure: A data deletion request arrives — delete the document by the user's ID after completing the deletion in the primary database.
- Cache eviction: An item in a search cache index becomes stale and must be removed so a fresh version can be re-indexed via
document/create. - Conditional cleanup: After processing a document in a workflow, delete the temporary staging document from a processing index once downstream steps succeed.
Configuration
Connection
| Field | Required | Description |
|---|---|---|
Host | Required | Elasticsearch cluster URL, e.g. https://localhost:9200. |
Username | Optional | Elasticsearch username (required if security is enabled). |
Password | Optional | Password for the specified username. |
IgnoreSSL | Optional | Default false. Skip TLS validation. Development use only. |
Operation
| Field | Required | Description |
|---|---|---|
IndexName | Required | The index containing the document to delete. |
DocumentId | Required | The exact _id of the document to remove. Supports BizFirst expressions, e.g. {{ $json.userId }}. |
Validation Errors
| Error Code | Cause |
|---|---|
VAL_MISSING_INDEX | IndexName is empty. |
VAL_MISSING_DOC_ID | DocumentId is empty. |
Output
Success Port
Returns the Elasticsearch delete response. Key fields include _id (the deleted document's ID), _index, _version, and result ("deleted").
Error Port
Fires when the document does not exist (404), authentication fails, or a network error occurs. The error output contains errorCode and message fields.
deleted or archivedAt field instead of deleting the document.
Examples
Delete a Discontinued Product
{
"resource": "document",
"operation": "delete",
"IndexName": "products",
"DocumentId": "{{ $json.productId }}"
}
Connect the success port to a confirmation node (e.g. log the deletion) and the error port to an alert node if the document was unexpectedly missing.
GDPR Erasure Workflow
{
"resource": "document",
"operation": "delete",
"IndexName": "user-profiles",
"DocumentId": "{{ $json.userId }}"
}
Place this node after the primary database deletion step. On the success port, proceed to delete from any additional indices (e.g. user-activity-logs). On the error port, log that the document was not present in Elasticsearch — this is acceptable if the user never had a search profile created.
Cache Invalidation Pattern
{
"resource": "document",
"operation": "delete",
"IndexName": "product-cache",
"DocumentId": "{{ $json.productId }}"
}
After removing the cached entry, connect the success port to a document/create node that re-indexes the fresh version of the product. This ensures the cache always reflects the latest source data.