Canvas operations refactored to use document store facade
The n8n editor's canvas operations now route through a centralized workflowDocumentStore instead of directly accessing the workflowObject, laying groundwork for upcoming CRDT support.
n8n's editor canvas is getting a structural update. Canvas operations that previously accessed the workflow object directly have been refactored to use a centralized document store facade instead.
The change consolidates how node and connection data is queried across the canvas. Instead of reaching into workflowObject for operations like retrieving parent nodes, finding connected nodes, or fetching workflow metadata, all calls now flow through workflowDocumentStore. This creates a cleaner boundary between the workflow data layer and UI operations.
The refactoring removes a standalone helper function and relocates its logic into the document store module where it belongs. Optional chaining is applied throughout, making the code more defensive against null values.
This is foundational work. By establishing a consistent access pattern now, the codebase will be better positioned to adopt CRDT for collaborative editing. Users won't see any change in behavior today, but the architecture is becoming more amenable to conflict resolution in distributed scenarios.
View Original GitHub Description
Summary
As part of the groundwork for introducing CRDT, this PR replaces direct workflowObject access in node operations with workflowDocumentStore facade methods.
Related Linear tickets, Github issues, and Community forum posts
Review / Merge checklist
- I have seen this code, I have run this code, and I take responsibility for this code.
- PR title and summary are descriptive. (conventions) <!-- **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** -->
- Docs updated or follow-up ticket created.
- Tests included. <!-- A bug is not considered fixed, unless a test is added to prevent it from happening again. A feature is not complete without tests. -->
- PR Labeled with
Backport to Beta,Backport to Stable, orBackport to v1(if the PR is an urgent fix that needs to be backported)