Feature - Implement version control system for ChatFlows and Assistants #5024
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.
Implement version control system for ChatFlows and Assistants
Overview
This PR introduces a comprehensive version control system that automatically creates snapshots for every save operation in ChatFlows and Assistants, enabling users to view version history, restore previous versions, and manage their AI workflow iterations effectively.
Problem Statement
Users frequently modify ChatFlows and Assistants during development and testing, but currently have no way to:
This creates significant productivity issues when experimenting with AI workflows, as users cannot easily recover from breaking changes.
Solution
Implemented a complete version control system with the following capabilities:
Core Features
User Experience
History
button appears in existing toolbarsImplementation
Database Schema
FlowHistory
entity with optimized indexes for performancecurrentHistoryVersion
field to existingChatFlow
andAssistant
entitiesBackend Services
Frontend Components
HistoryDialog
component with Material-UI designHistoryButton
component for toolbar integrationSecurity & Performance
Technical Details
The system integrates seamlessly with existing workflows by hooking into current save operations. When a user saves a ChatFlow or Assistant, the system:
Version restoration creates a new snapshot of the restored state, maintaining a complete audit trail of all changes.
Testing
Migration