mirror of
https://github.com/n8n-io/n8n.git
synced 2026-05-27 23:07:12 +02:00
fix(core): Make chat title generation work on instances that don't save executions (no-changelog) (#22518)
This commit is contained in:
parent
4adfced937
commit
1037df4933
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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}`);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user