Skip to content

Neo4J Transaction

Executes multiple Cypher queries as a single atomic transaction against a Neo4J database. Takes a JSON array of query objects (each with 'cypher' and 'parameters') and returns consolidated results. If any query fails, the entire transaction is rolled back.
Preview

Usage

Use this node when you need to perform multiple related updates or reads that must succeed or fail together (e.g., creating nodes and relationships, followed by verification queries). Typical workflow: provide credentials, set an appropriate timeout, compose the queries array in JSON, and connect the outputs to downstream nodes that parse text or JSON results.

Inputs

FieldRequiredTypeDescriptionExample
credentials_pathTrueSTRINGPath or reference to stored Neo4J credentials configured for the service./path/to/neo4j_credentials.json
timeoutTrueINTMaximum time in seconds allowed for the entire transaction request.120
queriesTrueSTRINGJSON array of query objects. Each object must include 'cypher' (string) and 'parameters' (object) to be executed in order within a single transaction.[{"cypher": "CREATE (n:Person {name: $name})", "parameters": {"name": "John"}}, {"cypher": "MATCH (n:Person) RETURN n", "parameters": {}}]

Outputs

FieldTypeDescriptionExample
textSTRINGHuman-readable summary of the transaction results.Neo4J Transaction Results: 2 queries executed successfully.
jsonSTRINGRaw JSON response containing detailed results for each query executed in the transaction.{"results": [{"records": [...]}, {"records": [...]}], "stats": {...}}
htmlSTRINGHTML-formatted representation of the results when applicable.
name
John
xlsxSTRINGSerialized Excel content or a reference string if export is produced by the service.xlsx_file_reference_or_content
pdfSTRINGSerialized PDF content or a reference string if export is produced by the service.pdf_file_reference_or_content

Important Notes

  • Credentials must be configured for the 'neo4j' service; the node loads them from the provided credentials_path.
  • The 'queries' input must be valid JSON. If parsing fails or the string is empty, an empty list is used and no queries are executed.
  • All queries are executed in order within a single transaction; any error will roll back the entire set.
  • Timeout applies to the entire transaction request, not per-query.
  • For write operations, ensure your user has appropriate Neo4J permissions and that any required plugins (e.g., GDS) are installed for advanced procedures.

Troubleshooting

  • Invalid JSON in 'queries': Ensure the input is a valid JSON array of objects with 'cypher' and 'parameters' keys.
  • Authentication or connection errors: Verify credentials_path points to valid credentials and that the database is reachable.
  • Transaction rolled back due to constraint violations or syntax errors: Test each query individually to isolate the failing statement.
  • Request timeout: Increase the timeout value or simplify/optimize queries to complete within the allotted time.
  • Empty or unexpected results: Confirm parameters match those referenced in Cypher queries and that target data exists.