@@ -109,6 +109,7 @@ async function fetchWorkflowsFromDB(workspaceId?: string): Promise<void> {
109109 description : description || '' ,
110110 color : color || '#3972F6' ,
111111 lastModified : createdAt ? new Date ( createdAt ) : new Date ( ) ,
112+ createdAt : createdAt ? new Date ( createdAt ) : new Date ( ) ,
112113 marketplaceData : marketplaceData || null ,
113114 workspaceId,
114115 folderId : folderId || null ,
@@ -594,6 +595,7 @@ export const useWorkflowRegistry = create<WorkflowRegistry>()(
594595 id : serverWorkflowId ,
595596 name : createdWorkflow . name ,
596597 lastModified : new Date ( ) ,
598+ createdAt : new Date ( ) ,
597599 description : createdWorkflow . description ,
598600 color : createdWorkflow . color ,
599601 marketplaceData : options . marketplaceId
@@ -836,6 +838,7 @@ export const useWorkflowRegistry = create<WorkflowRegistry>()(
836838 id,
837839 name : metadata . name || generateCreativeWorkflowName ( ) ,
838840 lastModified : new Date ( ) ,
841+ createdAt : new Date ( ) ,
839842 description : metadata . description || 'Imported from marketplace' ,
840843 color : metadata . color || getNextWorkflowColor ( ) ,
841844 marketplaceData : { id : marketplaceId , status : 'temp' as const } ,
@@ -992,6 +995,7 @@ export const useWorkflowRegistry = create<WorkflowRegistry>()(
992995 id,
993996 name : `${ sourceWorkflow . name } (Copy)` ,
994997 lastModified : new Date ( ) ,
998+ createdAt : new Date ( ) ,
995999 description : sourceWorkflow . description ,
9961000 color : getNextWorkflowColor ( ) ,
9971001 workspaceId, // Include the workspaceId in the new workflow
@@ -1322,6 +1326,7 @@ export const useWorkflowRegistry = create<WorkflowRegistry>()(
13221326 ...workflow ,
13231327 ...metadata ,
13241328 lastModified : new Date ( ) ,
1329+ createdAt : workflow . createdAt , // Preserve creation date
13251330 } ,
13261331 } ,
13271332 error : null ,
@@ -1354,6 +1359,9 @@ export const useWorkflowRegistry = create<WorkflowRegistry>()(
13541359 color : updatedWorkflow . color ,
13551360 folderId : updatedWorkflow . folderId ,
13561361 lastModified : new Date ( updatedWorkflow . updatedAt ) ,
1362+ createdAt : updatedWorkflow . createdAt
1363+ ? new Date ( updatedWorkflow . createdAt )
1364+ : state . workflows [ id ] . createdAt ,
13571365 } ,
13581366 } ,
13591367 } ) )
0 commit comments