MCPcopy
hub / github.com/simstudioai/sim / exportWorkflowToJson

Function exportWorkflowToJson

apps/sim/lib/workflows/operations/import-export.ts:165–178  ·  view source on GitHub ↗
(workflowData: WorkflowExportData)

Source from the content-addressed store, hash-verified

163 * Exports a single workflow to a JSON string.
164 */
165export function exportWorkflowToJson(workflowData: WorkflowExportData): string {
166 const workflowState = {
167 ...workflowData.state,
168 metadata: {
169 name: workflowData.workflow.name,
170 description: workflowData.workflow.description,
171 exportedAt: new Date().toISOString(),
172 },
173 variables: workflowData.variables,
174 }
175
176 const exportState = sanitizeForExport(workflowState)
177 return JSON.stringify(exportState, null, 2)
178}
179
180/**
181 * Exports multiple workflows to a ZIP file.

Callers 2

useExportWorkflowFunction · 0.90
exportWorkflowsToZipFunction · 0.85

Calls 1

sanitizeForExportFunction · 0.90

Tested by

no test coverage detected