Neo4j Create User icon

Neo4j Create User

創建一個新的用戶記錄。,external_id: 來自外部應用的 ID (例如 Line ID) (UUID),name: 用戶姓名,email: 用戶電子郵件,phone: 用戶電話號碼,notification_enabled: Whether notifications are enabled for the user。

Neo4j Create User

AI-generated

Overview

This node creates new user records in a Neo4j graph database. It is designed to insert user data as nodes labeled User with properties such as an external ID, name, email, phone number, notification preference, and timestamps.

Typical use cases include synchronizing user information from external applications (e.g., Line messaging platform) into a Neo4j database for further graph-based analysis or relationship mapping. For example, you might use this node to import customer profiles from a CRM system or messaging app into Neo4j to build social graphs or recommendation engines.

Properties

Name Meaning
External ID The unique identifier from an external application (e.g., Line ID).
Name The user's full name.
Email The user's email address.
Phone The user's phone number.
Notification Enabled Boolean flag indicating whether notifications are enabled for the user (true or false).

Output

The node outputs an array of JSON objects, each representing a created user node in Neo4j. Each output item contains a user field with all properties of the newly created user node, including:

  • id: A generated UUID for the user node.
  • external_id: The external application ID provided.
  • name: User's name.
  • email: User's email.
  • phone: User's phone number.
  • notification_enabled: Whether notifications are enabled.
  • created_at: Timestamp of when the user node was created.

No binary data output is produced by this node.

Example output JSON structure per item:

{
  "user": {
    "id": "generated-uuid",
    "external_id": "external-id-value",
    "name": "User Name",
    "email": "user@example.com",
    "phone": "1234567890",
    "notification_enabled": true,
    "created_at": "2024-06-01T12:00:00Z"
  }
}

Dependencies

  • Requires a Neo4j database instance accessible via host, port, username, and password.
  • Needs an API key credential or authentication token configured in n8n to connect securely to Neo4j.
  • Uses the official Neo4j driver library for Node.js to establish connections and run Cypher queries.
  • The node expects the Neo4j database version supporting the randomUUID() function and datetime() type.

Troubleshooting

  • Connection Errors: If the node fails to connect, verify that the Neo4j credentials (host, port, username, password) are correctly set and that the database is reachable from the n8n environment.
  • Session Errors: Errors opening or closing sessions may indicate network issues or misconfigured database access rights.
  • Query Failures: Invalid input data or missing required parameters can cause Cypher query errors. Ensure all required fields (external_id, name, email, phone, notification_enabled) are provided.
  • Error Handling: The node supports continuing on failure for individual items; errors will be included in the output with descriptive messages parsed from Neo4j error responses.
  • Common Error Messages:
    • "Neo4j credentials are not fully configured or missing required fields" — Check credential completeness.
    • "Failed to establish Neo4j connection or session." — Verify network connectivity and database status.
    • "Neo4j session is not available." — Indicates internal session management issues; retry or check logs.

Links and References

Discussion