Neo4j Update Customer icon

Neo4j Update Customer

根據 customer_id 更新客戶資訊。,customerId: 要更新的客戶 ID (UUID),name: 新的客戶姓名 (可選),phone: 新的客戶聯繫電話 (可選),email: 新的客戶聯繫電子郵件 (可選)。

Neo4j Update Customer

AI-generated

Overview

This node updates customer information in a Neo4j graph database based on a given customer ID. It allows updating the customer's name, phone number, and email address. If no update fields are provided, it simply returns the current data for the specified customer.

Common scenarios include:

  • Keeping customer records up to date with new contact details.
  • Correcting or adding missing customer information.
  • Synchronizing customer data from other systems into Neo4j.

Practical example:
You have a customer management system where users can update their profile information. This node can be used to apply those changes directly to the Neo4j database by specifying the customer ID and any new values for name, phone, or email.

Properties

Name Meaning
Customer ID The unique identifier (UUID) of the customer whose information you want to update.
Name The new name of the customer (optional).
Phone The new contact phone number of the customer (optional).
Email The new contact email address of the customer (optional).

Output

The node outputs an array of JSON objects representing the updated customer records. Each output item contains a customer field with all properties of the customer node after the update.

If no update fields are provided, the output will contain the current customer data without modification.

No binary data is produced by this node.

Example output structure:

{
  "customer": {
    "customer_id": "uuid-string",
    "name": "Updated Name",
    "phone": "1234567890",
    "email": "updated@email.com",
    "updated_at": "2024-06-01T12:34:56Z"
  }
}

Dependencies

  • Requires a Neo4j database connection.
  • Needs credentials including host, port, username, password, and optionally database name.
  • The node uses the official Neo4j driver to connect and run Cypher queries.
  • Proper configuration of the Neo4j API credential in n8n is necessary.

Troubleshooting

  • Missing or incomplete credentials: The node throws an error if the Neo4j credentials are not fully configured (host, port, username, password).
  • Connection failures: Errors connecting to Neo4j or opening a session will be logged and surfaced as errors.
  • No update parameters provided: If none of the optional fields (name, phone, email) are set, the node returns the existing customer data but logs a warning.
  • Session or driver closure errors: Errors during closing the Neo4j session or driver are logged but do not stop execution.
  • Handling errors per item: If the node is set to continue on failure, individual item errors are captured and returned alongside the original input data with error details.

Links and References

Discussion