feat(core): Store insights data at the end of executions (no-changelog) (#13905)

Co-authored-by: Danny Martini <danny@n8n.io>
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
Guillaume Jacquart
2025-03-20 20:25:29 +01:00
committed by GitHub
parent d80b49d6e5
commit cb5a803f9e
23 changed files with 941 additions and 5 deletions

View File

@@ -24,7 +24,7 @@ export async function createManyWorkflows(
}
export function newWorkflow(attributes: Partial<IWorkflowDb> = {}): IWorkflowDb {
const { active, name, nodes, connections, versionId } = attributes;
const { active, name, nodes, connections, versionId, settings } = attributes;
const workflowEntity = Container.get(WorkflowRepository).create({
active: active ?? false,
@@ -41,7 +41,7 @@ export function newWorkflow(attributes: Partial<IWorkflowDb> = {}): IWorkflowDb
],
connections: connections ?? {},
versionId: versionId ?? uuid(),
settings: {},
settings: settings ?? {},
...attributes,
});
@@ -119,8 +119,9 @@ export async function shareWorkflowWithProjects(
}
export async function getWorkflowSharing(workflow: IWorkflowBase) {
return await Container.get(SharedWorkflowRepository).findBy({
workflowId: workflow.id,
return await Container.get(SharedWorkflowRepository).find({
where: { workflowId: workflow.id },
relations: { project: true },
});
}

View File

@@ -86,6 +86,9 @@ const repositories = [
'WorkflowTagMapping',
'ApiKey',
'Folder',
'InsightsRaw',
'InsightsMetadata',
'InsightsByPeriod',
] as const;
/**