FN-7269: preserve workflow settings and prompts across import

Workflow exports now carry project-specific settings and prompt overrides through import.

- Add settingValues and promptOverrides to workflow export envelopes and client API types.\n- Restore imported setting values and prompt overrides onto the freshly created workflow with validation and rollback on failure.\n- Cover custom and built-in workflow round-trips plus invalid restore-map rejection cases.\n- Document portable workflow exports and add a patch changeset.\n\nFiles changed:\n ...7269-workflow-export-import-settings-prompts.md |   7 ++\n docs/workflow-editor.md                            |   4 +-\n packages/dashboard/app/api/legacy.ts               |  10 +-\n .../__tests__/workflow-import-export.test.ts       | 113 ++++++++++++++++++++-\n .../src/routes/register-workflow-routes.ts         |  86 +++++++++++++++-\n 5 files changed, 210 insertions(+), 10 deletions(-)

Fusion-Task-Id: FN-7269

Fusion-Task-Lineage: 718f42d0-c72d-4818-8f8c-979d01e960af

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
This commit is contained in:
gsxdsm
2026-06-30 01:28:33 -07:00
parent b5da5d310a
commit 04f06e6b70
5 changed files with 210 additions and 10 deletions

View File

@@ -5494,7 +5494,11 @@ export function compileWorkflow(id: string, projectId?: string): Promise<{ steps
/** A workflow export envelope (U5/R9/KTD-5). `schemaVersion` is the SERVER's
* schema version at export time — the import route version-gates against it
* (the app build aliases @fusion/core to types-only, so the value can only come
* from the server, never an app-side core import). */
* from the server, never an app-side core import).
*
* FNXC:WorkflowPortability 2026-06-30-00:00:
* Dashboard downloads must carry project-scoped setting values and prompt overrides with the workflow graph so the same shared API path supports portable desktop and mobile Workflow Editor imports.
*/
export interface WorkflowExportEnvelope {
fusionWorkflowExport: 1;
schemaVersion: number;
@@ -5503,6 +5507,8 @@ export interface WorkflowExportEnvelope {
description: string;
ir: import("@fusion/core").WorkflowIr;
layout: import("@fusion/core").WorkflowDefinition["layout"];
settingValues: Record<string, unknown>;
promptOverrides: Record<string, string>;
}
/** Fetch a workflow's export envelope and trigger a browser download as
@@ -5532,6 +5538,8 @@ export interface ImportWorkflowResult {
workflow: import("@fusion/core").WorkflowDefinition;
strippedApprovalFlags: boolean;
warnings: string[];
settingValues: Record<string, unknown>;
promptOverrides: Record<string, string>;
}
/** Import a workflow export envelope (U5/R10). The server is the sole validator;