Merged
Size
S
Change Breakdown
Refactor80%
Maintenance20%
#27422refactor(editor): Migrate AI assistant to workflowDocumentStore connections (no-changelog)

AI assistant migrated to centralized workflowDocumentStore

The AI assistant now routes connection queries through the workflowDocumentStore facade, aligning with the broader initiative to consolidate how workflow data is accessed across the editor.

The AI assistant's connection queries are being routed through a centralized facade instead of directly accessing multiple store APIs. Three files in the editor's AI assistant feature — focused nodes tracking, builder todos, and the builder store itself — are being updated to pull connection data from workflowDocumentStore rather than workflowsStore or workflowState.

This is part of a larger architectural effort to consolidate how workflow connections are accessed. The workflowDocumentStore serves as a single interface for connection data, replacing scattered direct store access throughout the codebase. Using a facade means changes to how connections are stored only need to happen in one place.

The changes are minimal in scope — replacing one set of accessor calls with equivalents from the new facade — but they position the AI assistant for easier maintenance as the underlying data layer evolves.

View Original GitHub Description

Summary

Migrates AI assistant connection access from direct workflowsStore / workflowState APIs to workflowDocumentStore facade.

Source files:

  • focusedNodes.store.tsconnectionsByDestinationNode, connectionsBySourceNodeworkflowDocumentStore
  • useBuilderTodos.tsoutgoingConnectionsByNodeName (×2) → workflowDocumentStore
  • builder.store.tsworkflowState.removeAllConnectionsworkflowDocumentStore.removeAllConnections(); pick(workflow, ['nodes', 'connections'])workflowDocumentStore.connectionsBySourceNode

Test files updated:

  • focusedNodes.store.test.ts — switched connection mocks from connectionsByDestinationNode/connectionsBySourceNode to workflow.connections (source-indexed)

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/CAT-2642

Review / Merge checklist

© 2026 · via Gitpulse