Neo4j Create Resource
AI-generatedOverview
This node creates a new resource record in a Neo4j graph database and links it to an existing business and resource type. It is useful for managing resources such as rooms, equipment, or seats within a business context, where each resource belongs to a specific resource type and business.
Typical use cases include:
- Adding new physical assets (e.g., chairs, rooms) to a business inventory system.
- Structuring resource data in a graph database to enable complex queries and relationships.
- Automating resource creation workflows integrated with other systems via n8n.
For example, you could create a "Room A" resource of type "Meeting Room" linked to a particular business, specifying its capacity and additional properties like features.
Properties
| Name | Meaning |
|---|---|
| Business ID | The unique identifier (UUID) of the business that owns this resource. |
| Resource Type ID | The unique identifier (UUID) of the resource type this resource belongs to. |
| Name | The name or label of the resource instance (e.g., "Chair 1", "Room A"). |
| Capacity | Optional numeric value representing the capacity of the resource (e.g., number of people). |
| Properties (JSON String) | Optional JSON-formatted string containing additional custom properties (e.g., {"feature": "window_view"}). |
Output
The node outputs an array of JSON objects, each representing a created resource. Each output item contains a resource field with all properties of the newly created resource node from Neo4j, including:
resource_id: The generated unique ID of the resource.business_id: The associated business ID.name: The resource's name.capacity: The resource's capacity if provided.properties: The parsed JSON string of additional properties.created_at: Timestamp of when the resource was created.
No binary data is output by this node.
Dependencies
- Requires a Neo4j database connection configured with host, port, username, password, and optionally database name.
- Needs an API key credential or authentication token for Neo4j access configured in n8n.
- Uses the official Neo4j driver library to connect and run Cypher queries.
- Relies on helper functions for error parsing and query execution bundled with the node.
Troubleshooting
- Missing or incomplete Neo4j credentials: The node will throw an error if any required connection details (host, port, username, password) are missing. Ensure all fields are correctly filled in the credential configuration.
- Connection failures: Errors connecting to Neo4j or opening a session may occur due to network issues, incorrect credentials, or database unavailability. Verify connectivity and credentials.
- Invalid Resource Type ID: If the resource type ID is empty or invalid, the node throws an error. Confirm the resource type exists in the database.
- Malformed JSON in Properties: The
Properties (JSON String)must be valid JSON. Invalid JSON strings can cause query failures. - Neo4j session errors: If the session cannot be opened or closed properly, check the Neo4j server status and driver compatibility.
- Continue On Fail behavior: When enabled, the node continues processing subsequent items even if some fail, returning error details alongside successful results.