perf(core): Improvements to GET /workflows endpoint (#17086)

This commit is contained in:
Ricardo Espinoza
2025-07-08 14:40:55 -04:00
committed by GitHub
parent f3ef0a713c
commit cc39c50737
2 changed files with 27 additions and 0 deletions
@@ -211,9 +211,30 @@ export = {
where.id = In(workflowsIds);
}
const selectFields: (keyof WorkflowEntity)[] = [
'id',
'name',
'active',
'createdAt',
'updatedAt',
'isArchived',
'nodes',
'connections',
'settings',
'staticData',
'meta',
'versionId',
'triggerCount',
];
if (!excludePinnedData) {
selectFields.push('pinData');
}
const [workflows, count] = await Container.get(WorkflowRepository).findAndCount({
skip: offset,
take: limit,
select: selectFields,
where,
...(!Container.get(GlobalConfig).tags.disabled && { relations: ['tags'] }),
});