Overview
The TiDB Cloud node's "Default" resource with the "Delete" operation allows you to delete rows from a specified table in a TiDB Cloud database. This is useful for automating data cleanup, removing obsolete records, or managing datasets directly from n8n workflows. For example, you might use this node to automatically remove user accounts flagged for deletion or clear out temporary data after processing.
Properties
| Name | Type | Meaning |
|---|---|---|
| Project | Resource Locator | The TiDB Cloud project where the target cluster resides. |
| Cluster | Resource Locator | The specific TiDB Cloud cluster containing the database and table to operate on. |
| User | Resource Locator | The database user account used to authenticate the connection. |
| Database | String | The name of the database within the cluster where the table is located. |
| Password | String (Password) | The password for the specified database user. |
| Table | Resource Locator | The table from which rows will be deleted. Can be selected from a list or entered manually. |
| Delete Key | String | The column/property name used to identify which rows should be deleted (e.g., "id"). |
Output
- The output is a JSON array containing the result of the delete operation.
- Each item in the output corresponds to the response from the database driver for the executed DELETE statement.
- Typical fields may include information such as the number of affected rows, but the exact structure depends on the underlying database response.
Example output:
[
{
"affectedRows": 1,
"insertId": 0,
"warningStatus": 0
}
]
- If an error occurs and "Continue On Fail" is enabled, the output will contain an
errorfield with the error message:
[
{
"error": "Error message here"
}
]
Dependencies
- External Service: Requires access to a TiDB Cloud instance.
- Credentials: You must configure the
tiDBCloudApicredential in n8n, including API keys or authentication details for your TiDB Cloud account. - n8n Configuration: Ensure network access to TiDB Cloud and that the credentials are set up correctly.
Troubleshooting
Common Issues:
- Invalid Credentials: If the database user or password is incorrect, the node will fail to connect.
- Table or Database Not Found: If the specified table or database does not exist, the operation will fail.
- Delete Key Missing: If the "Delete Key" property does not match any column in the table, no rows will be deleted.
- Insufficient Permissions: The database user must have permission to execute DELETE statements on the target table.
Error Messages:
"ER_ACCESS_DENIED_ERROR": Check your username and password."Unknown database": Verify the database name."Table doesn't exist": Confirm the table name and selection."The operation \"delete\" is not supported!": This should not occur if using the node as intended, but indicates a misconfiguration of the operation parameter.
Links and References
- TiDB Cloud Documentation
- n8n Documentation: Custom Nodes
- SQL DELETE Statement Reference (TiDB is MySQL compatible)