Neo4j Create Staff icon

Neo4j Create Staff

為指定商家創建一個新的員工記錄。,businessId: 員工所屬的商家 ID (UUID),name: 員工姓名,email: 員工電子郵件 (可選),phone: 員工電話號碼 (可選)。

Neo4j Create Staff

AI-generated

Overview

This node creates a new staff record in a Neo4j graph database for a specified business. It links the newly created staff member to an existing business node by establishing a "WORKS_AT" relationship. This is useful for managing employee data within a business context, especially when modeling organizational structures or employee relationships in a graph database.

Practical examples:

  • Adding new employees to a business in a CRM system that uses Neo4j.
  • Building an organizational chart where each staff member is connected to their employer.
  • Tracking employee contact information and associating it with the business entity.

Properties

Name Meaning
Business ID The unique identifier (UUID) of the business to which the staff member belongs.
Name The full name of the staff member being created.
Email Optional email address of the staff member.
Phone Optional phone number of the staff member.

Output

The output JSON contains the newly created staff record with all its properties as stored in Neo4j, including:

  • staff_id: A generated UUID for the staff member.
  • business_id: The business ID linked to this staff.
  • name: Staff member's name.
  • email: Staff member's email or null if not provided.
  • phone: Staff member's phone number or null if not provided.
  • created_at: Timestamp of when the staff record was created.

The output structure is:

{
  "staff": {
    "staff_id": "string",
    "business_id": "string",
    "name": "string",
    "email": "string|null",
    "phone": "string|null",
    "created_at": "datetime"
  }
}

No binary data output is produced 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.
  • Requires proper configuration of the Neo4j credentials in n8n before use.

Troubleshooting

  • Neo4j credentials are not fully configured: Ensure all required fields (host, port, username, password) are correctly set in the node credentials.
  • Failed to establish Neo4j connection: Check network connectivity to the Neo4j server, verify credentials, and confirm the database is running.
  • Neo4j session is not available: This indicates a failure in creating a session; ensure the driver is properly initialized.
  • Cypher query errors: These may occur if the business ID does not exist in the database or if there are syntax issues. Verify the business node exists before creating staff.
  • If the node is set to continue on fail, errors will be included in the output per item; otherwise, execution stops on the first error.

Links and References

Discussion