Skip to content

Neo4J Write

Executes write (CREATE/UPDATE/DELETE) Cypher statements against a Neo4J database. Supports parameterized queries via a JSON parameters object and returns formatted text plus raw JSON results. Uses stored credentials to connect and enforces a configurable timeout.
Preview

Usage

Use this node to modify data in a Neo4J graph (e.g., creating nodes/relationships, updating properties, deleting entities). Provide a Cypher write statement and optional parameters in JSON. It’s typically placed after a credentials setup step and before any downstream steps that rely on the updated graph state.

Inputs

FieldRequiredTypeDescriptionExample
credentials_pathTrueSTRINGPath or reference to the saved Neo4J credentials to authenticate requests./workspace/credentials/neo4j.json
timeoutTrueINTMaximum time in seconds to wait for the write operation before failing.120
cypher_queryTrueSTRINGCypher write query to execute (e.g., CREATE, MERGE, SET, DELETE, REMOVE).CREATE (n:Person {name: $name, age: $age})
parametersTrueSTRINGJSON string containing parameter key-value pairs used in the Cypher query.{"name": "John", "age": 30}

Outputs

FieldTypeDescriptionExample
textSTRINGHuman-readable summary of the write operation result.Neo4J Write Results Records affected: 1
jsonJSONRaw JSON response from the write execution, including any returned metadata.{"summary": {"counters": {"nodesCreated": 1, "propertiesSet": 2}}}
htmlHTMLHTML-rendered representation of results. Empty by default for this node.
xlsxXLSXExcel output of results. Empty by default for this node.
pdfPDFPDF output of results. Empty by default for this node.

Important Notes

  • Write operations modify data: Ensure you have appropriate permissions and test on non-production environments when possible.
  • Parameters must be valid JSON: Invalid JSON falls back to an empty parameter set, which may lead to unexpected query behavior.
  • Timeout applies to the full request: Long-running operations may fail if they exceed the configured timeout.
  • Credentials required: The provided credentials must have sufficient privileges to perform write operations.
  • Parameterized queries recommended: Use parameters to avoid injection risks and improve performance through query planning.
  • Result format: Text and JSON are populated by default; HTML, XLSX, and PDF outputs are left empty unless enhanced by downstream nodes.

Troubleshooting

  • Invalid JSON in parameters: Ensure the 'parameters' field is a valid JSON string (e.g., use double quotes and proper escaping).
  • Authentication or permission errors: Verify the credentials file path and that the user has write privileges in Neo4J.
  • Cypher syntax errors: Validate your Cypher write statement using a Neo4J client or playground; correct any syntax issues.
  • Operation times out: Increase the 'timeout' value or optimize the query and database performance.
  • No changes applied: Check that your query targets existing nodes/relationships (for MATCH/SET/DELETE) or that MERGE conditions are correct.
  • Parameter name mismatches: Ensure the parameter keys in the JSON match the $placeholders used in the Cypher query.