The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
feat(workflow): toggle core workflow visibility from the command menu (#26651)
Thomas Trompette776da2fd9446
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql b/packages/twenty-client-sdk/src/metadata/generated/schema.graphqlindex 8ffc45907ec..12fb3b96db1 100644--- a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql@@ -165,6 +165,7 @@ enum EngineComponentKey {ADD_NODE_WORKFLOWTIDY_UP_WORKFLOWDUPLICATE_WORKFLOW+ TOGGLE_WORKFLOW_VISIBILITYSEE_VERSION_WORKFLOW_RUNSEE_WORKFLOW_WORKFLOW_RUNSTOP_WORKFLOW_RUNdiff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.ts b/packages/twenty-client-sdk/src/metadata/generated/schema.tsindex 01ba3c152f8..5503cd16422 100644--- a/packages/twenty-client-sdk/src/metadata/generated/schema.ts+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.ts@@ -133,7 +133,7 @@ export interface CommandMenuItem {__typename: 'CommandMenuItem'}-export type EngineComponentKey = 'NAVIGATE_TO_NEXT_RECORD' | 'NAVIGATE_TO_PREVIOUS_RECORD' | 'CREATE_NEW_RECORD' | 'DELETE_RECORDS' | 'RESTORE_RECORDS' | 'DESTROY_RECORDS' | 'ADD_TO_FAVORITES' | 'REMOVE_FROM_FAVORITES' | 'EXPORT_NOTE_TO_PDF' | 'EXPORT_RECORDS' | 'UPDATE_MULTIPLE_RECORDS' | 'MERGE_MULTIPLE_RECORDS' | 'IMPORT_RECORDS' | 'EXPORT_VIEW' | 'SEE_DELETED_RECORDS' | 'CREATE_NEW_VIEW' | 'HIDE_DELETED_RECORDS' | 'EDIT_RECORD_PAGE_LAYOUT' | 'EDIT_DASHBOARD_LAYOUT' | 'SAVE_DASHBOARD_LAYOUT' | 'CANCEL_DASHBOARD_LAYOUT' | 'DUPLICATE_DASHBOARD' | 'DUPLICATE_MESSAGE_LIST' | 'ACTIVATE_WORKFLOW' | 'DEACTIVATE_WORKFLOW' | 'DISCARD_DRAFT_WORKFLOW' | 'TEST_WORKFLOW' | 'SEE_ACTIVE_VERSION_WORKFLOW' | 'SEE_RUNS_WORKFLOW' | 'SEE_VERSIONS_WORKFLOW' | 'ADD_NODE_WORKFLOW' | 'TIDY_UP_WORKFLOW' | 'DUPLICATE_WORKFLOW' | 'SEE_VERSION_WORKFLOW_RUN' | 'SEE_WORKFLOW_WORKFLOW_RUN' | 'STOP_WORKFLOW_RUN' | 'RETRY_WORKFLOW_RUN' | 'SEE_RUNS_WORKFLOW_VERSION' | 'SEE_WORKFLOW_WORKFLOW_VERSION' | 'USE_AS_DRAFT_WORKFLOW_VERSION' | 'SEE_VERSIONS_WORKFLOW_VERSION' | 'SEARCH_RECORDS' | 'SEARCH_RECORDS_FALLBACK' | 'ASK_AI' | 'VIEW_PREVIOUS_AI_CHATS' | 'NAVIGATION' | 'TRIGGER_WORKFLOW_VERSION' | 'FRONT_COMPONENT_RENDERER' | 'REPLY_TO_EMAIL_THREAD' | 'COMPOSE_EMAIL' | 'COMPOSE_CAMPAIGN' | 'SEND_MESSAGE_CAMPAIGN' | 'SEND_MESSAGE_CAMPAIGN_TEST' | 'CANCEL_MESSAGE_CAMPAIGN' | 'DUPLICATE_MESSAGE_CAMPAIGN' | 'EMAIL_BLOCK_SETTINGS' | 'GO_TO_PEOPLE' | 'GO_TO_COMPANIES' | 'GO_TO_DASHBOARDS' | 'GO_TO_OPPORTUNITIES' | 'GO_TO_SETTINGS' | 'GO_TO_TASKS' | 'GO_TO_NOTES' | 'GO_TO_WORKFLOWS' | 'GO_TO_RUNS' | 'DELETE_SINGLE_RECORD' | 'DELETE_MULTIPLE_RECORDS' | 'RESTORE_SINGLE_RECORD' | 'RESTORE_MULTIPLE_RECORDS' | 'DESTROY_SINGLE_RECORD' | 'DESTROY_MULTIPLE_RECORDS' | 'EXPORT_FROM_RECORD_INDEX' | 'EXPORT_FROM_RECORD_SHOW' | 'EXPORT_MULTIPLE_RECORDS'+export type EngineComponentKey = 'NAVIGATE_TO_NEXT_RECORD' | 'NAVIGATE_TO_PREVIOUS_RECORD' | 'CREATE_NEW_RECORD' | 'DELETE_RECORDS' | 'RESTORE_RECORDS' | 'DESTROY_RECORDS' | 'ADD_TO_FAVORITES' | 'REMOVE_FROM_FAVORITES' | 'EXPORT_NOTE_TO_PDF' | 'EXPORT_RECORDS' | 'UPDATE_MULTIPLE_RECORDS' | 'MERGE_MULTIPLE_RECORDS' | 'IMPORT_RECORDS' | 'EXPORT_VIEW' | 'SEE_DELETED_RECORDS' | 'CREATE_NEW_VIEW' | 'HIDE_DELETED_RECORDS' | 'EDIT_RECORD_PAGE_LAYOUT' | 'EDIT_DASHBOARD_LAYOUT' | 'SAVE_DASHBOARD_LAYOUT' | 'CANCEL_DASHBOARD_LAYOUT' | 'DUPLICATE_DASHBOARD' | 'DUPLICATE_MESSAGE_LIST' | 'ACTIVATE_WORKFLOW' | 'DEACTIVATE_WORKFLOW' | 'DISCARD_DRAFT_WORKFLOW' | 'TEST_WORKFLOW' | 'SEE_ACTIVE_VERSION_WORKFLOW' | 'SEE_RUNS_WORKFLOW' | 'SEE_VERSIONS_WORKFLOW' | 'ADD_NODE_WORKFLOW' | 'TIDY_UP_WORKFLOW' | 'DUPLICATE_WORKFLOW' | 'TOGGLE_WORKFLOW_VISIBILITY' | 'SEE_VERSION_WORKFLOW_RUN' | 'SEE_WORKFLOW_WORKFLOW_RUN' | 'STOP_WORKFLOW_RUN' | 'RETRY_WORKFLOW_RUN' | 'SEE_RUNS_WORKFLOW_VERSION' | 'SEE_WORKFLOW_WORKFLOW_VERSION' | 'USE_AS_DRAFT_WORKFLOW_VERSION' | 'SEE_VERSIONS_WORKFLOW_VERSION' | 'SEARCH_RECORDS' | 'SEARCH_RECORDS_FALLBACK' | 'ASK_AI' | 'VIEW_PREVIOUS_AI_CHATS' | 'NAVIGATION' | 'TRIGGER_WORKFLOW_VERSION' | 'FRONT_COMPONENT_RENDERER' | 'REPLY_TO_EMAIL_THREAD' | 'COMPOSE_EMAIL' | 'COMPOSE_CAMPAIGN' | 'SEND_MESSAGE_CAMPAIGN' | 'SEND_MESSAGE_CAMPAIGN_TEST' | 'CANCEL_MESSAGE_CAMPAIGN' | 'DUPLICATE_MESSAGE_CAMPAIGN' | 'EMAIL_BLOCK_SETTINGS' | 'GO_TO_PEOPLE' | 'GO_TO_COMPANIES' | 'GO_TO_DASHBOARDS' | 'GO_TO_OPPORTUNITIES' | 'GO_TO_SETTINGS' | 'GO_TO_TASKS' | 'GO_TO_NOTES' | 'GO_TO_WORKFLOWS' | 'GO_TO_RUNS' | 'DELETE_SINGLE_RECORD' | 'DELETE_MULTIPLE_RECORDS' | 'RESTORE_SINGLE_RECORD' | 'RESTORE_MULTIPLE_RECORDS' | 'DESTROY_SINGLE_RECORD' | 'DESTROY_MULTIPLE_RECORDS' | 'EXPORT_FROM_RECORD_INDEX' | 'EXPORT_FROM_RECORD_SHOW' | 'EXPORT_MULTIPLE_RECORDS'export type CommandMenuItemAvailabilityType = 'GLOBAL' | 'GLOBAL_OBJECT_CONTEXT' | 'RECORD_SELECTION' | 'FALLBACK'@@ -10676,6 +10676,7 @@ export const enumEngineComponentKey = {ADD_NODE_WORKFLOW: 'ADD_NODE_WORKFLOW' as const,TIDY_UP_WORKFLOW: 'TIDY_UP_WORKFLOW' as const,DUPLICATE_WORKFLOW: 'DUPLICATE_WORKFLOW' as const,+ TOGGLE_WORKFLOW_VISIBILITY: 'TOGGLE_WORKFLOW_VISIBILITY' as const,SEE_VERSION_WORKFLOW_RUN: 'SEE_VERSION_WORKFLOW_RUN' as const,SEE_WORKFLOW_WORKFLOW_RUN: 'SEE_WORKFLOW_WORKFLOW_RUN' as const,STOP_WORKFLOW_RUN: 'STOP_WORKFLOW_RUN' as const,diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.tsindex d1af4cb8b2a..59ca20fe581 100644--- a/packages/twenty-front/src/generated-metadata/graphql.ts+++ b/packages/twenty-front/src/generated-metadata/graphql.ts@@ -1973,6 +1973,7 @@ export enum EngineComponentKey {STOP_WORKFLOW_RUN = 'STOP_WORKFLOW_RUN',TEST_WORKFLOW = 'TEST_WORKFLOW',TIDY_UP_WORKFLOW = 'TIDY_UP_WORKFLOW',+ TOGGLE_WORKFLOW_VISIBILITY = 'TOGGLE_WORKFLOW_VISIBILITY',TRIGGER_WORKFLOW_VERSION = 'TRIGGER_WORKFLOW_VERSION',UPDATE_MULTIPLE_RECORDS = 'UPDATE_MULTIPLE_RECORDS',USE_AS_DRAFT_WORKFLOW_VERSION = 'USE_AS_DRAFT_WORKFLOW_VERSION',diff --git a/packages/twenty-front/src/generated/graphql.ts b/packages/twenty-front/src/generated/graphql.tsindex db72f0e2b7e..a47b345bb6f 100644--- a/packages/twenty-front/src/generated/graphql.ts+++ b/packages/twenty-front/src/generated/graphql.ts@@ -1329,6 +1329,13 @@ export type UpdateCoreWorkflowVersionTriggerMutationVariables = Exact<{export type UpdateCoreWorkflowVersionTriggerMutation = { __typename?: 'Mutation', updateWorkflowVersionTrigger: { __typename?: 'WorkflowVersionTrigger', trigger?: any | null } };+export type UpdateCoreWorkflowVisibilityMutationVariables = Exact<{+ input: UpdateCoreWorkflowVisibilityInput;+}>;+++export type UpdateCoreWorkflowVisibilityMutation = { __typename?: 'Mutation', updateCoreWorkflowVisibility?: { __typename?: 'CoreWorkflowDTO', id: any, visibility: WorkflowVisibility, canChangeVisibility: boolean, updatedAt: string } | null };+export type GetCoreWorkflowQueryVariables = Exact<{coreWorkflowId: Scalars['UUID']['input'];}>;@@ -1559,6 +1566,7 @@ export const UpdateCoreWorkflowDocument = {"kind":"Document","definitions":[{"kiexport const UpdateCoreWorkflowVersionPositionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateCoreWorkflowVersionPositions"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateCoreWorkflowVersionPositionsInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"updateWorkflowVersionPositions"},"name":{"kind":"Name","value":"updateCoreWorkflowVersionPositions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}]}]}}]} as unknown as DocumentNode<UpdateCoreWorkflowVersionPositionsMutation, UpdateCoreWorkflowVersionPositionsMutationVariables>;export const UpdateCoreWorkflowVersionStepDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateCoreWorkflowVersionStep"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateCoreWorkflowVersionStepInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"updateWorkflowVersionStep"},"name":{"kind":"Name","value":"updateCoreWorkflowVersionStep"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"settings"}},{"kind":"Field","name":{"kind":"Name","value":"valid"}},{"kind":"Field","name":{"kind":"Name","value":"nextStepIds"}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"x"}},{"kind":"Field","name":{"kind":"Name","value":"y"}}]}}]}}]}}]} as unknown as DocumentNode<UpdateCoreWorkflowVersionStepMutation, UpdateCoreWorkflowVersionStepMutationVariables>;export const UpdateCoreWorkflowVersionTriggerDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateCoreWorkflowVersionTrigger"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateCoreWorkflowVersionTriggerInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"updateWorkflowVersionTrigger"},"name":{"kind":"Name","value":"updateCoreWorkflowVersionTrigger"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"trigger"}}]}}]}}]} as unknown as DocumentNode<UpdateCoreWorkflowVersionTriggerMutation, UpdateCoreWorkflowVersionTriggerMutationVariables>;+export const UpdateCoreWorkflowVisibilityDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateCoreWorkflowVisibility"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateCoreWorkflowVisibilityInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateCoreWorkflowVisibility"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"visibility"}},{"kind":"Field","name":{"kind":"Name","value":"canChangeVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode<UpdateCoreWorkflowVisibilityMutation, UpdateCoreWorkflowVisibilityMutationVariables>;export const GetCoreWorkflowDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCoreWorkflow"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"coreWorkflowId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"coreWorkflow"},"name":{"kind":"Name","value":"coreWorkflowById"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"coreWorkflowId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"coreWorkflowId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"statuses"}},{"kind":"Field","name":{"kind":"Name","value":"lastPublishedCoreWorkflowVersionId"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceWorkflowId"}},{"kind":"Field","name":{"kind":"Name","value":"visibility"}},{"kind":"Field","name":{"kind":"Name","value":"canChangeVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode<GetCoreWorkflowQuery, GetCoreWorkflowQueryVariables>;export const GetCoreWorkflowLegacyMappingDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCoreWorkflowLegacyMapping"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceWorkflowId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"coreWorkflow"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"workspaceWorkflowId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceWorkflowId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode<GetCoreWorkflowLegacyMappingQuery, GetCoreWorkflowLegacyMappingQueryVariables>;export const GetCoreWorkflowVersionLegacyMappingDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCoreWorkflowVersionLegacyMapping"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceWorkflowVersionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"coreWorkflowVersion"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"workspaceWorkflowVersionId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceWorkflowVersionId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"coreWorkflowId"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceWorkflowVersionId"}}]}}]}}]} as unknown as DocumentNode<GetCoreWorkflowVersionLegacyMappingQuery, GetCoreWorkflowVersionLegacyMappingQueryVariables>;diff --git a/packages/twenty-front/src/modules/command-menu-item/constants/CommandMenuItemSectionByEngineComponentKey.ts b/packages/twenty-front/src/modules/command-menu-item/constants/CommandMenuItemSectionByEngineComponentKey.tsindex 649f476d075..f56e5b3cfb8 100644--- a/packages/twenty-front/src/modules/command-menu-item/constants/CommandMenuItemSectionByEngineComponentKey.ts+++ b/packages/twenty-front/src/modules/command-menu-item/constants/CommandMenuItemSectionByEngineComponentKey.ts@@ -20,6 +20,7 @@ export const COMMAND_MENU_ITEM_SECTION_BY_ENGINE_COMPONENT_KEY = {[EngineComponentKey.DUPLICATE_MESSAGE_LIST]: 'SELECTION',[EngineComponentKey.DUPLICATE_MESSAGE_CAMPAIGN]: 'SELECTION',[EngineComponentKey.DUPLICATE_WORKFLOW]: 'SELECTION',+ [EngineComponentKey.TOGGLE_WORKFLOW_VISIBILITY]: 'SELECTION',[EngineComponentKey.ACTIVATE_WORKFLOW]: 'SELECTION',[EngineComponentKey.DEACTIVATE_WORKFLOW]: 'SELECTION',[EngineComponentKey.DISCARD_DRAFT_WORKFLOW]: 'SELECTION',diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/constants/EngineComponentKeyHeadlessComponentMap.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/constants/EngineComponentKeyHeadlessComponentMap.tsxindex baf6868c3c9..7ba09c4a047 100644--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/constants/EngineComponentKeyHeadlessComponentMap.tsx+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/constants/EngineComponentKeyHeadlessComponentMap.tsx@@ -47,6 +47,7 @@ import { AddNodeWorkflowSingleRecordCommand } from '@/command-menu-item/engine-cimport { DeactivateWorkflowSingleRecordCommand } from '@/command-menu-item/engine-command/record/single-record/workflow/components/DeactivateWorkflowSingleRecordCommand';import { DiscardDraftWorkflowSingleRecordCommand } from '@/command-menu-item/engine-command/record/single-record/workflow/components/DiscardDraftWorkflowSingleRecordCommand';import { DuplicateWorkflowSingleRecordCommand } from '@/command-menu-item/engine-command/record/single-record/workflow/components/DuplicateWorkflowSingleRecordCommand';+import { ToggleWorkflowVisibilitySingleRecordCommand } from '@/command-menu-item/engine-command/record/single-record/workflow/components/ToggleWorkflowVisibilitySingleRecordCommand';import { SeeActiveVersionWorkflowSingleRecordCommand } from '@/command-menu-item/engine-command/record/single-record/workflow/components/SeeActiveVersionWorkflowSingleRecordCommand';import { SeeRunsWorkflowSingleRecordCommand } from '@/command-menu-item/engine-command/record/single-record/workflow/components/SeeRunsWorkflowSingleRecordCommand';import { SeeVersionsWorkflowSingleRecordCommand } from '@/command-menu-item/engine-command/record/single-record/workflow/components/SeeVersionsWorkflowSingleRecordCommand';@@ -80,6 +81,9 @@ export const ENGINE_COMPONENT_KEY_COMPONENT_MAP: Record<[EngineComponentKey.DUPLICATE_WORKFLOW]: (<DuplicateWorkflowSingleRecordCommand />),+ [EngineComponentKey.TOGGLE_WORKFLOW_VISIBILITY]: (+ <ToggleWorkflowVisibilitySingleRecordCommand />+ ),[EngineComponentKey.ACTIVATE_WORKFLOW]: (<ActivateWorkflowSingleRecordCommand />),diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/ToggleWorkflowVisibilitySingleRecordCommand.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/ToggleWorkflowVisibilitySingleRecordCommand.tsxnew file mode 100644index 00000000000..f7b612272d5--- /dev/null+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/ToggleWorkflowVisibilitySingleRecordCommand.tsx@@ -0,0 +1,40 @@+import { useMutation } from '@apollo/client/react';++import { HeadlessEngineCommandWrapperEffect } from '@/command-menu-item/engine-command/components/HeadlessEngineCommandWrapperEffect';+import { useHeadlessCommandContextApi } from '@/command-menu-item/engine-command/hooks/useHeadlessCommandContextApi';+import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';+import { isDefined } from 'twenty-shared/utils';+import {+ UpdateCoreWorkflowVisibilityDocument,+ WorkflowVisibility,+} from '~/generated/graphql';++export const ToggleWorkflowVisibilitySingleRecordCommand = () => {+ const { selectedRecords } = useHeadlessCommandContextApi();++ const selectedRecord = selectedRecords[0];+ const apolloCoreClient = useApolloCoreClient();+ const [updateCoreWorkflowVisibility] = useMutation(+ UpdateCoreWorkflowVisibilityDocument,+ { client: apolloCoreClient },+ );++ if (!isDefined(selectedRecord)) {+ throw new Error('Record ID is required to change workflow visibility');+ }++ const handleExecute = () =>+ updateCoreWorkflowVisibility({+ variables: {+ input: {+ coreWorkflowId: selectedRecord.id,+ visibility:+ selectedRecord.visibility === WorkflowVisibility.PRIVATE+ ? WorkflowVisibility.WORKSPACE+ : WorkflowVisibility.PRIVATE,+ },+ },+ });++ return <HeadlessEngineCommandWrapperEffect execute={handleExecute} />;+};diff --git a/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/updateCoreWorkflowVisibility.ts b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/updateCoreWorkflowVisibility.tsnew file mode 100644index 00000000000..fe385073630--- /dev/null+++ b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/updateCoreWorkflowVisibility.ts@@ -0,0 +1,14 @@+import { gql } from '@apollo/client';++export const UPDATE_CORE_WORKFLOW_VISIBILITY = gql`+ mutation UpdateCoreWorkflowVisibility(+ $input: UpdateCoreWorkflowVisibilityInput!+ ) {+ updateCoreWorkflowVisibility(input: $input) {+ id+ visibility+ canChangeVisibility+ updatedAt+ }+ }+`;diff --git a/packages/twenty-front/src/modules/object-core/workflows/utils/__tests__/buildWorkflowShowPageRecordFromCoreWorkflow.test.ts b/packages/twenty-front/src/modules/object-core/workflows/utils/__tests__/buildWorkflowShowPageRecordFromCoreWorkflow.test.tsindex d18ff642994..3f723663a17 100644--- a/packages/twenty-front/src/modules/object-core/workflows/utils/__tests__/buildWorkflowShowPageRecordFromCoreWorkflow.test.ts+++ b/packages/twenty-front/src/modules/object-core/workflows/utils/__tests__/buildWorkflowShowPageRecordFromCoreWorkflow.test.ts@@ -24,6 +24,8 @@ describe('buildWorkflowShowPageRecordFromCoreWorkflow', () => {name: 'My workflow',statuses: [CoreWorkflowStatus.ACTIVE],lastPublishedVersionId: 'published-version-id',+ visibility: WorkflowVisibility.WORKSPACE,+ canChangeVisibility: true,createdAt: '2026-09-01T00:00:00.000Z',updatedAt: '2026-09-14T00:00:00.000Z',deletedAt: null,diff --git a/packages/twenty-front/src/modules/object-core/workflows/utils/buildWorkflowShowPageRecordFromCoreWorkflow.ts b/packages/twenty-front/src/modules/object-core/workflows/utils/buildWorkflowShowPageRecordFromCoreWorkflow.tsindex b18978e3951..c6646ec8117 100644--- a/packages/twenty-front/src/modules/object-core/workflows/utils/buildWorkflowShowPageRecordFromCoreWorkflow.ts+++ b/packages/twenty-front/src/modules/object-core/workflows/utils/buildWorkflowShowPageRecordFromCoreWorkflow.ts@@ -16,6 +16,8 @@ export const buildWorkflowShowPageRecordFromCoreWorkflow = (name: coreWorkflow.name ?? '',statuses: coreWorkflow.statuses,lastPublishedVersionId: coreWorkflow.lastPublishedCoreWorkflowVersionId,+ visibility: coreWorkflow.visibility,+ canChangeVisibility: coreWorkflow.canChangeVisibility,createdAt: coreWorkflow.createdAt,updatedAt: coreWorkflow.updatedAt,deletedAt: null,diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-43/2-43-upgrade-version-command.module.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-43/2-43-upgrade-version-command.module.tsindex 0c655cd6a6f..a5ad5988570 100644--- a/packages/twenty-server/src/database/commands/upgrade-version-command/2-43/2-43-upgrade-version-command.module.ts+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-43/2-43-upgrade-version-command.module.ts@@ -15,6 +15,7 @@ import { RepairInitialCompanyTargetsCommand } from 'src/database/commands/upgradimport { ProvisionAgentChatThreadTargetCommand } from 'src/database/commands/upgrade-version-command/2-43/2-43-workspace-command-1790317893308-provision-agent-chat-thread-target.command';import { BackfillOAuthOnlyApplicationSourceTypeCommand } from 'src/database/commands/upgrade-version-command/2-43/2-43-workspace-command-1790352791059-backfill-oauth-only-application-source-type.command';import { ApplicationEntity } from 'src/engine/core-modules/application/application.entity';+import { AddWorkflowVisibilityCommandMenuItemsCommand } from 'src/database/commands/upgrade-version-command/2-43/2-43-workspace-command-1790358777596-add-workflow-visibility-command-menu-items.command';import { ApplicationModule } from 'src/engine/core-modules/application/application.module';import { BillingModule } from 'src/engine/core-modules/billing/billing.module';import { FileEntity } from 'src/engine/core-modules/file/entities/file.entity';@@ -54,6 +55,7 @@ import { WorkspaceMigrationModule } from 'src/engine/workspace-manager/workspaceProvisionAgentChatThreadTargetCommand,BackfillOAuthOnlyApplicationSourceTypeCommand,provideWorkspaceScopedRepository(ApplicationEntity),+ AddWorkflowVisibilityCommandMenuItemsCommand,provideWorkspaceScopedRepository(FieldMetadataEntity),provideWorkspaceScopedRepository(FileEntity),],diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-43/2-43-workspace-command-1790358777596-add-workflow-visibility-command-menu-items.command.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-43/2-43-workspace-command-1790358777596-add-workflow-visibility-command-menu-items.command.tsnew file mode 100644index 00000000000..14f3717c75e--- /dev/null+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-43/2-43-workspace-command-1790358777596-add-workflow-visibility-command-menu-items.command.ts@@ -0,0 +1,84 @@+import { Command } from 'nest-commander';+import { TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER } from 'twenty-shared/application';++import { ProvisionedWorkspaceCommandRunner } from 'src/database/commands/command-runners/provisioned-workspace.command-runner';+import { WorkspaceIteratorService } from 'src/database/commands/command-runners/workspace-iterator.service';+import { type RunOnWorkspaceArgs } from 'src/database/commands/command-runners/workspace.command-runner';+import { buildMissingStandardCommandMenuItemsToCreate } from 'src/database/commands/upgrade-version-command/2-39/utils/build-missing-standard-command-menu-items-to-create.util';+import { RegisteredWorkspaceCommand } from 'src/engine/core-modules/upgrade/decorators/registered-workspace-command.decorator';+import { WorkspaceCacheService } from 'src/engine/workspace-cache/services/workspace-cache.service';+import { WorkspaceMigrationBuilderException } from 'src/engine/workspace-manager/workspace-migration/exceptions/workspace-migration-builder-exception';+import { WorkspaceMigrationValidateBuildAndRunService } from 'src/engine/workspace-manager/workspace-migration/services/workspace-migration-validate-build-and-run-service';++@RegisteredWorkspaceCommand('2.43.0', 1790358777596)+@Command({+ name: 'upgrade:2-43:add-workflow-visibility-command-menu-items',+ description:+ 'Add the Make Private and Share with Workspace workflow commands to workspaces that predate them',+})+export class AddWorkflowVisibilityCommandMenuItemsCommand extends ProvisionedWorkspaceCommandRunner {+ constructor(+ protected readonly workspaceIteratorService: WorkspaceIteratorService,+ private readonly workspaceCacheService: WorkspaceCacheService,+ private readonly workspaceMigrationValidateBuildAndRunService: WorkspaceMigrationValidateBuildAndRunService,+ ) {+ super(workspaceIteratorService);+ }++ override async runOnWorkspace({+ workspaceId,+ options,+ }: RunOnWorkspaceArgs): Promise<void> {+ const { flatCommandMenuItemMaps, flatObjectMetadataMaps } =+ await this.workspaceCacheService.getOrRecompute(workspaceId, [+ 'flatCommandMenuItemMaps',+ 'flatObjectMetadataMaps',+ ]);++ const commandMenuItemsToCreate =+ buildMissingStandardCommandMenuItemsToCreate({+ commandMenuItemNames: [+ 'makeWorkflowPrivate',+ 'shareWorkflowWithWorkspace',+ ],+ flatCommandMenuItemByUniversalIdentifier:+ flatCommandMenuItemMaps.byUniversalIdentifier,+ flatObjectMetadataMaps,+ workspaceId,+ now: new Date().toISOString(),+ });++ if (commandMenuItemsToCreate.length === 0) {+ return;+ }++ if (options.dryRun) {+ this.logger.log(+ `Would add ${commandMenuItemsToCreate.length} workflow visibility command(s) for workspace ${workspaceId}`,+ );++ return;+ }++ const validateAndBuildResult =+ await this.workspaceMigrationValidateBuildAndRunService.validateBuildAndRunWorkspaceMigration(+ {+ allFlatEntityOperationByMetadataName: {+ commandMenuItem: {+ flatEntityToCreate: commandMenuItemsToCreate,+ flatEntityToDelete: [],+ flatEntityToUpdate: [],+ },+ },+ workspaceId,+ isSystemBuild: true,+ applicationUniversalIdentifier:+ TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,+ },+ );++ if (validateAndBuildResult.status === 'fail') {+ throw new WorkspaceMigrationBuilderException(validateAndBuildResult);+ }+ }+}diff --git a/packages/twenty-server/src/engine/metadata-modules/command-menu-item/enums/engine-component-key.enum.ts b/packages/twenty-server/src/engine/metadata-modules/command-menu-item/enums/engine-component-key.enum.tsindex fd450997d1a..d924c36b8b8 100644--- a/packages/twenty-server/src/engine/metadata-modules/command-menu-item/enums/engine-component-key.enum.ts+++ b/packages/twenty-server/src/engine/metadata-modules/command-menu-item/enums/engine-component-key.enum.ts@@ -34,6 +34,7 @@ export enum EngineComponentKey {ADD_NODE_WORKFLOW = 'ADD_NODE_WORKFLOW',TIDY_UP_WORKFLOW = 'TIDY_UP_WORKFLOW',DUPLICATE_WORKFLOW = 'DUPLICATE_WORKFLOW',+ TOGGLE_WORKFLOW_VISIBILITY = 'TOGGLE_WORKFLOW_VISIBILITY',SEE_VERSION_WORKFLOW_RUN = 'SEE_VERSION_WORKFLOW_RUN',SEE_WORKFLOW_WORKFLOW_RUN = 'SEE_WORKFLOW_WORKFLOW_RUN',STOP_WORKFLOW_RUN = 'STOP_WORKFLOW_RUN',diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-command-menu-item.constant.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-command-menu-item.constant.tsindex 7c125246b63..167fc357b0d 100644--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-command-menu-item.constant.ts+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-command-menu-item.constant.ts@@ -648,6 +648,55 @@ export const STANDARD_COMMAND_MENU_ITEMS = {engineComponentKey: EngineComponentKey.DUPLICATE_WORKFLOW,hotKeys: null,},+ makeWorkflowPrivate: {+ universalIdentifier: '26f98606-8b6e-42f2-bc97-2cfc4359bada',+ label: i18nLabel(+ msg({+ message: `Make Workflow Private`,+ context: 'commandMenuItem.label',+ }),+ ),+ icon: 'IconCircleDashed',+ isPinned: false,+ position: 33,+ shortLabel: i18nLabel(+ msg({ message: `Make Private`, context: 'commandMenuItem.shortLabel' }),+ ),+ availabilityType: CommandMenuItemAvailabilityType.RECORD_SELECTION,+ conditionalAvailabilityExpression:+ 'numberOfSelectedRecords == 1 and everyEquals(selectedRecords, "visibility", "WORKSPACE") and every(selectedRecords, "canChangeVisibility") and noneDefined(selectedRecords, "deletedAt")',+ availabilityObjectMetadataUniversalIdentifier:+ STANDARD_OBJECTS.workflow.universalIdentifier,+ frontComponentUniversalIdentifier: null,+ engineComponentKey: EngineComponentKey.TOGGLE_WORKFLOW_VISIBILITY,+ hotKeys: null,+ },+ shareWorkflowWithWorkspace: {+ universalIdentifier: '37745922-ba18-4bea-a1da-8625ad22d233',+ label: i18nLabel(+ msg({+ message: `Share Workflow with Workspace`,+ context: 'commandMenuItem.label',+ }),+ ),+ icon: 'IconCircle',+ isPinned: false,+ position: 33,+ shortLabel: i18nLabel(+ msg({+ message: `Share with Workspace`,+ context: 'commandMenuItem.shortLabel',+ }),+ ),+ availabilityType: CommandMenuItemAvailabilityType.RECORD_SELECTION,+ conditionalAvailabilityExpression:+ 'numberOfSelectedRecords == 1 and everyEquals(selectedRecords, "visibility", "PRIVATE") and every(selectedRecords, "canChangeVisibility") and noneDefined(selectedRecords, "deletedAt")',+ availabilityObjectMetadataUniversalIdentifier:+ STANDARD_OBJECTS.workflow.universalIdentifier,+ frontComponentUniversalIdentifier: null,+ engineComponentKey: EngineComponentKey.TOGGLE_WORKFLOW_VISIBILITY,+ hotKeys: null,+ },seeVersionWorkflowRun: {universalIdentifier: 'cc3a065c-c89e-40ac-9449-4272c55b1bb8',label: i18nLabel(