Eligibility for Migration
Only users who deployed FastGPT versions earlier than 4.8 must complete this workflow migration. Starting with FastGPT 4.15.0-beta7, workflow save payloads consistently use the V2 structure. Historical records stored in apps.modules and app_versions.nodes may remain in the V1 format. Complete this migration before running the subsequent V2 dirty-data cleanup step after upgrading your FastGPT instance.
Migration Endpoint and Command Parameters
The migration script is located at projects/app/src/pages/api/admin/dataClean/v1WorkflowToV2.ts. This endpoint is intended exclusively for this upgrade migration and is not a public OpenAPI endpoint.
By default, the endpoint runs in dry-run mode, which scans, converts data in memory, validates against PublishAppBodySchema, and does not write changes to MongoDB. Use the following curl command to execute a dry-run scan:
curl -X POST 'https://your-domain/api/admin/dataClean/v1WorkflowToV2' \
-H 'Content-Type: application/json' \
-H 'rootkey: YOUR_ROOT_KEY' \
-d '{"dryRun":true}'After reviewing the statistics returned in the command response, run the following command with dryRun set to false to write converted data to your MongoDB database:
curl -X POST 'https://your-domain/api/admin/dataClean/v1WorkflowToV2' \
-H 'Content-Type: application/json' \
-H 'rootkey: YOUR_ROOT_KEY' \
-d '{"dryRun":false}'The following table lists available request parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
dryRun | boolean | true | Whether to scan and validate only without writing changes. |
Migration Behavior Rules
The migration script follows these defined operational rules:
- Scans apps where
apps.version != 'v2'andtypeis notfolder,httpPlugin, ortoolFolder. - Processes apps in batches, converting and writing related
app_versionsrecords first, then converting and writingappsrecords. This ensures no historical versions are missed if the migration is interrupted partway through. - Converts V1 node fields to V2 format, including renaming
moduleIdtonodeIdandflowTypetoflowNodeType. - Falls back unknown node types to
emptyNode, and converts invalidvalueTypevalues toany. - Uses
flowTypeas a fallback for missingnode.namevalues, and usesinput.keyas a fallback for missinginput.labelvalues. - Validates
nodes,edges, andchatConfigagainstPublishAppBodySchemabefore writing any changes. Records that fail validation are not written to the database and are included in the endpoint's response.
Source: FastGPT official source
Applicability and version scope
Use this page for the documented Deployment and upgrades scenario. Confirm the FastGPT, dependency, API, and deployment versions in the official source before applying a change.
Safety guardrails
Use [REDACTED_CREDENTIAL] for credentials and private data. Confirm the documented environment and version before review.
Rollback guidance
Restore the prior technical-content authority snapshot. Restore saved configuration and data snapshots, then repeat the smallest verification scenario.