Merged
Size
M
Change Breakdown
Refactor65%
Maintenance35%
#28063refactor(editor): Migrate versionId to workflowDocument store (no-changelog)

Version tracking migrated to workflow document store

Version data has been consolidated into the workflow document store, removing duplicate state that could fall out of sync.

The workflows store previously held version tracking state (versionId and versionData) alongside the document store, creating potential for inconsistency. When saving, publishing, or activating workflows, code had to update both places or risk stale values.

A new composable now owns all version tracking. It follows the established apply/public pattern already used for checksum, tags, and other document properties — a reactive state container with event hooks for future extensibility. When version data changes, an event fires so other parts of the system can react.

All consumers across the editor UI have been updated to read and write version data through the document store. A sync-back listener keeps in sync with the document store, maintaining compatibility with the IWorkflowDb interface that expects the versionId on the workflow object itself.

In the editor UI package, components like WorkflowHeaderDraftPublishActions, WorkflowPublishModal, and WorkflowSettings now access version state through the document store. Composable functions like , , and have been updated accordingly.

This is part of a broader normalization effort — making the document store the single source of truth for workflow document state. The event hook pattern prepares the groundwork for CRDT support in future iterations.

View Original GitHub Description

Summary

Migrates versionId and versionData from workflows.store.ts to a new useWorkflowDocumentVersionData composable in the workflowDocument store, making it the single source of truth. Follows the established apply/public pattern (same as checksum, tags, etc.) with event hooks for future CRDT support. All consumers (composables, components, stores) are updated to read/write through the document store, with a sync-back listener keeping workflow.value.versionId in sync for IWorkflowDb compatibility.

Related Linear tickets, Github issues, and Community forum posts

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

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)
© 2026 · via Gitpulse