Neo4j Delete Service icon

Neo4j Delete Service

根據 service_id 刪除服務及其關聯關係。,serviceId: 要刪除的服務 ID (UUID)。

Neo4j Delete Service

AI-generated

Overview

This node deletes a service node and all its relationships from a Neo4j graph database based on a given service ID. It is useful when you want to remove a specific service entity identified by its unique service ID (UUID) along with any connected relationships, ensuring data consistency in your graph.

Typical use cases include:

  • Cleaning up obsolete or deprecated services from your Neo4j database.
  • Automating the removal of service nodes as part of a workflow that manages service lifecycle.
  • Maintaining data integrity by deleting related connections automatically.

For example, if you have a service node representing an API service with a unique ID, this node can delete that service and all its associated links in one operation.

Properties

Name Meaning
Service ID The unique identifier (UUID) of the service node to delete.

Output

The node outputs JSON objects for each input item processed, structured as follows:

{
  "success": true,
  "deletedServiceId": "the-service-id-that-was-deleted"
}
  • success: A boolean indicating whether the deletion was successful.
  • deletedServiceId: The service ID that was deleted.

If an error occurs and the node is set to continue on failure, the output JSON will include the original input data plus an error field describing the issue.

The node does not output binary data.

Dependencies

  • Requires a Neo4j database instance accessible via host, port, username, password, and optionally a database name.
  • Needs an API key credential or authentication token configured in n8n to connect securely to Neo4j.
  • Uses the official Neo4j driver library to establish connection and run Cypher queries.

Troubleshooting

  • Common issues:

    • Missing or incomplete Neo4j credentials (host, port, username, password).
    • Network connectivity problems preventing connection to the Neo4j server.
    • Invalid or non-existent service ID leading to no node being deleted.
    • Errors closing the Neo4j session or driver after execution.
  • Error messages and resolutions:

    • "Neo4j credentials are not fully configured or missing required fields...": Verify that all required credential fields are correctly filled.
    • "Failed to connect to Neo4j or open session:": Check network access, Neo4j server status, and credential correctness.
    • "Neo4j session is not available.": Indicates internal failure to create a session; retry or check configuration.
    • Errors returned from Neo4j during query execution will be parsed and included in the output if continuing on fail is enabled.

Links and References

Discussion