fix: include chatbotConfig to retain Starter Prompts during Workspace…#6253
Open
SyncWithRaj wants to merge 3 commits intoFlowiseAI:mainfrom
Open
fix: include chatbotConfig to retain Starter Prompts during Workspace…#6253SyncWithRaj wants to merge 3 commits intoFlowiseAI:mainfrom
SyncWithRaj wants to merge 3 commits intoFlowiseAI:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the sanitizeChatflow function in exportImport.js to include several additional fields such as chatbotConfig, category, and analytic when sanitizing chat flow data. A review comment suggests using a more robust nullish check instead of truthy checks to prevent skipping empty strings and recommends including the missing mcpServerConfig field to avoid data loss.
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
This PR fixes a data-loss issue where Starter Prompts (and other configurations) are dropped when a user exports and subsequently imports a Workspace.
Root Cause Analysis:
During the workspace export process, the backend correctly fetches the full
ChatFlowentities. However, thesanitizeChatflowfunction inpackages/ui/src/utils/exportImport.jswas explicitly returning onlyid,name,flowData, andtype. This silently stripped outchatbotConfig(which houses the Starter Prompts) along with other important configurations before the JSON file was generated.The Fix:
Updated
sanitizeChatflowto ensurechatbotConfigand other relevant properties (such ascategory,speechToText,textToSpeech,apiConfig, etc.) are preserved and included in the exported JSON payload.Related Issue
Fixes #6214
Changes Made
packages/ui/src/utils/exportImport.jsto include missing configuration fields in thesanitizeChatflowreturn object.How to Test
.jsonfile to confirmchatbotConfigis now present..jsonfile into a brand-new Workspace.Checklist
CONTRIBUTING.mdguidelines.pnpm testinpackages/ui) and they pass successfully.