fix(core): Make chat title generation work on instances that don't save executions (no-changelog) (#22518)

This commit is contained in:
Jaakko Husso 2025-12-01 14:04:55 +02:00 committed by GitHub
parent 4adfced937
commit 1037df4933
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View File

@ -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<WorkflowEntity>(newWorkflow);

View File

@ -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}`);
}