Memgraph icon

Memgraph

Excecute cypher query against a Memgraph graph database.

Overview

This node executes a Cypher query against a Memgraph graph database. It is designed to run custom Cypher queries provided by the user and return the results as JSON data. This node is useful in scenarios where you want to interact with a Memgraph database to retrieve, update, or analyze graph data using Cypher language directly within an n8n workflow.

Practical examples include:

  • Fetching specific nodes or relationships based on certain criteria.
  • Running complex graph pattern matching queries.
  • Extracting properties from graph elements for further processing or reporting.

Properties

Name Meaning
Cypher Query The Cypher query to execute against the Memgraph database. You can write any valid Cypher statement here, such as MATCH (n) RETURN n.id as Id, n.name as Name, n.content as Content LIMIT 10.

Output

The output of this node is a JSON array where each element corresponds to a record returned by the Cypher query. Each record contains key-value pairs representing the fields selected in the query (e.g., Id, Name, Content). The structure matches the aliases and properties specified in the Cypher query's RETURN clause.

No binary data output is produced by this node.

Dependencies

  • Requires access to a Memgraph graph database instance.
  • Needs an API authentication credential configured in n8n to connect securely to the Memgraph database.
  • Relies on internal helper functions to create a session and extract records from the query result.

Troubleshooting

  • Connection issues: Ensure that the Memgraph database is accessible from the n8n environment and that the API credentials are correctly configured.
  • Invalid Cypher syntax: If the query is malformed, the node will throw an error. Verify the Cypher query syntax and test it directly in Memgraph before using it in the node.
  • Empty results: If the query returns no records, the output JSON array will be empty. Confirm that the query matches existing data.
  • Session creation failure: Errors during session creation may indicate misconfiguration of credentials or network problems.

Links and References

Discussion