Update Node
AI-generatedOverview
This node integrates with a Neo4j graph database, allowing users to update nodes within the graph based on specified criteria. It is particularly useful for workflows that need to modify existing graph data dynamically, such as updating user profiles, changing statuses, or adding metadata to nodes after certain events.
For example, you might use this node to:
- Update all nodes labeled "Person" where the property "ID" matches a given value, setting their status to "updated" and recording the last modification timestamp.
- Merge new properties into matched nodes without overwriting existing ones, preserving previous data while adding new information.
Properties
| Name | Meaning |
|---|---|
| Match Labels | Labels of the nodes to update (optional). Specify one or more labels like "Person", "User". |
| Match Properties | JSON object defining properties to find the nodes to update. Values can include n8n expressions. |
| Update Mode | How to apply the new properties: - Merge: Add new properties and update existing ones. - Set (Replace): Replace all existing properties with the new ones. |
| Update Properties | JSON object containing properties to set or merge onto the matched nodes. Values can include n8n expressions. |
| Options > Return Data | Boolean flag indicating whether to return the updated node's element ID and properties in the output. |
Output
The node outputs JSON data representing the updated nodes. If the "Return Data" option is enabled, the output includes each updated node's element ID and its properties after the update operation. This allows subsequent workflow steps to access and utilize the updated node information.
The node does not output binary data.
Dependencies
- Requires connection to a Neo4j graph database.
- Needs an API key credential configured in n8n for authenticating with the Neo4j instance.
- The node depends on internal routing and method modules to perform operations but these are bundled internally.
Troubleshooting
- No nodes updated: Ensure that the "Match Labels" and "Match Properties" correctly identify existing nodes. Incorrect labels or property filters will result in no matches.
- Invalid JSON in properties: The "Match Properties" and "Update Properties" fields require valid JSON. Syntax errors or invalid expressions may cause failures.
- Authentication errors: Verify that the API key credential is correctly configured and has sufficient permissions to update nodes in the Neo4j database.
- Update mode confusion: Using "Set (Replace)" will overwrite all existing properties, which might unintentionally remove important data. Use "Merge" if you want to preserve existing properties.