Neo4j Link Staff to Service icon

Neo4j Link Staff to Service

指定某個員工可以提供哪些服務。,staffId: 要關聯的員工 staff_id (UUID),serviceId: 員工可以提供的服務 service_id (UUID)

Neo4j Link Staff to Service

AI-generated

Overview

This node creates a relationship in a Neo4j graph database linking a specific staff member to a service they can provide. It matches existing nodes labeled Staff and Service by their unique IDs and establishes a CAN_PROVIDE relationship from the staff node to the service node.

Common scenarios:

  • Managing employee capabilities in a service-oriented business.
  • Building a knowledge graph of which employees offer which services.
  • Automating updates to staff-service relationships in a Neo4j database.

Practical example:
If you have a staff member with ID staff123 and a service with ID service456, this node will create a link indicating that staff123 can provide service456. This is useful for querying available services per staff or vice versa.

Properties

Name Meaning
Staff ID The unique identifier (staff_id) of the staff member to link.
Service ID The unique identifier (service_id) of the service that the staff member can provide.

Output

The node outputs an array of JSON objects, each corresponding to one input item processed. Each output object has the following structure:

{
  "success": true,
  "staffId": "string",    // The staff ID used in the operation
  "serviceId": "string"   // The service ID used in the operation
}
  • If the link creation is successful, success is true.
  • If the staff or service node is not found, or the link cannot be created, an error is thrown unless "Continue On Fail" is enabled.
  • 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 to connect and run Cypher queries.
  • Needs proper Neo4j credentials set up in n8n with full configuration (host, port, username, password).
  • The node depends on helper utilities for running Cypher queries and parsing errors.

Troubleshooting

  • Neo4j credentials are not fully configured:
    Ensure all required fields (host, port, username, password) are provided in the credential settings.

  • Failed to establish Neo4j connection:
    Check network connectivity to the Neo4j server, verify credentials, and confirm the database is running.

  • Staff ID or Service ID not found:
    The node throws an error if either the staff or service node does not exist in the database. Verify that the IDs are correct and that the nodes exist.

  • Neo4j session is not available:
    Indicates an internal failure to create or maintain a session; retry or check Neo4j server status.

  • Error closing Neo4j session or driver:
    Logged internally; usually safe to ignore but may indicate resource cleanup issues.

  • Use "Continue On Fail" option to handle errors gracefully and continue processing other items.

Links and References

Discussion