Actions6
- Vector Store Actions
- Graph Database Actions
Overview
This node integrates with a Neo4j graph database, enabling users to perform various operations on graph data. Specifically, the Get Schema operation retrieves the schema of the connected Neo4j database, which describes the structure of nodes, relationships, and their properties.
Common scenarios for using this node include:
- Inspecting the database schema to understand the graph model before querying or modifying data.
- Automating documentation or visualization of the graph structure.
- Validating schema changes or ensuring compatibility before running complex queries.
For example, a user might want to fetch the schema as a JSON object to programmatically analyze node labels and relationship types, or as a string for quick display or logging purposes.
Properties
| Name | Meaning |
|---|---|
| Index Name | The name of the index to use (default: "vector"). Relevant when working with vector stores or graph DB indexing. Optional for Get Schema. |
| As String | Whether to return the schema as a raw string (true) or as a structured JSON object (false). |
Output
The output is a JSON array containing one element representing the schema:
- If As String is
true, the schema is returned as a JSON-parsed string inside an object with aschemaproperty. - If As String is
false, the schema is returned as a structured JSON object representing the detailed schema.
Example output when As String is false (formatted for clarity):
[
{
// Structured schema object describing nodes, relationships, properties, etc.
}
]
If As String is true:
[
{
"schema": "<string representation of the schema>"
}
]
No binary data output is produced by this operation.
Dependencies
- Requires connection credentials to a Neo4j database, including URI, username, password, and optionally the database name.
- Uses the
@langchain/community/graphs/neo4j_graphpackage internally to interact with the Neo4j database. - The node expects valid Neo4j credentials configured in n8n to authenticate API calls.
Troubleshooting
- Error connecting to Neo4j: Ensure that the provided URI, username, password, and database name are correct and that the Neo4j instance is accessible from the n8n environment.
- Invalid schema response: If the schema cannot be parsed or retrieved, verify that the Neo4j database is running and that the user has sufficient permissions to read the schema.
- Operation not implemented: The node throws an error if unsupported operations like "Create Relationship" are attempted.
- JSON parsing errors: When returning the schema as a string, the node parses it as JSON internally; malformed schema strings could cause errors.
To resolve these issues:
- Double-check credential correctness and network connectivity.
- Confirm user permissions in Neo4j.
- Use supported operations only.
- Validate any custom Cypher queries or JSON inputs.