Neo4j Delete Staff
AI-generatedOverview
This node deletes a staff member and all their related connections from a Neo4j graph database based on a given staff ID. It is useful in scenarios where you need to remove an employee record along with any associated relationships, such as roles, permissions, or service capabilities linked to that staff member.
Practical examples include:
- Cleaning up user data when an employee leaves an organization.
- Removing obsolete or incorrect staff entries from the database.
- Automating HR workflows that require deletion of staff nodes and their relationships in Neo4j.
Properties
| Name | Meaning |
|---|---|
| Staff ID | The unique identifier (staff_id) of the staff member to delete. |
Output
The node outputs JSON objects for each input item processed, containing:
success: Boolean indicating if the deletion was successful.deletedStaffId: The staff ID that was deleted.nodesDeleted: Number of nodes deleted in the operation (should be 1 if the staff node existed).
If an error occurs and "Continue On Fail" is enabled, the output will include the original input JSON plus an error field describing the failure.
No binary data is output by this node.
Dependencies
- Requires a Neo4j database connection configured via credentials including host, port, username, password, and optionally database name.
- Uses the official Neo4j driver for JavaScript to connect and run Cypher queries.
- Needs proper network access to the Neo4j instance.
Troubleshooting
Common issues:
- Incomplete or incorrect Neo4j credentials will cause connection failures.
- Network connectivity problems to the Neo4j server.
- Specified staff ID does not exist, resulting in zero nodes deleted (not an error but no effect).
Error messages:
"Neo4j credentials are not fully configured."— Ensure all required credential fields are filled."Failed to establish Neo4j connection."— Check Neo4j server availability and credentials."Neo4j session is not available."— Internal error; retry or check driver initialization.- Errors returned from Neo4j (e.g., syntax errors in Cypher) are parsed and presented clearly.
Resolution tips:
- Verify Neo4j credentials and network access.
- Confirm the staff ID exists before attempting deletion.
- Enable "Continue On Fail" to handle individual item errors gracefully in batch operations.