diff --git a/packages/cli/src/modules/chat-hub/chat-hub-workflow.service.ts b/packages/cli/src/modules/chat-hub/chat-hub-workflow.service.ts index b320ea32727..65d05a25102 100644 --- a/packages/cli/src/modules/chat-hub/chat-hub-workflow.service.ts +++ b/packages/cli/src/modules/chat-hub/chat-hub-workflow.service.ts @@ -131,6 +131,11 @@ export class ChatHubWorkflowService { ); const newWorkflow = new WorkflowEntity(); + + // Chat workflows are created as archived to hide them + // from the user by default while they are being run. + newWorkflow.isArchived = true; + newWorkflow.versionId = uuidv4(); newWorkflow.name = `Chat ${sessionId} (Title Generation)`; newWorkflow.active = false; @@ -139,6 +144,7 @@ export class ChatHubWorkflowService { newWorkflow.connections = connections; newWorkflow.settings = { executionOrder: 'v1', + saveDataSuccessExecution: 'all', }; const workflow = await em.save(newWorkflow); diff --git a/packages/cli/src/modules/chat-hub/chat-hub.service.ts b/packages/cli/src/modules/chat-hub/chat-hub.service.ts index 71c5407ee96..65c7d3da8d5 100644 --- a/packages/cli/src/modules/chat-hub/chat-hub.service.ts +++ b/packages/cli/src/modules/chat-hub/chat-hub.service.ts @@ -1871,6 +1871,9 @@ export class ChatHubService { workflowData, executionData, user, + undefined, + false, + 'chat', ); const executionId = started.executionId; @@ -1894,6 +1897,7 @@ export class ChatHubService { const execution = await this.executionRepository.findWithUnflattenedData(executionId, [ workflowData.id, ]); + if (!execution) { throw new OperationalError(`Could not find execution with ID ${executionId}`); }