Neo4j Delete Resource icon

Neo4j Delete Resource

根據 resource_id 刪除資源及其關聯關係。,resourceId: 要刪除的資源 ID (UUID)

Neo4j Delete Resource

AI-generated

Overview

This node deletes a resource and all its related connections in a Neo4j graph database based on a specified resource ID. It is useful when you want to remove an entire resource node along with any relationships it has, ensuring no orphaned connections remain.

Common scenarios include:

  • Cleaning up data by removing obsolete or unwanted resources.
  • Managing graph data lifecycle by deleting nodes and their relationships safely.
  • Automating deletion workflows where resources are identified by unique IDs.

For example, if you have a resource node representing a user or an asset identified by a UUID, this node can delete that node and all its connected relationships in one operation.

Properties

Name Meaning
Resource ID The unique identifier (ID) of the resource to delete. This should be the exact ID of the node you want removed from the Neo4j database.

Output

The output is an array of JSON objects, each corresponding to an input item processed. Each output item contains:

  • success: A boolean indicating whether the deletion was successful (true).
  • deletedResourceId: The resource ID that was deleted.

If an error occurs and the node is configured to continue on failure, the output for that item will include the original input JSON merged with an error field describing the issue.

No binary data is produced by this node.

Example output JSON for a successful deletion:

{
  "success": true,
  "deletedResourceId": "some-resource-uuid"
}

Dependencies

  • Requires a Neo4j database connection with valid credentials including host, port, username, password, and optionally a database name.
  • The node uses the official Neo4j driver to connect and execute Cypher queries.
  • Credentials must be fully configured in n8n before using this node.

Troubleshooting

  • Missing or incomplete credentials: The node throws an error if the Neo4j credentials are not fully provided (host, port, username, password). Ensure all required fields are set.
  • Connection failures: Errors connecting to Neo4j or opening a session may occur due to network issues, incorrect credentials, or database unavailability. Verify connectivity and credentials.
  • Invalid resource ID: If the resource ID does not exist in the database, the query will simply not delete anything but will still return success. To confirm deletion, check the database directly.
  • Session or driver closing errors: Rarely, errors might occur when closing the Neo4j session or driver; these are logged but do not affect the main operation.
  • Error handling: If "Continue On Fail" is enabled, errors during deletion for individual items will be captured in the output instead of stopping execution.

Links and References

Discussion