Prevent querying too much on worklow index page (#14916)

## Performance short term fix

Done in this PR:
workflowVersions and workflowRuns are heavy object. I'm preventing
loading their data when they are loaded as relations. This will reduce
the work on backend

## Long term fix

Todo:
We should make sure workflow data is ligher
This commit is contained in:
Charles Bochet
2025-10-06 23:53:58 +02:00
committed by GitHub
parent 5300ec5309
commit 0fd6085b53
7 changed files with 55 additions and 32 deletions
@@ -10,6 +10,7 @@ import { isDefined } from 'twenty-shared/utils';
export const useWorkflowWithCurrentVersion = (
workflowId: string | undefined,
): WorkflowWithCurrentVersion | undefined => {
// TODO: we should only load the data for the current version
const { record: workflow } = useFindOneRecord<Workflow>({
objectNameSingular: CoreObjectNameSingular.Workflow,
objectRecordId: workflowId,