fix(editor): Use direct store reference for connections in initializeWorkspace (backport to release-candidate/2.14.x) - #27559
Merged
r00gm merged 1 commit intoMar 25, 2026
Conversation
3 tasks
Contributor
There was a problem hiding this comment.
No issues found across 2 files
Architecture diagram
sequenceDiagram
participant UI as Editor UI
participant Ops as useCanvasOperations
participant WfStore as Workflows Store
participant DocStore as Workflow Document Store
Note over UI, DocStore: Workspace Initialization (e.g. Loading a Workflow or Preview)
UI->>Ops: initializeWorkspace(workflowData)
Ops->>WfStore: Check current workflow ID
Note right of WfStore: If resetWorkspace() was called, ID is ""
Ops->>DocStore: useWorkflowDocumentStore(workflowData.id)
DocStore-->>Ops: initializedDocumentStore (Direct Reference)
Ops->>DocStore: setNodes(workflowData.nodes)
alt Connection Handling
Note over Ops, DocStore: Fix: Avoid dependency on reactive 'workflowId' computed property
Ops->>DocStore: CHANGED: setConnections(workflowData.connections)
Note right of Ops: Now uses the 'initializedDocumentStore' reference directly
end
Ops->>WfStore: Update global workflow metadata (ID, name, etc.)
Note over Ops, DocStore: UI components (like AI Agents) now render with correct input slots
Ops-->>UI: return { workflowDocumentStore }
r00gm
enabled auto-merge (squash)
March 25, 2026 12:52
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
r00gm
disabled auto-merge
March 25, 2026 14:31
r00gm
enabled auto-merge (squash)
March 25, 2026 14:31
r00gm
approved these changes
Mar 25, 2026
Merged
Contributor
Author
|
Got released with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Backport of #27552 to
release-candidate/2.14.x.Checklist for the author (@r00gm) to go through.
After this PR has been merged, it will be picked up in the next patch release for release track.
Original description
Summary
initializeWorkspaceset nodes via the directinitializedDocumentStorereference but set connections via the computedworkflowDocumentStore?.value?. AfterresetWorkspace()clearsworkflowIdto'', the computed evaluates toundefinedandsetConnectionsis silently skipped — so no connections are loaded.This broke the workflow preview (used on n8n.io) for all workflows, most visibly for AI agent nodes whose shape depends on sub-node connections (model, memory, tool). Without connections, the agent renders as a plain square instead of a wide rectangle with input slots.
The fix uses
initializedDocumentStoreconsistently for bothsetNodesandsetConnections, matching the direct reference already returned byinitState.Regression introduced in: #27280
Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/ADO-4999
Review / Merge checklist