Delete From Database
Controlled node
Overview
The Delete From Database node removes rows from a specified table in a project database. It supports deletion by matching row objects or by referencing specific row IDs (intellectible_id). This node is useful for data cleanup, removing outdated records, or managing database state within your workflows.
This node permanently deletes data from the database. Ensure you have proper validation and confirmation steps in your workflow before triggering this node, as deleted rows cannot be recovered.
Inputs
| Input | Type | Description | Default |
|---|---|---|---|
| Run | Event | Fires the deletion operation when triggered. | - |
| Database ID | Text | The unique identifier of the project database containing the target table. | - |
| Table ID | Text | The unique identifier of the table from which to delete rows. | - |
| Rows | Data | The rows to delete. Accepts: • Array of row objects • Array of strings (treated as intellectible_id values)• Single row object • Single string (treated as intellectible_id) | - |
Outputs
| Output | Type | Description |
|---|---|---|
| Done | Event | Fires when the deletion operation has completed, regardless of success or failure. |
| Result | Data | Contains the deletion result. On success, returns the affected rows. On failure, returns an error object with a descriptive message. |
Runtime Behavior and Defaults
When executed, the node first validates that databaseId, tableId, and the runtime projectId are valid strings. If validation fails, it returns an error in the result output.
The node processes the rows input flexibly:
- String values are automatically converted to objects with the format
{"intellectible_id": string} - Object values are used as-is for matching
- Arrays are iterated to handle multiple deletions in a single operation
If the rows input is empty or contains no valid data, the node returns an error: "No valid rows to insert."
The deletion uses exact matching logic—rows in the database that match all column values specified in the input objects will be deleted. The operation is performed via projectDatabaseSystem.deleteMatchingRows().
Example Usage
Basic Deletion by ID
Connect a Text node containing a row's intellectible_id to the Rows input, then trigger the Run event:
[Start] → [Text: "row-12345"] → [Delete From Database]
↓
[Database ID: "db-001"]
[Table ID: "users"]
Deleting Multiple Records
Use a List node containing multiple IDs to delete several rows at once:
[List: ["id-1", "id-2", "id-3"]] → [Delete From Database]
[Database ID: "db-001"]
[Table ID: "orders"]
Conditional Deletion
Combine with a Query Database node to find and delete specific records:
[Query Database: "SELECT * FROM products WHERE status = 'discontinued'"]
↓
[Delete From Database: Rows = Query Result]