Neo4j Create Resource Type
AI-generatedOverview
This node creates a new resource type in a Neo4j graph database for a specified business. It is designed to define categories of resources that share common attributes or booking constraints, such as "Hairdressing Chair" or "Manicure Table". The node ensures the resource type is linked to an existing business entity in the database.
Common scenarios where this node is useful include managing inventory or assets in appointment scheduling systems, facility management, or any system requiring categorization and capacity tracking of shared resources.
For example, a salon might use this node to create a resource type called "4-Person Table" with a total capacity of 2, representing two physical tables available for booking.
Properties
| Name | Meaning |
|---|---|
| Business ID | The unique identifier (UUID) of the business to which the resource type belongs. |
| Type Name | The name of the resource type (e.g., "Hairdressing Chair", "Manicure Table"). |
| Total Capacity | The total number of instances available for this resource type (minimum 1). |
| Description | A textual description of the resource type, explaining its purpose or characteristics. |
Output
The node outputs JSON data representing the created resource type with the following structure:
{
"resourceType": {
"type_id": "string (UUID)",
"business_id": "string",
"name": "string",
"total_capacity": "number",
"description": "string",
"created_at": "datetime string"
}
}
type_id: Unique identifier generated for the resource type.business_id: The business ID associated with the resource type.name: The resource type's name.total_capacity: The total count of resources of this type.description: Description text provided by the user.created_at: Timestamp when the resource type was created.
If the node encounters errors but is configured to continue on failure, it will output error details alongside the item data.
Dependencies
- Requires a Neo4j database connection with 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 authentication credential is necessary within n8n.
Troubleshooting
- Missing or incomplete Neo4j credentials: The node throws an error if the Neo4j connection details are not fully provided. Ensure all required fields (host, port, username, password) are set.
- Business ID does not exist: If the specified business ID is not found in the database, the node will report an error indicating the business does not exist. Verify the business ID is correct and present in the Neo4j database.
- Neo4j connectivity issues: Errors during connection or session creation indicate network or configuration problems. Check Neo4j server availability and credentials.
- Invalid input parameters: Business ID and Type Name are mandatory; missing these will cause errors.
- Resource type duplication: The node uses MERGE to avoid duplicate resource types with the same properties, but ensure uniqueness logic fits your use case.
To resolve errors, verify inputs, credentials, and Neo4j server status. Enable "Continue On Fail" in the node settings to handle individual item failures gracefully.