Neo4j icon

Neo4j

Work with Neo4j database

Overview

This node integrates with a Neo4j graph database, enabling users to perform various operations such as executing Cypher queries, creating nodes, and managing vector stores. Specifically, for the Graph Database - Create Relationship operation, the node is intended to create relationships between nodes in the Neo4j database. However, based on the current implementation, the "Create Relationship" operation is not yet implemented and will throw an error if used.

Common scenarios where this node is beneficial include:

  • Managing graph data by adding nodes and querying complex relationships.
  • Integrating Neo4j graph capabilities into workflows for knowledge graphs, recommendation systems, or network analysis.
  • Using vector stores for similarity search and text embedding storage (though this is under the "vectorStore" resource).

Practical example:

  • Creating a new node with specific labels and properties to represent an entity in a knowledge graph.
  • Executing custom Cypher queries to retrieve or manipulate graph data dynamically.

Properties

Name Meaning
Index Name The index name to use within the Neo4j database or vector store. Defaults to "vector".

Note: For the Create Relationship operation specifically, no additional input properties are defined or supported in the current code.

Output

  • The output is always a JSON array returned from the executed operation.
  • For most operations, the output contains the results of the Cypher query or confirmation of node creation.
  • Since "Create Relationship" is not implemented, it throws an error instead of returning output.
  • No binary data output is produced by this node.

Example output structure for other operations (e.g., createNode):

[
  {
    "n": {
      "identity": "...",
      "labels": ["LabelName"],
      "properties": { ... }
    }
  }
]

Dependencies

  • Requires a Neo4j database instance accessible via credentials including URI, username, password, and database name.
  • Uses the @langchain/community/graphs/neo4j_graph and @langchain/community/vectorstores/neo4j_vector libraries internally.
  • Requires an API key credential for Neo4j connection configured in n8n.

Troubleshooting

  • Error: "Create relationship operation not implemented yet"
    This error occurs because the "Create Relationship" operation is currently not supported in the node's code. To resolve, avoid using this operation until it is implemented in a future update.

  • Connection errors
    Ensure that the Neo4j credentials (URI, username, password, database) are correct and that the Neo4j server is reachable from the n8n environment.

  • JSON parsing errors
    When providing node properties or filters as JSON strings, ensure they are valid JSON to prevent parsing failures.

Links and References

Discussion