Skip to content

fix: include chatbotConfig to retain Starter Prompts during Workspace…#6253

Open
SyncWithRaj wants to merge 3 commits intoFlowiseAI:mainfrom
SyncWithRaj:bugfix/workspace-export-starter-prompts
Open

fix: include chatbotConfig to retain Starter Prompts during Workspace…#6253
SyncWithRaj wants to merge 3 commits intoFlowiseAI:mainfrom
SyncWithRaj:bugfix/workspace-export-starter-prompts

Conversation

@SyncWithRaj
Copy link
Copy Markdown

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 ChatFlow entities. However, the sanitizeChatflow function in packages/ui/src/utils/exportImport.js was explicitly returning only id, name, flowData, and type. This silently stripped out chatbotConfig (which houses the Starter Prompts) along with other important configurations before the JSON file was generated.

The Fix:
Updated sanitizeChatflow to ensure chatbotConfig and other relevant properties (such as category, speechToText, textToSpeech, apiConfig, etc.) are preserved and included in the exported JSON payload.

Related Issue

Fixes #6214

Changes Made

  • Modified packages/ui/src/utils/exportImport.js to include missing configuration fields in the sanitizeChatflow return object.

How to Test

  1. Create a Workspace, add a Chatflow, and add a Starter Prompt via the Configuration menu. Save the Chatflow.
  2. Navigate back to the Workspaces overview and Export the Workspace.
  3. Check the downloaded .json file to confirm chatbotConfig is now present.
  4. Import the .json file into a brand-new Workspace.
  5. Open the imported Chatflow's configuration and verify that the Starter Prompt is intact.

Checklist

  • I have read the CONTRIBUTING.md guidelines.
  • I have tested my changes locally using the reproduction steps.
  • I have run the relevant tests (pnpm test in packages/ui) and they pass successfully.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread packages/ui/src/utils/exportImport.js Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing Starter Prompts after workspace import

1 participant