The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Refacto workflow folders (#9302)
Thomas Trompette9e74ffae52bd
diff --git a/packages/twenty-front/src/modules/object-record/record-field/form-types/components/FormTextFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/form-types/components/FormTextFieldInput.tsxindex 04f27b3a0da..945fde07c8a 100644--- a/packages/twenty-front/src/modules/object-record/record-field/form-types/components/FormTextFieldInput.tsx+++ b/packages/twenty-front/src/modules/object-record/record-field/form-types/components/FormTextFieldInput.tsx@@ -5,7 +5,7 @@ import { TextVariableEditor } from '@/object-record/record-field/form-types/compimport { useTextVariableEditor } from '@/object-record/record-field/form-types/hooks/useTextVariableEditor';import { VariablePickerComponent } from '@/object-record/record-field/form-types/types/VariablePickerComponent';import { InputLabel } from '@/ui/input/components/InputLabel';-import { parseEditorContent } from '@/workflow/search-variables/utils/parseEditorContent';+import { parseEditorContent } from '@/workflow/workflow-variables/utils/parseEditorContent';import { useId } from 'react';import { isDefined } from 'twenty-ui';diff --git a/packages/twenty-front/src/modules/object-record/record-field/form-types/components/VariableChip.tsx b/packages/twenty-front/src/modules/object-record/record-field/form-types/components/VariableChip.tsxindex 15273f1af25..17720e69fa9 100644--- a/packages/twenty-front/src/modules/object-record/record-field/form-types/components/VariableChip.tsx+++ b/packages/twenty-front/src/modules/object-record/record-field/form-types/components/VariableChip.tsx@@ -1,5 +1,5 @@import { SortOrFilterChip } from '@/views/components/SortOrFilterChip';-import { extractVariableLabel } from '@/workflow/search-variables/utils/extractVariableLabel';+import { extractVariableLabel } from '@/workflow/workflow-variables/utils/extractVariableLabel';import styled from '@emotion/styled';export const StyledContainer = styled.div`diff --git a/packages/twenty-front/src/modules/object-record/record-field/form-types/hooks/useTextVariableEditor.ts b/packages/twenty-front/src/modules/object-record/record-field/form-types/hooks/useTextVariableEditor.tsindex a00c52f26e0..6b8582a84d6 100644--- a/packages/twenty-front/src/modules/object-record/record-field/form-types/hooks/useTextVariableEditor.ts+++ b/packages/twenty-front/src/modules/object-record/record-field/form-types/hooks/useTextVariableEditor.ts@@ -1,5 +1,5 @@-import { initializeEditorContent } from '@/workflow/search-variables/utils/initializeEditorContent';-import { VariableTag } from '@/workflow/search-variables/utils/variableTag';+import { initializeEditorContent } from '@/workflow/workflow-variables/utils/initializeEditorContent';+import { VariableTag } from '@/workflow/workflow-variables/utils/variableTag';import Document from '@tiptap/extension-document';import HardBreak from '@tiptap/extension-hard-break';import Paragraph from '@tiptap/extension-paragraph';diff --git a/packages/twenty-front/src/modules/object-record/record-show/components/CardComponents.tsx b/packages/twenty-front/src/modules/object-record/record-show/components/CardComponents.tsxindex 549ebbf240e..2220d2cb8fc 100644--- a/packages/twenty-front/src/modules/object-record/record-show/components/CardComponents.tsx+++ b/packages/twenty-front/src/modules/object-record/record-show/components/CardComponents.tsx@@ -10,10 +10,10 @@ import { CardType } from '@/object-record/record-show/types/CardType';import { ShowPageActivityContainer } from '@/ui/layout/show-page/components/ShowPageActivityContainer';import { WorkflowRunOutputVisualizer } from '@/workflow/components/WorkflowRunOutputVisualizer';import { WorkflowRunVersionVisualizer } from '@/workflow/components/WorkflowRunVersionVisualizer';-import { WorkflowVersionVisualizer } from '@/workflow/components/WorkflowVersionVisualizer';-import { WorkflowVersionVisualizerEffect } from '@/workflow/components/WorkflowVersionVisualizerEffect';-import { WorkflowVisualizer } from '@/workflow/components/WorkflowVisualizer';-import { WorkflowVisualizerEffect } from '@/workflow/components/WorkflowVisualizerEffect';+import { WorkflowVersionVisualizer } from '@/workflow/workflow-diagram/components/WorkflowVersionVisualizer';+import { WorkflowVersionVisualizerEffect } from '@/workflow/workflow-diagram/components/WorkflowVersionVisualizerEffect';+import { WorkflowVisualizer } from '@/workflow/workflow-diagram/components/WorkflowVisualizer';+import { WorkflowVisualizerEffect } from '@/workflow/workflow-diagram/components/WorkflowVisualizerEffect';import styled from '@emotion/styled';const StyledGreyBox = styled.div<{ isInRightDrawer?: boolean }>`diff --git a/packages/twenty-front/src/modules/serverless-functions/utils/getDefaultFunctionInputFromInputSchema.ts b/packages/twenty-front/src/modules/serverless-functions/utils/getDefaultFunctionInputFromInputSchema.tsindex e16e703dd29..6d5c043a0d8 100644--- a/packages/twenty-front/src/modules/serverless-functions/utils/getDefaultFunctionInputFromInputSchema.ts+++ b/packages/twenty-front/src/modules/serverless-functions/utils/getDefaultFunctionInputFromInputSchema.ts@@ -1,5 +1,5 @@import { InputSchema } from '@/workflow/types/InputSchema';-import { FunctionInput } from '@/workflow/types/FunctionInput';+import { FunctionInput } from '@/workflow/workflow-actions/types/FunctionInput';import { isDefined } from '~/utils/isDefined';export const getDefaultFunctionInputFromInputSchema = (diff --git a/packages/twenty-front/src/modules/serverless-functions/utils/getFunctionInputFromSourceCode.ts b/packages/twenty-front/src/modules/serverless-functions/utils/getFunctionInputFromSourceCode.tsindex 94bbd1af3a0..4dc6643c38d 100644--- a/packages/twenty-front/src/modules/serverless-functions/utils/getFunctionInputFromSourceCode.ts+++ b/packages/twenty-front/src/modules/serverless-functions/utils/getFunctionInputFromSourceCode.ts@@ -1,6 +1,6 @@import { getDefaultFunctionInputFromInputSchema } from '@/serverless-functions/utils/getDefaultFunctionInputFromInputSchema';import { getFunctionInputSchema } from '@/serverless-functions/utils/getFunctionInputSchema';-import { FunctionInput } from '@/workflow/types/FunctionInput';+import { FunctionInput } from '@/workflow/workflow-actions/types/FunctionInput';import { isObject } from '@sniptt/guards';import { isDefined } from 'twenty-ui';diff --git a/packages/twenty-front/src/modules/serverless-functions/utils/getFunctionOutputSchema.ts b/packages/twenty-front/src/modules/serverless-functions/utils/getFunctionOutputSchema.tsindex 5505ce0c6fb..bf40934e0e7 100644--- a/packages/twenty-front/src/modules/serverless-functions/utils/getFunctionOutputSchema.ts+++ b/packages/twenty-front/src/modules/serverless-functions/utils/getFunctionOutputSchema.ts@@ -1,6 +1,6 @@-import { BaseOutputSchema } from '@/workflow/search-variables/types/StepOutputSchema';-import { isObject } from '@sniptt/guards';import { InputSchemaPropertyType } from '@/workflow/types/InputSchema';+import { BaseOutputSchema } from '@/workflow/workflow-variables/types/StepOutputSchema';+import { isObject } from '@sniptt/guards';import { isDefined } from 'twenty-ui';const getValueType = (value: any): InputSchemaPropertyType => {diff --git a/packages/twenty-front/src/modules/serverless-functions/utils/mergeDefaultFunctionInputAndFunctionInput.ts b/packages/twenty-front/src/modules/serverless-functions/utils/mergeDefaultFunctionInputAndFunctionInput.tsindex 1ba4e38a0d8..22cb16b658a 100644--- a/packages/twenty-front/src/modules/serverless-functions/utils/mergeDefaultFunctionInputAndFunctionInput.ts+++ b/packages/twenty-front/src/modules/serverless-functions/utils/mergeDefaultFunctionInputAndFunctionInput.ts@@ -1,4 +1,4 @@-import { FunctionInput } from '@/workflow/types/FunctionInput';+import { FunctionInput } from '@/workflow/workflow-actions/types/FunctionInput';import { isObject } from '@sniptt/guards';export const mergeDefaultFunctionInputAndFunctionInput = ({diff --git a/packages/twenty-front/src/modules/ui/layout/right-drawer/components/RightDrawerRouter.tsx b/packages/twenty-front/src/modules/ui/layout/right-drawer/components/RightDrawerRouter.tsxindex 8bcb0388272..959fe4986b9 100644--- a/packages/twenty-front/src/modules/ui/layout/right-drawer/components/RightDrawerRouter.tsx+++ b/packages/twenty-front/src/modules/ui/layout/right-drawer/components/RightDrawerRouter.tsx@@ -10,10 +10,10 @@ import { isRightDrawerMinimizedState } from '@/ui/layout/right-drawer/states/isRimport { RightDrawerContainer } from '@/ui/layout/right-drawer/components/RightDrawerContainer';import { RightDrawerTopBar } from '@/ui/layout/right-drawer/components/RightDrawerTopBar';import { ComponentByRightDrawerPage } from '@/ui/layout/right-drawer/types/ComponentByRightDrawerPage';-import { RightDrawerWorkflowEditStep } from '@/workflow/components/RightDrawerWorkflowEditStep';-import { RightDrawerWorkflowSelectAction } from '@/workflow/components/RightDrawerWorkflowSelectAction';-import { RightDrawerWorkflowSelectTriggerType } from '@/workflow/components/RightDrawerWorkflowSelectTriggerType';-import { RightDrawerWorkflowViewStep } from '@/workflow/components/RightDrawerWorkflowViewStep';+import { RightDrawerWorkflowSelectAction } from '@/workflow/workflow-actions/components/RightDrawerWorkflowSelectAction';+import { RightDrawerWorkflowEditStep } from '@/workflow/workflow-step/components/RightDrawerWorkflowEditStep';+import { RightDrawerWorkflowViewStep } from '@/workflow/workflow-step/components/RightDrawerWorkflowViewStep';+import { RightDrawerWorkflowSelectTriggerType } from '@/workflow/workflow-trigger/components/RightDrawerWorkflowSelectTriggerType';import { isDefined } from 'twenty-ui';import { rightDrawerPageState } from '../states/rightDrawerPageState';import { RightDrawerPages } from '../types/RightDrawerPages';diff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowDiagramStepNodeReadonly.tsx b/packages/twenty-front/src/modules/workflow/components/WorkflowDiagramStepNodeReadonly.tsxdeleted file mode 100644index 054a9b7a8d8..00000000000--- a/packages/twenty-front/src/modules/workflow/components/WorkflowDiagramStepNodeReadonly.tsx+++ /dev/null@@ -1,10 +0,0 @@-import { WorkflowDiagramStepNodeBase } from '@/workflow/components/WorkflowDiagramStepNodeBase';-import { WorkflowDiagramStepNodeData } from '@/workflow/types/WorkflowDiagram';--export const WorkflowDiagramStepNodeReadonly = ({- data,-}: {- data: WorkflowDiagramStepNodeData;-}) => {- return <WorkflowDiagramStepNodeBase data={data} />;-};diff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowRunVersionVisualizer.tsx b/packages/twenty-front/src/modules/workflow/components/WorkflowRunVersionVisualizer.tsxindex 8d8f265c426..71ea331d478 100644--- a/packages/twenty-front/src/modules/workflow/components/WorkflowRunVersionVisualizer.tsx+++ b/packages/twenty-front/src/modules/workflow/components/WorkflowRunVersionVisualizer.tsx@@ -1,6 +1,6 @@-import { WorkflowVersionVisualizer } from '@/workflow/components/WorkflowVersionVisualizer';-import { WorkflowVersionVisualizerEffect } from '@/workflow/components/WorkflowVersionVisualizerEffect';import { useWorkflowRun } from '@/workflow/hooks/useWorkflowRun';+import { WorkflowVersionVisualizer } from '@/workflow/workflow-diagram/components/WorkflowVersionVisualizer';+import { WorkflowVersionVisualizerEffect } from '@/workflow/workflow-diagram/components/WorkflowVersionVisualizerEffect';import { isDefined } from 'twenty-ui';export const WorkflowRunVersionVisualizer = ({diff --git a/packages/twenty-front/src/modules/workflow/hooks/useDeleteStep.ts b/packages/twenty-front/src/modules/workflow/hooks/useDeleteStep.tsindex 4beeed8a368..12a03540b96 100644--- a/packages/twenty-front/src/modules/workflow/hooks/useDeleteStep.ts+++ b/packages/twenty-front/src/modules/workflow/hooks/useDeleteStep.ts@@ -1,13 +1,13 @@+import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';+import { useUpdateOneRecord } from '@/object-record/hooks/useUpdateOneRecord';+import { useRightDrawer } from '@/ui/layout/right-drawer/hooks/useRightDrawer';+import { useDeleteWorkflowVersionStep } from '@/workflow/hooks/useDeleteWorkflowVersionStep';+import { useGetUpdatableWorkflowVersion } from '@/workflow/hooks/useGetUpdatableWorkflowVersion';import {- WorkflowWithCurrentVersion,WorkflowVersion,+ WorkflowWithCurrentVersion,} from '@/workflow/types/Workflow';-import { useDeleteWorkflowVersionStep } from '@/workflow/hooks/useDeleteWorkflowVersionStep';-import { useGetUpdatableWorkflowVersion } from '@/workflow/hooks/useGetUpdatableWorkflowVersion';-import { useRightDrawer } from '@/ui/layout/right-drawer/hooks/useRightDrawer';-import { TRIGGER_STEP_ID } from '@/workflow/constants/TriggerStepId';-import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';-import { useUpdateOneRecord } from '@/object-record/hooks/useUpdateOneRecord';+import { TRIGGER_STEP_ID } from '@/workflow/workflow-trigger/constants/TriggerStepId';export const useDeleteStep = ({workflow,diff --git a/packages/twenty-front/src/modules/workflow/hooks/useTriggerNodeSelection.ts b/packages/twenty-front/src/modules/workflow/hooks/useTriggerNodeSelection.tsindex 0f7e62cd429..f91a0cf3fae 100644--- a/packages/twenty-front/src/modules/workflow/hooks/useTriggerNodeSelection.ts+++ b/packages/twenty-front/src/modules/workflow/hooks/useTriggerNodeSelection.ts@@ -2,7 +2,7 @@ import { workflowDiagramTriggerNodeSelectionState } from '@/workflow/states/workimport {WorkflowDiagramEdge,WorkflowDiagramNode,-} from '@/workflow/types/WorkflowDiagram';+} from '@/workflow/workflow-diagram/types/WorkflowDiagram';import { useReactFlow } from '@xyflow/react';import { useEffect } from 'react';import { useRecoilState } from 'recoil';diff --git a/packages/twenty-front/src/modules/workflow/search-variables/constants/SearchVariablesDropdownId.ts b/packages/twenty-front/src/modules/workflow/search-variables/constants/SearchVariablesDropdownId.tsdeleted file mode 100644index 72ba97f811c..00000000000--- a/packages/twenty-front/src/modules/workflow/search-variables/constants/SearchVariablesDropdownId.ts+++ /dev/null@@ -1 +0,0 @@-export const SEARCH_VARIABLES_DROPDOWN_ID = 'search-variables';diff --git a/packages/twenty-front/src/modules/workflow/utils/__tests__/insertStep.test.ts b/packages/twenty-front/src/modules/workflow/utils/__tests__/insertStep.test.tsdeleted file mode 100644index 4cc05bf6b2e..00000000000--- a/packages/twenty-front/src/modules/workflow/utils/__tests__/insertStep.test.ts+++ /dev/null@@ -1,265 +0,0 @@-import { WorkflowStep, WorkflowVersion } from '@/workflow/types/Workflow';-import { insertStep } from '../insertStep';--describe('insertStep', () => {- it('returns a deep copy of the provided steps array instead of mutating it', () => {- const workflowVersionInitial = {- __typename: 'WorkflowVersion',- status: 'ACTIVE',- createdAt: '',- id: '1',- name: '',- steps: [],- trigger: {- name: 'Company created',- settings: { eventName: 'company.created', outputSchema: {} },- type: 'DATABASE_EVENT',- },- updatedAt: '',- workflowId: '',- } satisfies WorkflowVersion;- const stepToAdd: WorkflowStep = {- id: 'step-1',- name: '',- settings: {- errorHandlingOptions: {- retryOnFailure: { value: true },- continueOnFailure: { value: false },- },- input: {- serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',- serverlessFunctionVersion: '1',- serverlessFunctionInput: {},- },- outputSchema: {},- },- type: 'CODE',- valid: true,- };-- const stepsUpdated = insertStep({- steps: workflowVersionInitial.steps,- stepToAdd,- parentStepId: undefined,- });-- expect(workflowVersionInitial.steps).not.toBe(stepsUpdated);- });-- it('adds the step when the steps array is empty', () => {- const workflowVersionInitial = {- __typename: 'WorkflowVersion',- status: 'ACTIVE',- createdAt: '',- id: '1',- name: '',- steps: [],- trigger: {- name: 'Company created',- settings: { eventName: 'company.created', outputSchema: {} },- type: 'DATABASE_EVENT',- },- updatedAt: '',- workflowId: '',- } satisfies WorkflowVersion;- const stepToAdd: WorkflowStep = {- id: 'step-1',- name: '',- settings: {- errorHandlingOptions: {- retryOnFailure: { value: true },- continueOnFailure: { value: false },- },- input: {- serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',- serverlessFunctionVersion: '1',- serverlessFunctionInput: {},- },- outputSchema: {},- },- type: 'CODE',- valid: true,- };-- const stepsUpdated = insertStep({- steps: workflowVersionInitial.steps,- stepToAdd,- parentStepId: undefined,- });-- const expectedUpdatedSteps: Array<WorkflowStep> = [stepToAdd];- expect(stepsUpdated).toEqual(expectedUpdatedSteps);- });-- it('adds the step at the end of a non-empty steps array', () => {- const workflowVersionInitial = {- __typename: 'WorkflowVersion',- status: 'ACTIVE',- createdAt: '',- id: '1',- name: '',- steps: [- {- id: 'step-1',- name: '',- settings: {- errorHandlingOptions: {- retryOnFailure: { value: true },- continueOnFailure: { value: false },- },- input: {- serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',- serverlessFunctionVersion: '1',- serverlessFunctionInput: {},- },- outputSchema: {},- },- type: 'CODE',- valid: true,- },- {- id: 'step-2',- name: '',- settings: {- errorHandlingOptions: {- retryOnFailure: { value: true },- continueOnFailure: { value: false },- },- input: {- serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',- serverlessFunctionVersion: '1',- serverlessFunctionInput: {},- },- outputSchema: {},- },- type: 'CODE',- valid: true,- },- ],- trigger: {- name: 'Company created',- settings: { eventName: 'company.created', outputSchema: {} },- type: 'DATABASE_EVENT',- },- updatedAt: '',- workflowId: '',- } satisfies WorkflowVersion;- const stepToAdd: WorkflowStep = {- id: 'step-3',- name: '',- settings: {- errorHandlingOptions: {- retryOnFailure: { value: true },- continueOnFailure: { value: false },- },- input: {- serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',- serverlessFunctionVersion: '1',- serverlessFunctionInput: {},- },- outputSchema: {},- },- type: 'CODE',- valid: true,- };-- const stepsUpdated = insertStep({- steps: workflowVersionInitial.steps,- stepToAdd,- parentStepId: workflowVersionInitial.steps[1].id, // Note the selected step.- });-- const expectedUpdatedSteps: Array<WorkflowStep> = [- workflowVersionInitial.steps[0],- workflowVersionInitial.steps[1],- stepToAdd,- ];- expect(stepsUpdated).toEqual(expectedUpdatedSteps);- });-- it('adds the step in the middle of a non-empty steps array', () => {- const workflowVersionInitial = {- __typename: 'WorkflowVersion',- status: 'ACTIVE',- createdAt: '',- id: '1',- name: '',- steps: [- {- id: 'step-1',- name: '',- settings: {- errorHandlingOptions: {- retryOnFailure: { value: true },- continueOnFailure: { value: false },- },- input: {- serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',- serverlessFunctionVersion: '1',- serverlessFunctionInput: {},- },- outputSchema: {},- },- type: 'CODE',- valid: true,- },- {- id: 'step-2',- name: '',- settings: {- errorHandlingOptions: {- retryOnFailure: { value: true },- continueOnFailure: { value: false },- },- input: {- serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',- serverlessFunctionVersion: '1',- serverlessFunctionInput: {},- },- outputSchema: {},- },- type: 'CODE',- valid: true,- },- ],- trigger: {- name: 'Company created',- settings: { eventName: 'company.created', outputSchema: {} },- type: 'DATABASE_EVENT',- },- updatedAt: '',- workflowId: '',- } satisfies WorkflowVersion;- const stepToAdd: WorkflowStep = {- id: 'step-3',- name: '',- settings: {- errorHandlingOptions: {- retryOnFailure: { value: true },- continueOnFailure: { value: false },- },- input: {- serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',- serverlessFunctionVersion: '1',- serverlessFunctionInput: {},- },- outputSchema: {},- },- type: 'CODE',- valid: true,- };-- const stepsUpdated = insertStep({- steps: workflowVersionInitial.steps,- stepToAdd,- parentStepId: workflowVersionInitial.steps[0].id, // Note the selected step.- });-- const expectedUpdatedSteps: Array<WorkflowStep> = [- workflowVersionInitial.steps[0],- stepToAdd,- workflowVersionInitial.steps[1],- ];- expect(stepsUpdated).toEqual(expectedUpdatedSteps);- });-});diff --git a/packages/twenty-front/src/modules/workflow/utils/__tests__/removeStep.test.ts b/packages/twenty-front/src/modules/workflow/utils/__tests__/removeStep.test.tsdeleted file mode 100644index f4f30aafcfe..00000000000--- a/packages/twenty-front/src/modules/workflow/utils/__tests__/removeStep.test.ts+++ /dev/null@@ -1,130 +0,0 @@-import { WorkflowStep, WorkflowVersion } from '@/workflow/types/Workflow';-import { removeStep } from '../removeStep';--it('returns a deep copy of the provided steps array instead of mutating it', () => {- const stepToBeRemoved = {- id: 'step-1',- name: '',- settings: {- errorHandlingOptions: {- retryOnFailure: { value: true },- continueOnFailure: { value: false },- },- input: {- serverlessFunctionId: 'first',- serverlessFunctionVersion: '1',- serverlessFunctionInput: {},- },- outputSchema: {},- },- type: 'CODE',- valid: true,- } satisfies WorkflowStep;- const workflowVersionInitial = {- __typename: 'WorkflowVersion',- status: 'ACTIVE',- createdAt: '',- id: '1',- name: '',- steps: [stepToBeRemoved],- trigger: {- name: 'Company created',- settings: { eventName: 'company.created', outputSchema: {} },- type: 'DATABASE_EVENT',- },- updatedAt: '',- workflowId: '',- } satisfies WorkflowVersion;-- const stepsUpdated = removeStep({- steps: workflowVersionInitial.steps,- stepId: stepToBeRemoved.id,- });-- expect(workflowVersionInitial.steps).not.toBe(stepsUpdated);-});--it('removes a step in a non-empty steps array', () => {- const stepToBeRemoved: WorkflowStep = {- id: 'step-2',- name: '',- settings: {- errorHandlingOptions: {- retryOnFailure: { value: true },- continueOnFailure: { value: false },- },- input: {- serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',- serverlessFunctionVersion: '1',- serverlessFunctionInput: {},- },- outputSchema: {},- },- type: 'CODE',- valid: true,- };- const workflowVersionInitial = {- __typename: 'WorkflowVersion',- status: 'ACTIVE',- createdAt: '',- id: '1',- name: '',- steps: [- {- id: 'step-1',- name: '',- settings: {- errorHandlingOptions: {- retryOnFailure: { value: true },- continueOnFailure: { value: false },- },- input: {- serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',- serverlessFunctionVersion: '1',- serverlessFunctionInput: {},- },- outputSchema: {},- },- type: 'CODE',- valid: true,- },- stepToBeRemoved,- {- id: 'step-3',- name: '',- settings: {- errorHandlingOptions: {- retryOnFailure: { value: true },- continueOnFailure: { value: false },- },- input: {- serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',- serverlessFunctionVersion: '1',- serverlessFunctionInput: {},- },- outputSchema: {},- },- type: 'CODE',- valid: true,- },- ],- trigger: {- name: 'Company created',- settings: { eventName: 'company.created', outputSchema: {} },- type: 'DATABASE_EVENT',- },- updatedAt: '',- workflowId: '',- } satisfies WorkflowVersion;-- const stepsUpdated = removeStep({- steps: workflowVersionInitial.steps,- stepId: stepToBeRemoved.id,- });-- const expectedUpdatedSteps: Array<WorkflowStep> = [- workflowVersionInitial.steps[0],- workflowVersionInitial.steps[2],- ];- expect(stepsUpdated).toEqual(expectedUpdatedSteps);-});diff --git a/packages/twenty-front/src/modules/workflow/utils/__tests__/replaceStep.test.ts b/packages/twenty-front/src/modules/workflow/utils/__tests__/replaceStep.test.tsdeleted file mode 100644index 5e9b52e65e8..00000000000--- a/packages/twenty-front/src/modules/workflow/utils/__tests__/replaceStep.test.ts+++ /dev/null@@ -1,157 +0,0 @@-import { WorkflowStep, WorkflowVersion } from '@/workflow/types/Workflow';-import { replaceStep } from '../replaceStep';--describe('replaceStep', () => {- it('returns a deep copy of the provided steps array instead of mutating it', () => {- const stepToBeReplaced = {- id: 'step-1',- name: '',- settings: {- errorHandlingOptions: {- retryOnFailure: { value: true },- continueOnFailure: { value: false },- },- input: {- serverlessFunctionId: 'first',- serverlessFunctionVersion: '1',- serverlessFunctionInput: {},- },- outputSchema: {},- },- type: 'CODE',- valid: true,- } satisfies WorkflowStep;- const workflowVersionInitial = {- __typename: 'WorkflowVersion',- status: 'ACTIVE',- createdAt: '',- id: '1',- name: '',- steps: [stepToBeReplaced],- trigger: {- name: 'Company created',- settings: { eventName: 'company.created', outputSchema: {} },- type: 'DATABASE_EVENT',- },- updatedAt: '',- workflowId: '',- } satisfies WorkflowVersion;-- const stepsUpdated = replaceStep({- steps: workflowVersionInitial.steps,- stepToReplace: {- settings: {- errorHandlingOptions: {- retryOnFailure: { value: true },- continueOnFailure: { value: false },- },- input: {- serverlessFunctionId: 'second',- serverlessFunctionVersion: '1',- serverlessFunctionInput: {},- },- outputSchema: {},- },- },- stepId: stepToBeReplaced.id,- });-- expect(workflowVersionInitial.steps).not.toBe(stepsUpdated);- });-- it('replaces a step in a non-empty steps array', () => {- const stepToBeReplaced: WorkflowStep = {- id: 'step-2',- name: '',- settings: {- errorHandlingOptions: {- retryOnFailure: { value: true },- continueOnFailure: { value: false },- },- input: {- serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',- serverlessFunctionVersion: '1',- serverlessFunctionInput: {},- },- outputSchema: {},- },- type: 'CODE',- valid: true,- };- const workflowVersionInitial = {- __typename: 'WorkflowVersion',- status: 'ACTIVE',- createdAt: '',- id: '1',- name: '',- steps: [- {- id: 'step-1',- name: '',- settings: {- errorHandlingOptions: {- retryOnFailure: { value: true },- continueOnFailure: { value: false },- },- input: {- serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',- serverlessFunctionVersion: '1',- serverlessFunctionInput: {},- },- outputSchema: {},- },- type: 'CODE',- valid: true,- },- stepToBeReplaced,- {- id: 'step-3',- name: '',- settings: {- errorHandlingOptions: {- retryOnFailure: { value: true },- continueOnFailure: { value: false },- },- input: {- serverlessFunctionId: 'a5434be2-c10b-465c-acec-46492782a997',- serverlessFunctionVersion: '1',- serverlessFunctionInput: {},- },- outputSchema: {},- },- type: 'CODE',- valid: true,- },- ],- trigger: {- name: 'Company created',- settings: {- eventName: 'company.created',- outputSchema: {},- },- type: 'DATABASE_EVENT',- },- updatedAt: '',- workflowId: '',- } satisfies WorkflowVersion;-- const updatedStepName = "that's another name";- const stepsUpdated = replaceStep({- stepId: stepToBeReplaced.id,- steps: workflowVersionInitial.steps,- stepToReplace: {- name: updatedStepName,- },- });-- const expectedUpdatedSteps: Array<WorkflowStep> = [- workflowVersionInitial.steps[0],- {- ...stepToBeReplaced,- name: updatedStepName,- },- workflowVersionInitial.steps[2],- ];- expect(stepsUpdated).toEqual(expectedUpdatedSteps);- });-});diff --git a/packages/twenty-front/src/modules/workflow/utils/findStepPosition.ts b/packages/twenty-front/src/modules/workflow/utils/findStepPosition.tsindex 3ae23dff028..d609c3931be 100644--- a/packages/twenty-front/src/modules/workflow/utils/findStepPosition.ts+++ b/packages/twenty-front/src/modules/workflow/utils/findStepPosition.ts@@ -1,5 +1,5 @@-import { TRIGGER_STEP_ID } from '@/workflow/constants/TriggerStepId';import { WorkflowStep } from '@/workflow/types/Workflow';+import { TRIGGER_STEP_ID } from '@/workflow/workflow-trigger/constants/TriggerStepId';import { isDefined } from 'twenty-ui';/**diff --git a/packages/twenty-front/src/modules/workflow/utils/findStepPositionOrThrow.ts b/packages/twenty-front/src/modules/workflow/utils/findStepPositionOrThrow.tsdeleted file mode 100644index c20ffbcd4a6..00000000000--- a/packages/twenty-front/src/modules/workflow/utils/findStepPositionOrThrow.ts+++ /dev/null@@ -1,21 +0,0 @@-import { WorkflowStep } from '@/workflow/types/Workflow';-import { findStepPosition } from '@/workflow/utils/findStepPosition';-import { isDefined } from 'twenty-ui';--/**- * This function returns the reference of the array where the step should be positioned- * and at which index.- */-export const findStepPositionOrThrow = (props: {- steps: Array<WorkflowStep>;- stepId: string | undefined;-}): { steps: Array<WorkflowStep>; index: number } => {- const result = findStepPosition(props);- if (!isDefined(result)) {- throw new Error(- `Couldn't locate the step. Unreachable step id: ${props.stepId}.`,- );- }-- return result;-};diff --git a/packages/twenty-front/src/modules/workflow/utils/getStepDefinitionOrThrow.ts b/packages/twenty-front/src/modules/workflow/utils/getStepDefinitionOrThrow.tsindex 47ba8d4df88..e134cfb8e5a 100644--- a/packages/twenty-front/src/modules/workflow/utils/getStepDefinitionOrThrow.ts+++ b/packages/twenty-front/src/modules/workflow/utils/getStepDefinitionOrThrow.ts@@ -1,6 +1,6 @@-import { TRIGGER_STEP_ID } from '@/workflow/constants/TriggerStepId';import { WorkflowVersion } from '@/workflow/types/Workflow';import { findStepPosition } from '@/workflow/utils/findStepPosition';+import { TRIGGER_STEP_ID } from '@/workflow/workflow-trigger/constants/TriggerStepId';import { isDefined } from 'twenty-ui';export const getStepDefinitionOrThrow = ({diff --git a/packages/twenty-front/src/modules/workflow/utils/insertStep.ts b/packages/twenty-front/src/modules/workflow/utils/insertStep.tsdeleted file mode 100644index 1a6abbd5411..00000000000--- a/packages/twenty-front/src/modules/workflow/utils/insertStep.ts+++ /dev/null@@ -1,27 +0,0 @@-import { WorkflowStep } from '@/workflow/types/Workflow';-import { findStepPositionOrThrow } from '@/workflow/utils/findStepPositionOrThrow';--export const insertStep = ({- steps: stepsInitial,- stepToAdd,- parentStepId,-}: {- steps: Array<WorkflowStep>;- parentStepId: string | undefined;- stepToAdd: WorkflowStep;-}): Array<WorkflowStep> => {- const steps = structuredClone(stepsInitial);-- const parentStepPosition = findStepPositionOrThrow({- steps,- stepId: parentStepId,- });-- parentStepPosition.steps.splice(- parentStepPosition.index + 1, // The "+ 1" means that we add the step after its parent and not before.- 0,- stepToAdd,- );-- return steps;-};diff --git a/packages/twenty-front/src/modules/workflow/utils/removeStep.ts b/packages/twenty-front/src/modules/workflow/utils/removeStep.tsdeleted file mode 100644index eb6fe41dda5..00000000000--- a/packages/twenty-front/src/modules/workflow/utils/removeStep.ts+++ /dev/null@@ -1,21 +0,0 @@-import { WorkflowStep } from '@/workflow/types/Workflow';-import { findStepPositionOrThrow } from '@/workflow/utils/findStepPositionOrThrow';--export const removeStep = ({- steps: stepsInitial,- stepId,-}: {- steps: Array<WorkflowStep>;- stepId: string | undefined;-}) => {- const steps = structuredClone(stepsInitial);-- const parentStepPosition = findStepPositionOrThrow({- steps,- stepId,- });-- parentStepPosition.steps.splice(parentStepPosition.index, 1);-- return steps;-};diff --git a/packages/twenty-front/src/modules/workflow/utils/replaceStep.ts b/packages/twenty-front/src/modules/workflow/utils/replaceStep.tsdeleted file mode 100644index 0d4d4797726..00000000000--- a/packages/twenty-front/src/modules/workflow/utils/replaceStep.ts+++ /dev/null@@ -1,26 +0,0 @@-import { WorkflowStep } from '@/workflow/types/Workflow';-import { findStepPositionOrThrow } from '@/workflow/utils/findStepPositionOrThrow';--export const replaceStep = <T extends WorkflowStep>({- steps: stepsInitial,- stepId,- stepToReplace,-}: {- steps: Array<WorkflowStep>;- stepId: string;- stepToReplace: Partial<Omit<T, 'id'>>;-}) => {- const steps = structuredClone(stepsInitial);-- const parentStepPosition = findStepPositionOrThrow({- steps,- stepId,- });-- parentStepPosition.steps[parentStepPosition.index] = {- ...parentStepPosition.steps[parentStepPosition.index],- ...stepToReplace,- };-- return steps;-};diff --git a/packages/twenty-front/src/modules/workflow/components/RightDrawerWorkflowSelectAction.tsx b/packages/twenty-front/src/modules/workflow/workflow-actions/components/RightDrawerWorkflowSelectAction.tsxsimilarity index 89%rename from packages/twenty-front/src/modules/workflow/components/RightDrawerWorkflowSelectAction.tsxrename to packages/twenty-front/src/modules/workflow/workflow-actions/components/RightDrawerWorkflowSelectAction.tsxindex dadc160f4a8..1aa6be07b2d 100644--- a/packages/twenty-front/src/modules/workflow/components/RightDrawerWorkflowSelectAction.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-actions/components/RightDrawerWorkflowSelectAction.tsx@@ -1,6 +1,6 @@-import { RightDrawerWorkflowSelectActionContent } from '@/workflow/components/RightDrawerWorkflowSelectActionContent';import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';import { workflowIdState } from '@/workflow/states/workflowIdState';+import { RightDrawerWorkflowSelectActionContent } from '@/workflow/workflow-actions/components/RightDrawerWorkflowSelectActionContent';import { useRecoilValue } from 'recoil';import { isDefined } from 'twenty-ui';diff --git a/packages/twenty-front/src/modules/workflow/components/RightDrawerWorkflowSelectActionContent.tsx b/packages/twenty-front/src/modules/workflow/workflow-actions/components/RightDrawerWorkflowSelectActionContent.tsxsimilarity index 92%rename from packages/twenty-front/src/modules/workflow/components/RightDrawerWorkflowSelectActionContent.tsxrename to packages/twenty-front/src/modules/workflow/workflow-actions/components/RightDrawerWorkflowSelectActionContent.tsxindex 499c54c514a..84f93ce8c99 100644--- a/packages/twenty-front/src/modules/workflow/components/RightDrawerWorkflowSelectActionContent.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-actions/components/RightDrawerWorkflowSelectActionContent.tsx@@ -1,6 +1,6 @@-import { ACTIONS } from '@/workflow/constants/Actions';import { useCreateStep } from '@/workflow/hooks/useCreateStep';import { WorkflowWithCurrentVersion } from '@/workflow/types/Workflow';+import { ACTIONS } from '@/workflow/workflow-actions/constants/Actions';import styled from '@emotion/styled';import { MenuItem } from 'twenty-ui';diff --git a/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowEditActionFormCreateRecord.tsx b/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowEditActionFormCreateRecord.tsxindex 00eb7950616..86193b3d925 100644--- a/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowEditActionFormCreateRecord.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowEditActionFormCreateRecord.tsx@@ -3,10 +3,10 @@ import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataimport { formatFieldMetadataItemAsFieldDefinition } from '@/object-metadata/utils/formatFieldMetadataItemAsFieldDefinition';import { FormFieldInput } from '@/object-record/record-field/components/FormFieldInput';import { Select, SelectOption } from '@/ui/input/components/Select';-import { WorkflowStepBody } from '@/workflow/components/WorkflowStepBody';-import { WorkflowStepHeader } from '@/workflow/components/WorkflowStepHeader';-import { WorkflowVariablePicker } from '@/workflow/components/WorkflowVariablePicker';import { WorkflowCreateRecordAction } from '@/workflow/types/Workflow';+import { WorkflowStepBody } from '@/workflow/workflow-step/components/WorkflowStepBody';+import { WorkflowStepHeader } from '@/workflow/workflow-step/components/WorkflowStepHeader';+import { WorkflowVariablePicker } from '@/workflow/workflow-variables/components/WorkflowVariablePicker';import { useTheme } from '@emotion/react';import { useEffect, useState } from 'react';import {diff --git a/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowEditActionFormDeleteRecord.tsx b/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowEditActionFormDeleteRecord.tsxindex 19f8ee6cf3b..d1c78cb05a1 100644--- a/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowEditActionFormDeleteRecord.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowEditActionFormDeleteRecord.tsx@@ -1,8 +1,8 @@import { useFilteredObjectMetadataItems } from '@/object-metadata/hooks/useFilteredObjectMetadataItems';import { Select, SelectOption } from '@/ui/input/components/Select';-import { WorkflowSingleRecordPicker } from '@/workflow/components/WorkflowSingleRecordPicker';-import { WorkflowStepHeader } from '@/workflow/components/WorkflowStepHeader';import { WorkflowDeleteRecordAction } from '@/workflow/types/Workflow';+import { WorkflowSingleRecordPicker } from '@/workflow/workflow-actions/components/WorkflowSingleRecordPicker';+import { WorkflowStepHeader } from '@/workflow/workflow-step/components/WorkflowStepHeader';import { useTheme } from '@emotion/react';import { useEffect, useState } from 'react';import {@@ -12,7 +12,7 @@ import {useIcons,} from 'twenty-ui';-import { WorkflowStepBody } from '@/workflow/components/WorkflowStepBody';+import { WorkflowStepBody } from '@/workflow/workflow-step/components/WorkflowStepBody';import { JsonValue } from 'type-fest';import { useDebouncedCallback } from 'use-debounce';diff --git a/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowEditActionFormSendEmail.tsx b/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowEditActionFormSendEmail.tsxindex 3b8842f7c12..279f100473d 100644--- a/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowEditActionFormSendEmail.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowEditActionFormSendEmail.tsx@@ -5,11 +5,11 @@ import { useFindManyRecords } from '@/object-record/hooks/useFindManyRecords';import { FormTextFieldInput } from '@/object-record/record-field/form-types/components/FormTextFieldInput';import { useTriggerApisOAuth } from '@/settings/accounts/hooks/useTriggerApiOAuth';import { Select, SelectOption } from '@/ui/input/components/Select';-import { WorkflowStepBody } from '@/workflow/components/WorkflowStepBody';-import { WorkflowStepHeader } from '@/workflow/components/WorkflowStepHeader';-import { WorkflowVariablePicker } from '@/workflow/components/WorkflowVariablePicker';import { workflowIdState } from '@/workflow/states/workflowIdState';import { WorkflowSendEmailAction } from '@/workflow/types/Workflow';+import { WorkflowStepBody } from '@/workflow/workflow-step/components/WorkflowStepBody';+import { WorkflowStepHeader } from '@/workflow/workflow-step/components/WorkflowStepHeader';+import { WorkflowVariablePicker } from '@/workflow/workflow-variables/components/WorkflowVariablePicker';import { useTheme } from '@emotion/react';import { useEffect, useState } from 'react';import { useRecoilValue } from 'recoil';diff --git a/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowEditActionFormServerlessFunction.tsx b/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowEditActionFormServerlessFunction.tsxindex 33a924b9a73..61ac06490a6 100644--- a/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowEditActionFormServerlessFunction.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowEditActionFormServerlessFunction.tsx@@ -1,12 +1,12 @@import { useGetAvailablePackages } from '@/settings/serverless-functions/hooks/useGetAvailablePackages';import { useServerlessFunctionUpdateFormState } from '@/settings/serverless-functions/hooks/useServerlessFunctionUpdateFormState';import { useUpdateOneServerlessFunction } from '@/settings/serverless-functions/hooks/useUpdateOneServerlessFunction';-import { WorkflowStepHeader } from '@/workflow/components/WorkflowStepHeader';import { useGetUpdatableWorkflowVersion } from '@/workflow/hooks/useGetUpdatableWorkflowVersion';import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';import { workflowIdState } from '@/workflow/states/workflowIdState';import { WorkflowCodeAction } from '@/workflow/types/Workflow';-import { setNestedValue } from '@/workflow/utils/setNestedValue';+import { setNestedValue } from '@/workflow/workflow-actions/utils/setNestedValue';+import { WorkflowStepHeader } from '@/workflow/workflow-step/components/WorkflowStepHeader';import { CmdEnterActionButton } from '@/action-menu/components/CmdEnterActionButton';import { ServerlessFunctionExecutionResult } from '@/serverless-functions/components/ServerlessFunctionExecutionResult';@@ -19,11 +19,11 @@ import { InputLabel } from '@/ui/input/components/InputLabel';import { RightDrawerFooter } from '@/ui/layout/right-drawer/components/RightDrawerFooter';import { TabList } from '@/ui/layout/tab/components/TabList';import { useTabList } from '@/ui/layout/tab/hooks/useTabList';-import { WorkflowStepBody } from '@/workflow/components/WorkflowStepBody';-import { WorkflowVariablePicker } from '@/workflow/components/WorkflowVariablePicker';import { serverlessFunctionTestDataFamilyState } from '@/workflow/states/serverlessFunctionTestDataFamilyState';import { WorkflowEditActionFormServerlessFunctionFields } from '@/workflow/workflow-actions/components/WorkflowEditActionFormServerlessFunctionFields';import { WORKFLOW_SERVERLESS_FUNCTION_TAB_LIST_COMPONENT_ID } from '@/workflow/workflow-actions/constants/WorkflowServerlessFunctionTabListComponentId';+import { WorkflowStepBody } from '@/workflow/workflow-step/components/WorkflowStepBody';+import { WorkflowVariablePicker } from '@/workflow/workflow-variables/components/WorkflowVariablePicker';import { useTheme } from '@emotion/react';import styled from '@emotion/styled';import { Monaco } from '@monaco-editor/react';diff --git a/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowEditActionFormServerlessFunctionFields.tsx b/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowEditActionFormServerlessFunctionFields.tsxindex 9ecf3278cff..bb3933ff8fa 100644--- a/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowEditActionFormServerlessFunctionFields.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowEditActionFormServerlessFunctionFields.tsx@@ -1,11 +1,11 @@-import { FunctionInput } from '@/workflow/types/FunctionInput';+import { FormNestedFieldInputContainer } from '@/object-record/record-field/form-types/components/FormNestedFieldInputContainer';+import { FormTextFieldInput } from '@/object-record/record-field/form-types/components/FormTextFieldInput';import { VariablePickerComponent } from '@/object-record/record-field/form-types/types/VariablePickerComponent';-import { isObject } from '@sniptt/guards';import { InputLabel } from '@/ui/input/components/InputLabel';-import { FormTextFieldInput } from '@/object-record/record-field/form-types/components/FormTextFieldInput';+import { FunctionInput } from '@/workflow/workflow-actions/types/FunctionInput';import styled from '@emotion/styled';+import { isObject } from '@sniptt/guards';import { ReactNode } from 'react';-import { FormNestedFieldInputContainer } from '@/object-record/record-field/form-types/components/FormNestedFieldInputContainer';const StyledContainer = styled.div`display: inline-flex;diff --git a/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowEditActionFormUpdateRecord.tsx b/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowEditActionFormUpdateRecord.tsxindex e36d19ebb14..c19787b6bb5 100644--- a/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowEditActionFormUpdateRecord.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowEditActionFormUpdateRecord.tsx@@ -13,10 +13,10 @@ import {import { formatFieldMetadataItemAsFieldDefinition } from '@/object-metadata/utils/formatFieldMetadataItemAsFieldDefinition';import { FormFieldInput } from '@/object-record/record-field/components/FormFieldInput';import { FormMultiSelectFieldInput } from '@/object-record/record-field/form-types/components/FormMultiSelectFieldInput';-import { WorkflowSingleRecordPicker } from '@/workflow/components/WorkflowSingleRecordPicker';-import { WorkflowStepBody } from '@/workflow/components/WorkflowStepBody';-import { WorkflowStepHeader } from '@/workflow/components/WorkflowStepHeader';-import { WorkflowVariablePicker } from '@/workflow/components/WorkflowVariablePicker';+import { WorkflowSingleRecordPicker } from '@/workflow/workflow-actions/components/WorkflowSingleRecordPicker';+import { WorkflowStepBody } from '@/workflow/workflow-step/components/WorkflowStepBody';+import { WorkflowStepHeader } from '@/workflow/workflow-step/components/WorkflowStepHeader';+import { WorkflowVariablePicker } from '@/workflow/workflow-variables/components/WorkflowVariablePicker';import { JsonValue } from 'type-fest';import { useDebouncedCallback } from 'use-debounce';import { FieldMetadataType } from '~/generated-metadata/graphql';diff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowSingleRecordFieldChip.tsx b/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowSingleRecordFieldChip.tsxsimilarity index 96%rename from packages/twenty-front/src/modules/workflow/components/WorkflowSingleRecordFieldChip.tsxrename to packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowSingleRecordFieldChip.tsxindex 654e13ffed6..0facb4da0db 100644--- a/packages/twenty-front/src/modules/workflow/components/WorkflowSingleRecordFieldChip.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowSingleRecordFieldChip.tsx@@ -2,11 +2,11 @@ import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataimport { RecordChip } from '@/object-record/components/RecordChip';import { VariableChip } from '@/object-record/record-field/form-types/components/VariableChip';import { ObjectRecord } from '@/object-record/types/ObjectRecord';+import { isStandaloneVariableString } from '@/workflow/utils/isStandaloneVariableString';import {RecordId,Variable,-} from '@/workflow/components/WorkflowSingleRecordPicker';-import { isStandaloneVariableString } from '@/workflow/utils/isStandaloneVariableString';+} from '@/workflow/workflow-actions/components/WorkflowSingleRecordPicker';import styled from '@emotion/styled';const StyledRecordChip = styled(RecordChip)`diff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowSingleRecordPicker.tsx b/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowSingleRecordPicker.tsxsimilarity index 96%rename from packages/twenty-front/src/modules/workflow/components/WorkflowSingleRecordPicker.tsxrename to packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowSingleRecordPicker.tsxindex 9e3294952a5..622e858ead3 100644--- a/packages/twenty-front/src/modules/workflow/components/WorkflowSingleRecordPicker.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-actions/components/WorkflowSingleRecordPicker.tsx@@ -16,9 +16,9 @@ import { InputLabel } from '@/ui/input/components/InputLabel';import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown';import { DropdownScope } from '@/ui/layout/dropdown/scopes/DropdownScope';-import { WorkflowSingleRecordFieldChip } from '@/workflow/components/WorkflowSingleRecordFieldChip';-import { SearchVariablesDropdown } from '@/workflow/search-variables/components/SearchVariablesDropdown';import { isStandaloneVariableString } from '@/workflow/utils/isStandaloneVariableString';+import { WorkflowSingleRecordFieldChip } from '@/workflow/workflow-actions/components/WorkflowSingleRecordFieldChip';+import { WorkflowVariablesDropdown } from '@/workflow/workflow-variables/components/WorkflowVariablesDropdown';import { css } from '@emotion/react';import styled from '@emotion/styled';import { useCallback } from 'react';@@ -186,7 +186,7 @@ export const WorkflowSingleRecordPicker = ({</DropdownScope></StyledFormSelectContainer><StyledSearchVariablesDropdownContainer>- <SearchVariablesDropdown+ <WorkflowVariablesDropdowninputId={variablesDropdownId}onVariableSelect={handleVariableTagInsert}disabled={false}diff --git a/packages/twenty-front/src/modules/workflow/constants/Actions.ts b/packages/twenty-front/src/modules/workflow/workflow-actions/constants/Actions.tssimilarity index 100%rename from packages/twenty-front/src/modules/workflow/constants/Actions.tsrename to packages/twenty-front/src/modules/workflow/workflow-actions/constants/Actions.tsdiff --git a/packages/twenty-front/src/modules/workflow/types/FunctionInput.ts b/packages/twenty-front/src/modules/workflow/workflow-actions/types/FunctionInput.tssimilarity index 100%rename from packages/twenty-front/src/modules/workflow/types/FunctionInput.tsrename to packages/twenty-front/src/modules/workflow/workflow-actions/types/FunctionInput.tsdiff --git a/packages/twenty-front/src/modules/workflow/utils/__tests__/setNestedValue.test.ts b/packages/twenty-front/src/modules/workflow/workflow-actions/utils/__tests__/setNestedValue.test.tssimilarity index 90%rename from packages/twenty-front/src/modules/workflow/utils/__tests__/setNestedValue.test.tsrename to packages/twenty-front/src/modules/workflow/workflow-actions/utils/__tests__/setNestedValue.test.tsindex 87386c793c5..ba3b1369f2a 100644--- a/packages/twenty-front/src/modules/workflow/utils/__tests__/setNestedValue.test.ts+++ b/packages/twenty-front/src/modules/workflow/workflow-actions/utils/__tests__/setNestedValue.test.ts@@ -1,4 +1,4 @@-import { setNestedValue } from '@/workflow/utils/setNestedValue';+import { setNestedValue } from '@/workflow/workflow-actions/utils/setNestedValue';describe('setNestedValue', () => {it('should set nested value properly', () => {diff --git a/packages/twenty-front/src/modules/workflow/utils/setNestedValue.ts b/packages/twenty-front/src/modules/workflow/workflow-actions/utils/setNestedValue.tssimilarity index 100%rename from packages/twenty-front/src/modules/workflow/utils/setNestedValue.tsrename to packages/twenty-front/src/modules/workflow/workflow-actions/utils/setNestedValue.tsdiff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowDiagramBaseStepNode.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramBaseStepNode.tsxsimilarity index 97%rename from packages/twenty-front/src/modules/workflow/components/WorkflowDiagramBaseStepNode.tsxrename to packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramBaseStepNode.tsxindex caf1dc8565f..3717bd8a914 100644--- a/packages/twenty-front/src/modules/workflow/components/WorkflowDiagramBaseStepNode.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramBaseStepNode.tsx@@ -1,4 +1,4 @@-import { WorkflowDiagramStepNodeData } from '@/workflow/types/WorkflowDiagram';+import { WorkflowDiagramStepNodeData } from '@/workflow/workflow-diagram/types/WorkflowDiagram';import styled from '@emotion/styled';import { Handle, Position } from '@xyflow/react';import React from 'react';diff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowDiagramCanvasBase.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCanvasBase.tsxsimilarity index 94%rename from packages/twenty-front/src/modules/workflow/components/WorkflowDiagramCanvasBase.tsxrename to packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCanvasBase.tsxindex 803e117235d..3c72f609e3c 100644--- a/packages/twenty-front/src/modules/workflow/components/WorkflowDiagramCanvasBase.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCanvasBase.tsx@@ -1,16 +1,18 @@+import { useListenRightDrawerClose } from '@/ui/layout/right-drawer/hooks/useListenRightDrawerClose';import { isRightDrawerMinimizedState } from '@/ui/layout/right-drawer/states/isRightDrawerMinimizedState';import { isRightDrawerOpenState } from '@/ui/layout/right-drawer/states/isRightDrawerOpenState';import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';-import { WorkflowVersionStatusTag } from '@/workflow/components/WorkflowVersionStatusTag';-import { workflowDiagramState } from '@/workflow/states/workflowDiagramState';+import { workflowReactFlowRefState } from '@/workflow/states/workflowReactFlowRefState';import { WorkflowVersionStatus } from '@/workflow/types/Workflow';+import { WorkflowVersionStatusTag } from '@/workflow/workflow-diagram/components/WorkflowVersionStatusTag';+import { workflowDiagramState } from '@/workflow/workflow-diagram/states/workflowDiagramState';import {WorkflowDiagram,WorkflowDiagramEdge,WorkflowDiagramNode,WorkflowDiagramNodeType,-} from '@/workflow/types/WorkflowDiagram';-import { getOrganizedDiagram } from '@/workflow/utils/getOrganizedDiagram';+} from '@/workflow/workflow-diagram/types/WorkflowDiagram';+import { getOrganizedDiagram } from '@/workflow/workflow-diagram/utils/getOrganizedDiagram';import styled from '@emotion/styled';import {applyEdgeChanges,@@ -28,8 +30,6 @@ import '@xyflow/react/dist/style.css';import React, { useEffect, useMemo, useRef } from 'react';import { useRecoilValue, useSetRecoilState } from 'recoil';import { GRAY_SCALE, isDefined, THEME_COMMON } from 'twenty-ui';-import { useListenRightDrawerClose } from '@/ui/layout/right-drawer/hooks/useListenRightDrawerClose';-import { workflowReactFlowRefState } from '@/workflow/states/workflowReactFlowRefState';const StyledResetReactflowStyles = styled.div`height: 100%;diff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowDiagramCanvasEditable.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCanvasEditable.tsxsimilarity index 58%rename from packages/twenty-front/src/modules/workflow/components/WorkflowDiagramCanvasEditable.tsxrename to packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCanvasEditable.tsxindex 33a0ff62bc1..e14ad6879fc 100644--- a/packages/twenty-front/src/modules/workflow/components/WorkflowDiagramCanvasEditable.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCanvasEditable.tsx@@ -1,10 +1,10 @@-import { WorkflowDiagramCanvasBase } from '@/workflow/components/WorkflowDiagramCanvasBase';-import { WorkflowDiagramCanvasEditableEffect } from '@/workflow/components/WorkflowDiagramCanvasEditableEffect';-import { WorkflowDiagramCreateStepNode } from '@/workflow/components/WorkflowDiagramCreateStepNode';-import { WorkflowDiagramEmptyTrigger } from '@/workflow/components/WorkflowDiagramEmptyTrigger';-import { WorkflowDiagramStepNodeEditable } from '@/workflow/components/WorkflowDiagramStepNodeEditable';import { WorkflowWithCurrentVersion } from '@/workflow/types/Workflow';-import { WorkflowDiagram } from '@/workflow/types/WorkflowDiagram';+import { WorkflowDiagramCanvasBase } from '@/workflow/workflow-diagram/components/WorkflowDiagramCanvasBase';+import { WorkflowDiagramCanvasEditableEffect } from '@/workflow/workflow-diagram/components/WorkflowDiagramCanvasEditableEffect';+import { WorkflowDiagramCreateStepNode } from '@/workflow/workflow-diagram/components/WorkflowDiagramCreateStepNode';+import { WorkflowDiagramEmptyTrigger } from '@/workflow/workflow-diagram/components/WorkflowDiagramEmptyTrigger';+import { WorkflowDiagramStepNodeEditable } from '@/workflow/workflow-diagram/components/WorkflowDiagramStepNodeEditable';+import { WorkflowDiagram } from '@/workflow/workflow-diagram/types/WorkflowDiagram';import { ReactFlowProvider } from '@xyflow/react';export const WorkflowDiagramCanvasEditable = ({diff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowDiagramCanvasEditableEffect.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCanvasEditableEffect.tsxsimilarity index 89%rename from packages/twenty-front/src/modules/workflow/components/WorkflowDiagramCanvasEditableEffect.tsxrename to packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCanvasEditableEffect.tsxindex ae68427e792..41a0dcbf22c 100644--- a/packages/twenty-front/src/modules/workflow/components/WorkflowDiagramCanvasEditableEffect.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCanvasEditableEffect.tsx@@ -2,12 +2,12 @@ import { useRightDrawer } from '@/ui/layout/right-drawer/hooks/useRightDrawer';import { RightDrawerHotkeyScope } from '@/ui/layout/right-drawer/types/RightDrawerHotkeyScope';import { RightDrawerPages } from '@/ui/layout/right-drawer/types/RightDrawerPages';import { useSetHotkeyScope } from '@/ui/utilities/hotkey/hooks/useSetHotkeyScope';-import { CREATE_STEP_STEP_ID } from '@/workflow/constants/CreateStepStepId';-import { EMPTY_TRIGGER_STEP_ID } from '@/workflow/constants/EmptyTriggerStepId';import { useStartNodeCreation } from '@/workflow/hooks/useStartNodeCreation';import { useTriggerNodeSelection } from '@/workflow/hooks/useTriggerNodeSelection';import { workflowSelectedNodeState } from '@/workflow/states/workflowSelectedNodeState';-import { WorkflowDiagramNode } from '@/workflow/types/WorkflowDiagram';+import { CREATE_STEP_STEP_ID } from '@/workflow/workflow-diagram/constants/CreateStepStepId';+import { EMPTY_TRIGGER_STEP_ID } from '@/workflow/workflow-diagram/constants/EmptyTriggerStepId';+import { WorkflowDiagramNode } from '@/workflow/workflow-diagram/types/WorkflowDiagram';import { OnSelectionChangeParams, useOnSelectionChange } from '@xyflow/react';import { useCallback } from 'react';import { useSetRecoilState } from 'recoil';diff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowDiagramCanvasReadonly.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCanvasReadonly.tsxsimilarity index 59%rename from packages/twenty-front/src/modules/workflow/components/WorkflowDiagramCanvasReadonly.tsxrename to packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCanvasReadonly.tsxindex bb65a9b8379..8a7b4290233 100644--- a/packages/twenty-front/src/modules/workflow/components/WorkflowDiagramCanvasReadonly.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCanvasReadonly.tsx@@ -1,9 +1,9 @@-import { WorkflowDiagramCanvasBase } from '@/workflow/components/WorkflowDiagramCanvasBase';-import { WorkflowDiagramCanvasReadonlyEffect } from '@/workflow/components/WorkflowDiagramCanvasReadonlyEffect';-import { WorkflowDiagramEmptyTrigger } from '@/workflow/components/WorkflowDiagramEmptyTrigger';-import { WorkflowDiagramStepNodeReadonly } from '@/workflow/components/WorkflowDiagramStepNodeReadonly';import { WorkflowVersion } from '@/workflow/types/Workflow';-import { WorkflowDiagram } from '@/workflow/types/WorkflowDiagram';+import { WorkflowDiagramCanvasBase } from '@/workflow/workflow-diagram/components/WorkflowDiagramCanvasBase';+import { WorkflowDiagramCanvasReadonlyEffect } from '@/workflow/workflow-diagram/components/WorkflowDiagramCanvasReadonlyEffect';+import { WorkflowDiagramEmptyTrigger } from '@/workflow/workflow-diagram/components/WorkflowDiagramEmptyTrigger';+import { WorkflowDiagramStepNodeReadonly } from '@/workflow/workflow-diagram/components/WorkflowDiagramStepNodeReadonly';+import { WorkflowDiagram } from '@/workflow/workflow-diagram/types/WorkflowDiagram';import { ReactFlowProvider } from '@xyflow/react';export const WorkflowDiagramCanvasReadonly = ({diff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowDiagramCanvasReadonlyEffect.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCanvasReadonlyEffect.tsxsimilarity index 94%rename from packages/twenty-front/src/modules/workflow/components/WorkflowDiagramCanvasReadonlyEffect.tsxrename to packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCanvasReadonlyEffect.tsxindex e823ce2c6d5..c86fdf09d41 100644--- a/packages/twenty-front/src/modules/workflow/components/WorkflowDiagramCanvasReadonlyEffect.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCanvasReadonlyEffect.tsx@@ -4,7 +4,7 @@ import { RightDrawerPages } from '@/ui/layout/right-drawer/types/RightDrawerPageimport { useSetHotkeyScope } from '@/ui/utilities/hotkey/hooks/useSetHotkeyScope';import { useTriggerNodeSelection } from '@/workflow/hooks/useTriggerNodeSelection';import { workflowSelectedNodeState } from '@/workflow/states/workflowSelectedNodeState';-import { WorkflowDiagramNode } from '@/workflow/types/WorkflowDiagram';+import { WorkflowDiagramNode } from '@/workflow/workflow-diagram/types/WorkflowDiagram';import { OnSelectionChangeParams, useOnSelectionChange } from '@xyflow/react';import { useCallback } from 'react';import { useSetRecoilState } from 'recoil';diff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowDiagramCreateStepNode.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCreateStepNode.tsxsimilarity index 100%rename from packages/twenty-front/src/modules/workflow/components/WorkflowDiagramCreateStepNode.tsxrename to packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCreateStepNode.tsxdiff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowDiagramEffect.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramEffect.tsxsimilarity index 85%rename from packages/twenty-front/src/modules/workflow/components/WorkflowDiagramEffect.tsxrename to packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramEffect.tsxindex 011d93f600d..2ce093d09a3 100644--- a/packages/twenty-front/src/modules/workflow/components/WorkflowDiagramEffect.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramEffect.tsx@@ -1,14 +1,14 @@import { getSnapshotValue } from '@/ui/utilities/state/utils/getSnapshotValue';-import { workflowDiagramState } from '@/workflow/states/workflowDiagramState';import { workflowLastCreatedStepIdState } from '@/workflow/states/workflowLastCreatedStepIdState';import {WorkflowVersion,WorkflowWithCurrentVersion,} from '@/workflow/types/Workflow';+import { workflowDiagramState } from '@/workflow/workflow-diagram/states/workflowDiagramState';-import { addCreateStepNodes } from '@/workflow/utils/addCreateStepNodes';-import { getWorkflowVersionDiagram } from '@/workflow/utils/getWorkflowVersionDiagram';-import { mergeWorkflowDiagrams } from '@/workflow/utils/mergeWorkflowDiagrams';+import { addCreateStepNodes } from '@/workflow/workflow-diagram/utils/addCreateStepNodes';+import { getWorkflowVersionDiagram } from '@/workflow/workflow-diagram/utils/getWorkflowVersionDiagram';+import { mergeWorkflowDiagrams } from '@/workflow/workflow-diagram/utils/mergeWorkflowDiagrams';import { useEffect } from 'react';import { useRecoilCallback, useSetRecoilState } from 'recoil';import { isDefined } from 'twenty-ui';diff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowDiagramEmptyTrigger.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramEmptyTrigger.tsxsimilarity index 87%rename from packages/twenty-front/src/modules/workflow/components/WorkflowDiagramEmptyTrigger.tsxrename to packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramEmptyTrigger.tsxindex 68f4c0e66c6..0f59db3dcdd 100644--- a/packages/twenty-front/src/modules/workflow/components/WorkflowDiagramEmptyTrigger.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramEmptyTrigger.tsx@@ -1,4 +1,4 @@-import { WorkflowDiagramBaseStepNode } from '@/workflow/components/WorkflowDiagramBaseStepNode';+import { WorkflowDiagramBaseStepNode } from '@/workflow/workflow-diagram/components/WorkflowDiagramBaseStepNode';import { useTheme } from '@emotion/react';import styled from '@emotion/styled';import { IconPlaylistAdd } from 'twenty-ui';diff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowDiagramStepNodeBase.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramStepNodeBase.tsxsimilarity index 93%rename from packages/twenty-front/src/modules/workflow/components/WorkflowDiagramStepNodeBase.tsxrename to packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramStepNodeBase.tsxindex b2138d89bd7..50f9e65eb92 100644--- a/packages/twenty-front/src/modules/workflow/components/WorkflowDiagramStepNodeBase.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramStepNodeBase.tsx@@ -1,6 +1,6 @@-import { WorkflowDiagramBaseStepNode } from '@/workflow/components/WorkflowDiagramBaseStepNode';-import { WorkflowDiagramStepNodeData } from '@/workflow/types/WorkflowDiagram';import { assertUnreachable } from '@/workflow/utils/assertUnreachable';+import { WorkflowDiagramBaseStepNode } from '@/workflow/workflow-diagram/components/WorkflowDiagramBaseStepNode';+import { WorkflowDiagramStepNodeData } from '@/workflow/workflow-diagram/types/WorkflowDiagram';import { useTheme } from '@emotion/react';import styled from '@emotion/styled';import {diff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowDiagramStepNodeEditable.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramStepNodeEditable.tsxsimilarity index 85%rename from packages/twenty-front/src/modules/workflow/components/WorkflowDiagramStepNodeEditable.tsxrename to packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramStepNodeEditable.tsxindex e479e9d3b59..e77af8bd085 100644--- a/packages/twenty-front/src/modules/workflow/components/WorkflowDiagramStepNodeEditable.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramStepNodeEditable.tsx@@ -1,9 +1,9 @@-import { WorkflowDiagramStepNodeBase } from '@/workflow/components/WorkflowDiagramStepNodeBase';import { useDeleteStep } from '@/workflow/hooks/useDeleteStep';import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';import { workflowIdState } from '@/workflow/states/workflowIdState';-import { WorkflowDiagramStepNodeData } from '@/workflow/types/WorkflowDiagram';import { assertWorkflowWithCurrentVersionIsDefined } from '@/workflow/utils/assertWorkflowWithCurrentVersionIsDefined';+import { WorkflowDiagramStepNodeBase } from '@/workflow/workflow-diagram/components/WorkflowDiagramStepNodeBase';+import { WorkflowDiagramStepNodeData } from '@/workflow/workflow-diagram/types/WorkflowDiagram';import { useRecoilValue } from 'recoil';import { FloatingIconButton, IconTrash } from 'twenty-ui';diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramStepNodeReadonly.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramStepNodeReadonly.tsxnew file mode 100644index 00000000000..d02f518d413--- /dev/null+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramStepNodeReadonly.tsx@@ -0,0 +1,10 @@+import { WorkflowDiagramStepNodeBase } from '@/workflow/workflow-diagram/components/WorkflowDiagramStepNodeBase';+import { WorkflowDiagramStepNodeData } from '@/workflow/workflow-diagram/types/WorkflowDiagram';++export const WorkflowDiagramStepNodeReadonly = ({+ data,+}: {+ data: WorkflowDiagramStepNodeData;+}) => {+ return <WorkflowDiagramStepNodeBase data={data} />;+};diff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowVersionStatusTag.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowVersionStatusTag.tsxsimilarity index 100%rename from packages/twenty-front/src/modules/workflow/components/WorkflowVersionStatusTag.tsxrename to packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowVersionStatusTag.tsxdiff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowVersionVisualizer.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowVersionVisualizer.tsxsimilarity index 74%rename from packages/twenty-front/src/modules/workflow/components/WorkflowVersionVisualizer.tsxrename to packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowVersionVisualizer.tsxindex 966688a7fa4..16070202cea 100644--- a/packages/twenty-front/src/modules/workflow/components/WorkflowVersionVisualizer.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowVersionVisualizer.tsx@@ -1,6 +1,6 @@-import { WorkflowDiagramCanvasReadonly } from '@/workflow/components/WorkflowDiagramCanvasReadonly';import { useWorkflowVersion } from '@/workflow/hooks/useWorkflowVersion';-import { workflowDiagramState } from '@/workflow/states/workflowDiagramState';+import { WorkflowDiagramCanvasReadonly } from '@/workflow/workflow-diagram/components/WorkflowDiagramCanvasReadonly';+import { workflowDiagramState } from '@/workflow/workflow-diagram/states/workflowDiagramState';import '@xyflow/react/dist/style.css';import { useRecoilValue } from 'recoil';import { isDefined } from 'twenty-ui';diff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowVersionVisualizerEffect.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowVersionVisualizerEffect.tsxsimilarity index 83%rename from packages/twenty-front/src/modules/workflow/components/WorkflowVersionVisualizerEffect.tsxrename to packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowVersionVisualizerEffect.tsxindex 270c5c94401..1df237c3d05 100644--- a/packages/twenty-front/src/modules/workflow/components/WorkflowVersionVisualizerEffect.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowVersionVisualizerEffect.tsx@@ -1,7 +1,7 @@import { useWorkflowVersion } from '@/workflow/hooks/useWorkflowVersion';-import { workflowDiagramState } from '@/workflow/states/workflowDiagramState';import { workflowVersionIdState } from '@/workflow/states/workflowVersionIdState';-import { getWorkflowVersionDiagram } from '@/workflow/utils/getWorkflowVersionDiagram';+import { workflowDiagramState } from '@/workflow/workflow-diagram/states/workflowDiagramState';+import { getWorkflowVersionDiagram } from '@/workflow/workflow-diagram/utils/getWorkflowVersionDiagram';import { useEffect } from 'react';import { useSetRecoilState } from 'recoil';import { isDefined } from 'twenty-ui';diff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowVisualizer.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowVisualizer.tsxsimilarity index 75%rename from packages/twenty-front/src/modules/workflow/components/WorkflowVisualizer.tsxrename to packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowVisualizer.tsxindex 20099a25538..e7235616099 100644--- a/packages/twenty-front/src/modules/workflow/components/WorkflowVisualizer.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowVisualizer.tsx@@ -1,8 +1,8 @@import { ActivityTargetableObject } from '@/activities/types/ActivityTargetableEntity';-import { WorkflowDiagramCanvasEditable } from '@/workflow/components/WorkflowDiagramCanvasEditable';-import { WorkflowDiagramEffect } from '@/workflow/components/WorkflowDiagramEffect';import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';-import { workflowDiagramState } from '@/workflow/states/workflowDiagramState';+import { WorkflowDiagramCanvasEditable } from '@/workflow/workflow-diagram/components/WorkflowDiagramCanvasEditable';+import { WorkflowDiagramEffect } from '@/workflow/workflow-diagram/components/WorkflowDiagramEffect';+import { workflowDiagramState } from '@/workflow/workflow-diagram/states/workflowDiagramState';import '@xyflow/react/dist/style.css';import { useRecoilValue } from 'recoil';import { isDefined } from 'twenty-ui';diff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowVisualizerEffect.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowVisualizerEffect.tsxsimilarity index 100%rename from packages/twenty-front/src/modules/workflow/components/WorkflowVisualizerEffect.tsxrename to packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowVisualizerEffect.tsxdiff --git a/packages/twenty-front/src/modules/workflow/components/__stories__/WorkflowVersionStatusTag.stories.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/__stories__/WorkflowVersionStatusTag.stories.tsxsimilarity index 100%rename from packages/twenty-front/src/modules/workflow/components/__stories__/WorkflowVersionStatusTag.stories.tsxrename to packages/twenty-front/src/modules/workflow/workflow-diagram/components/__stories__/WorkflowVersionStatusTag.stories.tsxdiff --git a/packages/twenty-front/src/modules/workflow/constants/CreateStepStepId.ts b/packages/twenty-front/src/modules/workflow/workflow-diagram/constants/CreateStepStepId.tssimilarity index 100%rename from packages/twenty-front/src/modules/workflow/constants/CreateStepStepId.tsrename to packages/twenty-front/src/modules/workflow/workflow-diagram/constants/CreateStepStepId.tsdiff --git a/packages/twenty-front/src/modules/workflow/constants/EmptyTriggerStepId.ts b/packages/twenty-front/src/modules/workflow/workflow-diagram/constants/EmptyTriggerStepId.tssimilarity index 100%rename from packages/twenty-front/src/modules/workflow/constants/EmptyTriggerStepId.tsrename to packages/twenty-front/src/modules/workflow/workflow-diagram/constants/EmptyTriggerStepId.tsdiff --git a/packages/twenty-front/src/modules/workflow/states/workflowDiagramState.ts b/packages/twenty-front/src/modules/workflow/workflow-diagram/states/workflowDiagramState.tssimilarity index 71%rename from packages/twenty-front/src/modules/workflow/states/workflowDiagramState.tsrename to packages/twenty-front/src/modules/workflow/workflow-diagram/states/workflowDiagramState.tsindex 2d2f22a7c83..740370e6e2a 100644--- a/packages/twenty-front/src/modules/workflow/states/workflowDiagramState.ts+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/states/workflowDiagramState.ts@@ -1,5 +1,5 @@-import { WorkflowDiagram } from '@/workflow/types/WorkflowDiagram';import { createState } from '@ui/utilities/state/utils/createState';+import { WorkflowDiagram } from '@/workflow/workflow-diagram/types/WorkflowDiagram';export const workflowDiagramState = createState<WorkflowDiagram | undefined>({key: 'workflowDiagramState',diff --git a/packages/twenty-front/src/modules/workflow/types/WorkflowDiagram.ts b/packages/twenty-front/src/modules/workflow/workflow-diagram/types/WorkflowDiagram.tssimilarity index 100%rename from packages/twenty-front/src/modules/workflow/types/WorkflowDiagram.tsrename to packages/twenty-front/src/modules/workflow/workflow-diagram/types/WorkflowDiagram.tsdiff --git a/packages/twenty-front/src/modules/workflow/utils/__tests__/addCreateStepNodes.test.ts b/packages/twenty-front/src/modules/workflow/workflow-diagram/utils/__tests__/addCreateStepNodes.test.tssimilarity index 96%rename from packages/twenty-front/src/modules/workflow/utils/__tests__/addCreateStepNodes.test.tsrename to packages/twenty-front/src/modules/workflow/workflow-diagram/utils/__tests__/addCreateStepNodes.test.tsindex 6d56a51589f..4cedd97de0f 100644--- a/packages/twenty-front/src/modules/workflow/utils/__tests__/addCreateStepNodes.test.ts+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/utils/__tests__/addCreateStepNodes.test.ts@@ -1,5 +1,5 @@import { WorkflowStep, WorkflowTrigger } from '@/workflow/types/Workflow';-import { generateWorkflowDiagram } from '@/workflow/utils/generateWorkflowDiagram';+import { generateWorkflowDiagram } from '@/workflow/workflow-diagram/utils/generateWorkflowDiagram';import { addCreateStepNodes } from '../addCreateStepNodes';describe('addCreateStepNodes', () => {diff --git a/packages/twenty-front/src/modules/workflow/utils/__tests__/generateWorkflowDiagram.test.ts b/packages/twenty-front/src/modules/workflow/workflow-diagram/utils/__tests__/generateWorkflowDiagram.test.tssimilarity index 100%rename from packages/twenty-front/src/modules/workflow/utils/__tests__/generateWorkflowDiagram.test.tsrename to packages/twenty-front/src/modules/workflow/workflow-diagram/utils/__tests__/generateWorkflowDiagram.test.tsdiff --git a/packages/twenty-front/src/modules/workflow/utils/__tests__/getWorkflowVersionDiagram.test.ts b/packages/twenty-front/src/modules/workflow/workflow-diagram/utils/__tests__/getWorkflowVersionDiagram.test.tssimilarity index 100%rename from packages/twenty-front/src/modules/workflow/utils/__tests__/getWorkflowVersionDiagram.test.tsrename to packages/twenty-front/src/modules/workflow/workflow-diagram/utils/__tests__/getWorkflowVersionDiagram.test.tsdiff --git a/packages/twenty-front/src/modules/workflow/utils/__tests__/mergeWorkflowDiagrams.test.ts b/packages/twenty-front/src/modules/workflow/workflow-diagram/utils/__tests__/mergeWorkflowDiagrams.test.tssimilarity index 95%rename from packages/twenty-front/src/modules/workflow/utils/__tests__/mergeWorkflowDiagrams.test.tsrename to packages/twenty-front/src/modules/workflow/workflow-diagram/utils/__tests__/mergeWorkflowDiagrams.test.tsindex 4005ff04711..a1f39ae5d38 100644--- a/packages/twenty-front/src/modules/workflow/utils/__tests__/mergeWorkflowDiagrams.test.ts+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/utils/__tests__/mergeWorkflowDiagrams.test.ts@@ -1,4 +1,4 @@-import { WorkflowDiagram } from '@/workflow/types/WorkflowDiagram';+import { WorkflowDiagram } from '@/workflow/workflow-diagram/types/WorkflowDiagram';import { mergeWorkflowDiagrams } from '../mergeWorkflowDiagrams';it('Preserves the properties defined in the previous version but not in the next one', () => {diff --git a/packages/twenty-front/src/modules/workflow/utils/addCreateStepNodes.ts b/packages/twenty-front/src/modules/workflow/workflow-diagram/utils/addCreateStepNodes.tssimilarity index 95%rename from packages/twenty-front/src/modules/workflow/utils/addCreateStepNodes.tsrename to packages/twenty-front/src/modules/workflow/workflow-diagram/utils/addCreateStepNodes.tsindex 1e76140993f..ca9d1150539 100644--- a/packages/twenty-front/src/modules/workflow/utils/addCreateStepNodes.ts+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/utils/addCreateStepNodes.ts@@ -2,7 +2,7 @@ import {WorkflowDiagram,WorkflowDiagramEdge,WorkflowDiagramNode,-} from '@/workflow/types/WorkflowDiagram';+} from '@/workflow/workflow-diagram/types/WorkflowDiagram';import { MarkerType } from '@xyflow/react';import { v4 } from 'uuid';diff --git a/packages/twenty-front/src/modules/workflow/utils/generateWorkflowDiagram.ts b/packages/twenty-front/src/modules/workflow/workflow-diagram/utils/generateWorkflowDiagram.tssimilarity index 94%rename from packages/twenty-front/src/modules/workflow/utils/generateWorkflowDiagram.tsrename to packages/twenty-front/src/modules/workflow/workflow-diagram/utils/generateWorkflowDiagram.tsindex abb470489e0..9f506746be0 100644--- a/packages/twenty-front/src/modules/workflow/utils/generateWorkflowDiagram.ts+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/utils/generateWorkflowDiagram.ts@@ -1,12 +1,13 @@-import { TRIGGER_STEP_ID } from '@/workflow/constants/TriggerStepId';import { WorkflowStep, WorkflowTrigger } from '@/workflow/types/Workflow';+import { assertUnreachable } from '@/workflow/utils/assertUnreachable';+import { splitWorkflowTriggerEventName } from '@/workflow/utils/splitWorkflowTriggerEventName';import {WorkflowDiagram,WorkflowDiagramEdge,WorkflowDiagramNode,-} from '@/workflow/types/WorkflowDiagram';-import { assertUnreachable } from '@/workflow/utils/assertUnreachable';-import { splitWorkflowTriggerEventName } from '@/workflow/utils/splitWorkflowTriggerEventName';+} from '@/workflow/workflow-diagram/types/WorkflowDiagram';++import { TRIGGER_STEP_ID } from '@/workflow/workflow-trigger/constants/TriggerStepId';import { MarkerType } from '@xyflow/react';import { isDefined } from 'twenty-ui';import { v4 } from 'uuid';diff --git a/packages/twenty-front/src/modules/workflow/utils/getOrganizedDiagram.ts b/packages/twenty-front/src/modules/workflow/workflow-diagram/utils/getOrganizedDiagram.tssimilarity index 92%rename from packages/twenty-front/src/modules/workflow/utils/getOrganizedDiagram.tsrename to packages/twenty-front/src/modules/workflow/workflow-diagram/utils/getOrganizedDiagram.tsindex a5d549c71ad..81bb621335f 100644--- a/packages/twenty-front/src/modules/workflow/utils/getOrganizedDiagram.ts+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/utils/getOrganizedDiagram.ts@@ -1,4 +1,4 @@-import { WorkflowDiagram } from '@/workflow/types/WorkflowDiagram';+import { WorkflowDiagram } from '@/workflow/workflow-diagram/types/WorkflowDiagram';import Dagre from '@dagrejs/dagre';export const getOrganizedDiagram = (diff --git a/packages/twenty-front/src/modules/workflow/utils/getWorkflowVersionDiagram.ts b/packages/twenty-front/src/modules/workflow/workflow-diagram/utils/getWorkflowVersionDiagram.tssimilarity index 72%rename from packages/twenty-front/src/modules/workflow/utils/getWorkflowVersionDiagram.tsrename to packages/twenty-front/src/modules/workflow/workflow-diagram/utils/getWorkflowVersionDiagram.tsindex e119b1d2c5c..579c7891def 100644--- a/packages/twenty-front/src/modules/workflow/utils/getWorkflowVersionDiagram.ts+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/utils/getWorkflowVersionDiagram.ts@@ -1,6 +1,6 @@import { WorkflowVersion } from '@/workflow/types/Workflow';-import { WorkflowDiagram } from '@/workflow/types/WorkflowDiagram';-import { generateWorkflowDiagram } from '@/workflow/utils/generateWorkflowDiagram';+import { WorkflowDiagram } from '@/workflow/workflow-diagram/types/WorkflowDiagram';+import { generateWorkflowDiagram } from '@/workflow/workflow-diagram/utils/generateWorkflowDiagram';import { isDefined } from 'twenty-ui';const EMPTY_DIAGRAM: WorkflowDiagram = {diff --git a/packages/twenty-front/src/modules/workflow/utils/mergeWorkflowDiagrams.ts b/packages/twenty-front/src/modules/workflow/workflow-diagram/utils/mergeWorkflowDiagrams.tssimilarity index 93%rename from packages/twenty-front/src/modules/workflow/utils/mergeWorkflowDiagrams.tsrename to packages/twenty-front/src/modules/workflow/workflow-diagram/utils/mergeWorkflowDiagrams.tsindex b52ca8f726e..e76253a4c3c 100644--- a/packages/twenty-front/src/modules/workflow/utils/mergeWorkflowDiagrams.ts+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/utils/mergeWorkflowDiagrams.ts@@ -1,7 +1,7 @@import {WorkflowDiagram,WorkflowDiagramNode,-} from '@/workflow/types/WorkflowDiagram';+} from '@/workflow/workflow-diagram/types/WorkflowDiagram';const nodePropertiesToPreserve: Array<keyof WorkflowDiagramNode> = ['selected'];diff --git a/packages/twenty-front/src/modules/workflow/components/RightDrawerWorkflowEditStep.tsx b/packages/twenty-front/src/modules/workflow/workflow-step/components/RightDrawerWorkflowEditStep.tsxsimilarity index 81%rename from packages/twenty-front/src/modules/workflow/components/RightDrawerWorkflowEditStep.tsxrename to packages/twenty-front/src/modules/workflow/workflow-step/components/RightDrawerWorkflowEditStep.tsxindex bc0b4b54d5d..35f60b368c9 100644--- a/packages/twenty-front/src/modules/workflow/components/RightDrawerWorkflowEditStep.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-step/components/RightDrawerWorkflowEditStep.tsx@@ -1,6 +1,6 @@-import { RightDrawerWorkflowEditStepContent } from '@/workflow/components/RightDrawerWorkflowEditStepContent';import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';import { workflowIdState } from '@/workflow/states/workflowIdState';+import { RightDrawerWorkflowEditStepContent } from '@/workflow/workflow-step/components/RightDrawerWorkflowEditStepContent';import { useRecoilValue } from 'recoil';import { isDefined } from 'twenty-ui';diff --git a/packages/twenty-front/src/modules/workflow/components/RightDrawerWorkflowEditStepContent.tsx b/packages/twenty-front/src/modules/workflow/workflow-step/components/RightDrawerWorkflowEditStepContent.tsxsimilarity index 92%rename from packages/twenty-front/src/modules/workflow/components/RightDrawerWorkflowEditStepContent.tsxrename to packages/twenty-front/src/modules/workflow/workflow-step/components/RightDrawerWorkflowEditStepContent.tsxindex 4a21b88fe9e..7fabd563b05 100644--- a/packages/twenty-front/src/modules/workflow/components/RightDrawerWorkflowEditStepContent.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-step/components/RightDrawerWorkflowEditStepContent.tsx@@ -1,8 +1,8 @@-import { WorkflowStepDetail } from '@/workflow/components/WorkflowStepDetail';import { useUpdateStep } from '@/workflow/hooks/useUpdateStep';import { useUpdateWorkflowVersionTrigger } from '@/workflow/hooks/useUpdateWorkflowVersionTrigger';import { workflowSelectedNodeState } from '@/workflow/states/workflowSelectedNodeState';import { WorkflowWithCurrentVersion } from '@/workflow/types/Workflow';+import { WorkflowStepDetail } from '@/workflow/workflow-step/components/WorkflowStepDetail';import { useRecoilValue } from 'recoil';import { isDefined } from 'twenty-ui';diff --git a/packages/twenty-front/src/modules/workflow/components/RightDrawerWorkflowViewStep.tsx b/packages/twenty-front/src/modules/workflow/workflow-step/components/RightDrawerWorkflowViewStep.tsxsimilarity index 84%rename from packages/twenty-front/src/modules/workflow/components/RightDrawerWorkflowViewStep.tsxrename to packages/twenty-front/src/modules/workflow/workflow-step/components/RightDrawerWorkflowViewStep.tsxindex f692f4649ae..dfb5f6f8462 100644--- a/packages/twenty-front/src/modules/workflow/components/RightDrawerWorkflowViewStep.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-step/components/RightDrawerWorkflowViewStep.tsx@@ -1,6 +1,6 @@-import { RightDrawerWorkflowViewStepContent } from '@/workflow/components/RightDrawerWorkflowViewStepContent';import { useWorkflowVersion } from '@/workflow/hooks/useWorkflowVersion';import { workflowVersionIdState } from '@/workflow/states/workflowVersionIdState';+import { RightDrawerWorkflowViewStepContent } from '@/workflow/workflow-step/components/RightDrawerWorkflowViewStepContent';import { useRecoilValue } from 'recoil';import { isDefined } from 'twenty-ui';diff --git a/packages/twenty-front/src/modules/workflow/components/RightDrawerWorkflowViewStepContent.tsx b/packages/twenty-front/src/modules/workflow/workflow-step/components/RightDrawerWorkflowViewStepContent.tsxsimilarity index 88%rename from packages/twenty-front/src/modules/workflow/components/RightDrawerWorkflowViewStepContent.tsxrename to packages/twenty-front/src/modules/workflow/workflow-step/components/RightDrawerWorkflowViewStepContent.tsxindex 95a467fd53a..658cd575677 100644--- a/packages/twenty-front/src/modules/workflow/components/RightDrawerWorkflowViewStepContent.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-step/components/RightDrawerWorkflowViewStepContent.tsx@@ -1,6 +1,6 @@-import { WorkflowStepDetail } from '@/workflow/components/WorkflowStepDetail';import { workflowSelectedNodeState } from '@/workflow/states/workflowSelectedNodeState';import { WorkflowVersion } from '@/workflow/types/Workflow';+import { WorkflowStepDetail } from '@/workflow/workflow-step/components/WorkflowStepDetail';import { useRecoilValue } from 'recoil';import { isDefined } from 'twenty-ui';diff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowStepBody.tsx b/packages/twenty-front/src/modules/workflow/workflow-step/components/WorkflowStepBody.tsxsimilarity index 100%rename from packages/twenty-front/src/modules/workflow/components/WorkflowStepBody.tsxrename to packages/twenty-front/src/modules/workflow/workflow-step/components/WorkflowStepBody.tsxdiff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowStepDetail.tsx b/packages/twenty-front/src/modules/workflow/workflow-step/components/WorkflowStepDetail.tsxsimilarity index 95%rename from packages/twenty-front/src/modules/workflow/components/WorkflowStepDetail.tsxrename to packages/twenty-front/src/modules/workflow/workflow-step/components/WorkflowStepDetail.tsxindex 48b3d3b75e1..420ee54f93b 100644--- a/packages/twenty-front/src/modules/workflow/components/WorkflowStepDetail.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-step/components/WorkflowStepDetail.tsx@@ -1,5 +1,3 @@-import { WorkflowEditTriggerDatabaseEventForm } from '@/workflow/components/WorkflowEditTriggerDatabaseEventForm';-import { WorkflowEditTriggerManualForm } from '@/workflow/components/WorkflowEditTriggerManualForm';import {WorkflowAction,WorkflowTrigger,@@ -10,8 +8,10 @@ import { getStepDefinitionOrThrow } from '@/workflow/utils/getStepDefinitionOrThimport { WorkflowEditActionFormCreateRecord } from '@/workflow/workflow-actions/components/WorkflowEditActionFormCreateRecord';import { WorkflowEditActionFormDeleteRecord } from '@/workflow/workflow-actions/components/WorkflowEditActionFormDeleteRecord';import { WorkflowEditActionFormSendEmail } from '@/workflow/workflow-actions/components/WorkflowEditActionFormSendEmail';-import { Suspense, lazy } from 'react';import { WorkflowEditActionFormUpdateRecord } from '@/workflow/workflow-actions/components/WorkflowEditActionFormUpdateRecord';+import { WorkflowEditTriggerDatabaseEventForm } from '@/workflow/workflow-trigger/components/WorkflowEditTriggerDatabaseEventForm';+import { WorkflowEditTriggerManualForm } from '@/workflow/workflow-trigger/components/WorkflowEditTriggerManualForm';+import { Suspense, lazy } from 'react';import { isDefined } from 'twenty-ui';import { RightDrawerSkeletonLoader } from '~/loading/components/RightDrawerSkeletonLoader';diff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowStepHeader.tsx b/packages/twenty-front/src/modules/workflow/workflow-step/components/WorkflowStepHeader.tsxsimilarity index 100%rename from packages/twenty-front/src/modules/workflow/components/WorkflowStepHeader.tsxrename to packages/twenty-front/src/modules/workflow/workflow-step/components/WorkflowStepHeader.tsxdiff --git a/packages/twenty-front/src/modules/workflow/components/RightDrawerWorkflowSelectTriggerType.tsx b/packages/twenty-front/src/modules/workflow/workflow-trigger/components/RightDrawerWorkflowSelectTriggerType.tsxsimilarity index 88%rename from packages/twenty-front/src/modules/workflow/components/RightDrawerWorkflowSelectTriggerType.tsxrename to packages/twenty-front/src/modules/workflow/workflow-trigger/components/RightDrawerWorkflowSelectTriggerType.tsxindex 7eb10fc6ecb..305d7f23077 100644--- a/packages/twenty-front/src/modules/workflow/components/RightDrawerWorkflowSelectTriggerType.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-trigger/components/RightDrawerWorkflowSelectTriggerType.tsx@@ -1,6 +1,6 @@-import { RightDrawerWorkflowSelectTriggerTypeContent } from '@/workflow/components/RightDrawerWorkflowSelectTriggerTypeContent';import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';import { workflowIdState } from '@/workflow/states/workflowIdState';+import { RightDrawerWorkflowSelectTriggerTypeContent } from '@/workflow/workflow-trigger/components/RightDrawerWorkflowSelectTriggerTypeContent';import { useRecoilValue } from 'recoil';import { isDefined } from 'twenty-ui';diff --git a/packages/twenty-front/src/modules/workflow/components/RightDrawerWorkflowSelectTriggerTypeContent.tsx b/packages/twenty-front/src/modules/workflow/workflow-trigger/components/RightDrawerWorkflowSelectTriggerTypeContent.tsxsimilarity index 87%rename from packages/twenty-front/src/modules/workflow/components/RightDrawerWorkflowSelectTriggerTypeContent.tsxrename to packages/twenty-front/src/modules/workflow/workflow-trigger/components/RightDrawerWorkflowSelectTriggerTypeContent.tsxindex d02ea69c7cd..f7bcfcada99 100644--- a/packages/twenty-front/src/modules/workflow/components/RightDrawerWorkflowSelectTriggerTypeContent.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-trigger/components/RightDrawerWorkflowSelectTriggerTypeContent.tsx@@ -1,12 +1,12 @@import { useFilteredObjectMetadataItems } from '@/object-metadata/hooks/useFilteredObjectMetadataItems';import { useRightDrawer } from '@/ui/layout/right-drawer/hooks/useRightDrawer';import { RightDrawerPages } from '@/ui/layout/right-drawer/types/RightDrawerPages';-import { TRIGGER_STEP_ID } from '@/workflow/constants/TriggerStepId';-import { TRIGGER_TYPES } from '@/workflow/constants/TriggerTypes';import { useUpdateWorkflowVersionTrigger } from '@/workflow/hooks/useUpdateWorkflowVersionTrigger';import { workflowSelectedNodeState } from '@/workflow/states/workflowSelectedNodeState';import { WorkflowWithCurrentVersion } from '@/workflow/types/Workflow';-import { getTriggerDefaultDefinition } from '@/workflow/utils/getTriggerDefaultDefinition';+import { TRIGGER_STEP_ID } from '@/workflow/workflow-trigger/constants/TriggerStepId';+import { TRIGGER_TYPES } from '@/workflow/workflow-trigger/constants/TriggerTypes';+import { getTriggerDefaultDefinition } from '@/workflow/workflow-trigger/utils/getTriggerDefaultDefinition';import styled from '@emotion/styled';import { useSetRecoilState } from 'recoil';import { MenuItem } from 'twenty-ui';diff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowEditTriggerDatabaseEventForm.tsx b/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerDatabaseEventForm.tsxsimilarity index 94%rename from packages/twenty-front/src/modules/workflow/components/WorkflowEditTriggerDatabaseEventForm.tsxrename to packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerDatabaseEventForm.tsxindex 4fbe7a69421..798a4f1b0c4 100644--- a/packages/twenty-front/src/modules/workflow/components/WorkflowEditTriggerDatabaseEventForm.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerDatabaseEventForm.tsx@@ -1,12 +1,12 @@import { useFilteredObjectMetadataItems } from '@/object-metadata/hooks/useFilteredObjectMetadataItems';import { Select, SelectOption } from '@/ui/input/components/Select';-import { WorkflowStepHeader } from '@/workflow/components/WorkflowStepHeader';-import { OBJECT_EVENT_TRIGGERS } from '@/workflow/constants/ObjectEventTriggers';import { WorkflowDatabaseEventTrigger } from '@/workflow/types/Workflow';import { splitWorkflowTriggerEventName } from '@/workflow/utils/splitWorkflowTriggerEventName';+import { WorkflowStepBody } from '@/workflow/workflow-step/components/WorkflowStepBody';+import { WorkflowStepHeader } from '@/workflow/workflow-step/components/WorkflowStepHeader';+import { OBJECT_EVENT_TRIGGERS } from '@/workflow/workflow-trigger/constants/ObjectEventTriggers';import { useTheme } from '@emotion/react';import { IconPlaylistAdd, isDefined } from 'twenty-ui';-import { WorkflowStepBody } from '@/workflow/components/WorkflowStepBody';type WorkflowEditTriggerDatabaseEventFormProps = {trigger: WorkflowDatabaseEventTrigger;diff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowEditTriggerManualForm.tsx b/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerManualForm.tsxsimilarity index 90%rename from packages/twenty-front/src/modules/workflow/components/WorkflowEditTriggerManualForm.tsxrename to packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerManualForm.tsxindex 6365ebcbff9..6c6b9dfd9d4 100644--- a/packages/twenty-front/src/modules/workflow/components/WorkflowEditTriggerManualForm.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerManualForm.tsx@@ -1,15 +1,15 @@import { useFilteredObjectMetadataItems } from '@/object-metadata/hooks/useFilteredObjectMetadataItems';import { Select, SelectOption } from '@/ui/input/components/Select';-import { WorkflowStepHeader } from '@/workflow/components/WorkflowStepHeader';-import { MANUAL_TRIGGER_AVAILABILITY_OPTIONS } from '@/workflow/constants/ManualTriggerAvailabilityOptions';import {WorkflowManualTrigger,WorkflowManualTriggerAvailability,} from '@/workflow/types/Workflow';-import { getManualTriggerDefaultSettings } from '@/workflow/utils/getManualTriggerDefaultSettings';+import { WorkflowStepBody } from '@/workflow/workflow-step/components/WorkflowStepBody';+import { WorkflowStepHeader } from '@/workflow/workflow-step/components/WorkflowStepHeader';+import { MANUAL_TRIGGER_AVAILABILITY_OPTIONS } from '@/workflow/workflow-trigger/constants/ManualTriggerAvailabilityOptions';+import { getManualTriggerDefaultSettings } from '@/workflow/workflow-trigger/utils/getManualTriggerDefaultSettings';import { useTheme } from '@emotion/react';import { IconHandMove, isDefined, useIcons } from 'twenty-ui';-import { WorkflowStepBody } from '@/workflow/components/WorkflowStepBody';type WorkflowEditTriggerManualFormProps = {trigger: WorkflowManualTrigger;diff --git a/packages/twenty-front/src/modules/workflow/constants/ManualTriggerAvailabilityOptions.ts b/packages/twenty-front/src/modules/workflow/workflow-trigger/constants/ManualTriggerAvailabilityOptions.tssimilarity index 100%rename from packages/twenty-front/src/modules/workflow/constants/ManualTriggerAvailabilityOptions.tsrename to packages/twenty-front/src/modules/workflow/workflow-trigger/constants/ManualTriggerAvailabilityOptions.tsdiff --git a/packages/twenty-front/src/modules/workflow/constants/ObjectEventTriggers.ts b/packages/twenty-front/src/modules/workflow/workflow-trigger/constants/ObjectEventTriggers.tssimilarity index 100%rename from packages/twenty-front/src/modules/workflow/constants/ObjectEventTriggers.tsrename to packages/twenty-front/src/modules/workflow/workflow-trigger/constants/ObjectEventTriggers.tsdiff --git a/packages/twenty-front/src/modules/workflow/constants/TriggerStepId.ts b/packages/twenty-front/src/modules/workflow/workflow-trigger/constants/TriggerStepId.tssimilarity index 100%rename from packages/twenty-front/src/modules/workflow/constants/TriggerStepId.tsrename to packages/twenty-front/src/modules/workflow/workflow-trigger/constants/TriggerStepId.tsdiff --git a/packages/twenty-front/src/modules/workflow/constants/TriggerTypes.ts b/packages/twenty-front/src/modules/workflow/workflow-trigger/constants/TriggerTypes.tssimilarity index 100%rename from packages/twenty-front/src/modules/workflow/constants/TriggerTypes.tsrename to packages/twenty-front/src/modules/workflow/workflow-trigger/constants/TriggerTypes.tsdiff --git a/packages/twenty-front/src/modules/workflow/utils/__tests__/getManualTriggerDefaultSettings.test.ts b/packages/twenty-front/src/modules/workflow/workflow-trigger/utils/__tests__/getManualTriggerDefaultSettings.test.tssimilarity index 100%rename from packages/twenty-front/src/modules/workflow/utils/__tests__/getManualTriggerDefaultSettings.test.tsrename to packages/twenty-front/src/modules/workflow/workflow-trigger/utils/__tests__/getManualTriggerDefaultSettings.test.tsdiff --git a/packages/twenty-front/src/modules/workflow/utils/__tests__/getTriggerDefaultDefinition.test.ts b/packages/twenty-front/src/modules/workflow/workflow-trigger/utils/__tests__/getTriggerDefaultDefinition.test.tssimilarity index 100%rename from packages/twenty-front/src/modules/workflow/utils/__tests__/getTriggerDefaultDefinition.test.tsrename to packages/twenty-front/src/modules/workflow/workflow-trigger/utils/__tests__/getTriggerDefaultDefinition.test.tsdiff --git a/packages/twenty-front/src/modules/workflow/utils/getManualTriggerDefaultSettings.ts b/packages/twenty-front/src/modules/workflow/workflow-trigger/utils/getManualTriggerDefaultSettings.tssimilarity index 100%rename from packages/twenty-front/src/modules/workflow/utils/getManualTriggerDefaultSettings.tsrename to packages/twenty-front/src/modules/workflow/workflow-trigger/utils/getManualTriggerDefaultSettings.tsdiff --git a/packages/twenty-front/src/modules/workflow/utils/getTriggerDefaultDefinition.ts b/packages/twenty-front/src/modules/workflow/workflow-trigger/utils/getTriggerDefaultDefinition.tssimilarity index 84%rename from packages/twenty-front/src/modules/workflow/utils/getTriggerDefaultDefinition.tsrename to packages/twenty-front/src/modules/workflow/workflow-trigger/utils/getTriggerDefaultDefinition.tsindex 73b60054965..091ee91f2cf 100644--- a/packages/twenty-front/src/modules/workflow/utils/getTriggerDefaultDefinition.ts+++ b/packages/twenty-front/src/modules/workflow/workflow-trigger/utils/getTriggerDefaultDefinition.ts@@ -1,11 +1,11 @@import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';-import { OBJECT_EVENT_TRIGGERS } from '@/workflow/constants/ObjectEventTriggers';import {WorkflowTrigger,WorkflowTriggerType,} from '@/workflow/types/Workflow';import { assertUnreachable } from '@/workflow/utils/assertUnreachable';-import { getManualTriggerDefaultSettings } from '@/workflow/utils/getManualTriggerDefaultSettings';+import { OBJECT_EVENT_TRIGGERS } from '@/workflow/workflow-trigger/constants/ObjectEventTriggers';+import { getManualTriggerDefaultSettings } from '@/workflow/workflow-trigger/utils/getManualTriggerDefaultSettings';export const getTriggerDefaultDefinition = ({type,diff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowVariablePicker.tsx b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablePicker.tsxsimilarity index 91%rename from packages/twenty-front/src/modules/workflow/components/WorkflowVariablePicker.tsxrename to packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablePicker.tsxindex 2a21f48a9ec..948f77f319c 100644--- a/packages/twenty-front/src/modules/workflow/components/WorkflowVariablePicker.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablePicker.tsx@@ -1,5 +1,5 @@import { VariablePickerComponent } from '@/object-record/record-field/form-types/types/VariablePickerComponent';-import { SearchVariablesDropdown } from '@/workflow/search-variables/components/SearchVariablesDropdown';+import { WorkflowVariablesDropdown } from '@/workflow/workflow-variables/components/WorkflowVariablesDropdown';import { css } from '@emotion/react';import styled from '@emotion/styled';@@ -47,7 +47,7 @@ export const WorkflowVariablePicker: VariablePickerComponent = ({multiline={multiline}readonly={disabled}>- <SearchVariablesDropdown+ <WorkflowVariablesDropdowninputId={inputId}onVariableSelect={onVariableSelect}disabled={disabled}diff --git a/packages/twenty-front/src/modules/workflow/search-variables/components/SearchVariablesDropdown.tsx b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdown.tsxsimilarity index 80%rename from packages/twenty-front/src/modules/workflow/search-variables/components/SearchVariablesDropdown.tsxrename to packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdown.tsxindex 454dea99154..6e6884ed933 100644--- a/packages/twenty-front/src/modules/workflow/search-variables/components/SearchVariablesDropdown.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdown.tsx@@ -1,12 +1,13 @@import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';import { StyledDropdownButtonContainer } from '@/ui/layout/dropdown/components/StyledDropdownButtonContainer';import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown';-import { SearchVariablesDropdownFieldItems } from '@/workflow/search-variables/components/SearchVariablesDropdownFieldItems';-import { SearchVariablesDropdownObjectItems } from '@/workflow/search-variables/components/SearchVariablesDropdownObjectItems';-import { SearchVariablesDropdownWorkflowStepItems } from '@/workflow/search-variables/components/SearchVariablesDropdownWorkflowStepItems';-import { SEARCH_VARIABLES_DROPDOWN_ID } from '@/workflow/search-variables/constants/SearchVariablesDropdownId';-import { useAvailableVariablesInWorkflowStep } from '@/workflow/search-variables/hooks/useAvailableVariablesInWorkflowStep';-import { StepOutputSchema } from '@/workflow/search-variables/types/StepOutputSchema';+import { WorkflowVariablesDropdownFieldItems } from '@/workflow/workflow-variables/components/WorkflowVariablesDropdownFieldItems';+import { WorkflowVariablesDropdownObjectItems } from '@/workflow/workflow-variables/components/WorkflowVariablesDropdownObjectItems';+import { WorkflowVariablesDropdownWorkflowStepItems } from '@/workflow/workflow-variables/components/WorkflowVariablesDropdownWorkflowStepItems';+import { SEARCH_VARIABLES_DROPDOWN_ID } from '@/workflow/workflow-variables/constants/SearchVariablesDropdownId';++import { useAvailableVariablesInWorkflowStep } from '@/workflow/workflow-variables/hooks/useAvailableVariablesInWorkflowStep';+import { StepOutputSchema } from '@/workflow/workflow-variables/types/StepOutputSchema';import { useTheme } from '@emotion/react';import styled from '@emotion/styled';import { useState } from 'react';@@ -27,7 +28,7 @@ const StyledDropdownVariableButtonContainer = styled(}`;-export const SearchVariablesDropdown = ({+export const WorkflowVariablesDropdown = ({inputId,onVariableSelect,disabled,@@ -104,19 +105,19 @@ export const SearchVariablesDropdown = ({}dropdownComponents={!isDefined(selectedStep) ? (- <SearchVariablesDropdownWorkflowStepItems+ <WorkflowVariablesDropdownWorkflowStepItemsdropdownId={dropdownId}steps={availableVariablesInWorkflowStep}onSelect={handleStepSelect}/>) : isDefined(objectNameSingularToSelect) ? (- <SearchVariablesDropdownObjectItems+ <WorkflowVariablesDropdownObjectItemsstep={selectedStep}onSelect={handleSubItemSelect}onBack={handleBack}/>) : (- <SearchVariablesDropdownFieldItems+ <WorkflowVariablesDropdownFieldItemsstep={selectedStep}onSelect={handleSubItemSelect}onBack={handleBack}diff --git a/packages/twenty-front/src/modules/workflow/search-variables/components/SearchVariablesDropdownFieldItems.tsx b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownFieldItems.tsxsimilarity index 90%rename from packages/twenty-front/src/modules/workflow/search-variables/components/SearchVariablesDropdownFieldItems.tsxrename to packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownFieldItems.tsxindex 20259e6af82..03486f673b1 100644--- a/packages/twenty-front/src/modules/workflow/search-variables/components/SearchVariablesDropdownFieldItems.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownFieldItems.tsx@@ -7,11 +7,17 @@ import {LinkOutputSchema,OutputSchema,StepOutputSchema,-} from '@/workflow/search-variables/types/StepOutputSchema';-import { isBaseOutputSchema } from '@/workflow/search-variables/utils/isBaseOutputSchema';-import { isRecordOutputSchema } from '@/workflow/search-variables/utils/isRecordOutputSchema';+} from '@/workflow/workflow-variables/types/StepOutputSchema';+import { isBaseOutputSchema } from '@/workflow/workflow-variables/utils/isBaseOutputSchema';+import { isRecordOutputSchema } from '@/workflow/workflow-variables/utils/isRecordOutputSchema';+import { useTabList } from '@/ui/layout/tab/hooks/useTabList';+import { workflowDiagramTriggerNodeSelectionState } from '@/workflow/states/workflowDiagramTriggerNodeSelectionState';+import { workflowSelectedNodeState } from '@/workflow/states/workflowSelectedNodeState';+import { WORKFLOW_SERVERLESS_FUNCTION_TAB_LIST_COMPONENT_ID } from '@/workflow/workflow-actions/constants/WorkflowServerlessFunctionTabListComponentId';+import { isLinkOutputSchema } from '@/workflow/workflow-variables/utils/isLinkOutputSchema';import { useState } from 'react';+import { useSetRecoilState } from 'recoil';import {IconChevronLeft,isDefined,@@ -19,24 +25,18 @@ import {OverflowingTextWithTooltip,useIcons,} from 'twenty-ui';-import { useSetRecoilState } from 'recoil';-import { workflowSelectedNodeState } from '@/workflow/states/workflowSelectedNodeState';-import { useTabList } from '@/ui/layout/tab/hooks/useTabList';-import { WORKFLOW_SERVERLESS_FUNCTION_TAB_LIST_COMPONENT_ID } from '@/workflow/workflow-actions/constants/WorkflowServerlessFunctionTabListComponentId';-import { isLinkOutputSchema } from '@/workflow/search-variables/utils/isLinkOutputSchema';-import { workflowDiagramTriggerNodeSelectionState } from '@/workflow/states/workflowDiagramTriggerNodeSelectionState';-type SearchVariablesDropdownFieldItemsProps = {+type WorkflowVariablesDropdownFieldItemsProps = {step: StepOutputSchema;onSelect: (value: string) => void;onBack: () => void;};-export const SearchVariablesDropdownFieldItems = ({+export const WorkflowVariablesDropdownFieldItems = ({step,onSelect,onBack,-}: SearchVariablesDropdownFieldItemsProps) => {+}: WorkflowVariablesDropdownFieldItemsProps) => {const [currentPath, setCurrentPath] = useState<string[]>([]);const [searchInputValue, setSearchInputValue] = useState('');const { getIcon } = useIcons();diff --git a/packages/twenty-front/src/modules/workflow/search-variables/components/SearchVariablesDropdownObjectItems.tsx b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownObjectItems.tsxsimilarity index 91%rename from packages/twenty-front/src/modules/workflow/search-variables/components/SearchVariablesDropdownObjectItems.tsxrename to packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownObjectItems.tsxindex 157ef04ee1f..c5523e97200 100644--- a/packages/twenty-front/src/modules/workflow/search-variables/components/SearchVariablesDropdownObjectItems.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownObjectItems.tsx@@ -5,9 +5,9 @@ import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownMimport {OutputSchema,StepOutputSchema,-} from '@/workflow/search-variables/types/StepOutputSchema';-import { isBaseOutputSchema } from '@/workflow/search-variables/utils/isBaseOutputSchema';-import { isRecordOutputSchema } from '@/workflow/search-variables/utils/isRecordOutputSchema';+} from '@/workflow/workflow-variables/types/StepOutputSchema';+import { isBaseOutputSchema } from '@/workflow/workflow-variables/utils/isBaseOutputSchema';+import { isRecordOutputSchema } from '@/workflow/workflow-variables/utils/isRecordOutputSchema';import { useState } from 'react';import {@@ -17,17 +17,17 @@ import {useIcons,} from 'twenty-ui';-type SearchVariablesDropdownObjectItemsProps = {+type WorkflowVariablesDropdownObjectItemsProps = {step: StepOutputSchema;onSelect: (value: string) => void;onBack: () => void;};-export const SearchVariablesDropdownObjectItems = ({+export const WorkflowVariablesDropdownObjectItems = ({step,onSelect,onBack,-}: SearchVariablesDropdownObjectItemsProps) => {+}: WorkflowVariablesDropdownObjectItemsProps) => {const [currentPath, setCurrentPath] = useState<string[]>([]);const [searchInputValue, setSearchInputValue] = useState('');const { getIcon } = useIcons();diff --git a/packages/twenty-front/src/modules/workflow/search-variables/components/SearchVariablesDropdownWorkflowStepItems.tsx b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownWorkflowStepItems.tsxsimilarity index 88%rename from packages/twenty-front/src/modules/workflow/search-variables/components/SearchVariablesDropdownWorkflowStepItems.tsxrename to packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownWorkflowStepItems.tsxindex 0110c0f83d5..10ba878129e 100644--- a/packages/twenty-front/src/modules/workflow/search-variables/components/SearchVariablesDropdownWorkflowStepItems.tsx+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownWorkflowStepItems.tsx@@ -3,7 +3,7 @@ import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/Dropimport { DropdownMenuSearchInput } from '@/ui/layout/dropdown/components/DropdownMenuSearchInput';import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownMenuSeparator';import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown';-import { StepOutputSchema } from '@/workflow/search-variables/types/StepOutputSchema';+import { StepOutputSchema } from '@/workflow/workflow-variables/types/StepOutputSchema';import { useState } from 'react';import {IconX,@@ -13,17 +13,17 @@ import {useIcons,} from 'twenty-ui';-type SearchVariablesDropdownWorkflowStepItemsProps = {+type WorkflowVariablesDropdownWorkflowStepItemsProps = {dropdownId: string;steps: StepOutputSchema[];onSelect: (value: string) => void;};-export const SearchVariablesDropdownWorkflowStepItems = ({+export const WorkflowVariablesDropdownWorkflowStepItems = ({dropdownId,steps,onSelect,-}: SearchVariablesDropdownWorkflowStepItemsProps) => {+}: WorkflowVariablesDropdownWorkflowStepItemsProps) => {const { getIcon } = useIcons();const [searchInputValue, setSearchInputValue] = useState('');diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/constants/SearchVariablesDropdownId.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/constants/SearchVariablesDropdownId.tsnew file mode 100644index 00000000000..2f342a13fb6--- /dev/null+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/constants/SearchVariablesDropdownId.ts@@ -0,0 +1 @@+export const SEARCH_VARIABLES_DROPDOWN_ID = 'workflow-variables';diff --git a/packages/twenty-front/src/modules/workflow/search-variables/hooks/useAvailableVariablesInWorkflowStep.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/hooks/useAvailableVariablesInWorkflowStep.tssimilarity index 91%rename from packages/twenty-front/src/modules/workflow/search-variables/hooks/useAvailableVariablesInWorkflowStep.tsrename to packages/twenty-front/src/modules/workflow/workflow-variables/hooks/useAvailableVariablesInWorkflowStep.tsindex 85f8c340e6d..b141971d8b9 100644--- a/packages/twenty-front/src/modules/workflow/search-variables/hooks/useAvailableVariablesInWorkflowStep.ts+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/hooks/useAvailableVariablesInWorkflowStep.ts@@ -1,13 +1,13 @@import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';-import {- OutputSchema,- StepOutputSchema,-} from '@/workflow/search-variables/types/StepOutputSchema';-import { filterOutputSchema } from '@/workflow/search-variables/utils/filterOutputSchema';-import { getTriggerStepName } from '@/workflow/search-variables/utils/getTriggerStepName';import { workflowIdState } from '@/workflow/states/workflowIdState';import { workflowSelectedNodeState } from '@/workflow/states/workflowSelectedNodeState';import { getStepDefinitionOrThrow } from '@/workflow/utils/getStepDefinitionOrThrow';+import {+ OutputSchema,+ StepOutputSchema,+} from '@/workflow/workflow-variables/types/StepOutputSchema';+import { filterOutputSchema } from '@/workflow/workflow-variables/utils/filterOutputSchema';+import { getTriggerStepName } from '@/workflow/workflow-variables/utils/getTriggerStepName';import isEmpty from 'lodash.isempty';import { useRecoilValue } from 'recoil';import { isDefined } from 'twenty-ui';diff --git a/packages/twenty-front/src/modules/workflow/search-variables/types/StepOutputSchema.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/types/StepOutputSchema.tssimilarity index 100%rename from packages/twenty-front/src/modules/workflow/search-variables/types/StepOutputSchema.tsrename to packages/twenty-front/src/modules/workflow/workflow-variables/types/StepOutputSchema.tsdiff --git a/packages/twenty-front/src/modules/workflow/search-variables/utils/__tests__/extractVariableLabel.test.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/utils/__tests__/extractVariableLabel.test.tssimilarity index 100%rename from packages/twenty-front/src/modules/workflow/search-variables/utils/__tests__/extractVariableLabel.test.tsrename to packages/twenty-front/src/modules/workflow/workflow-variables/utils/__tests__/extractVariableLabel.test.tsdiff --git a/packages/twenty-front/src/modules/workflow/search-variables/utils/__tests__/filterOutputSchema.test.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/utils/__tests__/filterOutputSchema.test.tssimilarity index 98%rename from packages/twenty-front/src/modules/workflow/search-variables/utils/__tests__/filterOutputSchema.test.tsrename to packages/twenty-front/src/modules/workflow/workflow-variables/utils/__tests__/filterOutputSchema.test.tsindex 90d77249209..d5295b331e2 100644--- a/packages/twenty-front/src/modules/workflow/search-variables/utils/__tests__/filterOutputSchema.test.ts+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/utils/__tests__/filterOutputSchema.test.ts@@ -1,4 +1,4 @@-import { OutputSchema } from '@/workflow/search-variables/types/StepOutputSchema';+import { OutputSchema } from '@/workflow/workflow-variables/types/StepOutputSchema';import { filterOutputSchema } from '../filterOutputSchema';describe('filterOutputSchema', () => {diff --git a/packages/twenty-front/src/modules/workflow/search-variables/utils/__tests__/getTriggerStepName.test.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/utils/__tests__/getTriggerStepName.test.tssimilarity index 100%rename from packages/twenty-front/src/modules/workflow/search-variables/utils/__tests__/getTriggerStepName.test.tsrename to packages/twenty-front/src/modules/workflow/workflow-variables/utils/__tests__/getTriggerStepName.test.tsdiff --git a/packages/twenty-front/src/modules/workflow/search-variables/utils/__tests__/initializeEditorContent.test.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/utils/__tests__/initializeEditorContent.test.tssimilarity index 100%rename from packages/twenty-front/src/modules/workflow/search-variables/utils/__tests__/initializeEditorContent.test.tsrename to packages/twenty-front/src/modules/workflow/workflow-variables/utils/__tests__/initializeEditorContent.test.tsdiff --git a/packages/twenty-front/src/modules/workflow/search-variables/utils/__tests__/parseEditorContent.test.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/utils/__tests__/parseEditorContent.test.tssimilarity index 100%rename from packages/twenty-front/src/modules/workflow/search-variables/utils/__tests__/parseEditorContent.test.tsrename to packages/twenty-front/src/modules/workflow/workflow-variables/utils/__tests__/parseEditorContent.test.tsdiff --git a/packages/twenty-front/src/modules/workflow/search-variables/utils/extractVariableLabel.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/utils/extractVariableLabel.tssimilarity index 100%rename from packages/twenty-front/src/modules/workflow/search-variables/utils/extractVariableLabel.tsrename to packages/twenty-front/src/modules/workflow/workflow-variables/utils/extractVariableLabel.tsdiff --git a/packages/twenty-front/src/modules/workflow/search-variables/utils/filterOutputSchema.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/utils/filterOutputSchema.tssimilarity index 88%rename from packages/twenty-front/src/modules/workflow/search-variables/utils/filterOutputSchema.tsrename to packages/twenty-front/src/modules/workflow/workflow-variables/utils/filterOutputSchema.tsindex 6ed52f4a60b..9b3849a8c3d 100644--- a/packages/twenty-front/src/modules/workflow/search-variables/utils/filterOutputSchema.ts+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/utils/filterOutputSchema.ts@@ -2,11 +2,11 @@ import {BaseOutputSchema,OutputSchema,RecordOutputSchema,-} from '@/workflow/search-variables/types/StepOutputSchema';-import { isBaseOutputSchema } from '@/workflow/search-variables/utils/isBaseOutputSchema';-import { isRecordOutputSchema } from '@/workflow/search-variables/utils/isRecordOutputSchema';+} from '@/workflow/workflow-variables/types/StepOutputSchema';+import { isBaseOutputSchema } from '@/workflow/workflow-variables/utils/isBaseOutputSchema';+import { isLinkOutputSchema } from '@/workflow/workflow-variables/utils/isLinkOutputSchema';+import { isRecordOutputSchema } from '@/workflow/workflow-variables/utils/isRecordOutputSchema';import { isDefined } from 'twenty-ui';-import { isLinkOutputSchema } from '@/workflow/search-variables/utils/isLinkOutputSchema';const isValidRecordOutputSchema = (outputSchema: RecordOutputSchema,diff --git a/packages/twenty-front/src/modules/workflow/search-variables/utils/getTriggerStepName.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/utils/getTriggerStepName.tssimilarity index 100%rename from packages/twenty-front/src/modules/workflow/search-variables/utils/getTriggerStepName.tsrename to packages/twenty-front/src/modules/workflow/workflow-variables/utils/getTriggerStepName.tsdiff --git a/packages/twenty-front/src/modules/workflow/search-variables/utils/initializeEditorContent.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/utils/initializeEditorContent.tssimilarity index 100%rename from packages/twenty-front/src/modules/workflow/search-variables/utils/initializeEditorContent.tsrename to packages/twenty-front/src/modules/workflow/workflow-variables/utils/initializeEditorContent.tsdiff --git a/packages/twenty-front/src/modules/workflow/search-variables/utils/isBaseOutputSchema.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/utils/isBaseOutputSchema.tssimilarity index 75%rename from packages/twenty-front/src/modules/workflow/search-variables/utils/isBaseOutputSchema.tsrename to packages/twenty-front/src/modules/workflow/workflow-variables/utils/isBaseOutputSchema.tsindex 007bfeca6ab..7ee2c4e7266 100644--- a/packages/twenty-front/src/modules/workflow/search-variables/utils/isBaseOutputSchema.ts+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/utils/isBaseOutputSchema.ts@@ -1,7 +1,7 @@import {BaseOutputSchema,OutputSchema,-} from '@/workflow/search-variables/types/StepOutputSchema';+} from '@/workflow/workflow-variables/types/StepOutputSchema';export const isBaseOutputSchema = (outputSchema: OutputSchema,diff --git a/packages/twenty-front/src/modules/workflow/search-variables/utils/isLinkOutputSchema.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/utils/isLinkOutputSchema.tssimilarity index 76%rename from packages/twenty-front/src/modules/workflow/search-variables/utils/isLinkOutputSchema.tsrename to packages/twenty-front/src/modules/workflow/workflow-variables/utils/isLinkOutputSchema.tsindex e1dd24a2177..69f27d88751 100644--- a/packages/twenty-front/src/modules/workflow/search-variables/utils/isLinkOutputSchema.ts+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/utils/isLinkOutputSchema.ts@@ -1,7 +1,7 @@import {- OutputSchema,LinkOutputSchema,-} from '@/workflow/search-variables/types/StepOutputSchema';+ OutputSchema,+} from '@/workflow/workflow-variables/types/StepOutputSchema';export const isLinkOutputSchema = (outputSchema: OutputSchema,diff --git a/packages/twenty-front/src/modules/workflow/search-variables/utils/isRecordOutputSchema.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/utils/isRecordOutputSchema.tssimilarity index 77%rename from packages/twenty-front/src/modules/workflow/search-variables/utils/isRecordOutputSchema.tsrename to packages/twenty-front/src/modules/workflow/workflow-variables/utils/isRecordOutputSchema.tsindex 6ce193ca475..6c9fd6208a6 100644--- a/packages/twenty-front/src/modules/workflow/search-variables/utils/isRecordOutputSchema.ts+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/utils/isRecordOutputSchema.ts@@ -1,7 +1,7 @@import {OutputSchema,RecordOutputSchema,-} from '@/workflow/search-variables/types/StepOutputSchema';+} from '@/workflow/workflow-variables/types/StepOutputSchema';export const isRecordOutputSchema = (outputSchema: OutputSchema,diff --git a/packages/twenty-front/src/modules/workflow/search-variables/utils/parseEditorContent.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/utils/parseEditorContent.tssimilarity index 100%rename from packages/twenty-front/src/modules/workflow/search-variables/utils/parseEditorContent.tsrename to packages/twenty-front/src/modules/workflow/workflow-variables/utils/parseEditorContent.tsdiff --git a/packages/twenty-front/src/modules/workflow/search-variables/utils/variableTag.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/utils/variableTag.tssimilarity index 92%rename from packages/twenty-front/src/modules/workflow/search-variables/utils/variableTag.tsrename to packages/twenty-front/src/modules/workflow/workflow-variables/utils/variableTag.tsindex af6ba769862..a7bda7a9ed9 100644--- a/packages/twenty-front/src/modules/workflow/search-variables/utils/variableTag.ts+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/utils/variableTag.ts@@ -1,4 +1,4 @@-import { extractVariableLabel } from '@/workflow/search-variables/utils/extractVariableLabel';+import { extractVariableLabel } from '@/workflow/workflow-variables/utils/extractVariableLabel';import { Node } from '@tiptap/core';import { mergeAttributes } from '@tiptap/react';