Skip to content

The open alternative to Salesforce, designed for AI.

feat: migrate workflow editor and actions to core IDs (#26116)

Thomas Trompettefbd4c129dd7a
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
index 4b798a13226..c0d653db309 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
@@ -104,6 +104,7 @@ type FrontComponent {
type CommandMenuItem {
id: UUID!
workflowVersionId: UUID
+ coreWorkflowVersionId: UUID
frontComponentId: UUID
frontComponent: FrontComponent
engineComponentKey: EngineComponentKey!
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.ts b/packages/twenty-client-sdk/src/metadata/generated/schema.ts
index 67a0f055338..8ae50fe1eb6 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/schema.ts
+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.ts
@@ -104,6 +104,7 @@ export interface FrontComponent {
export interface CommandMenuItem {
id: Scalars['UUID']
workflowVersionId?: Scalars['UUID']
+ coreWorkflowVersionId?: Scalars['UUID']
frontComponentId?: Scalars['UUID']
frontComponent?: FrontComponent
engineComponentKey: EngineComponentKey
@@ -3712,6 +3713,7 @@ export interface FrontComponentGenqlSelection{
export interface CommandMenuItemGenqlSelection{
id?: boolean | number
workflowVersionId?: boolean | number
+ coreWorkflowVersionId?: boolean | number
frontComponentId?: boolean | number
frontComponent?: FrontComponentGenqlSelection
engineComponentKey?: boolean | number
diff --git a/packages/twenty-client-sdk/src/metadata/generated/types.ts b/packages/twenty-client-sdk/src/metadata/generated/types.ts
index f6e18afa911..98168dfff4a 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/types.ts
+++ b/packages/twenty-client-sdk/src/metadata/generated/types.ts
@@ -342,6 +342,9 @@ export default {
"workflowVersionId": [
3
],
+ "coreWorkflowVersionId": [
+ 3
+ ],
"frontComponentId": [
3
],
diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.ts
index 6f63f413b96..6ae9e310e13 100644
--- a/packages/twenty-front/src/generated-metadata/graphql.ts
+++ b/packages/twenty-front/src/generated-metadata/graphql.ts
@@ -1158,6 +1158,7 @@ export type CommandMenuItem = {
availabilityType: CommandMenuItemAvailabilityType;
conditionalAvailabilityExpression?: Maybe<Scalars['String']['output']>;
conditionalPinnedExpression?: Maybe<Scalars['String']['output']>;
+ coreWorkflowVersionId?: Maybe<Scalars['UUID']['output']>;
createdAt: Scalars['DateTime']['output'];
engineComponentKey: EngineComponentKey;
frontComponent?: Maybe<FrontComponent>;
@@ -8145,7 +8146,7 @@ export type ValidatePasswordResetTokenQueryVariables = Exact<{
export type ValidatePasswordResetTokenQuery = { __typename?: 'Query', validatePasswordResetToken: { __typename?: 'ValidatePasswordResetToken', id: string, email: string, hasPassword: boolean } };
-export type CommandMenuItemFieldsFragment = { __typename?: 'CommandMenuItem', id: string, universalIdentifier?: string | null, applicationId?: string | null, workflowVersionId?: string | null, frontComponentId?: string | null, engineComponentKey: EngineComponentKey, label: string, icon?: string | null, shortLabel?: string | null, position: number, isPinned: boolean, hotKeys?: Array<string> | null, conditionalAvailabilityExpression?: string | null, conditionalPinnedExpression?: string | null, availabilityType: CommandMenuItemAvailabilityType, availabilityObjectMetadataId?: string | null, navigationTargetObjectMetadataId?: string | null, pageLayoutId?: string | null, isActive: boolean, frontComponent?: { __typename?: 'FrontComponent', id: string, name: string, isHeadless: boolean } | null, payload?:
+export type CommandMenuItemFieldsFragment = { __typename?: 'CommandMenuItem', id: string, universalIdentifier?: string | null, applicationId?: string | null, coreWorkflowVersionId?: string | null, workflowVersionId?: string | null, frontComponentId?: string | null, engineComponentKey: EngineComponentKey, label: string, icon?: string | null, shortLabel?: string | null, position: number, isPinned: boolean, hotKeys?: Array<string> | null, conditionalAvailabilityExpression?: string | null, conditionalPinnedExpression?: string | null, availabilityType: CommandMenuItemAvailabilityType, availabilityObjectMetadataId?: string | null, navigationTargetObjectMetadataId?: string | null, pageLayoutId?: string | null, isActive: boolean, frontComponent?: { __typename?: 'FrontComponent', id: string, name: string, isHeadless: boolean } | null, payload?:
| { __typename?: 'ObjectMetadataCommandMenuItemPayload' }
| { __typename?: 'PathCommandMenuItemPayload', path: string }
| null };
@@ -8162,7 +8163,7 @@ export type ResetCommandMenuItemMutationVariables = Exact<{
}>;
-export type ResetCommandMenuItemMutation = { __typename?: 'Mutation', resetCommandMenuItem: { __typename?: 'CommandMenuItem', id: string, universalIdentifier?: string | null, applicationId?: string | null, workflowVersionId?: string | null, frontComponentId?: string | null, engineComponentKey: EngineComponentKey, label: string, icon?: string | null, shortLabel?: string | null, position: number, isPinned: boolean, hotKeys?: Array<string> | null, conditionalAvailabilityExpression?: string | null, conditionalPinnedExpression?: string | null, availabilityType: CommandMenuItemAvailabilityType, availabilityObjectMetadataId?: string | null, navigationTargetObjectMetadataId?: string | null, pageLayoutId?: string | null, isActive: boolean, frontComponent?: { __typename?: 'FrontComponent', id: string, name: string, isHeadless: boolean } | null, payload?:
+export type ResetCommandMenuItemMutation = { __typename?: 'Mutation', resetCommandMenuItem: { __typename?: 'CommandMenuItem', id: string, universalIdentifier?: string | null, applicationId?: string | null, coreWorkflowVersionId?: string | null, workflowVersionId?: string | null, frontComponentId?: string | null, engineComponentKey: EngineComponentKey, label: string, icon?: string | null, shortLabel?: string | null, position: number, isPinned: boolean, hotKeys?: Array<string> | null, conditionalAvailabilityExpression?: string | null, conditionalPinnedExpression?: string | null, availabilityType: CommandMenuItemAvailabilityType, availabilityObjectMetadataId?: string | null, navigationTargetObjectMetadataId?: string | null, pageLayoutId?: string | null, isActive: boolean, frontComponent?: { __typename?: 'FrontComponent', id: string, name: string, isHeadless: boolean } | null, payload?:
| { __typename?: 'ObjectMetadataCommandMenuItemPayload' }
| { __typename?: 'PathCommandMenuItemPayload', path: string }
| null } };
@@ -8172,7 +8173,7 @@ export type UpdateCommandMenuItemMutationVariables = Exact<{
}>;
-export type UpdateCommandMenuItemMutation = { __typename?: 'Mutation', updateCommandMenuItem: { __typename?: 'CommandMenuItem', id: string, universalIdentifier?: string | null, applicationId?: string | null, workflowVersionId?: string | null, frontComponentId?: string | null, engineComponentKey: EngineComponentKey, label: string, icon?: string | null, shortLabel?: string | null, position: number, isPinned: boolean, hotKeys?: Array<string> | null, conditionalAvailabilityExpression?: string | null, conditionalPinnedExpression?: string | null, availabilityType: CommandMenuItemAvailabilityType, availabilityObjectMetadataId?: string | null, navigationTargetObjectMetadataId?: string | null, pageLayoutId?: string | null, isActive: boolean, frontComponent?: { __typename?: 'FrontComponent', id: string, name: string, isHeadless: boolean } | null, payload?:
+export type UpdateCommandMenuItemMutation = { __typename?: 'Mutation', updateCommandMenuItem: { __typename?: 'CommandMenuItem', id: string, universalIdentifier?: string | null, applicationId?: string | null, coreWorkflowVersionId?: string | null, workflowVersionId?: string | null, frontComponentId?: string | null, engineComponentKey: EngineComponentKey, label: string, icon?: string | null, shortLabel?: string | null, position: number, isPinned: boolean, hotKeys?: Array<string> | null, conditionalAvailabilityExpression?: string | null, conditionalPinnedExpression?: string | null, availabilityType: CommandMenuItemAvailabilityType, availabilityObjectMetadataId?: string | null, navigationTargetObjectMetadataId?: string | null, pageLayoutId?: string | null, isActive: boolean, frontComponent?: { __typename?: 'FrontComponent', id: string, name: string, isHeadless: boolean } | null, payload?:
| { __typename?: 'ObjectMetadataCommandMenuItemPayload' }
| { __typename?: 'PathCommandMenuItemPayload', path: string }
| null } };
@@ -8180,7 +8181,7 @@ export type UpdateCommandMenuItemMutation = { __typename?: 'Mutation', updateCom
export type FindManyCommandMenuItemsQueryVariables = Exact<{ [key: string]: never; }>;
-export type FindManyCommandMenuItemsQuery = { __typename?: 'Query', commandMenuItems: Array<{ __typename?: 'CommandMenuItem', id: string, universalIdentifier?: string | null, applicationId?: string | null, workflowVersionId?: string | null, frontComponentId?: string | null, engineComponentKey: EngineComponentKey, label: string, icon?: string | null, shortLabel?: string | null, position: number, isPinned: boolean, hotKeys?: Array<string> | null, conditionalAvailabilityExpression?: string | null, conditionalPinnedExpression?: string | null, availabilityType: CommandMenuItemAvailabilityType, availabilityObjectMetadataId?: string | null, navigationTargetObjectMetadataId?: string | null, pageLayoutId?: string | null, isActive: boolean, frontComponent?: { __typename?: 'FrontComponent', id: string, name: string, isHeadless: boolean } | null, payload?:
+export type FindManyCommandMenuItemsQuery = { __typename?: 'Query', commandMenuItems: Array<{ __typename?: 'CommandMenuItem', id: string, universalIdentifier?: string | null, applicationId?: string | null, coreWorkflowVersionId?: string | null, workflowVersionId?: string | null, frontComponentId?: string | null, engineComponentKey: EngineComponentKey, label: string, icon?: string | null, shortLabel?: string | null, position: number, isPinned: boolean, hotKeys?: Array<string> | null, conditionalAvailabilityExpression?: string | null, conditionalPinnedExpression?: string | null, availabilityType: CommandMenuItemAvailabilityType, availabilityObjectMetadataId?: string | null, navigationTargetObjectMetadataId?: string | null, pageLayoutId?: string | null, isActive: boolean, frontComponent?: { __typename?: 'FrontComponent', id: string, name: string, isHeadless: boolean } | null, payload?:
| { __typename?: 'ObjectMetadataCommandMenuItemPayload' }
| { __typename?: 'PathCommandMenuItemPayload', path: string }
| null }> };
@@ -10072,7 +10073,7 @@ export const ApplicationFieldsFragmentDoc = {"kind":"Document","definitions":[{"
export const AuthTokenFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AuthTokenFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AuthToken"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"token"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}}]}}]} as unknown as DocumentNode<AuthTokenFragmentFragment, unknown>;
export const AuthTokenPairFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AuthTokenPairFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AuthTokenPair"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accessOrWorkspaceAgnosticToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AuthTokenFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"refreshToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AuthTokenFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AuthTokenFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AuthToken"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"token"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}}]}}]} as unknown as DocumentNode<AuthTokenPairFragmentFragment, unknown>;
export const AvailableSsoIdentityProvidersFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AvailableSSOIdentityProvidersFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FindAvailableSSOIDP"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"issuer"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"workspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}}]}}]}}]} as unknown as DocumentNode<AvailableSsoIdentityProvidersFragmentFragment, unknown>;
-export const CommandMenuItemFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CommandMenuItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CommandMenuItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"workflowVersionId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isHeadless"}}]}},{"kind":"Field","name":{"kind":"Name","value":"engineComponentKey"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"shortLabel"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"isPinned"}},{"kind":"Field","name":{"kind":"Name","value":"payload"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PathCommandMenuItemPayload"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"path"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"hotKeys"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalPinnedExpression"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityType"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityObjectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"navigationTargetObjectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}}]}}]} as unknown as DocumentNode<CommandMenuItemFieldsFragment, unknown>;
+export const CommandMenuItemFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CommandMenuItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CommandMenuItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"coreWorkflowVersionId"}},{"kind":"Field","name":{"kind":"Name","value":"workflowVersionId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isHeadless"}}]}},{"kind":"Field","name":{"kind":"Name","value":"engineComponentKey"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"shortLabel"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"isPinned"}},{"kind":"Field","name":{"kind":"Name","value":"payload"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PathCommandMenuItemPayload"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"path"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"hotKeys"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalPinnedExpression"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityType"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityObjectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"navigationTargetObjectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}}]}}]} as unknown as DocumentNode<CommandMenuItemFieldsFragment, unknown>;
export const PageLayoutWidgetFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutWidgetFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidget"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"gridPosition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetGridPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetVerticalListPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"heightBehavior"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetCanvasPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"configuration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BarChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"groupMode"}},{"kind":"Field","name":{"kind":"Name","value":"layout"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LineChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"isStacked"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PieChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"groupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"groupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"dateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"orderBy"}},{"kind":"Field","name":{"kind":"Name","value":"manualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"showCenterMetric"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"hideEmptyCategory"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"prefix"}},{"kind":"Field","name":{"kind":"Name","value":"suffix"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}},{"kind":"Field","name":{"kind":"Name","value":"ratioAggregateConfig"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"optionValue"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"IframeConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StandaloneRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"blocknote"}},{"kind":"Field","name":{"kind":"Name","value":"markdown"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CalendarConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailThreadConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingSummaryConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingTranscriptConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignBodyConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignDetailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldDisplayMode"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"nestedRelationFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"isUIEditable"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"newFieldDefaultVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"shouldAllowUserToSeeHiddenFields"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FormFieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FilesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NotesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TasksConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RecordTableConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"recordLimit"}},{"kind":"Field","name":{"kind":"Name","value":"isUIEditable"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowRunConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FrontComponentConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"headerCommandMenuItemUniversalIdentifiers"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutTabId"}}]}}]} as unknown as DocumentNode<PageLayoutWidgetFragmentFragment, unknown>;
export const PageLayoutTabFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutTabFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutTab"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"widgets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutWidgetFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutWidgetFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidget"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"gridPosition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetGridPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetVerticalListPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"heightBehavior"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetCanvasPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"configuration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BarChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"groupMode"}},{"kind":"Field","name":{"kind":"Name","value":"layout"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LineChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"isStacked"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PieChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"groupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"groupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"dateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"orderBy"}},{"kind":"Field","name":{"kind":"Name","value":"manualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"showCenterMetric"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"hideEmptyCategory"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"prefix"}},{"kind":"Field","name":{"kind":"Name","value":"suffix"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}},{"kind":"Field","name":{"kind":"Name","value":"ratioAggregateConfig"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"optionValue"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"IframeConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StandaloneRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"blocknote"}},{"kind":"Field","name":{"kind":"Name","value":"markdown"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CalendarConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailThreadConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingSummaryConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingTranscriptConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignBodyConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignDetailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldDisplayMode"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"nestedRelationFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"isUIEditable"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"newFieldDefaultVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"shouldAllowUserToSeeHiddenFields"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FormFieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FilesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NotesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TasksConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RecordTableConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"recordLimit"}},{"kind":"Field","name":{"kind":"Name","value":"isUIEditable"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowRunConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FrontComponentConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"headerCommandMenuItemUniversalIdentifiers"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutTabId"}}]}}]} as unknown as DocumentNode<PageLayoutTabFragmentFragment, unknown>;
export const PageLayoutFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayout"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"isFirstTabPinned"}},{"kind":"Field","name":{"kind":"Name","value":"defaultTabToFocusOnMobileAndSidePanelId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"tabs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutTabFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutWidgetFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidget"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"gridPosition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetGridPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetVerticalListPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"heightBehavior"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetCanvasPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"configuration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BarChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"groupMode"}},{"kind":"Field","name":{"kind":"Name","value":"layout"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LineChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"isStacked"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PieChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"groupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"groupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"dateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"orderBy"}},{"kind":"Field","name":{"kind":"Name","value":"manualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"showCenterMetric"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"hideEmptyCategory"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"prefix"}},{"kind":"Field","name":{"kind":"Name","value":"suffix"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}},{"kind":"Field","name":{"kind":"Name","value":"ratioAggregateConfig"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"optionValue"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"IframeConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StandaloneRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"blocknote"}},{"kind":"Field","name":{"kind":"Name","value":"markdown"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CalendarConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailThreadConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingSummaryConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingTranscriptConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignBodyConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignDetailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldDisplayMode"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"nestedRelationFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"isUIEditable"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"newFieldDefaultVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"shouldAllowUserToSeeHiddenFields"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FormFieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FilesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NotesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TasksConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RecordTableConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"recordLimit"}},{"kind":"Field","name":{"kind":"Name","value":"isUIEditable"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowRunConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FrontComponentConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"headerCommandMenuItemUniversalIdentifiers"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutTabId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutTabFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutTab"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"widgets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutWidgetFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode<PageLayoutFragmentFragment, unknown>;
@@ -10196,9 +10197,9 @@ export const GetPublicWorkspaceDataByDomainDocument = {"kind":"Document","defini
export const GetWorkspaceCreationDefaultsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetWorkspaceCreationDefaults"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getWorkspaceCreationDefaults"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"subdomain"}}]}}]}}]} as unknown as DocumentNode<GetWorkspaceCreationDefaultsQuery, GetWorkspaceCreationDefaultsQueryVariables>;
export const ValidatePasswordResetTokenDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ValidatePasswordResetToken"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"token"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"validatePasswordResetToken"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"passwordResetToken"},"value":{"kind":"Variable","name":{"kind":"Name","value":"token"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"hasPassword"}}]}}]}}]} as unknown as DocumentNode<ValidatePasswordResetTokenQuery, ValidatePasswordResetTokenQueryVariables>;
export const DuplicateMessageListDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DuplicateMessageList"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"duplicateMessageList"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"memberCount"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode<DuplicateMessageListMutation, DuplicateMessageListMutationVariables>;
-export const ResetCommandMenuItemDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ResetCommandMenuItem"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"resetCommandMenuItem"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CommandMenuItemFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CommandMenuItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CommandMenuItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"workflowVersionId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isHeadless"}}]}},{"kind":"Field","name":{"kind":"Name","value":"engineComponentKey"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"shortLabel"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"isPinned"}},{"kind":"Field","name":{"kind":"Name","value":"payload"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PathCommandMenuItemPayload"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"path"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"hotKeys"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalPinnedExpression"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityType"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityObjectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"navigationTargetObjectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}}]}}]} as unknown as DocumentNode<ResetCommandMenuItemMutation, ResetCommandMenuItemMutationVariables>;
-export const UpdateCommandMenuItemDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateCommandMenuItem"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateCommandMenuItemInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateCommandMenuItem"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CommandMenuItemFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CommandMenuItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CommandMenuItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"workflowVersionId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isHeadless"}}]}},{"kind":"Field","name":{"kind":"Name","value":"engineComponentKey"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"shortLabel"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"isPinned"}},{"kind":"Field","name":{"kind":"Name","value":"payload"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PathCommandMenuItemPayload"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"path"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"hotKeys"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalPinnedExpression"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityType"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityObjectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"navigationTargetObjectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}}]}}]} as unknown as DocumentNode<UpdateCommandMenuItemMutation, UpdateCommandMenuItemMutationVariables>;
-export const FindManyCommandMenuItemsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindManyCommandMenuItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"commandMenuItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CommandMenuItemFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CommandMenuItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CommandMenuItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"workflowVersionId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isHeadless"}}]}},{"kind":"Field","name":{"kind":"Name","value":"engineComponentKey"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"shortLabel"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"isPinned"}},{"kind":"Field","name":{"kind":"Name","value":"payload"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PathCommandMenuItemPayload"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"path"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"hotKeys"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalPinnedExpression"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityType"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityObjectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"navigationTargetObjectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}}]}}]} as unknown as DocumentNode<FindManyCommandMenuItemsQuery, FindManyCommandMenuItemsQueryVariables>;
+export const ResetCommandMenuItemDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ResetCommandMenuItem"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"resetCommandMenuItem"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CommandMenuItemFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CommandMenuItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CommandMenuItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"coreWorkflowVersionId"}},{"kind":"Field","name":{"kind":"Name","value":"workflowVersionId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isHeadless"}}]}},{"kind":"Field","name":{"kind":"Name","value":"engineComponentKey"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"shortLabel"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"isPinned"}},{"kind":"Field","name":{"kind":"Name","value":"payload"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PathCommandMenuItemPayload"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"path"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"hotKeys"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalPinnedExpression"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityType"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityObjectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"navigationTargetObjectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}}]}}]} as unknown as DocumentNode<ResetCommandMenuItemMutation, ResetCommandMenuItemMutationVariables>;
+export const UpdateCommandMenuItemDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateCommandMenuItem"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateCommandMenuItemInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateCommandMenuItem"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CommandMenuItemFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CommandMenuItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CommandMenuItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"coreWorkflowVersionId"}},{"kind":"Field","name":{"kind":"Name","value":"workflowVersionId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isHeadless"}}]}},{"kind":"Field","name":{"kind":"Name","value":"engineComponentKey"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"shortLabel"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"isPinned"}},{"kind":"Field","name":{"kind":"Name","value":"payload"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PathCommandMenuItemPayload"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"path"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"hotKeys"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalPinnedExpression"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityType"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityObjectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"navigationTargetObjectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}}]}}]} as unknown as DocumentNode<UpdateCommandMenuItemMutation, UpdateCommandMenuItemMutationVariables>;
+export const FindManyCommandMenuItemsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindManyCommandMenuItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"commandMenuItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CommandMenuItemFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CommandMenuItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CommandMenuItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"coreWorkflowVersionId"}},{"kind":"Field","name":{"kind":"Name","value":"workflowVersionId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isHeadless"}}]}},{"kind":"Field","name":{"kind":"Name","value":"engineComponentKey"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"shortLabel"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"isPinned"}},{"kind":"Field","name":{"kind":"Name","value":"payload"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PathCommandMenuItemPayload"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"path"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"hotKeys"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalPinnedExpression"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityType"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityObjectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"navigationTargetObjectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}}]}}]} as unknown as DocumentNode<FindManyCommandMenuItemsQuery, FindManyCommandMenuItemsQueryVariables>;
export const DuplicateDashboardDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DuplicateDashboard"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"duplicateDashboard"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode<DuplicateDashboardMutation, DuplicateDashboardMutationVariables>;
export const FindOnePageLayoutDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindOnePageLayout"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getPageLayout"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutWidgetFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidget"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"gridPosition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetGridPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetVerticalListPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"heightBehavior"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetCanvasPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"configuration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BarChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"groupMode"}},{"kind":"Field","name":{"kind":"Name","value":"layout"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LineChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"isStacked"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PieChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"groupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"groupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"dateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"orderBy"}},{"kind":"Field","name":{"kind":"Name","value":"manualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"showCenterMetric"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"hideEmptyCategory"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"prefix"}},{"kind":"Field","name":{"kind":"Name","value":"suffix"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}},{"kind":"Field","name":{"kind":"Name","value":"ratioAggregateConfig"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"optionValue"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"IframeConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StandaloneRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"blocknote"}},{"kind":"Field","name":{"kind":"Name","value":"markdown"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CalendarConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailThreadConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingSummaryConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingTranscriptConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignBodyConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignDetailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldDisplayMode"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"nestedRelationFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"isUIEditable"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"newFieldDefaultVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"shouldAllowUserToSeeHiddenFields"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FormFieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FilesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NotesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TasksConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RecordTableConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"recordLimit"}},{"kind":"Field","name":{"kind":"Name","value":"isUIEditable"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowRunConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FrontComponentConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"headerCommandMenuItemUniversalIdentifiers"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutTabId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutTabFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutTab"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"widgets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutWidgetFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayout"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"isFirstTabPinned"}},{"kind":"Field","name":{"kind":"Name","value":"defaultTabToFocusOnMobileAndSidePanelId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"tabs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutTabFragment"}}]}}]}}]} as unknown as DocumentNode<FindOnePageLayoutQuery, FindOnePageLayoutQueryVariables>;
export const FindOnePageLayoutTypeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindOnePageLayoutType"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getPageLayout"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}}]}}]} as unknown as DocumentNode<FindOnePageLayoutTypeQuery, FindOnePageLayoutTypeQueryVariables>;
diff --git a/packages/twenty-front/src/generated/graphql.ts b/packages/twenty-front/src/generated/graphql.ts
index 34751aac565..19a6621a3f1 100644
--- a/packages/twenty-front/src/generated/graphql.ts
+++ b/packages/twenty-front/src/generated/graphql.ts
@@ -63,6 +63,7 @@ export type CoreWorkflowDto = {
applicationId?: Maybe<Scalars['UUID']['output']>;
createdAt: Scalars['String']['output'];
id: Scalars['UUID']['output'];
+ lastPublishedCoreWorkflowVersionId?: Maybe<Scalars['UUID']['output']>;
lastPublishedVersionId?: Maybe<Scalars['UUID']['output']>;
name?: Maybe<Scalars['String']['output']>;
statuses: Array<CoreWorkflowStatus>;
@@ -138,6 +139,7 @@ export enum CoreWorkflowStatus {
export type CoreWorkflowVersionDto = {
__typename?: 'CoreWorkflowVersionDTO';
+ coreWorkflowId?: Maybe<Scalars['UUID']['output']>;
createdAt: Scalars['String']['output'];
id: Scalars['UUID']['output'];
label: Scalars['String']['output'];
@@ -156,6 +158,17 @@ export enum CoreWorkflowVersionStatus {
DRAFT = 'DRAFT'
}
+export type CoreWorkflowWithCurrentVersionDto = {
+ __typename?: 'CoreWorkflowWithCurrentVersionDTO';
+ currentVersion: CoreWorkflowVersionDto;
+ versions: Array<CoreWorkflowVersionDto>;
+ workflow: CoreWorkflowDto;
+};
+
+export type CoreWorkflowsWithCurrentVersionsInput = {
+ coreWorkflowIds: Array<Scalars['UUID']['input']>;
+};
+
export type CreateCoreWorkflowInput = {
name?: InputMaybe<Scalars['String']['input']>;
};
@@ -277,7 +290,7 @@ export type DeleteWorkflowVersionStepInput = {
export type DeletedCoreWorkflowDto = {
__typename?: 'DeletedCoreWorkflowDTO';
id: Scalars['UUID']['output'];
- workspaceWorkflowId: Scalars['UUID']['output'];
+ workspaceWorkflowId?: Maybe<Scalars['UUID']['output']>;
};
export type DiscardCoreWorkflowDraftInput = {
@@ -664,6 +677,7 @@ export type Query = {
coreWorkflowVersions: Array<CoreWorkflowVersionDto>;
coreWorkflowVersionsByCoreWorkflowId: Array<CoreWorkflowVersionDto>;
coreWorkflows: CoreWorkflowConnection;
+ coreWorkflowsWithCurrentVersions: Array<CoreWorkflowWithCurrentVersionDto>;
dpaAgreements: Array<DpaAgreement>;
dpaPreview: DpaDocument;
/** @deprecated Use getTimelineCalendarEventsFromObjectRecord instead */
@@ -726,6 +740,11 @@ export type QueryCoreWorkflowsArgs = {
};
+export type QueryCoreWorkflowsWithCurrentVersionsArgs = {
+ input: CoreWorkflowsWithCurrentVersionsInput;
+};
+
+
export type QueryGetTimelineCalendarEventsFromCompanyIdArgs = {
companyId: Scalars['UUID']['input'];
page: Scalars['Int']['input'];
@@ -1177,6 +1196,13 @@ export type SearchQueryVariables = Exact<{
export type SearchQuery = { __typename?: 'Query', search: { __typename?: 'SearchResultConnection', edges: Array<{ __typename?: 'SearchResultEdge', cursor: string, node: { __typename?: 'SearchRecord', recordId: any, objectNameSingular: string, objectLabelSingular: string, label: string, imageUrl?: string | null, tsRankCD: number, tsRank: number } }>, pageInfo: { __typename?: 'SearchResultPageInfo', hasNextPage: boolean, endCursor?: string | null } } };
+export type ActivateCoreWorkflowVersionMutationVariables = Exact<{
+ coreWorkflowVersionId: Scalars['UUID']['input'];
+}>;
+
+
+export type ActivateCoreWorkflowVersionMutation = { __typename?: 'Mutation', activateWorkflowVersion: boolean };
+
export type CreateCoreWorkflowMutationVariables = Exact<{
input: CreateCoreWorkflowInput;
}>;
@@ -1184,12 +1210,54 @@ export type CreateCoreWorkflowMutationVariables = Exact<{
export type CreateCoreWorkflowMutation = { __typename?: 'Mutation', createCoreWorkflow: { __typename?: 'CoreWorkflowDTO', id: any, name?: string | null, statuses: Array<CoreWorkflowStatus>, workspaceWorkflowId?: any | null, updatedAt: string } };
+export type CreateCoreWorkflowVersionEdgeMutationVariables = Exact<{
+ input: CreateCoreWorkflowVersionEdgeInput;
+}>;
+
+
+export type CreateCoreWorkflowVersionEdgeMutation = { __typename?: 'Mutation', createWorkflowVersionEdge: { __typename?: 'WorkflowVersionStepChanges', triggerDiff?: any | null, stepsDiff?: any | null } };
+
+export type CreateCoreWorkflowVersionStepMutationVariables = Exact<{
+ input: CreateCoreWorkflowVersionStepInput;
+}>;
+
+
+export type CreateCoreWorkflowVersionStepMutation = { __typename?: 'Mutation', createWorkflowVersionStep: { __typename?: 'WorkflowVersionStepChanges', triggerDiff?: any | null, stepsDiff?: any | null } };
+
+export type CreateDraftFromCoreWorkflowVersionMutationVariables = Exact<{
+ input: CreateDraftFromCoreWorkflowVersionInput;
+}>;
+
+
+export type CreateDraftFromCoreWorkflowVersionMutation = { __typename?: 'Mutation', createDraftFromWorkflowVersion: { __typename?: 'CoreWorkflowVersionDTO', id: any, coreWorkflowId?: any | null, label: string, status: CoreWorkflowVersionStatus, trigger?: any | null, steps?: any | null, createdAt: string, updatedAt: string } };
+
+export type DeactivateCoreWorkflowVersionMutationVariables = Exact<{
+ coreWorkflowVersionId: Scalars['UUID']['input'];
+}>;
+
+
+export type DeactivateCoreWorkflowVersionMutation = { __typename?: 'Mutation', deactivateWorkflowVersion: boolean };
+
+export type DeleteCoreWorkflowVersionEdgeMutationVariables = Exact<{
+ input: DeleteCoreWorkflowVersionEdgeInput;
+}>;
+
+
+export type DeleteCoreWorkflowVersionEdgeMutation = { __typename?: 'Mutation', deleteWorkflowVersionEdge: { __typename?: 'WorkflowVersionStepChanges', triggerDiff?: any | null, stepsDiff?: any | null } };
+
+export type DeleteCoreWorkflowVersionStepMutationVariables = Exact<{
+ input: DeleteCoreWorkflowVersionStepInput;
+}>;
+
+
+export type DeleteCoreWorkflowVersionStepMutation = { __typename?: 'Mutation', deleteWorkflowVersionStep: { __typename?: 'WorkflowVersionStepChanges', triggerDiff?: any | null, stepsDiff?: any | null } };
+
export type DeleteCoreWorkflowsMutationVariables = Exact<{
input: DeleteCoreWorkflowsInput;
}>;
-export type DeleteCoreWorkflowsMutation = { __typename?: 'Mutation', deleteCoreWorkflows: Array<{ __typename?: 'DeletedCoreWorkflowDTO', id: any, workspaceWorkflowId: any }> };
+export type DeleteCoreWorkflowsMutation = { __typename?: 'Mutation', deleteCoreWorkflows: Array<{ __typename?: 'DeletedCoreWorkflowDTO', id: any, workspaceWorkflowId?: any | null }> };
export type DiscardCoreWorkflowDraftMutationVariables = Exact<{
input: DiscardCoreWorkflowDraftInput;
@@ -1198,12 +1266,82 @@ export type DiscardCoreWorkflowDraftMutationVariables = Exact<{
export type DiscardCoreWorkflowDraftMutation = { __typename?: 'Mutation', discardCoreWorkflowDraft?: { __typename?: 'CoreWorkflowDTO', id: any, name?: string | null, statuses: Array<CoreWorkflowStatus>, lastPublishedVersionId?: any | null, workspaceWorkflowId?: any | null, updatedAt: string } | null };
+export type DuplicateCoreWorkflowMutationVariables = Exact<{
+ input: DuplicateCoreWorkflowInput;
+}>;
+
+
+export type DuplicateCoreWorkflowMutation = { __typename?: 'Mutation', duplicateWorkflow: { __typename?: 'CoreWorkflowDTO', id: any } };
+
+export type DuplicateCoreWorkflowVersionStepMutationVariables = Exact<{
+ input: DuplicateCoreWorkflowVersionStepInput;
+}>;
+
+
+export type DuplicateCoreWorkflowVersionStepMutation = { __typename?: 'Mutation', duplicateWorkflowVersionStep: { __typename?: 'WorkflowVersionStepChanges', triggerDiff?: any | null, stepsDiff?: any | null } };
+
+export type RunCoreWorkflowVersionMutationVariables = Exact<{
+ input: RunCoreWorkflowVersionInput;
+}>;
+
+
+export type RunCoreWorkflowVersionMutation = { __typename?: 'Mutation', runWorkflowVersion: { __typename?: 'RunWorkflowVersion', workflowRunId: any } };
+
+export type UpdateCoreWorkflowMutationVariables = Exact<{
+ input: UpdateCoreWorkflowInput;
+}>;
+
+
+export type UpdateCoreWorkflowMutation = { __typename?: 'Mutation', updateCoreWorkflow?: { __typename?: 'CoreWorkflowDTO', id: any, name?: string | null, updatedAt: string } | null };
+
+export type UpdateCoreWorkflowVersionPositionsMutationVariables = Exact<{
+ input: UpdateCoreWorkflowVersionPositionsInput;
+}>;
+
+
+export type UpdateCoreWorkflowVersionPositionsMutation = { __typename?: 'Mutation', updateWorkflowVersionPositions: boolean };
+
+export type UpdateCoreWorkflowVersionStepMutationVariables = Exact<{
+ input: UpdateCoreWorkflowVersionStepInput;
+}>;
+
+
+export type UpdateCoreWorkflowVersionStepMutation = { __typename?: 'Mutation', updateWorkflowVersionStep: { __typename?: 'WorkflowAction', id: any, name: string, type: WorkflowActionType, settings: any, valid: boolean, nextStepIds?: Array<any> | null, position?: { __typename?: 'WorkflowStepPosition', x: number, y: number } | null } };
+
+export type UpdateCoreWorkflowVersionTriggerMutationVariables = Exact<{
+ input: UpdateCoreWorkflowVersionTriggerInput;
+}>;
+
+
+export type UpdateCoreWorkflowVersionTriggerMutation = { __typename?: 'Mutation', updateWorkflowVersionTrigger: { __typename?: 'WorkflowVersionTrigger', trigger?: any | null } };
+
+export type ValidateCoreWorkflowVersionMutationVariables = Exact<{
+ coreWorkflowVersionId: Scalars['UUID']['input'];
+}>;
+
+
+export type ValidateCoreWorkflowVersionMutation = { __typename?: 'Mutation', validateCoreWorkflowVersion: boolean };
+
export type GetCoreWorkflowQueryVariables = Exact<{
+ coreWorkflowId: Scalars['UUID']['input'];
+}>;
+
+
+export type GetCoreWorkflowQuery = { __typename?: 'Query', coreWorkflow?: { __typename?: 'CoreWorkflowDTO', id: any, name?: string | null, statuses: Array<CoreWorkflowStatus>, lastPublishedCoreWorkflowVersionId?: any | null, workspaceWorkflowId?: any | null, createdAt: string, updatedAt: string } | null };
+
+export type GetCoreWorkflowLegacyMappingQueryVariables = Exact<{
workspaceWorkflowId: Scalars['UUID']['input'];
}>;
-export type GetCoreWorkflowQuery = { __typename?: 'Query', coreWorkflow?: { __typename?: 'CoreWorkflowDTO', id: any, name?: string | null, statuses: Array<CoreWorkflowStatus>, lastPublishedVersionId?: any | null, workspaceWorkflowId?: any | null, createdAt: string, updatedAt: string } | null };
+export type GetCoreWorkflowLegacyMappingQuery = { __typename?: 'Query', coreWorkflow?: { __typename?: 'CoreWorkflowDTO', id: any } | null };
+
+export type GetCoreWorkflowVersionLegacyMappingQueryVariables = Exact<{
+ workspaceWorkflowVersionId: Scalars['UUID']['input'];
+}>;
+
+
+export type GetCoreWorkflowVersionLegacyMappingQuery = { __typename?: 'Query', coreWorkflowVersion?: { __typename?: 'CoreWorkflowVersionDTO', id: any, coreWorkflowId?: any | null, workspaceWorkflowVersionId?: any | null } | null };
export type GetCoreWorkflowsQueryVariables = Exact<{
first?: InputMaybe<Scalars['Int']['input']>;
@@ -1216,19 +1354,26 @@ export type GetCoreWorkflowsQueryVariables = Exact<{
export type GetCoreWorkflowsQuery = { __typename?: 'Query', coreWorkflows: { __typename?: 'CoreWorkflowConnection', totalCount: number, edges: Array<{ __typename?: 'CoreWorkflowEdge', cursor: string, node: { __typename?: 'CoreWorkflowDTO', id: any, name?: string | null, statuses: Array<CoreWorkflowStatus>, workspaceWorkflowId?: any | null, updatedAt: string } }>, pageInfo: { __typename?: 'CoreWorkflowPageInfo', endCursor?: string | null, hasNextPage: boolean } } };
+export type GetCoreWorkflowsWithCurrentVersionsQueryVariables = Exact<{
+ input: CoreWorkflowsWithCurrentVersionsInput;
+}>;
+
+
+export type GetCoreWorkflowsWithCurrentVersionsQuery = { __typename?: 'Query', coreWorkflowsWithCurrentVersions: Array<{ __typename?: 'CoreWorkflowWithCurrentVersionDTO', workflow: { __typename?: 'CoreWorkflowDTO', id: any, name?: string | null, statuses: Array<CoreWorkflowStatus>, lastPublishedCoreWorkflowVersionId?: any | null }, versions: Array<{ __typename?: 'CoreWorkflowVersionDTO', id: any, coreWorkflowId?: any | null, label: string, status: CoreWorkflowVersionStatus, createdAt: string }>, currentVersion: { __typename?: 'CoreWorkflowVersionDTO', id: any, coreWorkflowId?: any | null, label: string, status: CoreWorkflowVersionStatus, trigger?: any | null, steps?: any | null, createdAt: string, updatedAt: string } }> };
+
export type GetCoreWorkflowVersionQueryVariables = Exact<{
- workspaceWorkflowVersionId: Scalars['UUID']['input'];
+ coreWorkflowVersionId: Scalars['UUID']['input'];
}>;
-export type GetCoreWorkflowVersionQuery = { __typename?: 'Query', coreWorkflowVersion?: { __typename?: 'CoreWorkflowVersionDTO', id: any, label: string, status: CoreWorkflowVersionStatus, workspaceWorkflowVersionId?: any | null, workspaceWorkflowId?: any | null, trigger?: any | null, steps?: any | null, createdAt: string, updatedAt: string } | null };
+export type GetCoreWorkflowVersionQuery = { __typename?: 'Query', coreWorkflowVersion?: { __typename?: 'CoreWorkflowVersionDTO', id: any, label: string, status: CoreWorkflowVersionStatus, workspaceWorkflowVersionId?: any | null, coreWorkflowId?: any | null, trigger?: any | null, steps?: any | null, createdAt: string, updatedAt: string } | null };
export type GetCoreWorkflowVersionsQueryVariables = Exact<{
- workspaceWorkflowId: Scalars['UUID']['input'];
+ coreWorkflowId: Scalars['UUID']['input'];
}>;
-export type GetCoreWorkflowVersionsQuery = { __typename?: 'Query', coreWorkflowVersions: Array<{ __typename?: 'CoreWorkflowVersionDTO', id: any, label: string, status: CoreWorkflowVersionStatus, workspaceWorkflowVersionId?: any | null, workspaceWorkflowId?: any | null, createdAt: string, updatedAt: string }> };
+export type GetCoreWorkflowVersionsQuery = { __typename?: 'Query', coreWorkflowVersions: Array<{ __typename?: 'CoreWorkflowVersionDTO', id: any, label: string, status: CoreWorkflowVersionStatus, coreWorkflowId?: any | null, createdAt: string, updatedAt: string }> };
export type WorkflowDiffFragmentFragment = { __typename?: 'WorkflowVersionStepChanges', triggerDiff?: any | null, stepsDiff?: any | null };
@@ -1390,13 +1535,31 @@ export const WorkflowDiffFragmentFragmentDoc = {"kind":"Document","definitions":
export const GetTimelineCalendarEventsFromObjectRecordDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTimelineCalendarEventsFromObjectRecord"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"objectNameSingular"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"recordId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"page"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"pageSize"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getTimelineCalendarEventsFromObjectRecord"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"objectNameSingular"},"value":{"kind":"Variable","name":{"kind":"Name","value":"objectNameSingular"}}},{"kind":"Argument","name":{"kind":"Name","value":"recordId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recordId"}}},{"kind":"Argument","name":{"kind":"Name","value":"page"},"value":{"kind":"Variable","name":{"kind":"Name","value":"page"}}},{"kind":"Argument","name":{"kind":"Name","value":"pageSize"},"value":{"kind":"Variable","name":{"kind":"Name","value":"pageSize"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"TimelineCalendarEventsWithTotalFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"TimelineCalendarEventParticipantFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineCalendarEventParticipant"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"personId"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMemberId"}},{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"handle"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"TimelineCalendarEventCallRecordingFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineCalendarEventCallRecording"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"TimelineCalendarEventFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineCalendarEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"location"}},{"kind":"Field","name":{"kind":"Name","value":"startsAt"}},{"kind":"Field","name":{"kind":"Name","value":"endsAt"}},{"kind":"Field","name":{"kind":"Name","value":"isFullDay"}},{"kind":"Field","name":{"kind":"Name","value":"visibility"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"TimelineCalendarEventParticipantFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"callRecordings"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"TimelineCalendarEventCallRecordingFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"TimelineCalendarEventsWithTotalFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineCalendarEventsWithTotal"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalNumberOfCalendarEvents"}},{"kind":"Field","name":{"kind":"Name","value":"relatedPersonIds"}},{"kind":"Field","name":{"kind":"Name","value":"timelineCalendarEvents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"TimelineCalendarEventFragment"}}]}}]}}]} as unknown as DocumentNode<GetTimelineCalendarEventsFromObjectRecordQuery, GetTimelineCalendarEventsFromObjectRecordQueryVariables>;
export const GetTimelineThreadsFromObjectRecordDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTimelineThreadsFromObjectRecord"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"objectNameSingular"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"recordId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"page"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"pageSize"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getTimelineThreadsFromObjectRecord"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"objectNameSingular"},"value":{"kind":"Variable","name":{"kind":"Name","value":"objectNameSingular"}}},{"kind":"Argument","name":{"kind":"Name","value":"recordId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recordId"}}},{"kind":"Argument","name":{"kind":"Name","value":"page"},"value":{"kind":"Variable","name":{"kind":"Name","value":"page"}}},{"kind":"Argument","name":{"kind":"Name","value":"pageSize"},"value":{"kind":"Variable","name":{"kind":"Name","value":"pageSize"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"TimelineThreadsWithTotalFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ParticipantFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineThreadParticipant"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"personId"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMemberId"}},{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"handle"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"TimelineThreadFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"read"}},{"kind":"Field","name":{"kind":"Name","value":"visibility"}},{"kind":"Field","name":{"kind":"Name","value":"firstParticipant"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ParticipantFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"lastTwoParticipants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ParticipantFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"lastMessageReceivedAt"}},{"kind":"Field","name":{"kind":"Name","value":"lastMessageBody"}},{"kind":"Field","name":{"kind":"Name","value":"subject"}},{"kind":"Field","name":{"kind":"Name","value":"numberOfMessagesInThread"}},{"kind":"Field","name":{"kind":"Name","value":"participantCount"}},{"kind":"Field","name":{"kind":"Name","value":"lastMessageIsDraft"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"TimelineThreadsWithTotalFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineThreadsWithTotal"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalNumberOfThreads"}},{"kind":"Field","name":{"kind":"Name","value":"relatedPersonIds"}},{"kind":"Field","name":{"kind":"Name","value":"timelineThreads"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"TimelineThreadFragment"}}]}}]}}]} as unknown as DocumentNode<GetTimelineThreadsFromObjectRecordQuery, GetTimelineThreadsFromObjectRecordQueryVariables>;
export const SearchDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Search"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"searchInput"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"after"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"excludedObjectNameSingulars"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"includedObjectNameSingulars"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filter"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ObjectRecordFilterInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"search"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"searchInput"},"value":{"kind":"Variable","name":{"kind":"Name","value":"searchInput"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"after"},"value":{"kind":"Variable","name":{"kind":"Name","value":"after"}}},{"kind":"Argument","name":{"kind":"Name","value":"excludedObjectNameSingulars"},"value":{"kind":"Variable","name":{"kind":"Name","value":"excludedObjectNameSingulars"}}},{"kind":"Argument","name":{"kind":"Name","value":"includedObjectNameSingulars"},"value":{"kind":"Variable","name":{"kind":"Name","value":"includedObjectNameSingulars"}}},{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filter"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"recordId"}},{"kind":"Field","name":{"kind":"Name","value":"objectNameSingular"}},{"kind":"Field","name":{"kind":"Name","value":"objectLabelSingular"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"imageUrl"}},{"kind":"Field","name":{"kind":"Name","value":"tsRankCD"}},{"kind":"Field","name":{"kind":"Name","value":"tsRank"}}]}},{"kind":"Field","name":{"kind":"Name","value":"cursor"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}},{"kind":"Field","name":{"kind":"Name","value":"endCursor"}}]}}]}}]}}]} as unknown as DocumentNode<SearchQuery, SearchQueryVariables>;
+export const ActivateCoreWorkflowVersionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ActivateCoreWorkflowVersion"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"coreWorkflowVersionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"activateWorkflowVersion"},"name":{"kind":"Name","value":"activateCoreWorkflowVersion"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"coreWorkflowVersionId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"coreWorkflowVersionId"}}}]}]}}]} as unknown as DocumentNode<ActivateCoreWorkflowVersionMutation, ActivateCoreWorkflowVersionMutationVariables>;
export const CreateCoreWorkflowDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateCoreWorkflow"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateCoreWorkflowInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createCoreWorkflow"},"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":"statuses"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceWorkflowId"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode<CreateCoreWorkflowMutation, CreateCoreWorkflowMutationVariables>;
+export const CreateCoreWorkflowVersionEdgeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateCoreWorkflowVersionEdge"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateCoreWorkflowVersionEdgeInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"createWorkflowVersionEdge"},"name":{"kind":"Name","value":"createCoreWorkflowVersionEdge"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WorkflowDiffFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WorkflowDiffFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionStepChanges"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"triggerDiff"}},{"kind":"Field","name":{"kind":"Name","value":"stepsDiff"}}]}}]} as unknown as DocumentNode<CreateCoreWorkflowVersionEdgeMutation, CreateCoreWorkflowVersionEdgeMutationVariables>;
+export const CreateCoreWorkflowVersionStepDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateCoreWorkflowVersionStep"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateCoreWorkflowVersionStepInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"createWorkflowVersionStep"},"name":{"kind":"Name","value":"createCoreWorkflowVersionStep"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WorkflowDiffFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WorkflowDiffFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionStepChanges"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"triggerDiff"}},{"kind":"Field","name":{"kind":"Name","value":"stepsDiff"}}]}}]} as unknown as DocumentNode<CreateCoreWorkflowVersionStepMutation, CreateCoreWorkflowVersionStepMutationVariables>;
+export const CreateDraftFromCoreWorkflowVersionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateDraftFromCoreWorkflowVersion"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateDraftFromCoreWorkflowVersionInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"createDraftFromWorkflowVersion"},"name":{"kind":"Name","value":"createDraftFromCoreWorkflowVersion"},"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":"coreWorkflowId"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"trigger"}},{"kind":"Field","name":{"kind":"Name","value":"steps"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode<CreateDraftFromCoreWorkflowVersionMutation, CreateDraftFromCoreWorkflowVersionMutationVariables>;
+export const DeactivateCoreWorkflowVersionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeactivateCoreWorkflowVersion"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"coreWorkflowVersionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"deactivateWorkflowVersion"},"name":{"kind":"Name","value":"deactivateCoreWorkflowVersion"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"coreWorkflowVersionId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"coreWorkflowVersionId"}}}]}]}}]} as unknown as DocumentNode<DeactivateCoreWorkflowVersionMutation, DeactivateCoreWorkflowVersionMutationVariables>;
+export const DeleteCoreWorkflowVersionEdgeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteCoreWorkflowVersionEdge"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"DeleteCoreWorkflowVersionEdgeInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"deleteWorkflowVersionEdge"},"name":{"kind":"Name","value":"deleteCoreWorkflowVersionEdge"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WorkflowDiffFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WorkflowDiffFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionStepChanges"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"triggerDiff"}},{"kind":"Field","name":{"kind":"Name","value":"stepsDiff"}}]}}]} as unknown as DocumentNode<DeleteCoreWorkflowVersionEdgeMutation, DeleteCoreWorkflowVersionEdgeMutationVariables>;
+export const DeleteCoreWorkflowVersionStepDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteCoreWorkflowVersionStep"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"DeleteCoreWorkflowVersionStepInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"deleteWorkflowVersionStep"},"name":{"kind":"Name","value":"deleteCoreWorkflowVersionStep"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WorkflowDiffFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WorkflowDiffFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionStepChanges"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"triggerDiff"}},{"kind":"Field","name":{"kind":"Name","value":"stepsDiff"}}]}}]} as unknown as DocumentNode<DeleteCoreWorkflowVersionStepMutation, DeleteCoreWorkflowVersionStepMutationVariables>;
export const DeleteCoreWorkflowsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteCoreWorkflows"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"DeleteCoreWorkflowsInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteCoreWorkflows"},"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":"workspaceWorkflowId"}}]}}]}}]} as unknown as DocumentNode<DeleteCoreWorkflowsMutation, DeleteCoreWorkflowsMutationVariables>;
export const DiscardCoreWorkflowDraftDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DiscardCoreWorkflowDraft"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"DiscardCoreWorkflowDraftInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"discardCoreWorkflowDraft"},"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":"statuses"}},{"kind":"Field","name":{"kind":"Name","value":"lastPublishedVersionId"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceWorkflowId"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode<DiscardCoreWorkflowDraftMutation, DiscardCoreWorkflowDraftMutationVariables>;
-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":"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"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"statuses"}},{"kind":"Field","name":{"kind":"Name","value":"lastPublishedVersionId"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceWorkflowId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode<GetCoreWorkflowQuery, GetCoreWorkflowQueryVariables>;
+export const DuplicateCoreWorkflowDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DuplicateCoreWorkflow"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"DuplicateCoreWorkflowInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"duplicateWorkflow"},"name":{"kind":"Name","value":"duplicateCoreWorkflow"},"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"}}]}}]}}]} as unknown as DocumentNode<DuplicateCoreWorkflowMutation, DuplicateCoreWorkflowMutationVariables>;
+export const DuplicateCoreWorkflowVersionStepDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DuplicateCoreWorkflowVersionStep"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"DuplicateCoreWorkflowVersionStepInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"duplicateWorkflowVersionStep"},"name":{"kind":"Name","value":"duplicateCoreWorkflowVersionStep"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WorkflowDiffFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WorkflowDiffFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionStepChanges"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"triggerDiff"}},{"kind":"Field","name":{"kind":"Name","value":"stepsDiff"}}]}}]} as unknown as DocumentNode<DuplicateCoreWorkflowVersionStepMutation, DuplicateCoreWorkflowVersionStepMutationVariables>;
+export const RunCoreWorkflowVersionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"RunCoreWorkflowVersion"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"RunCoreWorkflowVersionInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"runWorkflowVersion"},"name":{"kind":"Name","value":"runCoreWorkflowVersion"},"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":"workflowRunId"}}]}}]}}]} as unknown as DocumentNode<RunCoreWorkflowVersionMutation, RunCoreWorkflowVersionMutationVariables>;
+export const UpdateCoreWorkflowDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateCoreWorkflow"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateCoreWorkflowInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateCoreWorkflow"},"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":"updatedAt"}}]}}]}}]} as unknown as DocumentNode<UpdateCoreWorkflowMutation, UpdateCoreWorkflowMutationVariables>;
+export 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 ValidateCoreWorkflowVersionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ValidateCoreWorkflowVersion"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"coreWorkflowVersionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"validateCoreWorkflowVersion"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"coreWorkflowVersionId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"coreWorkflowVersionId"}}}]}]}}]} as unknown as DocumentNode<ValidateCoreWorkflowVersionMutation, ValidateCoreWorkflowVersionMutationVariables>;
+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":"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>;
export const GetCoreWorkflowsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCoreWorkflows"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"after"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"CoreWorkflowOrderByField"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderByDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"CoreWorkflowOrderByDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filter"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"CoreWorkflowFilterInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"coreWorkflows"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}},{"kind":"Argument","name":{"kind":"Name","value":"after"},"value":{"kind":"Variable","name":{"kind":"Name","value":"after"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderByDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderByDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filter"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"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":"workspaceWorkflowId"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"cursor"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"endCursor"}},{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode<GetCoreWorkflowsQuery, GetCoreWorkflowsQueryVariables>;
-export const GetCoreWorkflowVersionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCoreWorkflowVersion"},"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":"label"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceWorkflowVersionId"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceWorkflowId"}},{"kind":"Field","name":{"kind":"Name","value":"trigger"}},{"kind":"Field","name":{"kind":"Name","value":"steps"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode<GetCoreWorkflowVersionQuery, GetCoreWorkflowVersionQueryVariables>;
-export const GetCoreWorkflowVersionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCoreWorkflowVersions"},"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":"coreWorkflowVersions"},"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"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceWorkflowVersionId"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceWorkflowId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode<GetCoreWorkflowVersionsQuery, GetCoreWorkflowVersionsQueryVariables>;
+export const GetCoreWorkflowsWithCurrentVersionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCoreWorkflowsWithCurrentVersions"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CoreWorkflowsWithCurrentVersionsInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"coreWorkflowsWithCurrentVersions"},"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":"workflow"},"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":"versions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"coreWorkflowId"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"currentVersion"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"coreWorkflowId"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"trigger"}},{"kind":"Field","name":{"kind":"Name","value":"steps"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]}}]} as unknown as DocumentNode<GetCoreWorkflowsWithCurrentVersionsQuery, GetCoreWorkflowsWithCurrentVersionsQueryVariables>;
+export const GetCoreWorkflowVersionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCoreWorkflowVersion"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"coreWorkflowVersionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"coreWorkflowVersion"},"name":{"kind":"Name","value":"coreWorkflowVersionById"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"coreWorkflowVersionId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"coreWorkflowVersionId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceWorkflowVersionId"}},{"kind":"Field","name":{"kind":"Name","value":"coreWorkflowId"}},{"kind":"Field","name":{"kind":"Name","value":"trigger"}},{"kind":"Field","name":{"kind":"Name","value":"steps"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode<GetCoreWorkflowVersionQuery, GetCoreWorkflowVersionQueryVariables>;
+export const GetCoreWorkflowVersionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCoreWorkflowVersions"},"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":"coreWorkflowVersions"},"name":{"kind":"Name","value":"coreWorkflowVersionsByCoreWorkflowId"},"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":"label"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"coreWorkflowId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode<GetCoreWorkflowVersionsQuery, GetCoreWorkflowVersionsQueryVariables>;
export const ActivateWorkflowVersionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ActivateWorkflowVersion"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workflowVersionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activateWorkflowVersion"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"workflowVersionId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workflowVersionId"}}}]}]}}]} as unknown as DocumentNode<ActivateWorkflowVersionMutation, ActivateWorkflowVersionMutationVariables>;
export const ComputeStepOutputSchemaDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ComputeStepOutputSchema"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ComputeStepOutputSchemaInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"computeStepOutputSchema"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}]}]}}]} as unknown as DocumentNode<ComputeStepOutputSchemaMutation, ComputeStepOutputSchemaMutationVariables>;
export const CreateDraftFromWorkflowVersionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateDraftFromWorkflowVersion"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateDraftFromWorkflowVersionInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createDraftFromWorkflowVersion"},"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":"status"}},{"kind":"Field","name":{"kind":"Name","value":"trigger"}},{"kind":"Field","name":{"kind":"Name","value":"steps"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode<CreateDraftFromWorkflowVersionMutation, CreateDraftFromWorkflowVersionMutationVariables>;
diff --git a/packages/twenty-front/src/hooks/__tests__/usePageChangeEffectNavigateLocation.test.ts b/packages/twenty-front/src/hooks/__tests__/usePageChangeEffectNavigateLocation.test.ts
index a59c95f72a3..e126a173951 100644
--- a/packages/twenty-front/src/hooks/__tests__/usePageChangeEffectNavigateLocation.test.ts
+++ b/packages/twenty-front/src/hooks/__tests__/usePageChangeEffectNavigateLocation.test.ts
@@ -360,6 +360,16 @@ const testCases: {
{ loc: AppPath.RecordShowPage, isLogged: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.BOOK_CALL, res: AppPath.BookCall },
{ loc: AppPath.RecordShowPage, isLogged: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.COMPLETED, res: undefined },
+ { loc: AppPath.WorkflowCoreShowPage, isLogged: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: AppPath.PlanRequired },
+ { loc: AppPath.WorkflowCoreShowPage, isLogged: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },
+ { loc: AppPath.WorkflowCoreShowPage, isLogged: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: AppPath.SignInUp },
+ { loc: AppPath.WorkflowCoreShowPage, isLogged: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.WORKSPACE_ACTIVATION, res: AppPath.WorkspaceActivation },
+ { loc: AppPath.WorkflowCoreShowPage, isLogged: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PROFILE_CREATION, res: AppPath.CreateProfile },
+ { loc: AppPath.WorkflowCoreShowPage, isLogged: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.SYNC_EMAIL, res: AppPath.SyncEmails },
+ { loc: AppPath.WorkflowCoreShowPage, isLogged: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.APPS_INSTALLATION, res: AppPath.InstallApps },
+ { loc: AppPath.WorkflowCoreShowPage, isLogged: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.INVITE_TEAM, res: AppPath.InviteTeam },
+ { loc: AppPath.WorkflowCoreShowPage, isLogged: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.BOOK_CALL, res: AppPath.BookCall },
+ { loc: AppPath.WorkflowCoreShowPage, isLogged: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.COMPLETED, res: undefined },
{ loc: AppPath.WorkflowCoreIndexPage, isLogged: true, isWorkspaceSuspended: false, onboardingStatus: OnboardingStatus.PLAN_REQUIRED, res: AppPath.PlanRequired },
{ loc: AppPath.WorkflowCoreIndexPage, isLogged: true, isWorkspaceSuspended: true, onboardingStatus: OnboardingStatus.COMPLETED, res: getSettingsPath(SettingsPath.Billing) },
{ loc: AppPath.WorkflowCoreIndexPage, isLogged: false, isWorkspaceSuspended: false, onboardingStatus: undefined, res: AppPath.SignInUp },
diff --git a/packages/twenty-front/src/modules/app/routing/utils/__tests__/createWorkspaceRouteObjects.test.tsx b/packages/twenty-front/src/modules/app/routing/utils/__tests__/createWorkspaceRouteObjects.test.tsx
index cc060220829..89248f7ee1f 100644
--- a/packages/twenty-front/src/modules/app/routing/utils/__tests__/createWorkspaceRouteObjects.test.tsx
+++ b/packages/twenty-front/src/modules/app/routing/utils/__tests__/createWorkspaceRouteObjects.test.tsx
@@ -42,6 +42,7 @@ describe('workspace route objects', () => {
);
expect(panelRoutes.map(({ path }) => path)).toEqual([
+ AppPath.WorkflowCoreShowPage,
AppPath.RecordIndexPage,
AppPath.RecordShowPage,
SETTINGS_ROOT_PATH,
diff --git a/packages/twenty-front/src/modules/app/routing/utils/createWorkspaceRouteObjects.tsx b/packages/twenty-front/src/modules/app/routing/utils/createWorkspaceRouteObjects.tsx
index e478ab2e1f5..03ffc0ab5cf 100644
--- a/packages/twenty-front/src/modules/app/routing/utils/createWorkspaceRouteObjects.tsx
+++ b/packages/twenty-front/src/modules/app/routing/utils/createWorkspaceRouteObjects.tsx
@@ -17,6 +17,12 @@ const WorkflowCoreIndexPage = lazy(() =>
})),
);
+const WorkflowCoreShowPage = lazy(() =>
+ import('~/pages/object-core/WorkflowCoreShowPage').then((module) => ({
+ default: module.WorkflowCoreShowPage,
+ })),
+);
+
const RecordIndexPage = lazy(() =>
import('~/pages/object-record/RecordIndexPage').then((module) => ({
default: module.RecordIndexPage,
@@ -70,6 +76,18 @@ export const createWorkspaceRouteObjects = ({
});
return [
+ {
+ path: AppPath.WorkflowCoreShowPage,
+ element: (
+ <LazyRoute>
+ <WorkflowCoreShowPage />
+ </LazyRoute>
+ ),
+ handle: {
+ workspaceSurfaces: MAIN_AND_SIDE_PANEL,
+ isLocationExpandableFromSidePanel: true,
+ },
+ },
...(isWorkflowCoreIndexPageEnabled
? [
{
diff --git a/packages/twenty-front/src/modules/command-menu-item/contexts/CommandMenuContextProviderContent.tsx b/packages/twenty-front/src/modules/command-menu-item/contexts/CommandMenuContextProviderContent.tsx
index dddcabafdc4..f563f22d131 100644
--- a/packages/twenty-front/src/modules/command-menu-item/contexts/CommandMenuContextProviderContent.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/contexts/CommandMenuContextProviderContent.tsx
@@ -1,5 +1,6 @@
import { useGlobalRecordCreationCommandMenuItems } from '@/command-menu-item/hooks/useGlobalRecordCreationCommandMenuItems';
import { CommandMenuItemContainerType } from '@/command-menu-item/types/CommandMenuItemContainerType';
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
import {
CommandMenuContext,
type CommandMenuContextType,
@@ -20,10 +21,32 @@ import {
} from '@/page-layout/states/currentPageLayoutIdState';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { useContext, useMemo } from 'react';
-import { type CommandMenuContextApi } from 'twenty-shared/types';
+import {
+ ContextStorePageType,
+ CoreObjectNameSingular,
+ type CommandMenuContextApi,
+} from 'twenty-shared/types';
import { evaluateConditionalAvailabilityExpression } from 'twenty-shared/utils';
import { EngineComponentKey } from '~/generated-metadata/graphql';
+const WORKSPACE_DEFINITION_COMMANDS = new Set<EngineComponentKey>([
+ EngineComponentKey.ADD_TO_FAVORITES,
+ EngineComponentKey.REMOVE_FROM_FAVORITES,
+ EngineComponentKey.EDIT_RECORD_PAGE_LAYOUT,
+ EngineComponentKey.EXPORT_RECORDS,
+ EngineComponentKey.EXPORT_FROM_RECORD_INDEX,
+ EngineComponentKey.EXPORT_VIEW,
+ EngineComponentKey.IMPORT_RECORDS,
+ EngineComponentKey.SEE_DELETED_RECORDS,
+ EngineComponentKey.CREATE_NEW_VIEW,
+ EngineComponentKey.HIDE_DELETED_RECORDS,
+ EngineComponentKey.EXPORT_FROM_RECORD_SHOW,
+ EngineComponentKey.EXPORT_MULTIPLE_RECORDS,
+ EngineComponentKey.UPDATE_MULTIPLE_RECORDS,
+ EngineComponentKey.NAVIGATE_TO_NEXT_RECORD,
+ EngineComponentKey.NAVIGATE_TO_PREVIOUS_RECORD,
+]);
+
type CommandMenuContextProviderContentProps = {
displayType: CommandMenuContextType['displayType'];
containerType: CommandMenuContextType['containerType'];
@@ -39,6 +62,14 @@ export const CommandMenuContextProviderContent = ({
commandMenuContextApi,
isInPreviewMode,
}: CommandMenuContextProviderContentProps) => {
+ const isCore = useIsWorkflowCoreEnabled();
+ const isCoreWorkflow =
+ isCore &&
+ commandMenuContextApi.objectMetadataItem.nameSingular ===
+ CoreObjectNameSingular.Workflow;
+ const isCoreWorkflowIndex =
+ isCoreWorkflow &&
+ commandMenuContextApi.pageType === ContextStorePageType.Index;
const commandMenuItems = useAtomStateValue(commandMenuItemsSelector);
const {
hasGlobalRecordCreationCommandTemplate,
@@ -76,6 +107,16 @@ export const CommandMenuContextProviderContent = ({
: commandMenuItems;
const contextCommandMenuItems = commandMenuItemsToDisplay
+ .filter(
+ (item) =>
+ !isCoreWorkflowIndex ||
+ item.engineComponentKey !== EngineComponentKey.DELETE_RECORDS,
+ )
+ .filter(
+ (item) =>
+ !isCoreWorkflow ||
+ !WORKSPACE_DEFINITION_COMMANDS.has(item.engineComponentKey),
+ )
.filter(
(item) =>
item.engineComponentKey !==
@@ -111,11 +152,13 @@ export const CommandMenuContextProviderContent = ({
commandMenuContextApiForAvailability,
globalRecordCreationCommandMenuItems,
shouldDisplayGlobalRecordCreationCommands,
+ isCoreWorkflow,
commandMenuItems,
commandMenuItemsDraft,
effectivePageLayoutId,
isInPreviewMode,
isLayoutCustomizationAllowedOnCurrentPage,
+ isCoreWorkflowIndex,
]);
return (
diff --git a/packages/twenty-front/src/modules/command-menu-item/contexts/CommandMenuContextProviderWithWorkflowEnrichment.tsx b/packages/twenty-front/src/modules/command-menu-item/contexts/CommandMenuContextProviderWithWorkflowEnrichment.tsx
index 06266f74d17..1655e7cdc06 100644
--- a/packages/twenty-front/src/modules/command-menu-item/contexts/CommandMenuContextProviderWithWorkflowEnrichment.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/contexts/CommandMenuContextProviderWithWorkflowEnrichment.tsx
@@ -2,7 +2,9 @@ import { type CommandMenuContextApi } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { type CommandMenuContextType } from '@/command-menu-item/contexts/CommandMenuContext';
+import { useCoreWorkflowsWithCurrentVersions } from '@/command-menu-item/hooks/useCoreWorkflowsWithCurrentVersions';
import { useWorkflowsWithCurrentVersions } from '@/command-menu-item/hooks/useWorkflowsWithCurrentVersions';
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
import { CommandMenuContextProviderContent } from './CommandMenuContextProviderContent';
@@ -23,13 +25,21 @@ export const CommandMenuContextProviderWithWorkflowEnrichment = ({
selectedWorkflowRecordIds,
isInPreviewMode,
}: CommandMenuContextProviderWithWorkflowEnrichmentProps) => {
+ const isCore = useIsWorkflowCoreEnabled();
const workflowsWithCurrentVersions = useWorkflowsWithCurrentVersions(
- selectedWorkflowRecordIds,
+ isCore ? [] : selectedWorkflowRecordIds,
);
+ const coreWorkflowsWithCurrentVersions = useCoreWorkflowsWithCurrentVersions(
+ isCore ? selectedWorkflowRecordIds : [],
+ );
+
+ const workflows = isCore
+ ? coreWorkflowsWithCurrentVersions
+ : workflowsWithCurrentVersions;
const enrichedSelectedRecords = commandMenuContextApi.selectedRecords.map(
(record) => {
- const workflowWithCurrentVersion = workflowsWithCurrentVersions.find(
+ const workflowWithCurrentVersion = workflows.find(
(workflow) => workflow.id === record.id,
);
@@ -48,16 +58,14 @@ export const CommandMenuContextProviderWithWorkflowEnrichment = ({
},
);
- const enrichedCommandMenuContextApi = {
- ...commandMenuContextApi,
- selectedRecords: enrichedSelectedRecords,
- };
-
return (
<CommandMenuContextProviderContent
displayType={displayType}
containerType={containerType}
- commandMenuContextApi={enrichedCommandMenuContextApi}
+ commandMenuContextApi={{
+ ...commandMenuContextApi,
+ selectedRecords: enrichedSelectedRecords,
+ }}
isInPreviewMode={isInPreviewMode}
>
{children}
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/hooks/__tests__/useEnrichHeadlessCommandContextApiWithWorkflowVersionTriggerInformation.test.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/hooks/__tests__/useEnrichHeadlessCommandContextApiWithWorkflowVersionTriggerInformation.test.tsx
index f07e00acd83..2f437221ac3 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/hooks/__tests__/useEnrichHeadlessCommandContextApiWithWorkflowVersionTriggerInformation.test.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/hooks/__tests__/useEnrichHeadlessCommandContextApiWithWorkflowVersionTriggerInformation.test.tsx
@@ -1,3 +1,7 @@
+import {
+ GetCoreWorkflowVersionDocument,
+ GetCoreWorkflowVersionLegacyMappingDocument,
+} from '~/generated/graphql';
import { type HeadlessEngineCommandContextApi } from '@/command-menu-item/engine-command/types/HeadlessCommandContextApi';
import { useEnrichHeadlessCommandContextApiWithWorkflowVersionTriggerInformation } from '@/command-menu-item/engine-command/hooks/useEnrichHeadlessCommandContextApiWithWorkflowVersionTriggerInformation';
import { renderHook, act } from '@testing-library/react';
@@ -9,6 +13,11 @@ import {
} from '~/generated-metadata/graphql';
const mockFindOneWorkflowVersion = jest.fn();
+const mockCoreQuery = jest.fn();
+let mockIsCore = false;
+jest.mock('@/workflow/hooks/useIsWorkflowCoreEnabled', () => ({
+ useIsWorkflowCoreEnabled: () => mockIsCore,
+}));
jest.mock('@/object-record/hooks/useLazyFindOneRecord', () => ({
useLazyFindOneRecord: () => ({
@@ -39,18 +48,16 @@ const buildBaseContextApi = (
});
jest.mock('@/object-metadata/hooks/useApolloCoreClient', () => ({
- useApolloCoreClient: () => ({
- query: jest.fn().mockResolvedValue({
- data: {
- workflowVersionContent: { trigger: { type: 'MANUAL' } },
- },
- }),
- }),
+ useApolloCoreClient: () => ({ query: mockCoreQuery }),
}));
describe('useEnrichHeadlessCommandContextApiWithWorkflowVersionTriggerInformation', () => {
beforeEach(() => {
jest.clearAllMocks();
+ mockIsCore = false;
+ mockCoreQuery.mockReset().mockResolvedValue({
+ data: { workflowVersionContent: { trigger: { type: 'MANUAL' } } },
+ });
});
it('should return enriched context with workflow metadata', async () => {
@@ -129,4 +136,134 @@ describe('useEnrichHeadlessCommandContextApiWithWorkflowVersionTriggerInformatio
expect(enrichedResult).toBeUndefined();
});
+ it('uses the core pointer without loading workspace definitions', async () => {
+ mockIsCore = true;
+ mockCoreQuery.mockResolvedValue({
+ data: {
+ coreWorkflowVersion: {
+ id: 'core-version',
+ coreWorkflowId: 'core-workflow',
+ trigger: { type: 'MANUAL' },
+ },
+ },
+ });
+ const { result } = renderHook(
+ () =>
+ useEnrichHeadlessCommandContextApiWithWorkflowVersionTriggerInformation(),
+ { wrapper: getWrapper() },
+ );
+ const context =
+ await result.current.enrichHeadlessCommandContextApiWithWorkflowVersionTriggerInformation(
+ {
+ headlessEngineCommandContextApi: buildBaseContextApi(),
+ workflowVersionId: 'workspace-version',
+ coreWorkflowVersionId: 'core-version',
+ availabilityType: CommandMenuItemAvailabilityType.GLOBAL,
+ },
+ );
+ expect(mockCoreQuery).toHaveBeenCalledWith(
+ expect.objectContaining({
+ query: GetCoreWorkflowVersionDocument,
+ variables: { coreWorkflowVersionId: 'core-version' },
+ }),
+ );
+ expect(context).toMatchObject({
+ coreWorkflowVersionId: 'core-version',
+ workflowVersionId: 'core-version',
+ workflowId: 'core-workflow',
+ });
+ expect(mockFindOneWorkflowVersion).not.toHaveBeenCalled();
+ });
+
+ it('resolves legacy command items before reading the core definition', async () => {
+ mockIsCore = true;
+ mockCoreQuery
+ .mockResolvedValueOnce({
+ data: { coreWorkflowVersion: { id: 'core-version' } },
+ })
+ .mockResolvedValueOnce({
+ data: {
+ coreWorkflowVersion: {
+ id: 'core-version',
+ coreWorkflowId: 'core-workflow',
+ },
+ },
+ });
+ const { result } = renderHook(
+ () =>
+ useEnrichHeadlessCommandContextApiWithWorkflowVersionTriggerInformation(),
+ { wrapper: getWrapper() },
+ );
+ const context =
+ await result.current.enrichHeadlessCommandContextApiWithWorkflowVersionTriggerInformation(
+ {
+ headlessEngineCommandContextApi: buildBaseContextApi(),
+ workflowVersionId: 'workspace-version',
+ availabilityType: CommandMenuItemAvailabilityType.GLOBAL,
+ },
+ );
+ expect(mockCoreQuery).toHaveBeenNthCalledWith(
+ 1,
+ expect.objectContaining({
+ query: GetCoreWorkflowVersionLegacyMappingDocument,
+ variables: { workspaceWorkflowVersionId: 'workspace-version' },
+ }),
+ );
+ expect(context).toMatchObject({ coreWorkflowVersionId: 'core-version' });
+ expect(mockFindOneWorkflowVersion).not.toHaveBeenCalled();
+ });
+
+ it('does not fall back to workspace definitions after a core query fails', async () => {
+ mockIsCore = true;
+ mockCoreQuery.mockRejectedValue(new Error('core unavailable'));
+ const { result } = renderHook(
+ () =>
+ useEnrichHeadlessCommandContextApiWithWorkflowVersionTriggerInformation(),
+ { wrapper: getWrapper() },
+ );
+ await expect(
+ result.current.enrichHeadlessCommandContextApiWithWorkflowVersionTriggerInformation(
+ {
+ headlessEngineCommandContextApi: buildBaseContextApi(),
+ coreWorkflowVersionId: 'core-version',
+ workflowVersionId: 'workspace-version',
+ availabilityType: CommandMenuItemAvailabilityType.GLOBAL,
+ },
+ ),
+ ).rejects.toThrow('core unavailable');
+ expect(mockFindOneWorkflowVersion).not.toHaveBeenCalled();
+ });
+
+ it('keeps workspace IDs when the flag is off even when a core pointer exists', async () => {
+ mockFindOneWorkflowVersion.mockImplementation(
+ async ({ onCompleted }: { onCompleted: (value: unknown) => void }) =>
+ onCompleted({
+ id: 'workspace-version',
+ workflowId: 'workspace-workflow',
+ }),
+ );
+ const { result } = renderHook(
+ () =>
+ useEnrichHeadlessCommandContextApiWithWorkflowVersionTriggerInformation(),
+ { wrapper: getWrapper() },
+ );
+ const context =
+ await result.current.enrichHeadlessCommandContextApiWithWorkflowVersionTriggerInformation(
+ {
+ headlessEngineCommandContextApi: buildBaseContextApi(),
+ coreWorkflowVersionId: 'core-version',
+ workflowVersionId: 'workspace-version',
+ availabilityType: CommandMenuItemAvailabilityType.GLOBAL,
+ },
+ );
+ expect(context).toMatchObject({
+ workflowVersionId: 'workspace-version',
+ workflowId: 'workspace-workflow',
+ });
+ expect(mockCoreQuery).toHaveBeenCalledWith(
+ expect.objectContaining({
+ variables: { workflowVersionId: 'workspace-version' },
+ }),
+ );
+ });
});
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/hooks/useEnrichHeadlessCommandContextApiWithWorkflowVersionTriggerInformation.ts b/packages/twenty-front/src/modules/command-menu-item/engine-command/hooks/useEnrichHeadlessCommandContextApiWithWorkflowVersionTriggerInformation.ts
index c511139ef59..c19d2721d20 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/hooks/useEnrichHeadlessCommandContextApiWithWorkflowVersionTriggerInformation.ts
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/hooks/useEnrichHeadlessCommandContextApiWithWorkflowVersionTriggerInformation.ts
@@ -1,3 +1,8 @@
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
+import {
+ GetCoreWorkflowVersionDocument,
+ GetCoreWorkflowVersionLegacyMappingDocument,
+} from '~/generated/graphql';
import { useCallback } from 'react';
import {
@@ -20,13 +25,15 @@ type WorkflowVersionRecord = Pick<
type EnrichParams = {
headlessEngineCommandContextApi: HeadlessEngineCommandContextApi;
- workflowVersionId: string;
+ workflowVersionId?: string;
+ coreWorkflowVersionId?: string;
availabilityType: CommandMenuItemAvailabilityType;
availabilityObjectMetadataId?: string | null;
};
export const useEnrichHeadlessCommandContextApiWithWorkflowVersionTriggerInformation =
() => {
+ const isCore = useIsWorkflowCoreEnabled();
const apolloCoreClient = useApolloCoreClient();
const { findOneRecord: findOneWorkflowVersion } =
useLazyFindOneRecord<WorkflowVersionRecord>({
@@ -69,16 +76,72 @@ export const useEnrichHeadlessCommandContextApiWithWorkflowVersionTriggerInforma
async ({
headlessEngineCommandContextApi,
workflowVersionId,
+ coreWorkflowVersionId,
availabilityType,
availabilityObjectMetadataId,
}: EnrichParams): Promise<HeadlessCommandContextApi | undefined> => {
- const workflowVersion = await fetchWorkflowVersion(workflowVersionId);
+ let resolvedCoreVersionId = coreWorkflowVersionId;
+ let resolvedWorkspaceVersionId = workflowVersionId;
+
+ if (
+ isCore &&
+ !isDefined(resolvedCoreVersionId) &&
+ isDefined(workflowVersionId)
+ ) {
+ const { data } = await apolloCoreClient.query({
+ query: GetCoreWorkflowVersionLegacyMappingDocument,
+ variables: { workspaceWorkflowVersionId: workflowVersionId },
+ fetchPolicy: 'network-only',
+ });
+ resolvedCoreVersionId = data?.coreWorkflowVersion?.id;
+ }
+
+ if (
+ isDefined(resolvedCoreVersionId) &&
+ (isCore || !isDefined(resolvedWorkspaceVersionId))
+ ) {
+ const { data } = await apolloCoreClient.query({
+ query: GetCoreWorkflowVersionDocument,
+ variables: { coreWorkflowVersionId: resolvedCoreVersionId },
+ fetchPolicy: 'network-only',
+ });
+ const version = data?.coreWorkflowVersion;
+ if (!isDefined(version)) {
+ return undefined;
+ }
+ if (isCore) {
+ if (!isDefined(version.coreWorkflowId)) {
+ return undefined;
+ }
+ return {
+ ...headlessEngineCommandContextApi,
+ workflowId: version.coreWorkflowId,
+ workflowVersionId: version.id,
+ coreWorkflowId: version.coreWorkflowId,
+ coreWorkflowVersionId: version.id,
+ trigger: version.trigger ?? null,
+ availabilityType,
+ availabilityObjectMetadataId,
+ };
+ }
+ resolvedWorkspaceVersionId =
+ version.workspaceWorkflowVersionId ?? undefined;
+ }
+
+ if (isCore || !isDefined(resolvedWorkspaceVersionId)) {
+ return undefined;
+ }
+ const workflowVersion = await fetchWorkflowVersion(
+ resolvedWorkspaceVersionId,
+ );
if (!isDefined(workflowVersion)) {
return undefined;
}
- const trigger = await fetchTriggerFromCore(workflowVersionId);
+ const trigger = await fetchTriggerFromCore(
+ resolvedWorkspaceVersionId,
+ );
return {
...headlessEngineCommandContextApi,
@@ -89,7 +152,7 @@ export const useEnrichHeadlessCommandContextApiWithWorkflowVersionTriggerInforma
availabilityObjectMetadataId,
};
},
- [fetchWorkflowVersion, fetchTriggerFromCore],
+ [fetchWorkflowVersion, fetchTriggerFromCore, apolloCoreClient, isCore],
);
return {
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/hooks/useMountCommand.ts b/packages/twenty-front/src/modules/command-menu-item/engine-command/hooks/useMountCommand.ts
index e16c2d0cf57..d89ba5d8aac 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/hooks/useMountCommand.ts
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/hooks/useMountCommand.ts
@@ -17,6 +17,7 @@ type MountCommandParams = {
engineComponentKey: EngineComponentKey;
frontComponentId?: string;
workflowVersionId?: string;
+ coreWorkflowVersionId?: string;
availabilityType?: CommandMenuItemAvailabilityType;
availabilityObjectMetadataId?: string | null;
payload?: CommandMenuItemPayload | null;
@@ -39,6 +40,7 @@ export const useMountCommand = () => {
engineComponentKey,
frontComponentId,
workflowVersionId,
+ coreWorkflowVersionId,
availabilityType,
availabilityObjectMetadataId,
payload,
@@ -58,11 +60,13 @@ export const useMountCommand = () => {
const commandState = isDefined(frontComponentId)
? { ...headlessEngineCommandContextApi, frontComponentId }
- : isDefined(workflowVersionId) && isDefined(availabilityType)
+ : (isDefined(workflowVersionId) || isDefined(coreWorkflowVersionId)) &&
+ isDefined(availabilityType)
? await enrichHeadlessCommandContextApiWithWorkflowVersionTriggerInformation(
{
headlessEngineCommandContextApi,
workflowVersionId,
+ coreWorkflowVersionId,
availabilityType,
availabilityObjectMetadataId,
},
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/DeleteRecordsCommand.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/DeleteRecordsCommand.tsx
index 7ac438e6bff..555a2dbc23d 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/DeleteRecordsCommand.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/DeleteRecordsCommand.tsx
@@ -1,3 +1,9 @@
+import { DeleteCoreWorkflowsCommand } from '@/object-core/workflows/components/DeleteCoreWorkflowsCommand';
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
+import {
+ CoreObjectNameSingular,
+ type RecordGqlOperationFilter,
+} from 'twenty-shared/types';
import { HeadlessEngineCommandWrapperEffect } from '@/command-menu-item/engine-command/components/HeadlessEngineCommandWrapperEffect';
import { useHeadlessCommandContextApi } from '@/command-menu-item/engine-command/hooks/useHeadlessCommandContextApi';
import { useRemoveNavigationMenuItemByTargetRecordId } from '@/navigation-menu-item/common/hooks/useRemoveNavigationMenuItemByTargetRecordId';
@@ -8,10 +14,9 @@ import { useRemoveSelectedRecordsFromRecordBoard } from '@/object-record/record-
import { PLACEHOLDER_RECORD_INDEX_ID } from '@/object-record/record-index/constants/PlaceholderRecordIndexId';
import { useResetTableRowSelection } from '@/object-record/record-table/hooks/internal/useResetTableRowSelection';
import { useSidePanelMenu } from '@/side-panel/hooks/useSidePanelMenu';
-import { type RecordGqlOperationFilter } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
-export const DeleteRecordsCommand = () => {
+const DeleteWorkspaceRecordsCommand = () => {
const { recordIndexId, objectMetadataItem, selectedRecords, graphqlFilter } =
useHeadlessCommandContextApi();
@@ -74,3 +79,14 @@ export const DeleteRecordsCommand = () => {
return <HeadlessEngineCommandWrapperEffect execute={handleExecute} />;
};
+
+export const DeleteRecordsCommand = () => {
+ const isCore = useIsWorkflowCoreEnabled();
+ const { objectMetadataItem } = useHeadlessCommandContextApi();
+ return isCore &&
+ objectMetadataItem?.nameSingular === CoreObjectNameSingular.Workflow ? (
+ <DeleteCoreWorkflowsCommand />
+ ) : (
+ <DeleteWorkspaceRecordsCommand />
+ );
+};
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/TriggerWorkflowVersionEngineCommand.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/TriggerWorkflowVersionEngineCommand.tsx
index ba24f70fa6e..c80b6ad3006 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/TriggerWorkflowVersionEngineCommand.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/TriggerWorkflowVersionEngineCommand.tsx
@@ -59,8 +59,11 @@ export const TriggerWorkflowVersionEngineCommand = () => {
if (!isNonEmptyArray(payloads)) {
await runWorkflowVersion({
- workflowId: mountedCommandState.workflowId,
- workflowVersionId: mountedCommandState.workflowVersionId,
+ workflowId:
+ mountedCommandState.coreWorkflowId ?? mountedCommandState.workflowId,
+ workflowVersionId:
+ mountedCommandState.coreWorkflowVersionId ??
+ mountedCommandState.workflowVersionId,
});
return;
@@ -68,8 +71,11 @@ export const TriggerWorkflowVersionEngineCommand = () => {
for (const payload of payloads) {
await runWorkflowVersion({
- workflowId: mountedCommandState.workflowId,
- workflowVersionId: mountedCommandState.workflowVersionId,
+ workflowId:
+ mountedCommandState.coreWorkflowId ?? mountedCommandState.workflowId,
+ workflowVersionId:
+ mountedCommandState.coreWorkflowVersionId ??
+ mountedCommandState.workflowVersionId,
payload,
});
}
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow-runs/components/SeeVersionWorkflowRunSingleRecordCommand.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow-runs/components/SeeVersionWorkflowRunSingleRecordCommand.tsx
index 52bde380d96..55e57e3f984 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow-runs/components/SeeVersionWorkflowRunSingleRecordCommand.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow-runs/components/SeeVersionWorkflowRunSingleRecordCommand.tsx
@@ -1,12 +1,26 @@
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
import { HeadlessNavigateEngineCommand } from '@/command-menu-item/engine-command/components/HeadlessNavigateEngineCommand';
import { useHeadlessCommandContextApi } from '@/command-menu-item/engine-command/hooks/useHeadlessCommandContextApi';
import { AppPath, CoreObjectNameSingular } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
export const SeeVersionWorkflowRunSingleRecordCommand = () => {
+ const isCore = useIsWorkflowCoreEnabled();
const { selectedRecords } = useHeadlessCommandContextApi();
const selectedRecord = selectedRecords[0];
+ if (isCore) {
+ const coreWorkflowId = selectedRecord?.coreWorkflowId;
+ const coreWorkflowVersionId = selectedRecord?.coreWorkflowVersionId;
+ return isDefined(coreWorkflowId) && isDefined(coreWorkflowVersionId) ? (
+ <HeadlessNavigateEngineCommand
+ to={AppPath.WorkflowCoreShowPage}
+ params={{ coreWorkflowId }}
+ queryParams={{ version: coreWorkflowVersionId }}
+ />
+ ) : null;
+ }
+
if (
!isDefined(selectedRecord) ||
!isDefined(selectedRecord?.workflowVersion?.id)
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow-runs/components/SeeWorkflowWorkflowRunSingleRecordCommand.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow-runs/components/SeeWorkflowWorkflowRunSingleRecordCommand.tsx
index 2b31fde2cdd..bb8e8149a90 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow-runs/components/SeeWorkflowWorkflowRunSingleRecordCommand.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow-runs/components/SeeWorkflowWorkflowRunSingleRecordCommand.tsx
@@ -1,12 +1,24 @@
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
import { HeadlessNavigateEngineCommand } from '@/command-menu-item/engine-command/components/HeadlessNavigateEngineCommand';
import { useHeadlessCommandContextApi } from '@/command-menu-item/engine-command/hooks/useHeadlessCommandContextApi';
import { AppPath, CoreObjectNameSingular } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
export const SeeWorkflowWorkflowRunSingleRecordCommand = () => {
+ const isCore = useIsWorkflowCoreEnabled();
const { selectedRecords } = useHeadlessCommandContextApi();
const selectedRecord = selectedRecords[0];
+ if (isCore) {
+ const coreWorkflowId = selectedRecord?.coreWorkflowId;
+ return isDefined(coreWorkflowId) ? (
+ <HeadlessNavigateEngineCommand
+ to={AppPath.WorkflowCoreShowPage}
+ params={{ coreWorkflowId }}
+ />
+ ) : null;
+ }
+
if (!isDefined(selectedRecord) || !isDefined(selectedRecord?.workflow?.id)) {
return null;
}
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow-versions/components/SeeRunsWorkflowVersionSingleRecordCommand.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow-versions/components/SeeRunsWorkflowVersionSingleRecordCommand.tsx
index 0caf574065b..8e2884443ca 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow-versions/components/SeeRunsWorkflowVersionSingleRecordCommand.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow-versions/components/SeeRunsWorkflowVersionSingleRecordCommand.tsx
@@ -1,7 +1,9 @@
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
import { HeadlessNavigateEngineCommand } from '@/command-menu-item/engine-command/components/HeadlessNavigateEngineCommand';
import { useHeadlessCommandContextApi } from '@/command-menu-item/engine-command/hooks/useHeadlessCommandContextApi';
import { CoreObjectNamePlural } from '@/object-metadata/types/CoreObjectNamePlural';
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
+import { useCoreWorkflowVersion } from '@/object-core/workflows/versions/hooks/useCoreWorkflowVersion';
import { AppPath, ViewFilterOperand } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
@@ -12,6 +14,7 @@ const SeeRunsWorkflowVersionSingleRecordCommandContent = ({
workflowId: string;
recordId: string;
}) => {
+ const isCore = useIsWorkflowCoreEnabled();
const workflowWithCurrentVersion = useWorkflowWithCurrentVersion(workflowId);
return (
@@ -19,32 +22,51 @@ const SeeRunsWorkflowVersionSingleRecordCommandContent = ({
to={AppPath.RecordIndexPage}
params={{ objectNamePlural: CoreObjectNamePlural.WorkflowRun }}
queryParams={{
- filter: {
- workflow: {
- [ViewFilterOperand.IS]: {
- selectedRecordIds: [workflowWithCurrentVersion?.id],
+ filter: isCore
+ ? {
+ coreWorkflowId: { [ViewFilterOperand.IS]: workflowId },
+ coreWorkflowVersionId: { [ViewFilterOperand.IS]: recordId },
+ }
+ : {
+ workflow: {
+ [ViewFilterOperand.IS]: {
+ selectedRecordIds: [workflowWithCurrentVersion?.id],
+ },
+ },
+ recordStore: {
+ [ViewFilterOperand.IS]: {
+ selectedRecordIds: [recordId],
+ },
+ },
},
- },
- recordStore: {
- [ViewFilterOperand.IS]: {
- selectedRecordIds: [recordId],
- },
- },
- },
}}
/>
);
};
export const SeeRunsWorkflowVersionSingleRecordCommand = () => {
+ const isCore = useIsWorkflowCoreEnabled();
const { selectedRecords } = useHeadlessCommandContextApi();
- const recordId = selectedRecords[0]?.id;
const selectedRecord = selectedRecords[0];
+ const workspaceWorkflowVersionId = selectedRecord?.id;
+ const workspaceWorkflowId = selectedRecord?.workflow?.id;
+ const { coreWorkflowVersion, loading } = useCoreWorkflowVersion(
+ isCore ? selectedRecord?.coreWorkflowVersionId : undefined,
+ );
+
+ if (isCore && (loading || !isDefined(coreWorkflowVersion))) {
+ return null;
+ }
- const workflowId = selectedRecord?.workflow?.id;
+ const workflowId = isCore
+ ? coreWorkflowVersion?.coreWorkflowId
+ : workspaceWorkflowId;
+ const workflowVersionId = isCore
+ ? coreWorkflowVersion?.id
+ : workspaceWorkflowVersionId;
- if (!isDefined(recordId) || !isDefined(workflowId)) {
+ if (!isDefined(workflowVersionId) || !isDefined(workflowId)) {
throw new Error(
'Record ID and workflow ID are required to see runs workflow version',
);
@@ -53,7 +75,7 @@ export const SeeRunsWorkflowVersionSingleRecordCommand = () => {
return (
<SeeRunsWorkflowVersionSingleRecordCommandContent
workflowId={workflowId}
- recordId={recordId}
+ recordId={workflowVersionId}
/>
);
};
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow-versions/components/SeeVersionsWorkflowVersionSingleRecordCommand.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow-versions/components/SeeVersionsWorkflowVersionSingleRecordCommand.tsx
index dbd76ee5701..0559670df9a 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow-versions/components/SeeVersionsWorkflowVersionSingleRecordCommand.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow-versions/components/SeeVersionsWorkflowVersionSingleRecordCommand.tsx
@@ -1,17 +1,40 @@
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
+import { HeadlessEngineCommandWrapperEffect } from '@/command-menu-item/engine-command/components/HeadlessEngineCommandWrapperEffect';
+import { useOpenCoreWorkflowVersionsSidePanel } from '@/object-core/workflows/versions/hooks/useOpenCoreWorkflowVersionsSidePanel';
import { HeadlessNavigateEngineCommand } from '@/command-menu-item/engine-command/components/HeadlessNavigateEngineCommand';
import { useHeadlessCommandContextApi } from '@/command-menu-item/engine-command/hooks/useHeadlessCommandContextApi';
import { CoreObjectNamePlural } from '@/object-metadata/types/CoreObjectNamePlural';
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
+import { useCoreWorkflowVersion } from '@/object-core/workflows/versions/hooks/useCoreWorkflowVersion';
import { AppPath, ViewFilterOperand } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
const SeeVersionsWorkflowVersionSingleRecordCommandContent = ({
- workflowId,
+ workspaceWorkflowId,
+ coreWorkflowVersionId,
}: {
- workflowId: string;
+ workspaceWorkflowId: string;
+ coreWorkflowVersionId: string | undefined;
}) => {
+ const isCore = useIsWorkflowCoreEnabled();
+ const { openCoreWorkflowVersionsSidePanel } =
+ useOpenCoreWorkflowVersionsSidePanel();
+ const { coreWorkflowVersion } = useCoreWorkflowVersion(
+ isCore ? coreWorkflowVersionId : undefined,
+ );
+ const workflowId = isCore
+ ? coreWorkflowVersion?.coreWorkflowId
+ : workspaceWorkflowId;
const workflowWithCurrentVersion = useWorkflowWithCurrentVersion(workflowId);
+ if (isCore) {
+ return isDefined(workflowId) ? (
+ <HeadlessEngineCommandWrapperEffect
+ execute={() => openCoreWorkflowVersionsSidePanel(workflowId)}
+ />
+ ) : null;
+ }
+
return (
<HeadlessNavigateEngineCommand
to={AppPath.RecordIndexPage}
@@ -41,7 +64,8 @@ export const SeeVersionsWorkflowVersionSingleRecordCommand = () => {
return (
<SeeVersionsWorkflowVersionSingleRecordCommandContent
- workflowId={selectedRecord.workflowId}
+ workspaceWorkflowId={selectedRecord.workflowId}
+ coreWorkflowVersionId={selectedRecord.coreWorkflowVersionId}
/>
);
};
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow-versions/components/SeeWorkflowWorkflowVersionSingleRecordCommand.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow-versions/components/SeeWorkflowWorkflowVersionSingleRecordCommand.tsx
index 1ff86ae93dc..df7a1ec2c8d 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow-versions/components/SeeWorkflowWorkflowVersionSingleRecordCommand.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow-versions/components/SeeWorkflowWorkflowVersionSingleRecordCommand.tsx
@@ -1,11 +1,27 @@
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
import { HeadlessNavigateEngineCommand } from '@/command-menu-item/engine-command/components/HeadlessNavigateEngineCommand';
import { useHeadlessCommandContextApi } from '@/command-menu-item/engine-command/hooks/useHeadlessCommandContextApi';
+import { useCoreWorkflowVersion } from '@/object-core/workflows/versions/hooks/useCoreWorkflowVersion';
import { AppPath, CoreObjectNameSingular } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
export const SeeWorkflowWorkflowVersionSingleRecordCommand = () => {
+ const isCore = useIsWorkflowCoreEnabled();
const { selectedRecords } = useHeadlessCommandContextApi();
const selectedRecord = selectedRecords[0];
+ const { coreWorkflowVersion } = useCoreWorkflowVersion(
+ isCore ? selectedRecord?.coreWorkflowVersionId : undefined,
+ );
+
+ if (isCore) {
+ const coreWorkflowId = coreWorkflowVersion?.coreWorkflowId;
+ return isDefined(coreWorkflowId) ? (
+ <HeadlessNavigateEngineCommand
+ to={AppPath.WorkflowCoreShowPage}
+ params={{ coreWorkflowId }}
+ />
+ ) : null;
+ }
if (!isDefined(selectedRecord) || !isDefined(selectedRecord?.workflow?.id)) {
throw new Error(
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow-versions/components/UseAsDraftWorkflowVersionSingleRecordCommand.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow-versions/components/UseAsDraftWorkflowVersionSingleRecordCommand.tsx
index 919c63157b4..222bce58978 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow-versions/components/UseAsDraftWorkflowVersionSingleRecordCommand.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow-versions/components/UseAsDraftWorkflowVersionSingleRecordCommand.tsx
@@ -1,8 +1,10 @@
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
import { HeadlessConfirmationModalEngineCommandEffect } from '@/command-menu-item/engine-command/components/HeadlessConfirmationModalEngineCommandEffect';
import { HeadlessEngineCommandWrapperEffect } from '@/command-menu-item/engine-command/components/HeadlessEngineCommandWrapperEffect';
import { useHeadlessCommandContextApi } from '@/command-menu-item/engine-command/hooks/useHeadlessCommandContextApi';
import { useCreateDraftFromWorkflowVersion } from '@/workflow/hooks/useCreateDraftFromWorkflowVersion';
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
+import { useCoreWorkflowVersion } from '@/object-core/workflows/versions/hooks/useCoreWorkflowVersion';
import { useLingui } from '@lingui/react/macro';
import { AppPath, CoreObjectNameSingular } from 'twenty-shared/types';
import { getAppPath, isDefined } from 'twenty-shared/utils';
@@ -15,6 +17,7 @@ const UseAsDraftWorkflowVersionSingleRecordCommandContent = ({
workflowId: string;
workflowVersionId: string;
}) => {
+ const isCore = useIsWorkflowCoreEnabled();
const { t } = useLingui();
const workflow = useWorkflowWithCurrentVersion(workflowId);
const { createDraftFromWorkflowVersion } =
@@ -30,6 +33,10 @@ const UseAsDraftWorkflowVersionSingleRecordCommandContent = ({
workflowVersionIdToCopy: workflowVersionId,
});
+ if (isCore) {
+ navigate(AppPath.WorkflowCoreShowPage, { coreWorkflowId: workflowId });
+ return;
+ }
navigate(AppPath.RecordShowPage, {
objectNameSingular: CoreObjectNameSingular.Workflow,
objectRecordId: workflowId,
@@ -51,10 +58,14 @@ const UseAsDraftWorkflowVersionSingleRecordCommandContent = ({
confirmButtonText={t`Override Draft`}
linkButton={{
title: t`Go to Draft`,
- to: getAppPath(AppPath.RecordShowPage, {
- objectNameSingular: CoreObjectNameSingular.Workflow,
- objectRecordId: workflowId,
- }),
+ to: isCore
+ ? getAppPath(AppPath.WorkflowCoreShowPage, {
+ coreWorkflowId: workflowId,
+ })
+ : getAppPath(AppPath.RecordShowPage, {
+ objectNameSingular: CoreObjectNameSingular.Workflow,
+ objectRecordId: workflowId,
+ }),
}}
execute={handleExecute}
/>
@@ -62,11 +73,26 @@ const UseAsDraftWorkflowVersionSingleRecordCommandContent = ({
};
export const UseAsDraftWorkflowVersionSingleRecordCommand = () => {
+ const isCore = useIsWorkflowCoreEnabled();
const { selectedRecords } = useHeadlessCommandContextApi();
const selectedRecord = selectedRecords[0];
+ const { coreWorkflowVersion, loading } = useCoreWorkflowVersion(
+ isCore ? selectedRecord?.coreWorkflowVersionId : undefined,
+ );
+
+ if (isCore && (loading || !isDefined(coreWorkflowVersion))) {
+ return null;
+ }
+
+ const workflowId = isCore
+ ? coreWorkflowVersion?.coreWorkflowId
+ : selectedRecord?.workflowId;
+ const workflowVersionId = isCore
+ ? coreWorkflowVersion?.id
+ : selectedRecord?.id;
- if (!isDefined(selectedRecord) || !isDefined(selectedRecord.workflowId)) {
+ if (!isDefined(workflowId) || !isDefined(workflowVersionId)) {
throw new Error(
'Record ID and workflow ID are required to use as draft workflow version',
);
@@ -74,8 +100,8 @@ export const UseAsDraftWorkflowVersionSingleRecordCommand = () => {
return (
<UseAsDraftWorkflowVersionSingleRecordCommandContent
- workflowId={selectedRecord.workflowId}
- workflowVersionId={selectedRecord.id}
+ workflowId={workflowId}
+ workflowVersionId={workflowVersionId}
/>
);
};
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/ActivateWorkflowSingleRecordCommand.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/ActivateWorkflowSingleRecordCommand.tsx
index 29318539403..1048ad772bb 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/ActivateWorkflowSingleRecordCommand.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/ActivateWorkflowSingleRecordCommand.tsx
@@ -22,7 +22,7 @@ export const ActivateWorkflowSingleRecordCommand = () => {
return;
}
- activateWorkflowVersion({
+ return activateWorkflowVersion({
workflowVersionId: workflowWithCurrentVersion.currentVersion.id,
workflowId: workflowWithCurrentVersion.id,
});
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/DeactivateWorkflowSingleRecordCommand.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/DeactivateWorkflowSingleRecordCommand.tsx
index c5e96507e86..b530a78023f 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/DeactivateWorkflowSingleRecordCommand.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/DeactivateWorkflowSingleRecordCommand.tsx
@@ -22,8 +22,10 @@ export const DeactivateWorkflowSingleRecordCommand = () => {
return;
}
- deactivateWorkflowVersion({
- workflowVersionId: workflowWithCurrentVersion.currentVersion.id,
+ return deactivateWorkflowVersion({
+ workflowVersionId:
+ workflowWithCurrentVersion.lastPublishedVersionId ??
+ workflowWithCurrentVersion.currentVersion.id,
});
};
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/DiscardDraftWorkflowSingleRecordCommand.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/DiscardDraftWorkflowSingleRecordCommand.tsx
index 6d6e773bd12..354b7072fce 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/DiscardDraftWorkflowSingleRecordCommand.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/DiscardDraftWorkflowSingleRecordCommand.tsx
@@ -1,3 +1,5 @@
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
+import { useDiscardWorkspaceWorkflowDraft } from '@/workflow/hooks/useDiscardWorkspaceWorkflowDraft';
import { isDefined } from 'twenty-shared/utils';
import { HeadlessEngineCommandWrapperEffect } from '@/command-menu-item/engine-command/components/HeadlessEngineCommandWrapperEffect';
@@ -5,7 +7,7 @@ import { useHeadlessCommandContextApi } from '@/command-menu-item/engine-command
import { useDiscardCoreWorkflowDraft } from '@/object-core/workflows/hooks/useDiscardCoreWorkflowDraft';
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
-export const DiscardDraftWorkflowSingleRecordCommand = () => {
+const DiscardCoreWorkflowDraftCommand = () => {
const { selectedRecords } = useHeadlessCommandContextApi();
const recordId = selectedRecords[0]?.id;
@@ -24,7 +26,7 @@ export const DiscardDraftWorkflowSingleRecordCommand = () => {
}
return discardCoreWorkflowDraft({
- workspaceWorkflowVersionId: workflowWithCurrentVersion.currentVersion.id,
+ coreWorkflowVersionId: workflowWithCurrentVersion.currentVersion.id,
});
};
@@ -35,3 +37,31 @@ export const DiscardDraftWorkflowSingleRecordCommand = () => {
/>
);
};
+
+const DiscardWorkspaceWorkflowDraftCommand = () => {
+ const { selectedRecords } = useHeadlessCommandContextApi();
+ const workflow = useWorkflowWithCurrentVersion(selectedRecords[0]?.id);
+ const { discardWorkspaceWorkflowDraft } = useDiscardWorkspaceWorkflowDraft();
+
+ return (
+ <HeadlessEngineCommandWrapperEffect
+ ready={isDefined(workflow)}
+ execute={() =>
+ isDefined(workflow)
+ ? discardWorkspaceWorkflowDraft({
+ workspaceWorkflowVersionId: workflow.currentVersion.id,
+ })
+ : undefined
+ }
+ />
+ );
+};
+
+export const DiscardDraftWorkflowSingleRecordCommand = () => {
+ const isCore = useIsWorkflowCoreEnabled();
+ return isCore ? (
+ <DiscardCoreWorkflowDraftCommand />
+ ) : (
+ <DiscardWorkspaceWorkflowDraftCommand />
+ );
+};
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/DuplicateWorkflowSingleRecordCommand.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/DuplicateWorkflowSingleRecordCommand.tsx
index af7f77a4333..789425404de 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/DuplicateWorkflowSingleRecordCommand.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/DuplicateWorkflowSingleRecordCommand.tsx
@@ -1,3 +1,4 @@
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
import { HeadlessEngineCommandWrapperEffect } from '@/command-menu-item/engine-command/components/HeadlessEngineCommandWrapperEffect';
import { useHeadlessCommandContextApi } from '@/command-menu-item/engine-command/hooks/useHeadlessCommandContextApi';
import { useDuplicateWorkflow } from '@/workflow/hooks/useDuplicateWorkflow';
@@ -15,6 +16,7 @@ export const DuplicateWorkflowSingleRecordCommand = () => {
const recordId = selectedRecords[0]?.id;
const workflow = useWorkflowWithCurrentVersion(recordId ?? '');
const { duplicateWorkflow } = useDuplicateWorkflow();
+ const isCore = useIsWorkflowCoreEnabled();
const navigate = useNavigateApp();
const { enqueueToast } = useToast();
const { t } = useLingui();
@@ -39,6 +41,12 @@ export const DuplicateWorkflowSingleRecordCommand = () => {
children: t`Workflow duplicated successfully`,
});
+ if (isCore) {
+ navigate(AppPath.WorkflowCoreShowPage, {
+ coreWorkflowId: result.workflowId,
+ });
+ return;
+ }
navigate(AppPath.RecordShowPage, {
objectNameSingular: CoreObjectNameSingular.Workflow,
objectRecordId: result.workflowId,
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/SeeActiveVersionWorkflowSingleRecordCommand.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/SeeActiveVersionWorkflowSingleRecordCommand.tsx
index 32aad6a1793..774266f8e3b 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/SeeActiveVersionWorkflowSingleRecordCommand.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/SeeActiveVersionWorkflowSingleRecordCommand.tsx
@@ -1,3 +1,4 @@
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
import { HeadlessNavigateEngineCommand } from '@/command-menu-item/engine-command/components/HeadlessNavigateEngineCommand';
import { useHeadlessCommandContextApi } from '@/command-menu-item/engine-command/hooks/useHeadlessCommandContextApi';
import { useActiveWorkflowVersion } from '@/workflow/hooks/useActiveWorkflowVersion';
@@ -5,22 +6,36 @@ import { AppPath, CoreObjectNameSingular } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
export const SeeActiveVersionWorkflowSingleRecordCommand = () => {
+ const isCore = useIsWorkflowCoreEnabled();
const { selectedRecords } = useHeadlessCommandContextApi();
const recordId = selectedRecords[0]?.id;
- const { workflowVersion, loading } = useActiveWorkflowVersion({
- workflowId: recordId ?? '',
- });
+ const { workflowVersion, hasDraftVersion, loading } =
+ useActiveWorkflowVersion({
+ workflowId: recordId ?? '',
+ });
if (!isDefined(recordId)) {
throw new Error('Record ID is required to see active version workflow');
}
- if (loading) {
+ if (loading || !isDefined(workflowVersion)) {
return null;
}
+ if (isCore) {
+ return (
+ <HeadlessNavigateEngineCommand
+ to={AppPath.WorkflowCoreShowPage}
+ params={{ coreWorkflowId: recordId }}
+ queryParams={
+ hasDraftVersion ? { version: workflowVersion.id } : undefined
+ }
+ />
+ );
+ }
+
return (
<HeadlessNavigateEngineCommand
to={AppPath.RecordShowPage}
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/SeeRunsWorkflowSingleRecordCommand.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/SeeRunsWorkflowSingleRecordCommand.tsx
index 3f01cbf8b98..26f4dc32151 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/SeeRunsWorkflowSingleRecordCommand.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/SeeRunsWorkflowSingleRecordCommand.tsx
@@ -1,3 +1,4 @@
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
import { HeadlessNavigateEngineCommand } from '@/command-menu-item/engine-command/components/HeadlessNavigateEngineCommand';
import { useHeadlessCommandContextApi } from '@/command-menu-item/engine-command/hooks/useHeadlessCommandContextApi';
import { CoreObjectNamePlural } from '@/object-metadata/types/CoreObjectNamePlural';
@@ -6,6 +7,7 @@ import { AppPath, ViewFilterOperand } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
export const SeeRunsWorkflowSingleRecordCommand = () => {
+ const isCore = useIsWorkflowCoreEnabled();
const { selectedRecords } = useHeadlessCommandContextApi();
const recordId = selectedRecords[0]?.id;
@@ -22,13 +24,15 @@ export const SeeRunsWorkflowSingleRecordCommand = () => {
to={AppPath.RecordIndexPage}
params={{ objectNamePlural: CoreObjectNamePlural.WorkflowRun }}
queryParams={{
- filter: {
- workflow: {
- [ViewFilterOperand.IS]: {
- selectedRecordIds: [workflowWithCurrentVersion?.id],
+ filter: isCore
+ ? { coreWorkflowId: { [ViewFilterOperand.IS]: recordId } }
+ : {
+ workflow: {
+ [ViewFilterOperand.IS]: {
+ selectedRecordIds: [workflowWithCurrentVersion?.id],
+ },
+ },
},
- },
- },
}}
/>
);
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/TestWorkflowSingleRecordCommand.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/TestWorkflowSingleRecordCommand.tsx
index 40ce048f2fb..e5f5013ff46 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/TestWorkflowSingleRecordCommand.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/TestWorkflowSingleRecordCommand.tsx
@@ -29,11 +29,11 @@ export const TestWorkflowSingleRecordCommand = () => {
const { currentVersion } = workflowWithCurrentVersion;
- if (!isDefined(content?.trigger)) {
+ if (!isDefined(content) || !isDefined(content.trigger)) {
return;
}
- runWorkflowVersion({
+ return runWorkflowVersion({
workflowVersionId: currentVersion.id,
workflowId: workflowWithCurrentVersion.id,
payload: getTestPayloadFromTrigger(content.trigger),
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/types/HeadlessCommandContextApi.ts b/packages/twenty-front/src/modules/command-menu-item/engine-command/types/HeadlessCommandContextApi.ts
index a39c15c996c..4eedee7011c 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/types/HeadlessCommandContextApi.ts
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/types/HeadlessCommandContextApi.ts
@@ -37,6 +37,8 @@ export type HeadlessTriggerWorkflowVersionCommandContextApi =
HeadlessEngineCommandContextApi & {
workflowId: string;
workflowVersionId: string;
+ coreWorkflowId?: string;
+ coreWorkflowVersionId?: string;
trigger: WorkflowTrigger | null;
availabilityType: CommandMenuItemAvailabilityType;
availabilityObjectMetadataId?: string | null;
diff --git a/packages/twenty-front/src/modules/command-menu-item/graphql/fragments/commandMenuItemFragment.ts b/packages/twenty-front/src/modules/command-menu-item/graphql/fragments/commandMenuItemFragment.ts
index 8dc2de6d2b2..684c47fa7b8 100644
--- a/packages/twenty-front/src/modules/command-menu-item/graphql/fragments/commandMenuItemFragment.ts
+++ b/packages/twenty-front/src/modules/command-menu-item/graphql/fragments/commandMenuItemFragment.ts
@@ -5,6 +5,7 @@ export const COMMAND_MENU_ITEM_FRAGMENT = gql`
id
universalIdentifier
applicationId
+ coreWorkflowVersionId
workflowVersionId
frontComponentId
frontComponent {
diff --git a/packages/twenty-front/src/modules/command-menu-item/hooks/useCommandMenuItemClick.ts b/packages/twenty-front/src/modules/command-menu-item/hooks/useCommandMenuItemClick.ts
index cab80a52936..757d98a2a86 100644
--- a/packages/twenty-front/src/modules/command-menu-item/hooks/useCommandMenuItemClick.ts
+++ b/packages/twenty-front/src/modules/command-menu-item/hooks/useCommandMenuItemClick.ts
@@ -94,6 +94,7 @@ export const useCommandMenuItemClick = ({
engineComponentKey: item.engineComponentKey,
frontComponentId: item.frontComponentId ?? undefined,
workflowVersionId: item.workflowVersionId ?? undefined,
+ coreWorkflowVersionId: item.coreWorkflowVersionId ?? undefined,
availabilityType: item.availabilityType,
availabilityObjectMetadataId: item.availabilityObjectMetadataId,
payload:
diff --git a/packages/twenty-front/src/modules/command-menu-item/hooks/useCoreWorkflowsWithCurrentVersions.ts b/packages/twenty-front/src/modules/command-menu-item/hooks/useCoreWorkflowsWithCurrentVersions.ts
new file mode 100644
index 00000000000..a67e69658d8
--- /dev/null
+++ b/packages/twenty-front/src/modules/command-menu-item/hooks/useCoreWorkflowsWithCurrentVersions.ts
@@ -0,0 +1,51 @@
+import { skipToken, useQuery } from '@apollo/client/react';
+import { isDefined } from 'twenty-shared/utils';
+
+import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
+import { buildWorkflowVersionFromCore } from '@/object-core/workflows/utils/buildWorkflowVersionFromCore';
+import { type WorkflowWithCurrentVersion } from '@/workflow/types/Workflow';
+import { GetCoreWorkflowsWithCurrentVersionsDocument } from '~/generated/graphql';
+
+export const useCoreWorkflowsWithCurrentVersions = (
+ coreWorkflowIds: string[],
+): WorkflowWithCurrentVersion[] => {
+ const apolloCoreClient = useApolloCoreClient();
+
+ const { data } = useQuery(
+ GetCoreWorkflowsWithCurrentVersionsDocument,
+ coreWorkflowIds.length === 0
+ ? skipToken
+ : {
+ client: apolloCoreClient,
+ variables: { input: { coreWorkflowIds } },
+ },
+ );
+
+ return (data?.coreWorkflowsWithCurrentVersions ?? []).flatMap(
+ ({ workflow, versions, currentVersion }) => {
+ const builtCurrentVersion = buildWorkflowVersionFromCore(currentVersion);
+
+ if (!isDefined(builtCurrentVersion)) {
+ return [];
+ }
+
+ return [
+ {
+ __typename: 'Workflow' as const,
+ id: workflow.id,
+ name: workflow.name ?? '',
+ statuses: workflow.statuses,
+ lastPublishedVersionId:
+ workflow.lastPublishedCoreWorkflowVersionId ?? null,
+ versions: versions.map((version) => ({
+ id: version.id,
+ name: version.label,
+ status: version.status,
+ createdAt: version.createdAt,
+ })),
+ currentVersion: builtCurrentVersion,
+ },
+ ];
+ },
+ );
+};
diff --git a/packages/twenty-front/src/modules/context-store/components/RouteContextStoreProvider.tsx b/packages/twenty-front/src/modules/context-store/components/RouteContextStoreProvider.tsx
index 98d0e8a97c7..dceaa941222 100644
--- a/packages/twenty-front/src/modules/context-store/components/RouteContextStoreProvider.tsx
+++ b/packages/twenty-front/src/modules/context-store/components/RouteContextStoreProvider.tsx
@@ -10,7 +10,7 @@ import { viewsSelector } from '@/views/states/selectors/viewsSelector';
import { computeObjectViewTargetIds } from '@/views/utils/computeObjectViewTargetIds';
import { isUsableLastVisitedView } from '@/views/utils/isUsableLastVisitedView';
import { matchRoutes, useLocation, useSearchParams } from 'react-router-dom';
-import { AppPath } from 'twenty-shared/types';
+import { AppPath, CoreObjectNameSingular } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { FeatureFlagKey, ViewType } from '~/generated-metadata/graphql';
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
@@ -55,18 +55,30 @@ const getViewId = ({
export const RouteContextStoreProvider = () => {
const location = useLocation();
const routeObjects = useWorkspaceRouteObjects();
- const isRecordIndexPage = isMatchingLocation(
+ const isCoreWorkflowIndexPage = isMatchingLocation(
location,
- AppPath.RecordIndexPage,
+ AppPath.WorkflowCoreIndexPage,
);
- const isRecordShowPage = isMatchingLocation(location, AppPath.RecordShowPage);
+ const isRecordIndexPage =
+ isCoreWorkflowIndexPage ||
+ isMatchingLocation(location, AppPath.RecordIndexPage);
+ const isCoreWorkflowShowPage = isMatchingLocation(
+ location,
+ AppPath.WorkflowCoreShowPage,
+ );
+ const isRecordShowPage =
+ isCoreWorkflowShowPage ||
+ isMatchingLocation(location, AppPath.RecordShowPage);
const isStandalonePage = isMatchingLocation(location, AppPath.PageLayoutPage);
const isAiChatPage = isMatchingLocation(location, AppPath.AiChat);
const isSettingsPage = useIsSettingsPage();
const routeParams = matchRoutes(routeObjects, location)?.at(-1)?.params;
const objectNamePlural = routeParams?.objectNamePlural;
- const objectNameSingular = routeParams?.objectNameSingular;
+ const isCoreWorkflowPage = isCoreWorkflowIndexPage || isCoreWorkflowShowPage;
+ const objectNameSingular = isCoreWorkflowPage
+ ? CoreObjectNameSingular.Workflow
+ : routeParams?.objectNameSingular;
const [searchParams] = useSearchParams();
const viewIdQueryParamRaw = searchParams.get('viewId');
@@ -143,7 +155,7 @@ export const RouteContextStoreProvider = () => {
return (
<RouteContextStoreProviderEffect
- viewId={viewId}
+ viewId={isCoreWorkflowPage ? undefined : viewId}
objectMetadataItem={objectMetadataItem}
isRecordIndexPage={isRecordIndexPage}
isRecordShowPage={isRecordShowPage}
diff --git a/packages/twenty-front/src/modules/context-store/components/__tests__/RouteContextStoreProvider.test.tsx b/packages/twenty-front/src/modules/context-store/components/__tests__/RouteContextStoreProvider.test.tsx
index 7d200a3ff5a..a06e82d83c0 100644
--- a/packages/twenty-front/src/modules/context-store/components/__tests__/RouteContextStoreProvider.test.tsx
+++ b/packages/twenty-front/src/modules/context-store/components/__tests__/RouteContextStoreProvider.test.tsx
@@ -40,6 +40,11 @@ jest.mock('@/ui/utilities/state/jotai/hooks/useAtomStateValue', () => ({
namePlural: 'new',
nameSingular: 'new',
},
+ {
+ id: 'workflow-object',
+ namePlural: 'workflows',
+ nameSingular: 'workflow',
+ },
]
: [
{
@@ -69,14 +74,17 @@ jest.mock('@/context-store/components/RouteContextStoreProviderEffect', () => ({
RouteContextStoreProviderEffect: ({
viewId,
objectMetadataItem,
+ isRecordIndexPage,
}: {
viewId?: string;
objectMetadataItem?: { id: string };
+ isRecordIndexPage: boolean;
}) => (
<div
data-testid="route-context-store"
data-view-id={viewId}
data-object-metadata-id={objectMetadataItem?.id}
+ data-is-record-index-page={isRecordIndexPage}
/>
),
}));
@@ -94,6 +102,11 @@ const routeObjects: WorkspaceRouteObject[] = [
element: null,
handle: { workspaceSurfaces: MAIN_AND_SIDE_PANEL },
},
+ {
+ path: AppPath.WorkflowCoreIndexPage,
+ element: null,
+ handle: { workspaceSurfaces: MAIN_AND_SIDE_PANEL },
+ },
{
path: `/${AppPath.Settings}`,
element: <Outlet />,
@@ -164,6 +177,19 @@ describe('RouteContextStoreProvider', () => {
);
});
+ it('provides workflow index context on the standalone core route', () => {
+ renderAt('/workflow-core', <MainSurfaceRoutes />);
+
+ expect(screen.getByTestId('route-context-store')).toHaveAttribute(
+ 'data-object-metadata-id',
+ 'workflow-object',
+ );
+ expect(screen.getByTestId('route-context-store')).toHaveAttribute(
+ 'data-is-record-index-page',
+ 'true',
+ );
+ });
+
it('resolves the object on settings object pages', () => {
renderAt(
'/settings/objects/companies/new-field/select',
diff --git a/packages/twenty-front/src/modules/object-core/commands/hooks/__tests__/useCoreObjectsCommands.test.tsx b/packages/twenty-front/src/modules/object-core/commands/hooks/__tests__/useCoreObjectsCommands.test.tsx
new file mode 100644
index 00000000000..d5d8acac96e
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/commands/hooks/__tests__/useCoreObjectsCommands.test.tsx
@@ -0,0 +1,111 @@
+import { i18n } from '@lingui/core';
+import { I18nProvider } from '@lingui/react';
+import { SOURCE_LOCALE } from 'twenty-shared/translations';
+import { messages } from '~/locales/generated/en';
+import { act, renderHook } from '@testing-library/react';
+import { Provider as JotaiProvider } from 'jotai';
+import { MemoryRouter } from 'react-router-dom';
+import { CoreObjectNameSingular } from 'twenty-shared/types';
+
+import { EMPTY_COMMAND_MENU_CONTEXT_API } from '@/command-menu-item/constants/EmptyCommandMenuContextApi';
+import { CommandMenuContext } from '@/command-menu-item/contexts/CommandMenuContext';
+import { CommandMenuItemContainerType } from '@/command-menu-item/types/CommandMenuItemContainerType';
+import { useCoreObjectsCommands } from '@/object-core/commands/hooks/useCoreObjectsCommands';
+import { coreWorkflowsFilterSettingsState } from '@/object-core/workflows/states/coreWorkflowsFilterSettingsState';
+import { coreWorkflowsSelectionState } from '@/object-core/workflows/states/coreWorkflowsSelectionState';
+import { jotaiStore } from '@/ui/utilities/state/jotai/jotaiStore';
+
+i18n.load({ [SOURCE_LOCALE]: messages });
+i18n.activate(SOURCE_LOCALE);
+
+const mockIsCoreEnabled = jest.fn();
+const mockHasPermission = jest.fn();
+const mockCanSoftDeleteWorkflow = jest.fn();
+
+jest.mock('@/workspace/hooks/useIsFeatureEnabled', () => ({
+ useIsFeatureEnabled: () => mockIsCoreEnabled(),
+}));
+jest.mock('@/settings/roles/hooks/useHasPermissionFlag', () => ({
+ useHasPermissionFlag: () => mockHasPermission(),
+}));
+jest.mock('@/object-metadata/hooks/useObjectMetadataItem', () => ({
+ useObjectMetadataItem: () => ({
+ objectMetadataItem: {
+ id: '20202020-9e2b-4f2b-8f47-61b41565859a',
+ },
+ }),
+}));
+jest.mock('@/object-record/hooks/useObjectPermissionsForObject', () => ({
+ useObjectPermissionsForObject: () => ({
+ canSoftDeleteObjectRecords: mockCanSoftDeleteWorkflow(),
+ }),
+}));
+
+const Wrapper = ({ children }: { children: React.ReactNode }) => (
+ <JotaiProvider store={jotaiStore}>
+ <I18nProvider i18n={i18n}>
+ <MemoryRouter initialEntries={['/command-menu']}>
+ <CommandMenuContext.Provider
+ value={{
+ displayType: 'listItem',
+ containerType: CommandMenuItemContainerType.CommandMenuList,
+ isInPreviewMode: false,
+ commandMenuItems: [],
+ commandMenuContextApi: {
+ ...EMPTY_COMMAND_MENU_CONTEXT_API,
+ objectMetadataItem: {
+ nameSingular: CoreObjectNameSingular.Workflow,
+ },
+ },
+ }}
+ >
+ {children}
+ </CommandMenuContext.Provider>
+ </MemoryRouter>
+ </I18nProvider>
+ </JotaiProvider>
+);
+
+const renderCommands = () => {
+ const rendered = renderHook(useCoreObjectsCommands, { wrapper: Wrapper });
+ act(() =>
+ jotaiStore.set(coreWorkflowsSelectionState.atom, {
+ filterSettings: jotaiStore.get(coreWorkflowsFilterSettingsState.atom),
+ rowIds: ['8c9a3708-5674-4e1b-a9b9-4f0dacb26c15'],
+ }),
+ );
+ return rendered;
+};
+
+describe('useCoreObjectsCommands', () => {
+ beforeEach(() => {
+ mockIsCoreEnabled.mockReturnValue(true);
+ mockHasPermission.mockReturnValue(true);
+ mockCanSoftDeleteWorkflow.mockReturnValue(true);
+ jotaiStore.set(coreWorkflowsFilterSettingsState.atom, {});
+ });
+
+ it('exposes selected workflow commands inside the command-menu route', () => {
+ const { result } = renderCommands();
+ expect(result.current.shouldDisplayCoreWorkflowsDeleteCommand).toBe(true);
+ expect(result.current.shouldDisplayCoreWorkflowFiltersCommand).toBe(true);
+ });
+
+ it('does not expose core deletion without the workflow permission', () => {
+ mockHasPermission.mockReturnValue(false);
+ const { result } = renderCommands();
+ expect(result.current.shouldDisplayCoreWorkflowsDeleteCommand).toBe(false);
+ });
+
+ it('does not expose core deletion without object delete permission', () => {
+ mockCanSoftDeleteWorkflow.mockReturnValue(false);
+ const { result } = renderCommands();
+ expect(result.current.shouldDisplayCoreWorkflowsDeleteCommand).toBe(false);
+ });
+
+ it('keeps core commands hidden with the flag off', () => {
+ mockIsCoreEnabled.mockReturnValue(false);
+ const { result } = renderCommands();
+ expect(result.current.coreObjectsCommandIds).toEqual([]);
+ });
+});
diff --git a/packages/twenty-front/src/modules/object-core/commands/hooks/useCoreObjectsCommands.ts b/packages/twenty-front/src/modules/object-core/commands/hooks/useCoreObjectsCommands.ts
index 45da6cf830f..a27f6a140f8 100644
--- a/packages/twenty-front/src/modules/object-core/commands/hooks/useCoreObjectsCommands.ts
+++ b/packages/twenty-front/src/modules/object-core/commands/hooks/useCoreObjectsCommands.ts
@@ -1,15 +1,13 @@
import { useLingui } from '@lingui/react/macro';
import { useContext } from 'react';
-import { useLocation } from 'react-router-dom';
import {
- AppPath,
+ ContextStorePageType,
CoreObjectNameSingular,
FeatureFlagKey,
} from 'twenty-shared/types';
import { isNonEmptyArray } from 'twenty-shared/utils';
import { CommandMenuContext } from '@/command-menu-item/contexts/CommandMenuContext';
-import { CoreObjectNamePlural } from '@/object-metadata/types/CoreObjectNamePlural';
import { CORE_WORKFLOWS_DELETE_COMMAND_ID } from '@/object-core/commands/constants/CoreWorkflowsDeleteCommandId';
import { CORE_WORKFLOW_FILTERS_COMMAND_ID } from '@/object-core/commands/constants/CoreWorkflowFiltersCommandId';
import { coreWorkflowsFilterSettingsState } from '@/object-core/workflows/states/coreWorkflowsFilterSettingsState';
@@ -17,27 +15,28 @@ import { coreWorkflowsSelectionState } from '@/object-core/workflows/states/core
import { getSelectedCoreWorkflowRowIds } from '@/object-core/workflows/utils/getSelectedCoreWorkflowRowIds';
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
import { useObjectPermissionsForObject } from '@/object-record/hooks/useObjectPermissionsForObject';
+import { useHasPermissionFlag } from '@/settings/roles/hooks/useHasPermissionFlag';
+import { PermissionFlagType } from 'twenty-shared/constants';
import { sidePanelSearchState } from '@/side-panel/states/sidePanelSearchState';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
-import { isMatchingLocation } from '~/utils/isMatchingLocation';
import { normalizeSearchText } from '~/utils/normalizeSearchText';
export const useCoreObjectsCommands = () => {
const { t } = useLingui();
- const location = useLocation();
- const { isInPreviewMode } = useContext(CommandMenuContext);
+ const { isInPreviewMode, commandMenuContextApi } =
+ useContext(CommandMenuContext);
const sidePanelSearch = useAtomStateValue(sidePanelSearchState);
const isWorkflowCoreIndexPageEnabled = useIsFeatureEnabled(
FeatureFlagKey.IS_WORKFLOW_CORE_INDEX_PAGE_ENABLED,
);
+ const canManageWorkflows = useHasPermissionFlag(PermissionFlagType.WORKFLOWS);
const { objectMetadataItem: workflowObjectMetadataItem } =
useObjectMetadataItem({
objectNameSingular: CoreObjectNameSingular.Workflow,
});
-
const workflowObjectPermissions = useObjectPermissionsForObject(
workflowObjectMetadataItem.id,
);
@@ -53,15 +52,10 @@ export const useCoreObjectsCommands = () => {
});
const isOnCoreWorkflowsIndex =
- isMatchingLocation(location, AppPath.WorkflowCoreIndexPage) ||
- (isWorkflowCoreIndexPageEnabled &&
- isMatchingLocation(
- location,
- AppPath.RecordIndexPage.replace(
- ':objectNamePlural',
- CoreObjectNamePlural.Workflow,
- ),
- ));
+ isWorkflowCoreIndexPageEnabled &&
+ commandMenuContextApi.pageType === ContextStorePageType.Index &&
+ commandMenuContextApi.objectMetadataItem.nameSingular ===
+ CoreObjectNameSingular.Workflow;
const matchesSidePanelSearch = (label: string) =>
normalizeSearchText(label).includes(
@@ -84,6 +78,7 @@ export const useCoreObjectsCommands = () => {
isOnCoreWorkflowsIndex &&
!isInPreviewMode &&
isNonEmptyArray(selectedCoreWorkflowIds) &&
+ canManageWorkflows &&
workflowObjectPermissions.canSoftDeleteObjectRecords &&
matchesSidePanelSearch(coreWorkflowsDeleteCommandLabel);
diff --git a/packages/twenty-front/src/modules/object-core/constants/CoreObjectShowPages.ts b/packages/twenty-front/src/modules/object-core/constants/CoreObjectShowPages.ts
index 3a009b85a04..f710e3716c3 100644
--- a/packages/twenty-front/src/modules/object-core/constants/CoreObjectShowPages.ts
+++ b/packages/twenty-front/src/modules/object-core/constants/CoreObjectShowPages.ts
@@ -14,9 +14,11 @@ export const CORE_OBJECT_SHOW_PAGES: ReadonlyMap<
[
CoreObjectNameSingular.Workflow,
lazy(() =>
- import('~/pages/object-core/WorkflowCoreShowPage').then((module) => ({
- default: module.WorkflowCoreShowPage,
- })),
+ import('~/pages/object-core/WorkflowCoreObjectShowPage').then(
+ (module) => ({
+ default: module.WorkflowCoreObjectShowPage,
+ }),
+ ),
),
],
]);
diff --git a/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowEditor.tsx b/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowEditor.tsx
new file mode 100644
index 00000000000..ecdd5506ecb
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowEditor.tsx
@@ -0,0 +1,63 @@
+import { t } from '@lingui/core/macro';
+import { isDefined } from 'twenty-shared/utils';
+import { Loader } from 'twenty-ui/primitives/feedback';
+
+import { WorkspaceRouteUnavailable } from '@/app/routing/components/WorkspaceRouteUnavailable';
+import { useCoreWorkflowVersion } from '@/object-core/workflows/versions/hooks/useCoreWorkflowVersion';
+import { CoreWorkflowVersionCard } from '@/object-core/workflows/versions/components/CoreWorkflowVersionCard';
+import { getWorkflowVisualizerComponentInstanceId } from '@/workflow/utils/getWorkflowVisualizerComponentInstanceId';
+import { WorkflowDiagramCanvasEditable } from '@/workflow/workflow-diagram/components/WorkflowDiagramCanvasEditable';
+import { WorkflowDiagramEffect } from '@/workflow/workflow-diagram/components/WorkflowDiagramEffect';
+import { WorkflowVisualizerEffect } from '@/workflow/workflow-diagram/components/WorkflowVisualizerEffect';
+import { WorkflowVisualizerComponentInstanceContext } from '@/workflow/workflow-diagram/states/contexts/WorkflowVisualizerComponentInstanceContext';
+
+export const CoreWorkflowEditor = ({
+ coreWorkflowId,
+ coreWorkflowVersionId,
+ readonly,
+}: {
+ coreWorkflowId: string;
+ coreWorkflowVersionId: string;
+ readonly: boolean;
+}) => {
+ const { coreWorkflowVersion, loading, error } = useCoreWorkflowVersion(
+ coreWorkflowVersionId,
+ );
+
+ if (loading && !isDefined(coreWorkflowVersion)) {
+ return <Loader />;
+ }
+ if (isDefined(error)) {
+ return (
+ <WorkspaceRouteUnavailable>{t`Could not load this workflow version.`}</WorkspaceRouteUnavailable>
+ );
+ }
+ if (
+ !isDefined(coreWorkflowVersion) ||
+ coreWorkflowVersion.coreWorkflowId !== coreWorkflowId
+ ) {
+ return (
+ <WorkspaceRouteUnavailable>{t`Workflow version not found.`}</WorkspaceRouteUnavailable>
+ );
+ }
+
+ if (readonly) {
+ return (
+ <CoreWorkflowVersionCard coreWorkflowVersionId={coreWorkflowVersionId} />
+ );
+ }
+
+ return (
+ <WorkflowVisualizerComponentInstanceContext.Provider
+ value={{
+ instanceId: getWorkflowVisualizerComponentInstanceId({
+ recordId: coreWorkflowId,
+ }),
+ }}
+ >
+ <WorkflowVisualizerEffect workflowId={coreWorkflowId} />
+ <WorkflowDiagramEffect />
+ <WorkflowDiagramCanvasEditable />
+ </WorkflowVisualizerComponentInstanceContext.Provider>
+ );
+};
diff --git a/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowShowToolbar.tsx b/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowShowToolbar.tsx
new file mode 100644
index 00000000000..154619b37b0
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowShowToolbar.tsx
@@ -0,0 +1,70 @@
+import { styled } from '@linaria/react';
+import { t } from '@lingui/core/macro';
+import { isDefined } from 'twenty-shared/utils';
+import { IconRefresh } from 'twenty-ui/icon';
+import { Button } from 'twenty-ui/primitives/input';
+import { themeCssVariables } from 'twenty-ui/theme-constants';
+
+import { Select } from '@/ui/input/components/Select';
+import { CoreWorkflowVersionRestoreButton } from '@/object-core/workflows/versions/components/CoreWorkflowVersionRestoreButton';
+import { CORE_WORKFLOW_VERSION_STATUS_TAG_PROPS } from '@/object-core/workflows/versions/constants/CoreWorkflowVersionStatusTagProps';
+import { type GetCoreWorkflowVersionsQuery } from '~/generated/graphql';
+
+const StyledToolbar = styled.div`
+ align-items: center;
+ border-bottom: 1px solid ${themeCssVariables.border.color.light};
+ display: flex;
+ gap: ${themeCssVariables.spacing[2]};
+ padding: ${themeCssVariables.spacing[2]} ${themeCssVariables.spacing[3]};
+`;
+
+type CoreWorkflowShowToolbarProps = {
+ coreWorkflowId: string;
+ versions: GetCoreWorkflowVersionsQuery['coreWorkflowVersions'];
+ selectedVersionId: string | undefined;
+ isHistoricalVersion: boolean;
+ isValidating: boolean;
+ onVersionChange: (versionId: string) => void;
+ onValidate: () => Promise<void>;
+ onRefresh: () => Promise<void>;
+};
+
+export const CoreWorkflowShowToolbar = ({
+ coreWorkflowId,
+ versions,
+ selectedVersionId,
+ isHistoricalVersion,
+ isValidating,
+ onVersionChange,
+ onValidate,
+ onRefresh,
+}: CoreWorkflowShowToolbarProps) => (
+ <StyledToolbar>
+ <Select
+ dropdownId={`core-workflow-version-${coreWorkflowId}`}
+ aria-label={t`Version`}
+ value={selectedVersionId ?? ''}
+ options={versions.map((version) => ({
+ value: version.id,
+ label: `${version.label} · ${t(CORE_WORKFLOW_VERSION_STATUS_TAG_PROPS[version.status].label)}`,
+ }))}
+ onChange={onVersionChange}
+ />
+ {isHistoricalVersion && isDefined(selectedVersionId) && (
+ <CoreWorkflowVersionRestoreButton
+ workflowId={coreWorkflowId}
+ coreWorkflowVersionId={selectedVersionId}
+ />
+ )}
+ <Button
+ size="sm"
+ disabled={!isDefined(selectedVersionId) || isValidating}
+ onClick={onValidate}
+ >
+ {t`Validate`}
+ </Button>
+ <Button size="sm" startIcon={<IconRefresh />} onClick={onRefresh}>
+ {t`Refresh`}
+ </Button>
+ </StyledToolbar>
+);
diff --git a/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowToWorkspaceRedirect.tsx b/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowToWorkspaceRedirect.tsx
new file mode 100644
index 00000000000..faf71457293
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowToWorkspaceRedirect.tsx
@@ -0,0 +1,42 @@
+import { Navigate } from 'react-router-dom';
+import { AppPath, CoreObjectNameSingular } from 'twenty-shared/types';
+import { getAppPath, isDefined } from 'twenty-shared/utils';
+import { Loader } from 'twenty-ui/primitives/feedback';
+
+import { WorkspaceRouteUnavailable } from '@/app/routing/components/WorkspaceRouteUnavailable';
+import { useFindManyRecords } from '@/object-record/hooks/useFindManyRecords';
+import { type Workflow } from '@/workflow/types/Workflow';
+
+export const CoreWorkflowToWorkspaceRedirect = ({
+ coreWorkflowId,
+}: {
+ coreWorkflowId: string;
+}) => {
+ const { records, loading } = useFindManyRecords<
+ Pick<Workflow, 'id' | '__typename'> & { coreWorkflowId: string | null }
+ >({
+ objectNameSingular: CoreObjectNameSingular.Workflow,
+ filter: { coreWorkflowId: { eq: coreWorkflowId } },
+ recordGqlFields: { id: true, coreWorkflowId: true },
+ });
+
+ if (loading) {
+ return <Loader />;
+ }
+
+ const workspaceWorkflowId = records[0]?.id;
+
+ if (!isDefined(workspaceWorkflowId)) {
+ return <WorkspaceRouteUnavailable />;
+ }
+
+ return (
+ <Navigate
+ replace
+ to={getAppPath(AppPath.RecordShowPage, {
+ objectNameSingular: CoreObjectNameSingular.Workflow,
+ objectRecordId: workspaceWorkflowId,
+ })}
+ />
+ );
+};
diff --git a/packages/twenty-front/src/modules/object-core/workflows/components/DeleteCoreWorkflowsCommand.tsx b/packages/twenty-front/src/modules/object-core/workflows/components/DeleteCoreWorkflowsCommand.tsx
new file mode 100644
index 00000000000..f038c2a5e36
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/workflows/components/DeleteCoreWorkflowsCommand.tsx
@@ -0,0 +1,30 @@
+import { AppPath } from 'twenty-shared/types';
+import { isNonEmptyArray } from 'twenty-shared/utils';
+import { HeadlessEngineCommandWrapperEffect } from '@/command-menu-item/engine-command/components/HeadlessEngineCommandWrapperEffect';
+import { useHeadlessCommandContextApi } from '@/command-menu-item/engine-command/hooks/useHeadlessCommandContextApi';
+import { useDeleteSelectedCoreWorkflows } from '@/object-core/workflows/hooks/useDeleteSelectedCoreWorkflows';
+import { useSidePanelMenu } from '@/side-panel/hooks/useSidePanelMenu';
+import { useNavigateApp } from '~/hooks/useNavigateApp';
+
+export const DeleteCoreWorkflowsCommand = () => {
+ const { selectedRecords } = useHeadlessCommandContextApi();
+ const { deleteSelectedCoreWorkflows } = useDeleteSelectedCoreWorkflows();
+ const navigate = useNavigateApp();
+ const { closeSidePanelMenu } = useSidePanelMenu();
+
+ const execute = async () => {
+ const coreWorkflowIds = selectedRecords.map(({ id }) => id);
+ if (!isNonEmptyArray(coreWorkflowIds)) {
+ return;
+ }
+ const wereCoreWorkflowsDeleted =
+ await deleteSelectedCoreWorkflows(coreWorkflowIds);
+ if (!wereCoreWorkflowsDeleted) {
+ return;
+ }
+ closeSidePanelMenu();
+ navigate(AppPath.WorkflowCoreIndexPage);
+ };
+
+ return <HeadlessEngineCommandWrapperEffect execute={execute} />;
+};
diff --git a/packages/twenty-front/src/modules/object-core/workflows/components/WorkspaceWorkflowRedirect.tsx b/packages/twenty-front/src/modules/object-core/workflows/components/WorkspaceWorkflowRedirect.tsx
new file mode 100644
index 00000000000..2ca9f8bf55b
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/workflows/components/WorkspaceWorkflowRedirect.tsx
@@ -0,0 +1,41 @@
+import { useQuery } from '@apollo/client/react';
+import { Navigate } from 'react-router-dom';
+import { AppPath } from 'twenty-shared/types';
+import { getAppPath, isDefined } from 'twenty-shared/utils';
+import { Loader } from 'twenty-ui/primitives/feedback';
+
+import { WorkspaceRouteUnavailable } from '@/app/routing/components/WorkspaceRouteUnavailable';
+import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
+import { GetCoreWorkflowLegacyMappingDocument } from '~/generated/graphql';
+
+export const WorkspaceWorkflowRedirect = ({
+ workspaceWorkflowId,
+}: {
+ workspaceWorkflowId: string;
+}) => {
+ const client = useApolloCoreClient();
+ const { data, loading, error } = useQuery(
+ GetCoreWorkflowLegacyMappingDocument,
+ {
+ client,
+ variables: { workspaceWorkflowId },
+ fetchPolicy: 'network-only',
+ },
+ );
+
+ if (loading) {
+ return <Loader />;
+ }
+ if (isDefined(error) || !isDefined(data?.coreWorkflow)) {
+ return <WorkspaceRouteUnavailable />;
+ }
+
+ return (
+ <Navigate
+ replace
+ to={getAppPath(AppPath.WorkflowCoreShowPage, {
+ coreWorkflowId: data.coreWorkflow.id,
+ })}
+ />
+ );
+};
diff --git a/packages/twenty-front/src/modules/object-core/workflows/docs/acceptance-images/core-completed-run.png b/packages/twenty-front/src/modules/object-core/workflows/docs/acceptance-images/core-completed-run.png
new file mode 100644
index 00000000000..3a926b104e8
Binary files /dev/null and b/packages/twenty-front/src/modules/object-core/workflows/docs/acceptance-images/core-completed-run.png differ
diff --git a/packages/twenty-front/src/modules/object-core/workflows/docs/acceptance-images/core-conditional-editor.png b/packages/twenty-front/src/modules/object-core/workflows/docs/acceptance-images/core-conditional-editor.png
new file mode 100644
index 00000000000..afa260366a5
Binary files /dev/null and b/packages/twenty-front/src/modules/object-core/workflows/docs/acceptance-images/core-conditional-editor.png differ
diff --git a/packages/twenty-front/src/modules/object-core/workflows/docs/acceptance-images/core-restored-draft.png b/packages/twenty-front/src/modules/object-core/workflows/docs/acceptance-images/core-restored-draft.png
new file mode 100644
index 00000000000..77cd97184c1
Binary files /dev/null and b/packages/twenty-front/src/modules/object-core/workflows/docs/acceptance-images/core-restored-draft.png differ
diff --git a/packages/twenty-front/src/modules/object-core/workflows/docs/rollout.md b/packages/twenty-front/src/modules/object-core/workflows/docs/rollout.md
new file mode 100644
index 00000000000..07121b38f28
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/workflows/docs/rollout.md
@@ -0,0 +1,78 @@
+# Core workflow frontend rollout
+
+This frontend uses the core-ID API merged through #26068, and this branch is rebased onto that merge. Keep `IS_WORKFLOW_CORE_INDEX_PAGE_ENABLED` disabled for general rollout until the dependencies below are satisfied. This change does not switch the background execution engine.
+
+## Definition ownership and rollback
+
+With the flag enabled, workflow routes use `/workflow-core/:coreWorkflowId`. Version selectors, diagrams, draft editing, output-schema keys, command-menu actions and definition mutations use core IDs. The existing workspace route resolves its mirror's core ID and redirects. A failed core query shows an error; it never loads a workspace definition as a fallback.
+
+With the flag disabled, the workspace index, show page and mutation paths remain available. A core direct link resolves its workspace mirror and redirects. The backend's core-authoritative writes and rollback mirrors must remain deployed, including the legacy-write-to-core synchronization provided by #26068. Disabling the UI flag does not roll back database migrations.
+
+Workflow runs remain workspace records. Run navigation, subscriptions, retry and stop continue to use the workspace run ID. The core UI uses the run's `coreWorkflowId` and `coreWorkflowVersionId` to inspect definitions. Business record IDs inside trigger payloads and step inputs are not translated.
+
+Existing command-menu items with only `workflowVersionId` resolve the core version before executing with the flag enabled. Items containing both references prefer the core reference when enabled and the workspace reference when disabled. Apply the inherited pointer backfill and this PR's command-menu check-constraint migration before creating core-only items.
+
+## Blocking live-update contract
+
+The available SSE stream has workspace `objectRecordEventsWithQueryIds`, metadata events and queue events. Its record operation signatures accept workspace object metadata and workspace record IDs. There is no core workflow/version subscription contract. Core mirror writes emitting workspace events do not constitute a core event contract.
+
+Before rollout, the SSE dependency must provide:
+
+- Workspace-scoped, permission-checked subscriptions for core workflows and their versions, authorized by the workflow permission.
+- Created, updated and deleted events carrying `coreWorkflowId` and, for version events, `coreWorkflowVersionId`.
+- An ordering/revision mechanism and reconnect resynchronization, including missed deletions and draft replacement.
+- Lifecycle coverage for every writer: core mutations, legacy mirror writes, activation/deactivation, draft creation/discard, duplication and deletion.
+
+Deliver the backend contract and frontend consumer together in a separate follow-up PR, which may be stacked on this frontend PR. The consumer must invalidate `coreWorkflows`, `coreWorkflowById`, `coreWorkflowVersionsByCoreWorkflowId` and `coreWorkflowVersionById`, reconcile removed selections and update open diagrams. It must not subscribe using workspace definition IDs. Local mutation refetches and the explicit Refresh action are implemented; remote live updates are not complete. Keep general rollout blocked until that contract and consumer land and multi-session/reconnect tests pass.
+
+## Execution integration
+
+B-async (#26098) is merged. The shared execution engine, automated triggers and webhook resolution now consume core definitions independently of the UI flag. Core webhook URLs contain a core workflow ID, while existing workspace-ID URLs remain supported.
+
+This frontend PR is rebased and retargeted onto `main` after #26068 and #26098 merged. Their overlapping core-version UI/context, generated GraphQL, workflow lifecycle/list services and instance-command registrations are reconciled on this branch. Before enabling the flag, rerun the complete create → edit → activate → run → inspect flow, command-menu lifecycle after the core-only rename/deletion cleanup, connected If/Else duplication, and ON → OFF → ON rollback behavior against the integrated backend.
+
+## Integrated duplication verification
+
+Browser acceptance exposed a failure in the earlier #26068 implementation: connected If/Else branch destinations were left pointing at the original steps during workflow duplication. The merged API now remaps those destinations through `remapDuplicatedStepDestinations`.
+
+The upstream regression suite covering regular, iterator and If/Else destinations passes on this rebased branch. Browser re-verification of manual trigger → iterator → If/Else → form duplication remains part of final-stack acceptance with the reconciled B-async branch.
+
+MCP rekeying and the A1bis constraints remain separate follow-up work. They are not prerequisites for completing this flag-gated frontend PR, but the full migration must not claim them as covered here.
+
+## Acceptance before enabling
+
+Exercise create, rename, step/trigger/edge/position editing, activation, run inspection, duplication, version switching, draft replacement/discard and deletion with unequal core/workspace IDs. Include manual and webhook triggers, iterator, If/Else, form and code actions, and iterator schema recomputation using `coreWorkflowVersionId`.
+
+Exercise ON → OFF → ON with edits on each UI, direct links and browser history; verify permission denial, missing records and failed queries. Verify multi-session edits, remote deletion, dropped events and SSE reconnect. Search, favorites and workspace-object teardown remain separate migrations.
+
+
+## Browser acceptance on twenty-2 (2026-09-17)
+
+Tested this branch on `apple.localhost:4001` against its server/worker and local `default_2` database, after applying instance migrations and inherited pointer backfills. Only the local Apple workspace flag was toggled. Core/workspace workflow and version IDs were different throughout.
+
+| Area | Observed result |
+| --- | --- |
+| Create, rename and navigation | Index creation redirected to the new core workflow; names persisted across refetch. Legacy direct links redirected to core when enabled. |
+| Editing | Manual and webhook trigger editing, POST body editing, code source editing, iterator items, If/Else conditions using iterator output, and form fields persisted. Step duplication/deletion, edge deletion/reconnection and node movement persisted. |
+| Drafts and versions | First edit of an active version created a core draft. Later edits stayed on that returned draft; the active version was unchanged. Version switching and browser Back restored the selected content. Discard returned to the published version. Restoring a historical version over an existing draft selected the replacement draft; subsequent editing saved to that replacement. |
+| Validation and lifecycle | Validate, activate and deactivate succeeded. Manual/form workflow duplication succeeded. Index deletion removed the selected duplicate and cleared selection; its direct link showed Workflow not found. |
+| Run and inspection | A manual/form run completed, its submitted value appeared in step output, and See Version opened its core version. Immediate submission no longer races the pending form autosave. |
+| Rollback | ON → OFF → ON preserved the complex draft. Flag-off core links redirected to the workspace mirror, the workspace index/show paths worked, and a name edit through the old UI appeared in core after re-enabling. Read-only SQL confirmed matching step, trigger and status content in all four tested core/mirror version pairs. |
+| Errors and permissions | A Guest without workflow permission saw explicit denial. A malformed core ID showed an error/retry state. A deleted workflow showed missing-record state. Neither used workspace fallback. Stopping the local server left a failed rename in the input; after restarting, retrying without retyping saved that name. |
+| ID boundaries | Completed workspace run `de3f9855-6c0a-4820-bee1-1407afb6b572` retained its ID and referenced core workflow `c3546f66-d16f-465f-93ca-a82f3db536b6` / version `13f37ddc-3620-49a4-b92d-a2e9b4ca6225`. A business-record UUID in the webhook payload was preserved unchanged. |
+
+Incomplete acceptance is explicit: the merged backend If/Else duplication regression passes, while browser verification on the final combined frontend/API/B-async stack remains pending. Code source persisted, but executing its Lambda build failed because the local AWS SSO session had expired. Actual webhook/automated execution remains B-async acceptance. Core definition remote updates, remote deletion and reconnect remain blocked on the missing SSE contract and consumer; workspace run SSE was observed updating the completed run.
+
+### Screenshots
+
+If/Else editing using iterator output:
+
+![Core conditional editor](acceptance-images/core-conditional-editor.png)
+
+Completed workspace run inspected beside its core definition:
+
+![Completed form run](acceptance-images/core-completed-run.png)
+
+Editing the replacement draft after restoring a historical version:
+
+![Restored draft editor](acceptance-images/core-restored-draft.png)
diff --git a/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/activateCoreWorkflowVersion.ts b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/activateCoreWorkflowVersion.ts
new file mode 100644
index 00000000000..28dfaf5ac09
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/activateCoreWorkflowVersion.ts
@@ -0,0 +1,9 @@
+import { gql } from '@apollo/client';
+
+export const ACTIVATE_CORE_WORKFLOW_VERSION = gql`
+ mutation ActivateCoreWorkflowVersion($coreWorkflowVersionId: UUID!) {
+ activateWorkflowVersion: activateCoreWorkflowVersion(
+ coreWorkflowVersionId: $coreWorkflowVersionId
+ )
+ }
+`;
diff --git a/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/createCoreWorkflowVersionEdge.ts b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/createCoreWorkflowVersionEdge.ts
new file mode 100644
index 00000000000..06a9cd35acc
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/createCoreWorkflowVersionEdge.ts
@@ -0,0 +1,14 @@
+import { WORKFLOW_DIFF_FRAGMENT } from '@/workflow/graphql/fragments/workflowDiffFragment';
+import { gql } from '@apollo/client';
+
+export const CREATE_CORE_WORKFLOW_VERSION_EDGE = gql`
+ mutation CreateCoreWorkflowVersionEdge(
+ $input: CreateCoreWorkflowVersionEdgeInput!
+ ) {
+ createWorkflowVersionEdge: createCoreWorkflowVersionEdge(input: $input) {
+ ...WorkflowDiffFragment
+ }
+ }
+
+ ${WORKFLOW_DIFF_FRAGMENT}
+`;
diff --git a/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/createCoreWorkflowVersionStep.ts b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/createCoreWorkflowVersionStep.ts
new file mode 100644
index 00000000000..d0f33659c44
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/createCoreWorkflowVersionStep.ts
@@ -0,0 +1,14 @@
+import { WORKFLOW_DIFF_FRAGMENT } from '@/workflow/graphql/fragments/workflowDiffFragment';
+import { gql } from '@apollo/client';
+
+export const CREATE_CORE_WORKFLOW_VERSION_STEP = gql`
+ mutation CreateCoreWorkflowVersionStep(
+ $input: CreateCoreWorkflowVersionStepInput!
+ ) {
+ createWorkflowVersionStep: createCoreWorkflowVersionStep(input: $input) {
+ ...WorkflowDiffFragment
+ }
+ }
+
+ ${WORKFLOW_DIFF_FRAGMENT}
+`;
diff --git a/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/createDraftFromCoreWorkflowVersion.ts b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/createDraftFromCoreWorkflowVersion.ts
new file mode 100644
index 00000000000..abb8c0d9e33
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/createDraftFromCoreWorkflowVersion.ts
@@ -0,0 +1,20 @@
+import { gql } from '@apollo/client';
+
+export const CREATE_DRAFT_FROM_CORE_WORKFLOW_VERSION = gql`
+ mutation CreateDraftFromCoreWorkflowVersion(
+ $input: CreateDraftFromCoreWorkflowVersionInput!
+ ) {
+ createDraftFromWorkflowVersion: createDraftFromCoreWorkflowVersion(
+ input: $input
+ ) {
+ id
+ coreWorkflowId
+ label
+ status
+ trigger
+ steps
+ createdAt
+ updatedAt
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/deactivateCoreWorkflowVersion.ts b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/deactivateCoreWorkflowVersion.ts
new file mode 100644
index 00000000000..2d602a67290
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/deactivateCoreWorkflowVersion.ts
@@ -0,0 +1,9 @@
+import { gql } from '@apollo/client';
+
+export const DEACTIVATE_CORE_WORKFLOW_VERSION = gql`
+ mutation DeactivateCoreWorkflowVersion($coreWorkflowVersionId: UUID!) {
+ deactivateWorkflowVersion: deactivateCoreWorkflowVersion(
+ coreWorkflowVersionId: $coreWorkflowVersionId
+ )
+ }
+`;
diff --git a/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/deleteCoreWorkflowVersionEdge.ts b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/deleteCoreWorkflowVersionEdge.ts
new file mode 100644
index 00000000000..b1293f90e5e
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/deleteCoreWorkflowVersionEdge.ts
@@ -0,0 +1,14 @@
+import { WORKFLOW_DIFF_FRAGMENT } from '@/workflow/graphql/fragments/workflowDiffFragment';
+import { gql } from '@apollo/client';
+
+export const DELETE_CORE_WORKFLOW_VERSION_EDGE = gql`
+ mutation DeleteCoreWorkflowVersionEdge(
+ $input: DeleteCoreWorkflowVersionEdgeInput!
+ ) {
+ deleteWorkflowVersionEdge: deleteCoreWorkflowVersionEdge(input: $input) {
+ ...WorkflowDiffFragment
+ }
+ }
+
+ ${WORKFLOW_DIFF_FRAGMENT}
+`;
diff --git a/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/deleteCoreWorkflowVersionStep.ts b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/deleteCoreWorkflowVersionStep.ts
new file mode 100644
index 00000000000..e6e628c55ee
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/deleteCoreWorkflowVersionStep.ts
@@ -0,0 +1,14 @@
+import { WORKFLOW_DIFF_FRAGMENT } from '@/workflow/graphql/fragments/workflowDiffFragment';
+import { gql } from '@apollo/client';
+
+export const DELETE_CORE_WORKFLOW_VERSION_STEP = gql`
+ mutation DeleteCoreWorkflowVersionStep(
+ $input: DeleteCoreWorkflowVersionStepInput!
+ ) {
+ deleteWorkflowVersionStep: deleteCoreWorkflowVersionStep(input: $input) {
+ ...WorkflowDiffFragment
+ }
+ }
+
+ ${WORKFLOW_DIFF_FRAGMENT}
+`;
diff --git a/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/duplicateCoreWorkflow.ts b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/duplicateCoreWorkflow.ts
new file mode 100644
index 00000000000..883f3456829
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/duplicateCoreWorkflow.ts
@@ -0,0 +1,9 @@
+import { gql } from '@apollo/client';
+
+export const DUPLICATE_CORE_WORKFLOW = gql`
+ mutation DuplicateCoreWorkflow($input: DuplicateCoreWorkflowInput!) {
+ duplicateWorkflow: duplicateCoreWorkflow(input: $input) {
+ id
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/duplicateCoreWorkflowVersionStep.ts b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/duplicateCoreWorkflowVersionStep.ts
new file mode 100644
index 00000000000..be2a93b5e04
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/duplicateCoreWorkflowVersionStep.ts
@@ -0,0 +1,16 @@
+import { WORKFLOW_DIFF_FRAGMENT } from '@/workflow/graphql/fragments/workflowDiffFragment';
+import { gql } from '@apollo/client';
+
+export const DUPLICATE_CORE_WORKFLOW_VERSION_STEP = gql`
+ mutation DuplicateCoreWorkflowVersionStep(
+ $input: DuplicateCoreWorkflowVersionStepInput!
+ ) {
+ duplicateWorkflowVersionStep: duplicateCoreWorkflowVersionStep(
+ input: $input
+ ) {
+ ...WorkflowDiffFragment
+ }
+ }
+
+ ${WORKFLOW_DIFF_FRAGMENT}
+`;
diff --git a/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/runCoreWorkflowVersion.ts b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/runCoreWorkflowVersion.ts
new file mode 100644
index 00000000000..43d334ac9fc
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/runCoreWorkflowVersion.ts
@@ -0,0 +1,9 @@
+import { gql } from '@apollo/client';
+
+export const RUN_CORE_WORKFLOW_VERSION = gql`
+ mutation RunCoreWorkflowVersion($input: RunCoreWorkflowVersionInput!) {
+ runWorkflowVersion: runCoreWorkflowVersion(input: $input) {
+ workflowRunId
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/updateCoreWorkflow.ts b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/updateCoreWorkflow.ts
new file mode 100644
index 00000000000..18102624960
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/updateCoreWorkflow.ts
@@ -0,0 +1,11 @@
+import { gql } from '@apollo/client';
+
+export const UPDATE_CORE_WORKFLOW = gql`
+ mutation UpdateCoreWorkflow($input: UpdateCoreWorkflowInput!) {
+ updateCoreWorkflow(input: $input) {
+ id
+ name
+ updatedAt
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/updateCoreWorkflowVersionPositions.ts b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/updateCoreWorkflowVersionPositions.ts
new file mode 100644
index 00000000000..e650d3d9cd1
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/updateCoreWorkflowVersionPositions.ts
@@ -0,0 +1,11 @@
+import { gql } from '@apollo/client';
+
+export const UPDATE_CORE_WORKFLOW_VERSION_POSITIONS = gql`
+ mutation UpdateCoreWorkflowVersionPositions(
+ $input: UpdateCoreWorkflowVersionPositionsInput!
+ ) {
+ updateWorkflowVersionPositions: updateCoreWorkflowVersionPositions(
+ input: $input
+ )
+ }
+`;
diff --git a/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/updateCoreWorkflowVersionStep.ts b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/updateCoreWorkflowVersionStep.ts
new file mode 100644
index 00000000000..000e534aba5
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/updateCoreWorkflowVersionStep.ts
@@ -0,0 +1,20 @@
+import { gql } from '@apollo/client';
+
+export const UPDATE_CORE_WORKFLOW_VERSION_STEP = gql`
+ mutation UpdateCoreWorkflowVersionStep(
+ $input: UpdateCoreWorkflowVersionStepInput!
+ ) {
+ updateWorkflowVersionStep: updateCoreWorkflowVersionStep(input: $input) {
+ id
+ name
+ type
+ settings
+ valid
+ nextStepIds
+ position {
+ x
+ y
+ }
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/updateCoreWorkflowVersionTrigger.ts b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/updateCoreWorkflowVersionTrigger.ts
new file mode 100644
index 00000000000..fa644c70314
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/updateCoreWorkflowVersionTrigger.ts
@@ -0,0 +1,13 @@
+import { gql } from '@apollo/client';
+
+export const UPDATE_CORE_WORKFLOW_VERSION_TRIGGER = gql`
+ mutation UpdateCoreWorkflowVersionTrigger(
+ $input: UpdateCoreWorkflowVersionTriggerInput!
+ ) {
+ updateWorkflowVersionTrigger: updateCoreWorkflowVersionTrigger(
+ input: $input
+ ) {
+ trigger
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/validateCoreWorkflowVersion.ts b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/validateCoreWorkflowVersion.ts
new file mode 100644
index 00000000000..a63930d2502
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/workflows/graphql/mutations/validateCoreWorkflowVersion.ts
@@ -0,0 +1,7 @@
+import { gql } from '@apollo/client';
+
+export const VALIDATE_CORE_WORKFLOW_VERSION = gql`
+ mutation ValidateCoreWorkflowVersion($coreWorkflowVersionId: UUID!) {
+ validateCoreWorkflowVersion(coreWorkflowVersionId: $coreWorkflowVersionId)
+ }
+`;
diff --git a/packages/twenty-front/src/modules/object-core/workflows/graphql/queries/getCoreWorkflow.ts b/packages/twenty-front/src/modules/object-core/workflows/graphql/queries/getCoreWorkflow.ts
index 21a2e486403..0d3c124e103 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/graphql/queries/getCoreWorkflow.ts
+++ b/packages/twenty-front/src/modules/object-core/workflows/graphql/queries/getCoreWorkflow.ts
@@ -1,12 +1,12 @@
import { gql } from '@apollo/client';
export const GET_CORE_WORKFLOW = gql`
- query GetCoreWorkflow($workspaceWorkflowId: UUID!) {
- coreWorkflow(workspaceWorkflowId: $workspaceWorkflowId) {
+ query GetCoreWorkflow($coreWorkflowId: UUID!) {
+ coreWorkflow: coreWorkflowById(coreWorkflowId: $coreWorkflowId) {
id
name
statuses
- lastPublishedVersionId
+ lastPublishedCoreWorkflowVersionId
workspaceWorkflowId
createdAt
updatedAt
diff --git a/packages/twenty-front/src/modules/object-core/workflows/graphql/queries/getCoreWorkflowLegacyMapping.ts b/packages/twenty-front/src/modules/object-core/workflows/graphql/queries/getCoreWorkflowLegacyMapping.ts
new file mode 100644
index 00000000000..51091278d8f
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/workflows/graphql/queries/getCoreWorkflowLegacyMapping.ts
@@ -0,0 +1,23 @@
+import { gql } from '@apollo/client';
+
+export const GET_CORE_WORKFLOW_LEGACY_MAPPING = gql`
+ query GetCoreWorkflowLegacyMapping($workspaceWorkflowId: UUID!) {
+ coreWorkflow(workspaceWorkflowId: $workspaceWorkflowId) {
+ id
+ }
+ }
+`;
+
+export const GET_CORE_WORKFLOW_VERSION_LEGACY_MAPPING = gql`
+ query GetCoreWorkflowVersionLegacyMapping(
+ $workspaceWorkflowVersionId: UUID!
+ ) {
+ coreWorkflowVersion(
+ workspaceWorkflowVersionId: $workspaceWorkflowVersionId
+ ) {
+ id
+ coreWorkflowId
+ workspaceWorkflowVersionId
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/object-core/workflows/graphql/queries/getCoreWorkflowsWithCurrentVersions.ts b/packages/twenty-front/src/modules/object-core/workflows/graphql/queries/getCoreWorkflowsWithCurrentVersions.ts
new file mode 100644
index 00000000000..270bd970c52
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/workflows/graphql/queries/getCoreWorkflowsWithCurrentVersions.ts
@@ -0,0 +1,33 @@
+import { gql } from '@apollo/client';
+
+export const GET_CORE_WORKFLOWS_WITH_CURRENT_VERSIONS = gql`
+ query GetCoreWorkflowsWithCurrentVersions(
+ $input: CoreWorkflowsWithCurrentVersionsInput!
+ ) {
+ coreWorkflowsWithCurrentVersions(input: $input) {
+ workflow {
+ id
+ name
+ statuses
+ lastPublishedCoreWorkflowVersionId
+ }
+ versions {
+ id
+ coreWorkflowId
+ label
+ status
+ createdAt
+ }
+ currentVersion {
+ id
+ coreWorkflowId
+ label
+ status
+ trigger
+ steps
+ createdAt
+ updatedAt
+ }
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/object-core/workflows/hooks/__tests__/useCoreWorkflowsSelection.test.tsx b/packages/twenty-front/src/modules/object-core/workflows/hooks/__tests__/useCoreWorkflowsSelection.test.tsx
index 9aa560e29ed..ebd82eeb3c3 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/hooks/__tests__/useCoreWorkflowsSelection.test.tsx
+++ b/packages/twenty-front/src/modules/object-core/workflows/hooks/__tests__/useCoreWorkflowsSelection.test.tsx
@@ -65,59 +65,31 @@ describe('useCoreWorkflowsSelection', () => {
);
});
- it('should drop the deleted rows and clear the selection when a deletion is reported', () => {
+ it('selects a core workflow without a workspace mirror ID', () => {
const { result } = renderSelection();
-
- act(() => {
- result.current.toggleRow('core-1');
- });
-
- act(() => {
- result.current.forgetDeletedWorkspaceWorkflows(['workspace-1']);
- });
-
- expect(
- result.current.displayedCoreWorkflows.map(
- (coreWorkflow) => coreWorkflow.id,
- ),
- ).toEqual(['core-2', 'core-3']);
- expect(result.current.selectedRowIds).toEqual([]);
+ act(() => result.current.toggleRow('core-3'));
+ expect(result.current.selectedRowIds).toEqual(['core-3']);
});
- it('should ignore a deletion that targets rows it is not showing', () => {
- const { result } = renderSelection();
-
- act(() => {
- result.current.toggleRow('core-1');
- });
-
- act(() => {
- result.current.forgetDeletedWorkspaceWorkflows(['workspace-elsewhere']);
- });
-
- expect(result.current.displayedCoreWorkflows).toHaveLength(3);
- expect(result.current.selectedRowIds).toEqual(['core-1']);
- });
-
- it('should keep a deleted workflow hidden once the mirror drops its workspace record', () => {
+ it('preserves selected records that are not in the currently loaded page', () => {
const { result, rerender } = renderSelection();
+ act(() => result.current.toggleRow('core-1'));
+ rerender({ coreWorkflows: coreWorkflows.slice(1) });
+ expect(result.current.selectedRowIds).toEqual([]);
+ expect(jotaiStore.get(coreWorkflowsSelectionState.atom).rowIds).toEqual([
+ 'core-1',
+ ]);
- act(() => {
- result.current.forgetDeletedWorkspaceWorkflows(['workspace-1']);
- });
-
- rerender({
- coreWorkflows: [
- { id: 'core-1', workspaceWorkflowId: null },
- { id: 'core-2', workspaceWorkflowId: 'workspace-2' },
- ],
- });
+ act(() => result.current.toggleRow('core-2'));
- expect(
- result.current.displayedCoreWorkflows.map(
- (coreWorkflow) => coreWorkflow.id,
- ),
- ).toEqual(['core-2']);
+ expect(jotaiStore.get(coreWorkflowsSelectionState.atom).rowIds).toEqual([
+ 'core-1',
+ 'core-2',
+ ]);
+ expect(result.current.displayedCoreWorkflows.map(({ id }) => id)).toEqual([
+ 'core-2',
+ 'core-3',
+ ]);
});
it('should drop the selection when the filter settings change', () => {
diff --git a/packages/twenty-front/src/modules/object-core/workflows/hooks/useCoreWorkflowForShowPage.ts b/packages/twenty-front/src/modules/object-core/workflows/hooks/useCoreWorkflowForShowPage.ts
index 83f8cda75f0..9e54a48ff88 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/hooks/useCoreWorkflowForShowPage.ts
+++ b/packages/twenty-front/src/modules/object-core/workflows/hooks/useCoreWorkflowForShowPage.ts
@@ -20,10 +20,10 @@ type CoreWorkflowShowPageWorkflow = Pick<
>;
export const useCoreWorkflowForShowPage = ({
- workspaceWorkflowId,
+ coreWorkflowId,
skip,
}: {
- workspaceWorkflowId: string | undefined;
+ coreWorkflowId: string | undefined;
skip: boolean;
}): {
coreWorkflow: CoreWorkflowShowPageWorkflow | undefined;
@@ -32,12 +32,12 @@ export const useCoreWorkflowForShowPage = ({
} => {
const apolloCoreClient = useApolloCoreClient();
- const shouldSkip = skip || !isDefined(workspaceWorkflowId);
+ const shouldSkip = skip || !isDefined(coreWorkflowId);
const { data: coreWorkflowData } = useQuery(GetCoreWorkflowDocument, {
client: apolloCoreClient,
fetchPolicy: 'cache-and-network',
- variables: { workspaceWorkflowId: workspaceWorkflowId ?? '' },
+ variables: { coreWorkflowId: coreWorkflowId ?? '' },
skip: shouldSkip,
});
@@ -46,26 +46,20 @@ export const useCoreWorkflowForShowPage = ({
{
client: apolloCoreClient,
fetchPolicy: 'cache-and-network',
- variables: { workspaceWorkflowId: workspaceWorkflowId ?? '' },
+ variables: { coreWorkflowId: coreWorkflowId ?? '' },
skip: shouldSkip,
},
);
const coreWorkflow = coreWorkflowData?.coreWorkflow;
- const versions = (
- coreWorkflowVersionsData?.coreWorkflowVersions ?? []
- ).flatMap((coreWorkflowVersion) =>
- isDefined(coreWorkflowVersion.workspaceWorkflowVersionId)
- ? [
- {
- id: coreWorkflowVersion.workspaceWorkflowVersionId,
- name: coreWorkflowVersion.label,
- status: coreWorkflowVersion.status,
- createdAt: coreWorkflowVersion.createdAt,
- },
- ]
- : [],
+ const versions = (coreWorkflowVersionsData?.coreWorkflowVersions ?? []).map(
+ (version) => ({
+ id: version.id,
+ name: version.label,
+ status: version.status,
+ createdAt: version.createdAt,
+ }),
);
const draftVersionIdFromServer = versions.find(
@@ -75,10 +69,11 @@ export const useCoreWorkflowForShowPage = ({
return {
coreWorkflow: isDefined(coreWorkflow)
? {
- id: coreWorkflow.workspaceWorkflowId,
+ id: coreWorkflow.id,
name: coreWorkflow.name ?? '',
statuses: coreWorkflow.statuses,
- lastPublishedVersionId: coreWorkflow.lastPublishedVersionId,
+ lastPublishedVersionId:
+ coreWorkflow.lastPublishedCoreWorkflowVersionId,
}
: undefined,
versions,
diff --git a/packages/twenty-front/src/modules/object-core/workflows/hooks/useCoreWorkflowShowPageResource.ts b/packages/twenty-front/src/modules/object-core/workflows/hooks/useCoreWorkflowShowPageResource.ts
index dc4483534b8..34c95a79286 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/hooks/useCoreWorkflowShowPageResource.ts
+++ b/packages/twenty-front/src/modules/object-core/workflows/hooks/useCoreWorkflowShowPageResource.ts
@@ -6,16 +6,16 @@ import { buildWorkflowShowPageRecordFromCoreWorkflow } from '@/object-core/workf
import { GetCoreWorkflowDocument } from '~/generated/graphql';
export const useCoreWorkflowShowPageResource = ({
- workspaceWorkflowId,
+ coreWorkflowId,
}: {
- workspaceWorkflowId: string;
+ coreWorkflowId: string;
}) => {
const apolloCoreClient = useApolloCoreClient();
const { data, loading, error, refetch } = useQuery(GetCoreWorkflowDocument, {
client: apolloCoreClient,
fetchPolicy: 'cache-and-network',
- variables: { workspaceWorkflowId },
+ variables: { coreWorkflowId },
});
const record = useMemo(
diff --git a/packages/twenty-front/src/modules/object-core/workflows/hooks/useCoreWorkflowVersionContent.ts b/packages/twenty-front/src/modules/object-core/workflows/hooks/useCoreWorkflowVersionContent.ts
index fecf0b63424..743a77c113d 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/hooks/useCoreWorkflowVersionContent.ts
+++ b/packages/twenty-front/src/modules/object-core/workflows/hooks/useCoreWorkflowVersionContent.ts
@@ -1,3 +1,4 @@
+import { buildWorkflowVersionFromCore } from '@/object-core/workflows/utils/buildWorkflowVersionFromCore';
import { useQuery } from '@apollo/client/react';
import { isDefined } from 'twenty-shared/utils';
@@ -6,12 +7,12 @@ import { type WorkflowVersion } from '@/workflow/types/Workflow';
import { GetCoreWorkflowVersionDocument } from '~/generated/graphql';
export const useCoreWorkflowVersionContent = ({
- workspaceWorkflowId,
- workspaceWorkflowVersionId,
+ coreWorkflowId,
+ coreWorkflowVersionId,
skip,
}: {
- workspaceWorkflowId: string | undefined;
- workspaceWorkflowVersionId: string | undefined;
+ coreWorkflowId: string | undefined;
+ coreWorkflowVersionId: string | undefined;
skip: boolean;
}): WorkflowVersion | undefined => {
const apolloCoreClient = useApolloCoreClient();
@@ -20,36 +21,23 @@ export const useCoreWorkflowVersionContent = ({
client: apolloCoreClient,
fetchPolicy: 'cache-and-network',
variables: {
- workspaceWorkflowVersionId: workspaceWorkflowVersionId ?? '',
+ coreWorkflowVersionId: coreWorkflowVersionId ?? '',
},
skip:
- skip ||
- !isDefined(workspaceWorkflowVersionId) ||
- !isDefined(workspaceWorkflowId),
+ skip || !isDefined(coreWorkflowVersionId) || !isDefined(coreWorkflowId),
});
const coreWorkflowVersion = data?.coreWorkflowVersion;
if (
!isDefined(coreWorkflowVersion) ||
- !isDefined(workspaceWorkflowId) ||
- !isDefined(workspaceWorkflowVersionId) ||
- coreWorkflowVersion.workspaceWorkflowVersionId !==
- workspaceWorkflowVersionId ||
- coreWorkflowVersion.workspaceWorkflowId !== workspaceWorkflowId
+ !isDefined(coreWorkflowId) ||
+ !isDefined(coreWorkflowVersionId) ||
+ coreWorkflowVersion.id !== coreWorkflowVersionId ||
+ coreWorkflowVersion.coreWorkflowId !== coreWorkflowId
) {
return undefined;
}
- return {
- __typename: 'WorkflowVersion',
- id: workspaceWorkflowVersionId,
- name: coreWorkflowVersion.label,
- status: coreWorkflowVersion.status,
- workflowId: workspaceWorkflowId,
- createdAt: coreWorkflowVersion.createdAt,
- updatedAt: coreWorkflowVersion.updatedAt,
- trigger: coreWorkflowVersion.trigger,
- steps: coreWorkflowVersion.steps,
- };
+ return buildWorkflowVersionFromCore(coreWorkflowVersion);
};
diff --git a/packages/twenty-front/src/modules/object-core/workflows/hooks/useCoreWorkflowsSelection.ts b/packages/twenty-front/src/modules/object-core/workflows/hooks/useCoreWorkflowsSelection.ts
index a53e4f8464f..3c58c666b4f 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/hooks/useCoreWorkflowsSelection.ts
+++ b/packages/twenty-front/src/modules/object-core/workflows/hooks/useCoreWorkflowsSelection.ts
@@ -1,5 +1,4 @@
-import { useEffect, useState } from 'react';
-import { isDefined } from 'twenty-shared/utils';
+import { useEffect } from 'react';
import { coreWorkflowsFilterSettingsState } from '@/object-core/workflows/states/coreWorkflowsFilterSettingsState';
import {
@@ -13,7 +12,7 @@ import { useAtomState } from '@/ui/utilities/state/jotai/hooks/useAtomState';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
export const useCoreWorkflowsSelection = <
- TCoreWorkflow extends Pick<CoreWorkflow, 'id' | 'workspaceWorkflowId'>,
+ TCoreWorkflow extends Pick<CoreWorkflow, 'id'>,
>({
coreWorkflows,
}: {
@@ -23,10 +22,6 @@ export const useCoreWorkflowsSelection = <
coreWorkflowsSelectionState,
);
- const [deletedCoreWorkflowIds, setDeletedCoreWorkflowIds] = useState<
- string[]
- >([]);
-
const coreWorkflowsFilterSettings = useAtomStateValue(
coreWorkflowsFilterSettingsState,
);
@@ -36,10 +31,13 @@ export const useCoreWorkflowsSelection = <
[setCoreWorkflowsSelection],
);
- const selectedRowIds = getSelectedCoreWorkflowRowIds({
+ const selectionRowIds = getSelectedCoreWorkflowRowIds({
selection: coreWorkflowsSelection,
currentFilterSettings: coreWorkflowsFilterSettings,
});
+ const selectedRowIds = selectionRowIds.filter((id) =>
+ coreWorkflows.some((workflow) => workflow.id === id),
+ );
const selectRows = (rowIds: string[]) =>
setCoreWorkflowsSelection({
@@ -47,42 +45,15 @@ export const useCoreWorkflowsSelection = <
rowIds,
});
- const displayedCoreWorkflows = coreWorkflows.filter(
- (coreWorkflow) => !deletedCoreWorkflowIds.includes(coreWorkflow.id),
- );
-
const toggleRow = (rowId: string) =>
- selectRows(toggleRowIdInSelection({ selectedRowIds, rowId }));
-
- const forgetDeletedWorkspaceWorkflows = (
- deletedWorkspaceWorkflowIds: string[],
- ) => {
- const coreWorkflowIdsToForget = coreWorkflows
- .filter(
- (coreWorkflow) =>
- isDefined(coreWorkflow.workspaceWorkflowId) &&
- deletedWorkspaceWorkflowIds.includes(
- coreWorkflow.workspaceWorkflowId,
- ),
- )
- .map((coreWorkflow) => coreWorkflow.id);
-
- if (coreWorkflowIdsToForget.length === 0) {
- return;
- }
-
- setDeletedCoreWorkflowIds((previousDeletedCoreWorkflowIds) => [
- ...previousDeletedCoreWorkflowIds,
- ...coreWorkflowIdsToForget,
- ]);
- selectRows([]);
- };
+ selectRows(
+ toggleRowIdInSelection({ selectedRowIds: selectionRowIds, rowId }),
+ );
return {
- displayedCoreWorkflows,
+ displayedCoreWorkflows: coreWorkflows,
selectedRowIds,
toggleRow,
selectRows,
- forgetDeletedWorkspaceWorkflows,
};
};
diff --git a/packages/twenty-front/src/modules/object-core/workflows/hooks/useCreateCoreWorkflow.ts b/packages/twenty-front/src/modules/object-core/workflows/hooks/useCreateCoreWorkflow.ts
index 80f94d52d08..c0eaf1771f8 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/hooks/useCreateCoreWorkflow.ts
+++ b/packages/twenty-front/src/modules/object-core/workflows/hooks/useCreateCoreWorkflow.ts
@@ -2,13 +2,16 @@ import { useMutation } from '@apollo/client/react';
import { t } from '@lingui/core/macro';
import { useCallback, useState } from 'react';
import { AppPath, CoreObjectNameSingular } from 'twenty-shared/types';
+import { PermissionFlagType } from 'twenty-shared/constants';
import { isDefined } from 'twenty-shared/utils';
import { CREATE_CORE_WORKFLOW } from '@/object-core/workflows/graphql/mutations/createCoreWorkflow';
+import { invalidateCoreWorkflowVersions } from '@/object-core/workflows/versions/utils/invalidateCoreWorkflowVersions';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
import { useObjectPermissionsForObject } from '@/object-record/hooks/useObjectPermissionsForObject';
import { canCreateRecordsForObjectMetadataItem } from '@/object-record/utils/canCreateRecordsForObjectMetadataItem';
+import { useHasPermissionFlag } from '@/settings/roles/hooks/useHasPermissionFlag';
import { useToast } from 'twenty-ui/primitives/feedback';
import {
type CreateCoreWorkflowMutation,
@@ -20,13 +23,19 @@ import { logError } from '~/utils/logError';
export const useCreateCoreWorkflow = () => {
const apolloCoreClient = useApolloCoreClient();
+ const canManageWorkflows = useHasPermissionFlag(PermissionFlagType.WORKFLOWS);
const { objectMetadataItem } = useObjectMetadataItem({
objectNameSingular: CoreObjectNameSingular.Workflow,
});
-
const objectPermissions = useObjectPermissionsForObject(
objectMetadataItem.id,
);
+ const canCreateCoreWorkflow =
+ canManageWorkflows &&
+ canCreateRecordsForObjectMetadataItem({
+ objectPermissions,
+ objectMetadataItem,
+ });
const [createCoreWorkflowMutation] = useMutation<
CreateCoreWorkflowMutation,
@@ -39,26 +48,21 @@ export const useCreateCoreWorkflow = () => {
const { enqueueToast } = useToast();
- const canCreateCoreWorkflow = canCreateRecordsForObjectMetadataItem({
- objectPermissions,
- objectMetadataItem,
- });
-
const createCoreWorkflow = useCallback(async () => {
- if (isCreatingCoreWorkflow) {
+ if (isCreatingCoreWorkflow || !canCreateCoreWorkflow) {
return;
}
setIsCreatingCoreWorkflow(true);
- let workspaceWorkflowId: string | null | undefined;
+ let coreWorkflowId: string | null | undefined;
try {
const { data } = await createCoreWorkflowMutation({
variables: { input: {} },
});
- workspaceWorkflowId = data?.createCoreWorkflow.workspaceWorkflowId;
+ coreWorkflowId = data?.createCoreWorkflow.id;
} catch (error) {
logError(error);
enqueueToast({
@@ -71,7 +75,7 @@ export const useCreateCoreWorkflow = () => {
setIsCreatingCoreWorkflow(false);
}
- if (!isDefined(workspaceWorkflowId)) {
+ if (!isDefined(coreWorkflowId)) {
enqueueToast({
variant: 'error',
children: t`Failed to create workflow`,
@@ -80,11 +84,11 @@ export const useCreateCoreWorkflow = () => {
return;
}
- navigate(AppPath.RecordShowPage, {
- objectNameSingular: CoreObjectNameSingular.Workflow,
- objectRecordId: workspaceWorkflowId,
- });
+ navigate(AppPath.WorkflowCoreShowPage, { coreWorkflowId });
+ await invalidateCoreWorkflowVersions(apolloCoreClient);
}, [
+ canCreateCoreWorkflow,
+ apolloCoreClient,
createCoreWorkflowMutation,
navigate,
enqueueToast,
diff --git a/packages/twenty-front/src/modules/object-core/workflows/hooks/useDeleteSelectedCoreWorkflows.ts b/packages/twenty-front/src/modules/object-core/workflows/hooks/useDeleteSelectedCoreWorkflows.ts
index e2e9673a3f2..2f158bdd747 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/hooks/useDeleteSelectedCoreWorkflows.ts
+++ b/packages/twenty-front/src/modules/object-core/workflows/hooks/useDeleteSelectedCoreWorkflows.ts
@@ -1,6 +1,6 @@
import { useMutation } from '@apollo/client/react';
import { t } from '@lingui/core/macro';
-import { isNonEmptyArray } from 'twenty-shared/utils';
+import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
import { dispatchObjectRecordOperationBrowserEvent } from '@/browser-event/utils/dispatchObjectRecordOperationBrowserEvent';
import { useRemoveNavigationMenuItemByTargetRecordId } from '@/navigation-menu-item/common/hooks/useRemoveNavigationMenuItemByTargetRecordId';
@@ -11,6 +11,7 @@ import {
coreWorkflowsSelectionState,
} from '@/object-core/workflows/states/coreWorkflowsSelectionState';
import { getSelectedCoreWorkflowRowIds } from '@/object-core/workflows/utils/getSelectedCoreWorkflowRowIds';
+import { invalidateCoreWorkflowVersions } from '@/object-core/workflows/versions/utils/invalidateCoreWorkflowVersions';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
@@ -54,21 +55,23 @@ export const useDeleteSelectedCoreWorkflows = () => {
currentFilterSettings: coreWorkflowsFilterSettings,
});
- const deleteSelectedCoreWorkflows = async () => {
- if (!isNonEmptyArray(selectedCoreWorkflowIds)) {
- return;
+ const deleteSelectedCoreWorkflows = async (
+ coreWorkflowIds = selectedCoreWorkflowIds,
+ ) => {
+ if (!isNonEmptyArray(coreWorkflowIds)) {
+ return false;
}
- let deletedWorkspaceWorkflowIds: string[];
+ let deletedCoreWorkflows: NonNullable<
+ DeleteCoreWorkflowsMutation['deleteCoreWorkflows']
+ >;
try {
const { data } = await deleteCoreWorkflowsMutation({
- variables: { input: { coreWorkflowIds: selectedCoreWorkflowIds } },
+ variables: { input: { coreWorkflowIds } },
});
- deletedWorkspaceWorkflowIds = (data?.deleteCoreWorkflows ?? []).map(
- (deletedCoreWorkflow) => deletedCoreWorkflow.workspaceWorkflowId,
- );
+ deletedCoreWorkflows = data?.deleteCoreWorkflows ?? [];
} catch (error) {
logError(error);
enqueueToast({
@@ -76,20 +79,26 @@ export const useDeleteSelectedCoreWorkflows = () => {
children: t`Failed to delete workflows`,
});
- return;
+ return false;
}
- if (!isNonEmptyArray(deletedWorkspaceWorkflowIds)) {
+ if (!isNonEmptyArray(deletedCoreWorkflows)) {
enqueueToast({
variant: 'error',
children: t`No workflows were deleted`,
});
- return;
+ return false;
}
setCoreWorkflowsSelection(EMPTY_CORE_WORKFLOWS_SELECTION);
+ const deletedWorkspaceWorkflowIds = deletedCoreWorkflows
+ .map((deletedCoreWorkflow) => deletedCoreWorkflow.workspaceWorkflowId)
+ .filter(isDefined);
+
+ void invalidateCoreWorkflowVersions(apolloCoreClient).catch(logError);
+
removeNavigationMenuItemsByTargetRecordIds(deletedWorkspaceWorkflowIds);
dispatchObjectRecordOperationBrowserEvent({
@@ -99,6 +108,8 @@ export const useDeleteSelectedCoreWorkflows = () => {
deletedRecordIds: deletedWorkspaceWorkflowIds,
},
});
+
+ return true;
};
return { deleteSelectedCoreWorkflows, selectedCoreWorkflowIds };
diff --git a/packages/twenty-front/src/modules/object-core/workflows/hooks/useDiscardCoreWorkflowDraft.ts b/packages/twenty-front/src/modules/object-core/workflows/hooks/useDiscardCoreWorkflowDraft.ts
index fc41179ff32..5b66071265b 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/hooks/useDiscardCoreWorkflowDraft.ts
+++ b/packages/twenty-front/src/modules/object-core/workflows/hooks/useDiscardCoreWorkflowDraft.ts
@@ -1,18 +1,19 @@
+import { useSidePanelMenu } from '@/side-panel/hooks/useSidePanelMenu';
import { useMutation } from '@apollo/client/react';
+import { useSearchParams } from 'react-router-dom';
import { DISCARD_CORE_WORKFLOW_DRAFT } from '@/object-core/workflows/graphql/mutations/discardCoreWorkflowDraft';
import { invalidateCoreWorkflowVersions } from '@/object-core/workflows/versions/utils/invalidateCoreWorkflowVersions';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
-import { useEvictDiscardedDraftFromWorkflowCache } from '@/workflow/hooks/useEvictDiscardedDraftFromWorkflowCache';
import {
type DiscardCoreWorkflowDraftMutation,
type DiscardCoreWorkflowDraftMutationVariables,
} from '~/generated/graphql';
export const useDiscardCoreWorkflowDraft = () => {
+ const { closeSidePanelMenu } = useSidePanelMenu();
const apolloCoreClient = useApolloCoreClient();
- const { evictDiscardedDraftFromWorkflowCache } =
- useEvictDiscardedDraftFromWorkflowCache();
+ const [searchParams, setSearchParams] = useSearchParams();
const [discardCoreWorkflowDraftMutation] = useMutation<
DiscardCoreWorkflowDraftMutation,
@@ -20,15 +21,22 @@ export const useDiscardCoreWorkflowDraft = () => {
>(DISCARD_CORE_WORKFLOW_DRAFT, { client: apolloCoreClient });
const discardCoreWorkflowDraft = async ({
- workspaceWorkflowVersionId,
+ coreWorkflowVersionId,
}: {
- workspaceWorkflowVersionId: string;
+ coreWorkflowVersionId: string;
}) => {
await discardCoreWorkflowDraftMutation({
- variables: { input: { workspaceWorkflowVersionId } },
+ variables: { input: { coreWorkflowVersionId } },
});
- evictDiscardedDraftFromWorkflowCache(workspaceWorkflowVersionId);
+ closeSidePanelMenu();
+
+ if (searchParams.get('version') === coreWorkflowVersionId) {
+ const nextSearchParams = new URLSearchParams(searchParams);
+
+ nextSearchParams.delete('version');
+ setSearchParams(nextSearchParams, { replace: true });
+ }
await invalidateCoreWorkflowVersions(apolloCoreClient);
};
diff --git a/packages/twenty-front/src/modules/object-core/workflows/hooks/useRenameCoreWorkflow.ts b/packages/twenty-front/src/modules/object-core/workflows/hooks/useRenameCoreWorkflow.ts
new file mode 100644
index 00000000000..4c66fecdc2c
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/workflows/hooks/useRenameCoreWorkflow.ts
@@ -0,0 +1,44 @@
+import { useMutation } from '@apollo/client/react';
+import { t } from '@lingui/core/macro';
+import { useToast } from 'twenty-ui/primitives/feedback';
+
+import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
+import { invalidateCoreWorkflowVersions } from '@/object-core/workflows/versions/utils/invalidateCoreWorkflowVersions';
+import { UpdateCoreWorkflowDocument } from '~/generated/graphql';
+
+export const useRenameCoreWorkflow = ({
+ coreWorkflowId,
+ currentName,
+}: {
+ coreWorkflowId: string;
+ currentName: string | undefined | null;
+}) => {
+ const client = useApolloCoreClient();
+ const [updateWorkflow] = useMutation(UpdateCoreWorkflowDocument, { client });
+ const { enqueueToast } = useToast();
+
+ const renameWorkflow = async (name: string) => {
+ if (name === currentName) {
+ return true;
+ }
+
+ try {
+ await updateWorkflow({ variables: { input: { coreWorkflowId, name } } });
+ await invalidateCoreWorkflowVersions(client);
+
+ return true;
+ } catch (mutationError) {
+ enqueueToast({
+ variant: 'error',
+ children:
+ mutationError instanceof Error
+ ? mutationError.message
+ : t`Could not save workflow`,
+ });
+
+ return false;
+ }
+ };
+
+ return { renameWorkflow };
+};
diff --git a/packages/twenty-front/src/modules/object-core/workflows/hooks/useValidateCoreWorkflowVersion.ts b/packages/twenty-front/src/modules/object-core/workflows/hooks/useValidateCoreWorkflowVersion.ts
new file mode 100644
index 00000000000..f2a0d99ed6d
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/workflows/hooks/useValidateCoreWorkflowVersion.ts
@@ -0,0 +1,39 @@
+import { useMutation } from '@apollo/client/react';
+import { t } from '@lingui/core/macro';
+import { isDefined } from 'twenty-shared/utils';
+import { useToast } from 'twenty-ui/primitives/feedback';
+
+import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
+import { ValidateCoreWorkflowVersionDocument } from '~/generated/graphql';
+
+export const useValidateCoreWorkflowVersion = (
+ coreWorkflowVersionId: string | undefined,
+) => {
+ const client = useApolloCoreClient();
+ const [validateVersion, { loading: isValidating }] = useMutation(
+ ValidateCoreWorkflowVersionDocument,
+ { client },
+ );
+ const { enqueueToast } = useToast();
+
+ const validate = async () => {
+ if (!isDefined(coreWorkflowVersionId)) {
+ return;
+ }
+
+ try {
+ await validateVersion({ variables: { coreWorkflowVersionId } });
+ enqueueToast({ variant: 'success', children: t`Workflow is valid` });
+ } catch (mutationError) {
+ enqueueToast({
+ variant: 'error',
+ children:
+ mutationError instanceof Error
+ ? mutationError.message
+ : t`Could not save workflow`,
+ });
+ }
+ };
+
+ return { validate, isValidating };
+};
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.ts
index dc075b2a7b8..8518b05daa0 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
@@ -7,18 +7,18 @@ describe('buildWorkflowShowPageRecordFromCoreWorkflow', () => {
id: 'core-workflow-id',
name: 'My workflow',
statuses: [CoreWorkflowStatus.ACTIVE],
- lastPublishedVersionId: 'published-version-id',
+ lastPublishedCoreWorkflowVersionId: 'published-version-id',
workspaceWorkflowId: 'workspace-workflow-id',
createdAt: '2026-09-01T00:00:00.000Z',
updatedAt: '2026-09-14T00:00:00.000Z',
};
- it('maps the core workflow onto the workspace record shape', () => {
+ it('keeps core IDs in the command context resource', () => {
const record = buildWorkflowShowPageRecordFromCoreWorkflow(coreWorkflow);
expect(record).toEqual({
__typename: 'Workflow',
- id: 'workspace-workflow-id',
+ id: 'core-workflow-id',
name: 'My workflow',
statuses: [CoreWorkflowStatus.ACTIVE],
lastPublishedVersionId: 'published-version-id',
@@ -35,13 +35,13 @@ describe('buildWorkflowShowPageRecordFromCoreWorkflow', () => {
).toBeUndefined();
});
- it('returns undefined when the core row has no workspace pointer', () => {
+ it('supports a core row without a workspace pointer', () => {
expect(
buildWorkflowShowPageRecordFromCoreWorkflow({
...coreWorkflow,
workspaceWorkflowId: null,
- }),
- ).toBeUndefined();
+ })?.id,
+ ).toBe('core-workflow-id');
});
it('defaults a null name to an empty string', () => {
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.ts
index 3df6530cf9c..b18978e3951 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
@@ -6,19 +6,16 @@ import { type GetCoreWorkflowQuery } from '~/generated/graphql';
export const buildWorkflowShowPageRecordFromCoreWorkflow = (
coreWorkflow: GetCoreWorkflowQuery['coreWorkflow'] | undefined,
): ObjectRecord | undefined => {
- if (
- !isDefined(coreWorkflow) ||
- !isDefined(coreWorkflow.workspaceWorkflowId)
- ) {
+ if (!isDefined(coreWorkflow)) {
return undefined;
}
return {
__typename: 'Workflow',
- id: coreWorkflow.workspaceWorkflowId,
+ id: coreWorkflow.id,
name: coreWorkflow.name ?? '',
statuses: coreWorkflow.statuses,
- lastPublishedVersionId: coreWorkflow.lastPublishedVersionId,
+ lastPublishedVersionId: coreWorkflow.lastPublishedCoreWorkflowVersionId,
createdAt: coreWorkflow.createdAt,
updatedAt: coreWorkflow.updatedAt,
deletedAt: null,
diff --git a/packages/twenty-front/src/modules/object-core/workflows/utils/buildWorkflowVersionFromCore.ts b/packages/twenty-front/src/modules/object-core/workflows/utils/buildWorkflowVersionFromCore.ts
new file mode 100644
index 00000000000..b6605af4a3f
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/workflows/utils/buildWorkflowVersionFromCore.ts
@@ -0,0 +1,20 @@
+import { type WorkflowVersion } from '@/workflow/types/Workflow';
+import { type GetCoreWorkflowVersionQuery } from '~/generated/graphql';
+import { isDefined } from 'twenty-shared/utils';
+
+export const buildWorkflowVersionFromCore = (
+ version: GetCoreWorkflowVersionQuery['coreWorkflowVersion'],
+): WorkflowVersion | undefined =>
+ isDefined(version) && isDefined(version.coreWorkflowId)
+ ? {
+ __typename: 'WorkflowVersion',
+ id: version.id,
+ workflowId: version.coreWorkflowId,
+ name: version.label,
+ status: version.status,
+ trigger: version.trigger,
+ steps: version.steps,
+ createdAt: version.createdAt,
+ updatedAt: version.updatedAt,
+ }
+ : undefined;
diff --git a/packages/twenty-front/src/modules/object-core/workflows/versions/components/CoreWorkflowVersionCard.tsx b/packages/twenty-front/src/modules/object-core/workflows/versions/components/CoreWorkflowVersionCard.tsx
index db3b60c3309..5f3f7042eb5 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/versions/components/CoreWorkflowVersionCard.tsx
+++ b/packages/twenty-front/src/modules/object-core/workflows/versions/components/CoreWorkflowVersionCard.tsx
@@ -14,17 +14,15 @@ const StyledContainer = styled.div`
`;
export const CoreWorkflowVersionCard = ({
- workspaceWorkflowVersionId,
+ coreWorkflowVersionId,
}: {
- workspaceWorkflowVersionId: string;
+ coreWorkflowVersionId: string;
}) => {
- const { coreWorkflowVersion } = useCoreWorkflowVersion(
- workspaceWorkflowVersionId,
- );
+ const { coreWorkflowVersion } = useCoreWorkflowVersion(coreWorkflowVersionId);
if (
!isDefined(coreWorkflowVersion) ||
- !isDefined(coreWorkflowVersion.workspaceWorkflowId)
+ !isDefined(coreWorkflowVersion.coreWorkflowId)
) {
return null;
}
@@ -33,13 +31,13 @@ export const CoreWorkflowVersionCard = ({
<WorkflowVisualizerComponentInstanceContext.Provider
value={{
instanceId: getWorkflowVisualizerComponentInstanceId({
- recordId: workspaceWorkflowVersionId,
+ recordId: coreWorkflowVersionId,
}),
}}
>
<CoreWorkflowVersionDiagramEffect
- workflowId={coreWorkflowVersion.workspaceWorkflowId}
- workspaceWorkflowVersionId={workspaceWorkflowVersionId}
+ workflowId={coreWorkflowVersion.coreWorkflowId}
+ coreWorkflowVersionId={coreWorkflowVersionId}
label={coreWorkflowVersion.label}
status={coreWorkflowVersion.status}
createdAt={coreWorkflowVersion.createdAt}
diff --git a/packages/twenty-front/src/modules/object-core/workflows/versions/components/CoreWorkflowVersionDiagramEffect.tsx b/packages/twenty-front/src/modules/object-core/workflows/versions/components/CoreWorkflowVersionDiagramEffect.tsx
index d4a00fb3abe..4838f31462c 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/versions/components/CoreWorkflowVersionDiagramEffect.tsx
+++ b/packages/twenty-front/src/modules/object-core/workflows/versions/components/CoreWorkflowVersionDiagramEffect.tsx
@@ -15,7 +15,7 @@ import { useStepsOutputSchema } from '@/workflow/workflow-variables/hooks/useSte
export const CoreWorkflowVersionDiagramEffect = ({
workflowId,
- workspaceWorkflowVersionId,
+ coreWorkflowVersionId,
label,
status,
createdAt,
@@ -23,7 +23,7 @@ export const CoreWorkflowVersionDiagramEffect = ({
steps,
}: {
workflowId: string;
- workspaceWorkflowVersionId: string;
+ coreWorkflowVersionId: string;
label: string;
status: WorkflowVersionStatus;
createdAt: string;
@@ -44,12 +44,12 @@ export const CoreWorkflowVersionDiagramEffect = ({
useEffect(() => {
setFlow({
- workflowVersionId: workspaceWorkflowVersionId,
+ workflowVersionId: coreWorkflowVersionId,
trigger,
steps,
});
setWorkflowVisualizerWorkflowId(workflowId);
- setWorkflowVisualizerWorkflowVersionId(workspaceWorkflowVersionId);
+ setWorkflowVisualizerWorkflowVersionId(coreWorkflowVersionId);
setWorkflowDiagram(
generateWorkflowDiagram({
trigger: trigger ?? undefined,
@@ -59,7 +59,7 @@ export const CoreWorkflowVersionDiagramEffect = ({
);
populateStepsOutputSchema({
__typename: 'WorkflowVersion',
- id: workspaceWorkflowVersionId,
+ id: coreWorkflowVersionId,
name: label,
workflowId,
status,
@@ -80,7 +80,7 @@ export const CoreWorkflowVersionDiagramEffect = ({
steps,
trigger,
workflowId,
- workspaceWorkflowVersionId,
+ coreWorkflowVersionId,
]);
return null;
diff --git a/packages/twenty-front/src/modules/object-core/workflows/versions/components/CoreWorkflowVersionRestoreButton.tsx b/packages/twenty-front/src/modules/object-core/workflows/versions/components/CoreWorkflowVersionRestoreButton.tsx
index f8868027f78..9a48046ef0c 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/versions/components/CoreWorkflowVersionRestoreButton.tsx
+++ b/packages/twenty-front/src/modules/object-core/workflows/versions/components/CoreWorkflowVersionRestoreButton.tsx
@@ -8,10 +8,10 @@ import { useDialog } from '@/ui/layout/dialog/hooks/useDialog';
export const CoreWorkflowVersionRestoreButton = ({
workflowId,
- workspaceWorkflowVersionId,
+ coreWorkflowVersionId,
}: {
workflowId: string;
- workspaceWorkflowVersionId: string;
+ coreWorkflowVersionId: string;
}) => {
const { t } = useLingui();
const { openDialog } = useDialog();
@@ -22,7 +22,7 @@ export const CoreWorkflowVersionRestoreButton = ({
isLoadingCoreWorkflowVersions,
} = useRestoreCoreWorkflowVersionAsDraft({
workflowId,
- workspaceWorkflowVersionId,
+ coreWorkflowVersionId,
});
const handleRestoreClick = () => {
diff --git a/packages/twenty-front/src/modules/object-core/workflows/versions/components/SidePanelCoreWorkflowVersionPage.tsx b/packages/twenty-front/src/modules/object-core/workflows/versions/components/SidePanelCoreWorkflowVersionPage.tsx
index 13b47bbce23..029d65493fa 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/versions/components/SidePanelCoreWorkflowVersionPage.tsx
+++ b/packages/twenty-front/src/modules/object-core/workflows/versions/components/SidePanelCoreWorkflowVersionPage.tsx
@@ -30,10 +30,8 @@ const StyledSpacer = styled.div`
export const SidePanelCoreWorkflowVersionPage = () => {
const { t } = useLingui();
- const workspaceWorkflowVersionId = useSidePanelWorkflowVersionIdOrThrow();
- const { coreWorkflowVersion } = useCoreWorkflowVersion(
- workspaceWorkflowVersionId,
- );
+ const coreWorkflowVersionId = useSidePanelWorkflowVersionIdOrThrow();
+ const { coreWorkflowVersion } = useCoreWorkflowVersion(coreWorkflowVersionId);
if (!isDefined(coreWorkflowVersion)) {
return null;
@@ -47,16 +45,14 @@ export const SidePanelCoreWorkflowVersionPage = () => {
<StyledActions>
<Tag color={tagProps.color}>{t(tagProps.label)}</Tag>
<StyledSpacer />
- {isDefined(coreWorkflowVersion.workspaceWorkflowId) && (
+ {isDefined(coreWorkflowVersion.coreWorkflowId) && (
<CoreWorkflowVersionRestoreButton
- workflowId={coreWorkflowVersion.workspaceWorkflowId}
- workspaceWorkflowVersionId={workspaceWorkflowVersionId}
+ workflowId={coreWorkflowVersion.coreWorkflowId}
+ coreWorkflowVersionId={coreWorkflowVersionId}
/>
)}
</StyledActions>
- <CoreWorkflowVersionCard
- workspaceWorkflowVersionId={workspaceWorkflowVersionId}
- />
+ <CoreWorkflowVersionCard coreWorkflowVersionId={coreWorkflowVersionId} />
</StyledContainer>
);
};
diff --git a/packages/twenty-front/src/modules/object-core/workflows/versions/components/SidePanelCoreWorkflowVersionsPage.tsx b/packages/twenty-front/src/modules/object-core/workflows/versions/components/SidePanelCoreWorkflowVersionsPage.tsx
index 3f5e0e0f529..7bbfd556c08 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/versions/components/SidePanelCoreWorkflowVersionsPage.tsx
+++ b/packages/twenty-front/src/modules/object-core/workflows/versions/components/SidePanelCoreWorkflowVersionsPage.tsx
@@ -24,11 +24,9 @@ export const SidePanelCoreWorkflowVersionsPage = () => {
const { openCoreWorkflowVersionSidePanel } =
useOpenCoreWorkflowVersionSidePanel();
- const selectableCoreWorkflowVersionIds = coreWorkflowVersions
- .filter(({ workspaceWorkflowVersionId }) =>
- isDefined(workspaceWorkflowVersionId),
- )
- .map(({ id }) => id);
+ const selectableCoreWorkflowVersionIds = coreWorkflowVersions.map(
+ ({ id }) => id,
+ );
return (
<SidePanelList
@@ -49,17 +47,10 @@ export const SidePanelCoreWorkflowVersionsPage = () => {
label={coreWorkflowVersion.label}
createdAt={coreWorkflowVersion.createdAt}
status={coreWorkflowVersion.status}
- isSelectable={isDefined(
- coreWorkflowVersion.workspaceWorkflowVersionId,
- )}
+ isSelectable
onSelect={() => {
- if (!isDefined(coreWorkflowVersion.workspaceWorkflowVersionId)) {
- return;
- }
-
openCoreWorkflowVersionSidePanel({
- workspaceWorkflowVersionId:
- coreWorkflowVersion.workspaceWorkflowVersionId,
+ coreWorkflowVersionId: coreWorkflowVersion.id,
pageTitle: coreWorkflowVersion.label,
});
}}
diff --git a/packages/twenty-front/src/modules/object-core/workflows/versions/graphql/queries/getCoreWorkflowVersion.ts b/packages/twenty-front/src/modules/object-core/workflows/versions/graphql/queries/getCoreWorkflowVersion.ts
index 80567157e18..1824ae5450d 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/versions/graphql/queries/getCoreWorkflowVersion.ts
+++ b/packages/twenty-front/src/modules/object-core/workflows/versions/graphql/queries/getCoreWorkflowVersion.ts
@@ -1,15 +1,15 @@
import { gql } from '@apollo/client';
export const GET_CORE_WORKFLOW_VERSION = gql`
- query GetCoreWorkflowVersion($workspaceWorkflowVersionId: UUID!) {
- coreWorkflowVersion(
- workspaceWorkflowVersionId: $workspaceWorkflowVersionId
+ query GetCoreWorkflowVersion($coreWorkflowVersionId: UUID!) {
+ coreWorkflowVersion: coreWorkflowVersionById(
+ coreWorkflowVersionId: $coreWorkflowVersionId
) {
id
label
status
workspaceWorkflowVersionId
- workspaceWorkflowId
+ coreWorkflowId
trigger
steps
createdAt
diff --git a/packages/twenty-front/src/modules/object-core/workflows/versions/graphql/queries/getCoreWorkflowVersions.ts b/packages/twenty-front/src/modules/object-core/workflows/versions/graphql/queries/getCoreWorkflowVersions.ts
index d1618d8fc4c..df294f2764d 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/versions/graphql/queries/getCoreWorkflowVersions.ts
+++ b/packages/twenty-front/src/modules/object-core/workflows/versions/graphql/queries/getCoreWorkflowVersions.ts
@@ -1,13 +1,14 @@
import { gql } from '@apollo/client';
export const GET_CORE_WORKFLOW_VERSIONS = gql`
- query GetCoreWorkflowVersions($workspaceWorkflowId: UUID!) {
- coreWorkflowVersions(workspaceWorkflowId: $workspaceWorkflowId) {
+ query GetCoreWorkflowVersions($coreWorkflowId: UUID!) {
+ coreWorkflowVersions: coreWorkflowVersionsByCoreWorkflowId(
+ coreWorkflowId: $coreWorkflowId
+ ) {
id
label
status
- workspaceWorkflowVersionId
- workspaceWorkflowId
+ coreWorkflowId
createdAt
updatedAt
}
diff --git a/packages/twenty-front/src/modules/object-core/workflows/versions/hooks/useCoreWorkflowVersion.ts b/packages/twenty-front/src/modules/object-core/workflows/versions/hooks/useCoreWorkflowVersion.ts
index 5bca0da14f1..6660f62aa2b 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/versions/hooks/useCoreWorkflowVersion.ts
+++ b/packages/twenty-front/src/modules/object-core/workflows/versions/hooks/useCoreWorkflowVersion.ts
@@ -2,14 +2,18 @@ import { useQuery } from '@apollo/client/react';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { GetCoreWorkflowVersionDocument } from '~/generated/graphql';
+import { isDefined } from 'twenty-shared/utils';
-export const useCoreWorkflowVersion = (workspaceWorkflowVersionId: string) => {
+export const useCoreWorkflowVersion = (
+ coreWorkflowVersionId: string | undefined,
+) => {
const apolloCoreClient = useApolloCoreClient();
const { data, loading, error } = useQuery(GetCoreWorkflowVersionDocument, {
client: apolloCoreClient,
fetchPolicy: 'cache-and-network',
- variables: { workspaceWorkflowVersionId },
+ variables: { coreWorkflowVersionId: coreWorkflowVersionId ?? '' },
+ skip: !isDefined(coreWorkflowVersionId),
});
return {
diff --git a/packages/twenty-front/src/modules/object-core/workflows/versions/hooks/useCoreWorkflowVersions.ts b/packages/twenty-front/src/modules/object-core/workflows/versions/hooks/useCoreWorkflowVersions.ts
index 67dd3c3abf1..edcddc25720 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/versions/hooks/useCoreWorkflowVersions.ts
+++ b/packages/twenty-front/src/modules/object-core/workflows/versions/hooks/useCoreWorkflowVersions.ts
@@ -11,7 +11,7 @@ export const useCoreWorkflowVersions = (workflowId: string) => {
{
client: apolloCoreClient,
fetchPolicy: 'cache-and-network',
- variables: { workspaceWorkflowId: workflowId },
+ variables: { coreWorkflowId: workflowId },
},
);
diff --git a/packages/twenty-front/src/modules/object-core/workflows/versions/hooks/useOpenCoreWorkflowVersionSidePanel.ts b/packages/twenty-front/src/modules/object-core/workflows/versions/hooks/useOpenCoreWorkflowVersionSidePanel.ts
index 1cf60feaa41..0c3f544f21c 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/versions/hooks/useOpenCoreWorkflowVersionSidePanel.ts
+++ b/packages/twenty-front/src/modules/object-core/workflows/versions/hooks/useOpenCoreWorkflowVersionSidePanel.ts
@@ -12,10 +12,10 @@ export const useOpenCoreWorkflowVersionSidePanel = () => {
const { navigateSidePanel } = useNavigateSidePanel();
const openCoreWorkflowVersionSidePanel = ({
- workspaceWorkflowVersionId,
+ coreWorkflowVersionId,
pageTitle,
}: {
- workspaceWorkflowVersionId: string;
+ coreWorkflowVersionId: string;
pageTitle: string;
}) => {
const pageId = v4();
@@ -24,7 +24,7 @@ export const useOpenCoreWorkflowVersionSidePanel = () => {
sidePanelWorkflowVersionIdComponentState.atomFamily({
instanceId: pageId,
}),
- workspaceWorkflowVersionId,
+ coreWorkflowVersionId,
);
navigateSidePanel({
diff --git a/packages/twenty-front/src/modules/object-core/workflows/versions/hooks/useRestoreCoreWorkflowVersionAsDraft.ts b/packages/twenty-front/src/modules/object-core/workflows/versions/hooks/useRestoreCoreWorkflowVersionAsDraft.ts
index 733b0125bc9..e376f6421b3 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/versions/hooks/useRestoreCoreWorkflowVersionAsDraft.ts
+++ b/packages/twenty-front/src/modules/object-core/workflows/versions/hooks/useRestoreCoreWorkflowVersionAsDraft.ts
@@ -1,6 +1,7 @@
+import { useSidePanelMenu } from '@/side-panel/hooks/useSidePanelMenu';
import { useLingui } from '@lingui/react/macro';
import { useState } from 'react';
-import { AppPath, CoreObjectNameSingular } from 'twenty-shared/types';
+import { AppPath } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { useCoreWorkflowVersions } from '@/object-core/workflows/versions/hooks/useCoreWorkflowVersions';
@@ -11,11 +12,12 @@ import { useNavigateApp } from '~/hooks/useNavigateApp';
export const useRestoreCoreWorkflowVersionAsDraft = ({
workflowId,
- workspaceWorkflowVersionId,
+ coreWorkflowVersionId,
}: {
workflowId: string;
- workspaceWorkflowVersionId: string;
+ coreWorkflowVersionId: string;
}) => {
+ const { closeSidePanelMenu } = useSidePanelMenu();
const { t } = useLingui();
const [isRestoring, setIsRestoring] = useState(false);
const { coreWorkflowVersions, loading: isLoadingCoreWorkflowVersions } =
@@ -40,7 +42,7 @@ export const useRestoreCoreWorkflowVersionAsDraft = ({
try {
const draftWorkflowVersionId = await createDraftFromWorkflowVersion({
workflowId,
- workflowVersionIdToCopy: workspaceWorkflowVersionId,
+ workflowVersionIdToCopy: coreWorkflowVersionId,
});
if (!isDefined(draftWorkflowVersionId)) {
@@ -52,10 +54,8 @@ export const useRestoreCoreWorkflowVersionAsDraft = ({
return;
}
- navigate(AppPath.RecordShowPage, {
- objectNameSingular: CoreObjectNameSingular.Workflow,
- objectRecordId: workflowId,
- });
+ closeSidePanelMenu();
+ navigate(AppPath.WorkflowCoreShowPage, { coreWorkflowId: workflowId });
} catch {
enqueueToast({
variant: 'error',
diff --git a/packages/twenty-front/src/modules/object-core/workflows/versions/utils/__tests__/invalidateCoreWorkflowVersions.test.ts b/packages/twenty-front/src/modules/object-core/workflows/versions/utils/__tests__/invalidateCoreWorkflowVersions.test.ts
new file mode 100644
index 00000000000..fb66669ce9e
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-core/workflows/versions/utils/__tests__/invalidateCoreWorkflowVersions.test.ts
@@ -0,0 +1,69 @@
+import {
+ ApolloClient,
+ ApolloLink,
+ InMemoryCache,
+ Observable,
+} from '@apollo/client';
+
+import { invalidateCoreWorkflowVersions } from '@/object-core/workflows/versions/utils/invalidateCoreWorkflowVersions';
+import { GetCoreWorkflowDocument } from '~/generated/graphql';
+
+describe('invalidateCoreWorkflowVersions', () => {
+ it('refreshes active definitions without executing skipped queries with empty IDs', async () => {
+ const requestedIds: string[] = [];
+ let name = 'Initial name';
+ const client = new ApolloClient({
+ cache: new InMemoryCache(),
+ link: new ApolloLink(
+ (operation) =>
+ new Observable((observer) => {
+ requestedIds.push(operation.variables.coreWorkflowId);
+ const timeout = setTimeout(() => {
+ observer.next({
+ data: {
+ coreWorkflow: {
+ id: operation.variables.coreWorkflowId,
+ name,
+ statuses: ['DRAFT'],
+ lastPublishedCoreWorkflowVersionId: null,
+ workspaceWorkflowId: null,
+ createdAt: '2026-09-17T00:00:00Z',
+ updatedAt: '2026-09-17T00:00:00Z',
+ },
+ },
+ });
+ observer.complete();
+ }, 0);
+ return () => clearTimeout(timeout);
+ }),
+ ),
+ });
+ const variables = {
+ coreWorkflowId: '8c9a3708-5674-4e1b-a9b9-4f0dacb26c15',
+ };
+ await client.query({ query: GetCoreWorkflowDocument, variables });
+ const activeQuery = client.watchQuery({
+ query: GetCoreWorkflowDocument,
+ variables,
+ });
+ const skippedQuery = client.watchQuery({
+ query: GetCoreWorkflowDocument,
+ variables: { coreWorkflowId: '' },
+ fetchPolicy: 'standby',
+ });
+ const activeSubscription = activeQuery.subscribe({});
+ const skippedSubscription = skippedQuery.subscribe({});
+ requestedIds.length = 0;
+ name = 'Updated name';
+
+ await invalidateCoreWorkflowVersions(client);
+
+ expect(requestedIds).toEqual([variables.coreWorkflowId]);
+ expect(activeQuery.getCurrentResult().data?.coreWorkflow?.name).toBe(
+ 'Updated name',
+ );
+ activeSubscription.unsubscribe();
+ skippedSubscription.unsubscribe();
+ client.stop();
+ });
+});
diff --git a/packages/twenty-front/src/modules/object-core/workflows/versions/utils/invalidateCoreWorkflowVersions.ts b/packages/twenty-front/src/modules/object-core/workflows/versions/utils/invalidateCoreWorkflowVersions.ts
index c062b6a79a0..84e88df398f 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/versions/utils/invalidateCoreWorkflowVersions.ts
+++ b/packages/twenty-front/src/modules/object-core/workflows/versions/utils/invalidateCoreWorkflowVersions.ts
@@ -2,6 +2,8 @@ import { type ApolloClient } from '@apollo/client';
import {
GetCoreWorkflowDocument,
+ GetCoreWorkflowsDocument,
+ GetCoreWorkflowsWithCurrentVersionsDocument,
GetCoreWorkflowVersionDocument,
GetCoreWorkflowVersionsDocument,
} from '~/generated/graphql';
@@ -9,19 +11,26 @@ import {
export const invalidateCoreWorkflowVersions = async (
apolloCoreClient: ApolloClient,
) => {
- for (const fieldName of [
- 'coreWorkflow',
- 'coreWorkflowVersion',
- 'coreWorkflowVersions',
- ]) {
- apolloCoreClient.cache.evict({ id: 'ROOT_QUERY', fieldName });
- }
-
await apolloCoreClient.refetchQueries({
+ optimistic: true,
+ updateCache: (cache) => {
+ for (const fieldName of [
+ 'coreWorkflowById',
+ 'coreWorkflowVersionById',
+ 'coreWorkflowVersionsByCoreWorkflowId',
+ 'coreWorkflows',
+ 'coreWorkflowsWithCurrentVersions',
+ ]) {
+ cache.evict({ id: 'ROOT_QUERY', fieldName });
+ }
+ },
include: [
GetCoreWorkflowVersionsDocument,
GetCoreWorkflowVersionDocument,
GetCoreWorkflowDocument,
+ GetCoreWorkflowsDocument,
+ GetCoreWorkflowsWithCurrentVersionsDocument,
],
+ onQueryUpdated: (query) => query.options.fetchPolicy !== 'standby',
});
};
diff --git a/packages/twenty-front/src/modules/workflow/hooks/__tests__/useCreateDraftFromWorkflowVersion.test.ts b/packages/twenty-front/src/modules/workflow/hooks/__tests__/useCreateDraftFromWorkflowVersion.test.ts
new file mode 100644
index 00000000000..a44d41be673
--- /dev/null
+++ b/packages/twenty-front/src/modules/workflow/hooks/__tests__/useCreateDraftFromWorkflowVersion.test.ts
@@ -0,0 +1,96 @@
+import { act, renderHook } from '@testing-library/react';
+import { useCreateDraftFromWorkflowVersion } from '@/workflow/hooks/useCreateDraftFromWorkflowVersion';
+import { CreateDraftFromCoreWorkflowVersionDocument } from '~/generated/graphql';
+
+const mockCoreMutation = jest.fn();
+const mockWorkspaceMutation = jest.fn();
+const mockInvalidate = jest.fn();
+let mockIsCore = true;
+
+jest.mock('@/workflow/hooks/useIsWorkflowCoreEnabled', () => ({
+ useIsWorkflowCoreEnabled: () => mockIsCore,
+}));
+jest.mock('@/object-metadata/hooks/useApolloCoreClient', () => ({
+ useApolloCoreClient: () => ({}),
+}));
+jest.mock('@/object-record/hooks/useFindManyRecordsQuery', () => ({
+ useFindManyRecordsQuery: () => ({ findManyRecordsQuery: {} }),
+}));
+jest.mock(
+ '@/object-core/workflows/versions/utils/invalidateCoreWorkflowVersions',
+ () => ({ invalidateCoreWorkflowVersions: () => mockInvalidate() }),
+);
+jest.mock('@apollo/client/react', () => ({
+ useMutation: (document: unknown) => [
+ document === CreateDraftFromCoreWorkflowVersionDocument
+ ? mockCoreMutation
+ : mockWorkspaceMutation,
+ ],
+}));
+
+describe('draft creation ID boundary', () => {
+ beforeEach(() => {
+ jest.clearAllMocks();
+ mockIsCore = true;
+ mockCoreMutation.mockResolvedValue({
+ data: { createDraftFromWorkflowVersion: { id: 'returned-core-draft' } },
+ });
+ mockWorkspaceMutation.mockResolvedValue({
+ data: {
+ createDraftFromWorkflowVersion: { id: 'returned-workspace-draft' },
+ },
+ });
+ });
+
+ it('returns the core draft ID for subsequent edits and refetches core definitions', async () => {
+ const { result } = renderHook(() => useCreateDraftFromWorkflowVersion());
+ let draftId: string | undefined;
+ await act(async () => {
+ draftId = await result.current.createDraftFromWorkflowVersion({
+ workflowId: 'core-workflow',
+ workflowVersionIdToCopy: 'core-published-version',
+ });
+ });
+ expect(draftId).toBe('returned-core-draft');
+ expect(mockCoreMutation).toHaveBeenCalledWith({
+ variables: {
+ input: {
+ coreWorkflowId: 'core-workflow',
+ coreWorkflowVersionIdToCopy: 'core-published-version',
+ },
+ },
+ });
+ expect(mockWorkspaceMutation).not.toHaveBeenCalled();
+ expect(mockInvalidate).toHaveBeenCalledTimes(1);
+ });
+
+ it('preserves the workspace mutation and returned ID with the flag off', async () => {
+ mockIsCore = false;
+ const { result } = renderHook(() => useCreateDraftFromWorkflowVersion());
+ const input = {
+ workflowId: 'workspace-workflow',
+ workflowVersionIdToCopy: 'workspace-published-version',
+ };
+ let draftId: string | undefined;
+ await act(async () => {
+ draftId = await result.current.createDraftFromWorkflowVersion(input);
+ });
+ expect(draftId).toBe('returned-workspace-draft');
+ expect(mockWorkspaceMutation).toHaveBeenCalledWith(
+ expect.objectContaining({ variables: { input } }),
+ );
+ expect(mockCoreMutation).not.toHaveBeenCalled();
+ });
+
+ it('propagates core errors without invoking the workspace mutation', async () => {
+ mockCoreMutation.mockRejectedValueOnce(new Error('Core unavailable'));
+ const { result } = renderHook(() => useCreateDraftFromWorkflowVersion());
+ await expect(
+ result.current.createDraftFromWorkflowVersion({
+ workflowId: 'core-workflow',
+ workflowVersionIdToCopy: 'core-published-version',
+ }),
+ ).rejects.toThrow('Core unavailable');
+ expect(mockWorkspaceMutation).not.toHaveBeenCalled();
+ });
+});
diff --git a/packages/twenty-front/src/modules/workflow/hooks/useActivateWorkflowVersion.ts b/packages/twenty-front/src/modules/workflow/hooks/useActivateWorkflowVersion.ts
index 88c54ed9f3a..bea329e4bff 100644
--- a/packages/twenty-front/src/modules/workflow/hooks/useActivateWorkflowVersion.ts
+++ b/packages/twenty-front/src/modules/workflow/hooks/useActivateWorkflowVersion.ts
@@ -1,3 +1,9 @@
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
+import {
+ ActivateCoreWorkflowVersionDocument,
+ type ActivateWorkflowVersionMutation,
+ type ActivateWorkflowVersionMutationVariables,
+} from '~/generated/graphql';
import { invalidateCoreWorkflowVersions } from '@/object-core/workflows/versions/utils/invalidateCoreWorkflowVersions';
import { useMutation } from '@apollo/client/react';
@@ -17,13 +23,13 @@ import {
type WorkflowVersion,
} from '@/workflow/types/Workflow';
import { isDefined } from 'twenty-shared/utils';
-import {
- type ActivateWorkflowVersionMutation,
- type ActivateWorkflowVersionMutationVariables,
-} from '~/generated/graphql';
export const useActivateWorkflowVersion = () => {
const apolloCoreClient = useApolloCoreClient();
+ const isCore = useIsWorkflowCoreEnabled();
+ const [mutateCore] = useMutation(ActivateCoreWorkflowVersionDocument, {
+ client: apolloCoreClient,
+ });
const [mutate] = useMutation<
ActivateWorkflowVersionMutation,
ActivateWorkflowVersionMutationVariables
@@ -51,6 +57,14 @@ export const useActivateWorkflowVersion = () => {
workflowVersionId: string;
workflowId: string;
}) => {
+ if (isCore) {
+ await mutateCore({
+ variables: { coreWorkflowVersionId: workflowVersionId },
+ });
+ await invalidateCoreWorkflowVersions(apolloCoreClient);
+ return;
+ }
+
await mutate({
variables: {
workflowVersionId,
diff --git a/packages/twenty-front/src/modules/workflow/hooks/useActiveWorkflowVersion.ts b/packages/twenty-front/src/modules/workflow/hooks/useActiveWorkflowVersion.ts
index b23b4b159a9..3c40bec5ca0 100644
--- a/packages/twenty-front/src/modules/workflow/hooks/useActiveWorkflowVersion.ts
+++ b/packages/twenty-front/src/modules/workflow/hooks/useActiveWorkflowVersion.ts
@@ -1,3 +1,7 @@
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
+import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
+import { useQuery } from '@apollo/client/react';
+import { GetCoreWorkflowVersionsDocument } from '~/generated/graphql';
import { CoreObjectNameSingular } from 'twenty-shared/types';
import { useFindManyRecords } from '@/object-record/hooks/useFindManyRecords';
import { type WorkflowVersion } from '@/workflow/types/Workflow';
@@ -9,6 +13,13 @@ type UseActiveWorkflowVersionProps = {
export const useActiveWorkflowVersion = ({
workflowId,
}: UseActiveWorkflowVersionProps) => {
+ const isCore = useIsWorkflowCoreEnabled();
+ const client = useApolloCoreClient();
+ const core = useQuery(GetCoreWorkflowVersionsDocument, {
+ client,
+ variables: { coreWorkflowId: workflowId },
+ skip: !isCore || !workflowId,
+ });
const { records: workflowVersions, loading } = useFindManyRecords<
Pick<WorkflowVersion, 'id' | '__typename'>
>({
@@ -21,13 +32,27 @@ export const useActiveWorkflowVersion = ({
eq: 'ACTIVE',
},
},
+ skip: isCore,
recordGqlFields: {
id: true,
},
});
+ if (isCore) {
+ return {
+ workflowVersion: core.data?.coreWorkflowVersions.find(
+ (version) => version.status === 'ACTIVE',
+ ),
+ hasDraftVersion: core.data?.coreWorkflowVersions.some(
+ (version) => version.status === 'DRAFT',
+ ),
+ loading: core.loading,
+ };
+ }
+
return {
workflowVersion: workflowVersions?.[0],
+ hasDraftVersion: false,
loading,
};
};
diff --git a/packages/twenty-front/src/modules/workflow/hooks/useCreateDraftFromWorkflowVersion.ts b/packages/twenty-front/src/modules/workflow/hooks/useCreateDraftFromWorkflowVersion.ts
index ac98814d6b5..195c9f93270 100644
--- a/packages/twenty-front/src/modules/workflow/hooks/useCreateDraftFromWorkflowVersion.ts
+++ b/packages/twenty-front/src/modules/workflow/hooks/useCreateDraftFromWorkflowVersion.ts
@@ -1,15 +1,21 @@
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
+import {
+ CreateDraftFromCoreWorkflowVersionDocument,
+ type CreateDraftFromWorkflowVersionInput,
+ CreateDraftFromWorkflowVersionDocument,
+} from '~/generated/graphql';
import { invalidateCoreWorkflowVersions } from '@/object-core/workflows/versions/utils/invalidateCoreWorkflowVersions';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { CoreObjectNameSingular } from 'twenty-shared/types';
import { useFindManyRecordsQuery } from '@/object-record/hooks/useFindManyRecordsQuery';
import { useMutation } from '@apollo/client/react';
-import {
- type CreateDraftFromWorkflowVersionInput,
- CreateDraftFromWorkflowVersionDocument,
-} from '~/generated/graphql';
export const useCreateDraftFromWorkflowVersion = () => {
const apolloCoreClient = useApolloCoreClient();
+ const isCore = useIsWorkflowCoreEnabled();
+ const [mutateCore] = useMutation(CreateDraftFromCoreWorkflowVersionDocument, {
+ client: apolloCoreClient,
+ });
const [mutate] = useMutation(CreateDraftFromWorkflowVersionDocument, {
client: apolloCoreClient,
@@ -35,6 +41,19 @@ export const useCreateDraftFromWorkflowVersion = () => {
const createDraftFromWorkflowVersion = async (
input: CreateDraftFromWorkflowVersionInput,
) => {
+ if (isCore) {
+ const result = await mutateCore({
+ variables: {
+ input: {
+ coreWorkflowId: input.workflowId,
+ coreWorkflowVersionIdToCopy: input.workflowVersionIdToCopy,
+ },
+ },
+ });
+ await invalidateCoreWorkflowVersions(apolloCoreClient);
+ return result.data?.createDraftFromWorkflowVersion.id;
+ }
+
const result = await mutate({
variables: { input },
awaitRefetchQueries: true,
diff --git a/packages/twenty-front/src/modules/workflow/hooks/useDeactivateWorkflowVersion.ts b/packages/twenty-front/src/modules/workflow/hooks/useDeactivateWorkflowVersion.ts
index d6a258e7e4e..a0974b80a1e 100644
--- a/packages/twenty-front/src/modules/workflow/hooks/useDeactivateWorkflowVersion.ts
+++ b/packages/twenty-front/src/modules/workflow/hooks/useDeactivateWorkflowVersion.ts
@@ -1,3 +1,9 @@
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
+import {
+ DeactivateCoreWorkflowVersionDocument,
+ type DeactivateWorkflowVersionMutation,
+ type DeactivateWorkflowVersionMutationVariables,
+} from '~/generated/graphql';
import { invalidateCoreWorkflowVersions } from '@/object-core/workflows/versions/utils/invalidateCoreWorkflowVersions';
import { useMutation } from '@apollo/client/react';
@@ -17,13 +23,13 @@ import {
type WorkflowVersion,
} from '@/workflow/types/Workflow';
import { isDefined } from 'twenty-shared/utils';
-import {
- type DeactivateWorkflowVersionMutation,
- type DeactivateWorkflowVersionMutationVariables,
-} from '~/generated/graphql';
export const useDeactivateWorkflowVersion = () => {
const apolloCoreClient = useApolloCoreClient();
+ const isCore = useIsWorkflowCoreEnabled();
+ const [mutateCore] = useMutation(DeactivateCoreWorkflowVersionDocument, {
+ client: apolloCoreClient,
+ });
const { objectPermissionsByObjectMetadataId } = useObjectPermissions();
const { objectMetadataItems } = useObjectMetadataItems();
const [mutate] = useMutation<
@@ -49,6 +55,14 @@ export const useDeactivateWorkflowVersion = () => {
}: {
workflowVersionId: string;
}) => {
+ if (isCore) {
+ await mutateCore({
+ variables: { coreWorkflowVersionId: workflowVersionId },
+ });
+ await invalidateCoreWorkflowVersions(apolloCoreClient);
+ return;
+ }
+
await mutate({
variables: {
workflowVersionId,
diff --git a/packages/twenty-front/src/modules/workflow/hooks/useDiscardWorkspaceWorkflowDraft.ts b/packages/twenty-front/src/modules/workflow/hooks/useDiscardWorkspaceWorkflowDraft.ts
new file mode 100644
index 00000000000..df61958566f
--- /dev/null
+++ b/packages/twenty-front/src/modules/workflow/hooks/useDiscardWorkspaceWorkflowDraft.ts
@@ -0,0 +1,37 @@
+import { useMutation } from '@apollo/client/react';
+
+import { DISCARD_CORE_WORKFLOW_DRAFT } from '@/object-core/workflows/graphql/mutations/discardCoreWorkflowDraft';
+import { invalidateCoreWorkflowVersions } from '@/object-core/workflows/versions/utils/invalidateCoreWorkflowVersions';
+import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
+import { useEvictDiscardedDraftFromWorkflowCache } from '@/workflow/hooks/useEvictDiscardedDraftFromWorkflowCache';
+import {
+ type DiscardCoreWorkflowDraftMutation,
+ type DiscardCoreWorkflowDraftMutationVariables,
+} from '~/generated/graphql';
+
+export const useDiscardWorkspaceWorkflowDraft = () => {
+ const apolloCoreClient = useApolloCoreClient();
+ const { evictDiscardedDraftFromWorkflowCache } =
+ useEvictDiscardedDraftFromWorkflowCache();
+
+ const [discardCoreWorkflowDraftMutation] = useMutation<
+ DiscardCoreWorkflowDraftMutation,
+ DiscardCoreWorkflowDraftMutationVariables
+ >(DISCARD_CORE_WORKFLOW_DRAFT, { client: apolloCoreClient });
+
+ const discardWorkspaceWorkflowDraft = async ({
+ workspaceWorkflowVersionId,
+ }: {
+ workspaceWorkflowVersionId: string;
+ }) => {
+ await discardCoreWorkflowDraftMutation({
+ variables: { input: { workspaceWorkflowVersionId } },
+ });
+
+ evictDiscardedDraftFromWorkflowCache(workspaceWorkflowVersionId);
+
+ await invalidateCoreWorkflowVersions(apolloCoreClient);
+ };
+
+ return { discardWorkspaceWorkflowDraft };
+};
diff --git a/packages/twenty-front/src/modules/workflow/hooks/useDuplicateWorkflow.ts b/packages/twenty-front/src/modules/workflow/hooks/useDuplicateWorkflow.ts
index b5e24852e92..b3040090c30 100644
--- a/packages/twenty-front/src/modules/workflow/hooks/useDuplicateWorkflow.ts
+++ b/packages/twenty-front/src/modules/workflow/hooks/useDuplicateWorkflow.ts
@@ -1,15 +1,22 @@
-import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
-import { CoreObjectNameSingular } from 'twenty-shared/types';
-import { useFindManyRecordsQuery } from '@/object-record/hooks/useFindManyRecordsQuery';
-import { useMutation } from '@apollo/client/react';
+import { invalidateCoreWorkflowVersions } from '@/object-core/workflows/versions/utils/invalidateCoreWorkflowVersions';
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
import {
+ DuplicateCoreWorkflowDocument,
type DuplicateWorkflowInput,
type WorkflowVersionDto,
} from '~/generated/graphql';
+import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
+import { CoreObjectNameSingular } from 'twenty-shared/types';
+import { useFindManyRecordsQuery } from '@/object-record/hooks/useFindManyRecordsQuery';
+import { useMutation } from '@apollo/client/react';
import { DUPLICATE_WORKFLOW } from '@/workflow/graphql/mutations/duplicateWorkflow';
export const useDuplicateWorkflow = () => {
const apolloCoreClient = useApolloCoreClient();
+ const isCore = useIsWorkflowCoreEnabled();
+ const [mutateCore] = useMutation(DuplicateCoreWorkflowDocument, {
+ client: apolloCoreClient,
+ });
const [mutate] = useMutation<
{ duplicateWorkflow: WorkflowVersionDto },
{ input: DuplicateWorkflowInput }
@@ -30,6 +37,21 @@ export const useDuplicateWorkflow = () => {
});
const duplicateWorkflow = async (input: DuplicateWorkflowInput) => {
+ if (isCore) {
+ const result = await mutateCore({
+ variables: {
+ input: {
+ coreWorkflowIdToDuplicate: input.workflowIdToDuplicate,
+ coreWorkflowVersionIdToCopy: input.workflowVersionIdToCopy,
+ },
+ },
+ });
+ await invalidateCoreWorkflowVersions(apolloCoreClient);
+ return result.data
+ ? { workflowId: result.data.duplicateWorkflow.id }
+ : undefined;
+ }
+
const result = await mutate({
variables: { input },
awaitRefetchQueries: true,
diff --git a/packages/twenty-front/src/modules/workflow/hooks/useEffectiveDraftVersionId.ts b/packages/twenty-front/src/modules/workflow/hooks/useEffectiveDraftVersionId.ts
index 03bbd895bbb..7c41075abda 100644
--- a/packages/twenty-front/src/modules/workflow/hooks/useEffectiveDraftVersionId.ts
+++ b/packages/twenty-front/src/modules/workflow/hooks/useEffectiveDraftVersionId.ts
@@ -7,6 +7,7 @@ import { isDefined } from 'twenty-shared/utils';
export const useEffectiveDraftVersionId = (
draftVersionFromServer: { id: string } | undefined,
+ skip = false,
): {
effectiveDraftId: string | undefined;
lastDiscardedDraftId: string | undefined;
@@ -24,6 +25,10 @@ export const useEffectiveDraftVersionId = (
string | undefined
>();
+ if (skip) {
+ return { effectiveDraftId: undefined, lastDiscardedDraftId: undefined };
+ }
+
if (isDefined(draftVersionFromServer)) {
const isReaddedBySSEAfterDiscard =
draftVersionFromServer.id === lastDiscardedDraftId;
diff --git a/packages/twenty-front/src/modules/workflow/hooks/useIsWorkflowCoreEnabled.ts b/packages/twenty-front/src/modules/workflow/hooks/useIsWorkflowCoreEnabled.ts
new file mode 100644
index 00000000000..348343d53d1
--- /dev/null
+++ b/packages/twenty-front/src/modules/workflow/hooks/useIsWorkflowCoreEnabled.ts
@@ -0,0 +1,5 @@
+import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
+import { FeatureFlagKey } from 'twenty-shared/types';
+
+export const useIsWorkflowCoreEnabled = () =>
+ useIsFeatureEnabled(FeatureFlagKey.IS_WORKFLOW_CORE_INDEX_PAGE_ENABLED);
diff --git a/packages/twenty-front/src/modules/workflow/hooks/useRunWorkflowRunOpeningInSidePanelEffects.ts b/packages/twenty-front/src/modules/workflow/hooks/useRunWorkflowRunOpeningInSidePanelEffects.ts
index 171c5ca7854..f687543dba3 100644
--- a/packages/twenty-front/src/modules/workflow/hooks/useRunWorkflowRunOpeningInSidePanelEffects.ts
+++ b/packages/twenty-front/src/modules/workflow/hooks/useRunWorkflowRunOpeningInSidePanelEffects.ts
@@ -1,3 +1,4 @@
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
import { useSidePanelWorkflowNavigation } from '@/side-panel/pages/workflow/hooks/useSidePanelWorkflowNavigation';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { objectMetadataItemsSelector } from '@/object-metadata/states/objectMetadataItemsSelector';
@@ -19,6 +20,7 @@ import { useIcons } from 'twenty-ui/icon';
import { useStore } from 'jotai';
export const useRunWorkflowRunOpeningInSidePanelEffects = () => {
+ const isCore = useIsWorkflowCoreEnabled();
const store = useStore();
const apolloCoreClient = useApolloCoreClient();
const { openWorkflowRunViewStepInSidePanel } =
@@ -50,6 +52,16 @@ export const useRunWorkflowRunOpeningInSidePanelEffects = () => {
return;
}
+ const workflowId = isCore
+ ? (workflowRunRecord.coreWorkflowId ?? workflowRunRecord.workflowId)
+ : workflowRunRecord.workflowId;
+ const workflowVersionId = isCore
+ ? (workflowRunRecord.coreWorkflowVersionId ??
+ workflowRunRecord.workflowVersionId)
+ : workflowRunRecord.workflowVersionId;
+ if (!isDefined(workflowId) || !isDefined(workflowVersionId)) {
+ return;
+ }
const { stepToOpenByDefault } = generateWorkflowRunDiagram({
steps: workflowRunRecord.state.flow.steps,
stepInfos: workflowRunRecord.state.stepInfos,
@@ -74,14 +86,14 @@ export const useRunWorkflowRunOpeningInSidePanelEffects = () => {
workflowVisualizerWorkflowIdComponentState.atomFamily({
instanceId,
}),
- workflowRunRecord.workflowId,
+ workflowId,
);
store.set(
flowComponentState.atomFamily({
instanceId,
}),
{
- workflowVersionId: workflowRunRecord.workflowVersionId,
+ workflowVersionId,
trigger: workflowRunRecord.state.flow.trigger,
steps: workflowRunRecord.state.flow.steps,
},
@@ -106,7 +118,7 @@ export const useRunWorkflowRunOpeningInSidePanelEffects = () => {
],
);
openWorkflowRunViewStepInSidePanel({
- workflowId: workflowRunRecord.workflowId,
+ workflowId,
workflowRunId: workflowRunRecord.id,
title: stepToOpenByDefault.data.name,
icon: getIcon(getWorkflowNodeIconKey(stepToOpenByDefault.data)),
@@ -115,6 +127,7 @@ export const useRunWorkflowRunOpeningInSidePanelEffects = () => {
});
},
[
+ isCore,
apolloCoreClient.cache,
objectPermissionsByObjectMetadataId,
openWorkflowRunViewStepInSidePanel,
diff --git a/packages/twenty-front/src/modules/workflow/hooks/useRunWorkflowVersion.tsx b/packages/twenty-front/src/modules/workflow/hooks/useRunWorkflowVersion.tsx
index 4dabf1a4bb1..b1f8b43abc0 100644
--- a/packages/twenty-front/src/modules/workflow/hooks/useRunWorkflowVersion.tsx
+++ b/packages/twenty-front/src/modules/workflow/hooks/useRunWorkflowVersion.tsx
@@ -1,3 +1,9 @@
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
+import {
+ RunCoreWorkflowVersionDocument,
+ type RunWorkflowVersionMutation,
+ type RunWorkflowVersionMutationVariables,
+} from '~/generated/graphql';
import { triggerCreateRecordsOptimisticEffect } from '@/apollo/optimistic-effect/utils/triggerCreateRecordsOptimisticEffect';
import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
import { useOpenRecordInSidePanel } from '@/side-panel/hooks/useOpenRecordInSidePanel';
@@ -24,15 +30,15 @@ import { useCallback } from 'react';
import { useMutation } from '@apollo/client/react';
import { isDefined } from 'twenty-shared/utils';
import { v4 } from 'uuid';
-import {
- type RunWorkflowVersionMutation,
- type RunWorkflowVersionMutationVariables,
-} from '~/generated/graphql';
import { useStore } from 'jotai';
export const useRunWorkflowVersion = () => {
const store = useStore();
+ const isCore = useIsWorkflowCoreEnabled();
const apolloCoreClient = useApolloCoreClient();
+ const [mutateCore] = useMutation(RunCoreWorkflowVersionDocument, {
+ client: apolloCoreClient,
+ });
const { upsertRecordsInStore } = useUpsertRecordsInStore();
const { objectMetadataItem } = useObjectMetadataItem({
@@ -81,15 +87,19 @@ export const useRunWorkflowVersion = () => {
}: {
workflowId: string;
workflowVersionId: string;
- payload?: Record<string, any>;
+ payload?: Record<string, unknown>;
}) => {
const workflowRunId = v4();
const recordInput: Partial<WorkflowRun> = {
name: '#0',
status: 'NOT_STARTED',
- workflowVersionId,
- workflowId,
+ ...(isCore
+ ? {
+ coreWorkflowVersionId: workflowVersionId,
+ coreWorkflowId: workflowId,
+ }
+ : { workflowVersionId, workflowId }),
createdAt: new Date().toISOString(),
};
@@ -151,9 +161,21 @@ export const useRunWorkflowVersion = () => {
changeQueryIdListenState(true, sseQueryId, sseOperationSignature);
try {
- await mutate({
- variables: { input: { workflowVersionId, workflowRunId, payload } },
- });
+ if (isCore) {
+ await mutateCore({
+ variables: {
+ input: {
+ coreWorkflowVersionId: workflowVersionId,
+ workflowRunId,
+ payload,
+ },
+ },
+ });
+ } else {
+ await mutate({
+ variables: { input: { workflowVersionId, workflowRunId, payload } },
+ });
+ }
} catch (error) {
changeQueryIdListenState(false, sseQueryId, sseOperationSignature);
throw error;
diff --git a/packages/twenty-front/src/modules/workflow/hooks/useWorkflowEditorMutationErrorHandler.ts b/packages/twenty-front/src/modules/workflow/hooks/useWorkflowEditorMutationErrorHandler.ts
new file mode 100644
index 00000000000..0e8d5056d95
--- /dev/null
+++ b/packages/twenty-front/src/modules/workflow/hooks/useWorkflowEditorMutationErrorHandler.ts
@@ -0,0 +1,37 @@
+import { useStore } from 'jotai';
+import { isDefined } from 'twenty-shared/utils';
+import { useToast } from 'twenty-ui/primitives/feedback';
+
+import { getToastOptionsFromError } from '@/error-handler/utils/getToastOptionsFromError';
+import { useAtomComponentStateCallbackState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateCallbackState';
+import { flowComponentState } from '@/workflow/states/flowComponentState';
+import { workflowDiagramComponentState } from '@/workflow/workflow-diagram/states/workflowDiagramComponentState';
+import { generateWorkflowDiagram } from '@/workflow/workflow-diagram/utils/generateWorkflowDiagram';
+
+export const useWorkflowEditorMutationErrorHandler = (instanceId?: string) => {
+ const store = useStore();
+ const { enqueueToast } = useToast();
+ const flowState = useAtomComponentStateCallbackState(
+ flowComponentState,
+ instanceId,
+ );
+ const diagramState = useAtomComponentStateCallbackState(
+ workflowDiagramComponentState,
+ instanceId,
+ );
+
+ return (error: Error) => {
+ enqueueToast(getToastOptionsFromError({ error }));
+ const flow = store.get(flowState);
+ if (isDefined(flow)) {
+ store.set(
+ diagramState,
+ generateWorkflowDiagram({
+ trigger: flow.trigger ?? undefined,
+ steps: flow.steps ?? [],
+ workflowContext: 'workflow',
+ }),
+ );
+ }
+ };
+};
diff --git a/packages/twenty-front/src/modules/workflow/hooks/useWorkflowVersion.ts b/packages/twenty-front/src/modules/workflow/hooks/useWorkflowVersion.ts
index 67fbaae0973..6352c226943 100644
--- a/packages/twenty-front/src/modules/workflow/hooks/useWorkflowVersion.ts
+++ b/packages/twenty-front/src/modules/workflow/hooks/useWorkflowVersion.ts
@@ -1,8 +1,44 @@
+import { useMemo } from 'react';
+import { useQuery } from '@apollo/client/react';
+import {
+ GetCoreWorkflowVersionDocument,
+ GetCoreWorkflowDocument,
+} from '~/generated/graphql';
+import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
+import { buildWorkflowVersionFromCore } from '@/object-core/workflows/utils/buildWorkflowVersionFromCore';
import { useFindOneRecord } from '@/object-record/hooks/useFindOneRecord';
import { type Workflow, type WorkflowVersion } from '@/workflow/types/Workflow';
import { CoreObjectNameSingular } from 'twenty-shared/types';
export const useWorkflowVersion = (workflowVersionId?: string) => {
+ const isCore = useIsWorkflowCoreEnabled();
+ const client = useApolloCoreClient();
+ const { data } = useQuery(GetCoreWorkflowVersionDocument, {
+ client,
+ variables: { coreWorkflowVersionId: workflowVersionId ?? '' },
+ fetchPolicy: 'cache-and-network',
+ skip: !isCore || !workflowVersionId,
+ });
+ const coreWorkflowId = data?.coreWorkflowVersion?.coreWorkflowId;
+ const { data: workflowData } = useQuery(GetCoreWorkflowDocument, {
+ client,
+ variables: { coreWorkflowId: coreWorkflowId ?? '' },
+ fetchPolicy: 'cache-and-network',
+ skip: !isCore || !coreWorkflowId,
+ });
+ const coreVersion = useMemo(() => {
+ const version = buildWorkflowVersionFromCore(data?.coreWorkflowVersion);
+ return version
+ ? {
+ ...version,
+ workflow: {
+ id: version.workflowId,
+ name: workflowData?.coreWorkflow?.name ?? '',
+ },
+ }
+ : undefined;
+ }, [data, workflowData]);
const { record: workflowVersion } = useFindOneRecord<
WorkflowVersion & { workflow: Pick<Workflow, 'id' | 'name'> }
>({
@@ -20,8 +56,8 @@ export const useWorkflowVersion = (workflowVersionId?: string) => {
name: true,
},
},
- skip: !workflowVersionId,
+ skip: isCore || !workflowVersionId,
});
- return workflowVersion;
+ return isCore ? coreVersion : workflowVersion;
};
diff --git a/packages/twenty-front/src/modules/workflow/hooks/useWorkflowWithCurrentVersion.ts b/packages/twenty-front/src/modules/workflow/hooks/useWorkflowWithCurrentVersion.ts
index c2c135e87bf..e7b7c84305e 100644
--- a/packages/twenty-front/src/modules/workflow/hooks/useWorkflowWithCurrentVersion.ts
+++ b/packages/twenty-front/src/modules/workflow/hooks/useWorkflowWithCurrentVersion.ts
@@ -2,6 +2,7 @@ import { useCoreWorkflowForShowPage } from '@/object-core/workflows/hooks/useCor
import { useCoreWorkflowVersionContent } from '@/object-core/workflows/hooks/useCoreWorkflowVersionContent';
import { useFindOneRecord } from '@/object-record/hooks/useFindOneRecord';
import { useEffectiveDraftVersionId } from '@/workflow/hooks/useEffectiveDraftVersionId';
+import { getWorkflowCurrentVersion } from '@/workflow/utils/getWorkflowCurrentVersion';
import {
type Workflow,
type WorkflowVersion,
@@ -48,7 +49,7 @@ export const useWorkflowWithCurrentVersion = (
versions: coreVersions,
draftVersionIdFromServer,
} = useCoreWorkflowForShowPage({
- workspaceWorkflowId: workflowId,
+ coreWorkflowId: workflowId,
skip: !isWorkflowCoreIndexPageEnabled,
});
@@ -74,13 +75,16 @@ export const useWorkflowWithCurrentVersion = (
const { effectiveDraftId, lastDiscardedDraftId } = useEffectiveDraftVersionId(
draftVersionFromServer,
+ isWorkflowCoreIndexPageEnabled,
);
const workflowVersions = [...allVersions]
.filter((version) => version.id !== lastDiscardedDraftId)
.sort((a, b) => (a.createdAt > b.createdAt ? -1 : 1));
- const currentVersionId = effectiveDraftId ?? workflowVersions[0]?.id;
+ const currentVersionId = isWorkflowCoreIndexPageEnabled
+ ? getWorkflowCurrentVersion(workflowVersions)?.id
+ : (effectiveDraftId ?? workflowVersions[0]?.id);
const { record: workspaceCurrentVersion } = useFindOneRecord<WorkflowVersion>(
{
@@ -99,8 +103,8 @@ export const useWorkflowWithCurrentVersion = (
);
const coreCurrentVersion = useCoreWorkflowVersionContent({
- workspaceWorkflowId: workflowId,
- workspaceWorkflowVersionId: currentVersionId,
+ coreWorkflowId: workflowId,
+ coreWorkflowVersionId: currentVersionId,
skip: !isWorkflowCoreIndexPageEnabled,
});
diff --git a/packages/twenty-front/src/modules/workflow/utils/__tests__/getWorkflowCurrentVersion.test.ts b/packages/twenty-front/src/modules/workflow/utils/__tests__/getWorkflowCurrentVersion.test.ts
new file mode 100644
index 00000000000..8592ba608a1
--- /dev/null
+++ b/packages/twenty-front/src/modules/workflow/utils/__tests__/getWorkflowCurrentVersion.test.ts
@@ -0,0 +1,32 @@
+import { getWorkflowCurrentVersion } from '@/workflow/utils/getWorkflowCurrentVersion';
+
+const buildVersion = (status: string, createdAt: string) => ({
+ id: `${status}-${createdAt}`,
+ status,
+ createdAt,
+});
+
+describe('getWorkflowCurrentVersion', () => {
+ it('prefers a draft, then an active version, then the newest version', () => {
+ const deactivatedVersion = buildVersion(
+ 'DEACTIVATED',
+ '2026-09-18T12:00:00.000Z',
+ );
+ const activeVersion = buildVersion('ACTIVE', '2026-09-18T11:00:00.000Z');
+ const draftVersion = buildVersion('DRAFT', '2026-09-18T10:00:00.000Z');
+
+ expect(
+ getWorkflowCurrentVersion([
+ draftVersion,
+ activeVersion,
+ deactivatedVersion,
+ ]),
+ ).toEqual(draftVersion);
+ expect(
+ getWorkflowCurrentVersion([activeVersion, deactivatedVersion]),
+ ).toEqual(activeVersion);
+ expect(getWorkflowCurrentVersion([deactivatedVersion])).toEqual(
+ deactivatedVersion,
+ );
+ });
+});
diff --git a/packages/twenty-front/src/modules/workflow/utils/getWorkflowCurrentVersion.ts b/packages/twenty-front/src/modules/workflow/utils/getWorkflowCurrentVersion.ts
new file mode 100644
index 00000000000..3f70960aa55
--- /dev/null
+++ b/packages/twenty-front/src/modules/workflow/utils/getWorkflowCurrentVersion.ts
@@ -0,0 +1,20 @@
+type WorkflowVersionForCurrentSelection = {
+ createdAt: string;
+ status: string;
+};
+
+export const getWorkflowCurrentVersion = <
+ TWorkflowVersion extends WorkflowVersionForCurrentSelection,
+>(
+ versions: TWorkflowVersion[],
+): TWorkflowVersion | undefined => {
+ const versionsByRecency = versions.toSorted((firstVersion, secondVersion) =>
+ secondVersion.createdAt.localeCompare(firstVersion.createdAt),
+ );
+
+ return (
+ versionsByRecency.find(({ status }) => status === 'DRAFT') ??
+ versionsByRecency.find(({ status }) => status === 'ACTIVE') ??
+ versionsByRecency[0]
+ );
+};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramEffect.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramEffect.tsx
index 7ffe7a85908..c2e7ae8bb13 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramEffect.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramEffect.tsx
@@ -1,3 +1,4 @@
+import { TRIGGER_STEP_ID } from 'twenty-shared/workflow';
import { useAtomComponentStateCallbackState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateCallbackState';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useAtomFamilyState } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyState';
@@ -35,7 +36,8 @@ export const WorkflowDiagramEffect = () => {
);
const setFlow = useSetAtomComponentState(flowComponentState);
const flow = useAtomComponentStateValue(flowComponentState);
- const { populateStepsOutputSchema } = useStepsOutputSchema();
+ const { populateStepsOutputSchema, deleteStepsOutputSchema } =
+ useStepsOutputSchema();
const workflowLastCreatedStepId = useAtomComponentStateCallbackState(
workflowLastCreatedStepIdComponentState,
@@ -44,9 +46,8 @@ export const WorkflowDiagramEffect = () => {
const store = useStore();
const currentVersion = workflowWithCurrentVersion?.currentVersion;
- const { content, refetchContent } = useWorkflowVersionContent(
- currentVersion?.id,
- );
+ const { content, refetchContent, contentUpdatedAt } =
+ useWorkflowVersionContent(currentVersion?.id);
const [shouldWorkflowRefetchRequest, setShouldWorkflowRefetchRequest] =
useAtomFamilyState(
@@ -55,6 +56,10 @@ export const WorkflowDiagramEffect = () => {
);
const [seededVersionId, setSeededVersionId] = useState<string>();
+ const [seededVersionUpdatedAt, setSeededVersionUpdatedAt] =
+ useState<string>();
+ const [previousDiagramUpdatedAt, setPreviousDiagramUpdatedAt] =
+ useState<string>();
const [previousDiagramVersionId, setPreviousDiagramVersionId] =
useState<string>();
@@ -131,18 +136,39 @@ export const WorkflowDiagramEffect = () => {
return;
}
- if (seededVersionId === currentVersion.id) {
+ if (
+ seededVersionId === currentVersion.id &&
+ seededVersionUpdatedAt === contentUpdatedAt
+ ) {
return;
}
+ if (isDefined(contentUpdatedAt)) {
+ deleteStepsOutputSchema({
+ workflowVersionId: currentVersion.id,
+ stepIds: [
+ TRIGGER_STEP_ID,
+ ...(content.steps ?? []).map((step: WorkflowAction) => step.id),
+ ],
+ });
+ }
setSeededVersionId(currentVersion.id);
+ setSeededVersionUpdatedAt(contentUpdatedAt);
setFlow({
workflowVersionId: currentVersion.id,
trigger: content.trigger,
steps: content.steps,
});
- }, [content, currentVersion, seededVersionId, setFlow]);
+ }, [
+ content,
+ currentVersion,
+ seededVersionId,
+ seededVersionUpdatedAt,
+ contentUpdatedAt,
+ setFlow,
+ deleteStepsOutputSchema,
+ ]);
useEffect(() => {
if (!isDefined(flow)) {
@@ -151,13 +177,16 @@ export const WorkflowDiagramEffect = () => {
const isSameVersion = previousDiagramVersionId === flow.workflowVersionId;
const isTransitionToDraft = currentVersion?.status === 'DRAFT';
- const shouldPreservePositions = isSameVersion || isTransitionToDraft;
+ const shouldPreservePositions =
+ (isSameVersion || isTransitionToDraft) &&
+ previousDiagramUpdatedAt === contentUpdatedAt;
setPreviousDiagramVersionId(flow.workflowVersionId);
+ setPreviousDiagramUpdatedAt(contentUpdatedAt);
computeAndMergeNewWorkflowDiagram(flow, shouldPreservePositions);
// eslint-disable-next-line react-hooks/exhaustive-deps
- }, [computeAndMergeNewWorkflowDiagram, flow]);
+ }, [computeAndMergeNewWorkflowDiagram, flow, contentUpdatedAt]);
useEffect(() => {
if (!isDefined(currentVersion) || !isDefined(flow)) {
diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowRunVisualizerEffect.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowRunVisualizerEffect.tsx
index b5d5fcf7cf5..7cdd986a026 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowRunVisualizerEffect.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowRunVisualizerEffect.tsx
@@ -1,3 +1,4 @@
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
import { CommandMenuContext } from '@/command-menu-item/contexts/CommandMenuContext';
import { useSidePanelWorkflowNavigation } from '@/side-panel/pages/workflow/hooks/useSidePanelWorkflowNavigation';
import { useAtomComponentStateCallbackState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateCallbackState';
@@ -29,14 +30,23 @@ export const WorkflowRunVisualizerEffect = ({
workflowRunId: string;
}) => {
const { getIcon } = useIcons();
+ const isCore = useIsWorkflowCoreEnabled();
const workflowRun = useWorkflowRun({ workflowRunId });
const setWorkflowVisualizerWorkflowRunId = useSetAtomComponentState(
workflowVisualizerWorkflowRunIdComponentState,
);
- const workflowVersionId = workflowRun?.workflowVersionId;
- const workflowVersion = useWorkflowVersion(workflowVersionId);
+ const workflowVersionId = isCore
+ ? (workflowRun?.coreWorkflowVersionId ??
+ workflowRun?.workflowVersionId ??
+ undefined)
+ : (workflowRun?.workflowVersionId ?? undefined);
+ const workflowVersion = useWorkflowVersion(
+ isCore
+ ? (workflowRun?.coreWorkflowVersionId ?? undefined)
+ : workflowVersionId,
+ );
const setWorkflowVisualizerWorkflowVersionId = useSetAtomComponentState(
workflowVisualizerWorkflowVersionIdComponentState,
);
@@ -83,8 +93,12 @@ export const WorkflowRunVisualizerEffect = ({
return;
}
- setWorkflowVisualizerWorkflowId(workflowRun.workflowId);
- }, [setWorkflowVisualizerWorkflowId, workflowRun]);
+ setWorkflowVisualizerWorkflowId(
+ isCore
+ ? (workflowRun.coreWorkflowId ?? workflowRun.workflowId ?? undefined)
+ : (workflowRun.workflowId ?? undefined),
+ );
+ }, [isCore, setWorkflowVisualizerWorkflowId, workflowRun]);
useEffect(() => {
if (!isDefined(workflowVersionId)) {
@@ -235,14 +249,14 @@ export const WorkflowRunVisualizerEffect = ({
useEffect(() => {
handleWorkflowRunDiagramGeneration({
workflowRunState: workflowRun?.state ?? undefined,
- workflowVersionId: workflowRun?.workflowVersionId,
+ workflowVersionId,
isInSidePanel,
});
}, [
handleWorkflowRunDiagramGeneration,
isInSidePanel,
workflowRun?.state,
- workflowRun?.workflowVersionId,
+ workflowVersionId,
]);
useEffect(() => {
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/__tests__/useUpdateWorkflowVersionStep.test.ts b/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/__tests__/useUpdateWorkflowVersionStep.test.ts
index 1da3f92c3b6..8827d29e6d9 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/__tests__/useUpdateWorkflowVersionStep.test.ts
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/__tests__/useUpdateWorkflowVersionStep.test.ts
@@ -1,9 +1,26 @@
+import { createStore, Provider } from 'jotai';
+import { flowComponentState } from '@/workflow/states/flowComponentState';
+import { workflowDiagramComponentState } from '@/workflow/workflow-diagram/states/workflowDiagramComponentState';
import { WorkflowVisualizerComponentInstanceContext } from '@/workflow/workflow-diagram/states/contexts/WorkflowVisualizerComponentInstanceContext';
import { useUpdateWorkflowVersionStep } from '@/workflow/workflow-steps/hooks/useUpdateWorkflowVersionStep';
import { act, renderHook } from '@testing-library/react';
import { createElement, type ReactNode } from 'react';
const mockMutate = jest.fn();
+let mockOnCoreError: (error: Error) => void;
+const jotaiStore = createStore();
+let mockIsCore = false;
+const mockInvalidate = jest.fn();
+jest.mock('@/workflow/hooks/useIsWorkflowCoreEnabled', () => ({
+ useIsWorkflowCoreEnabled: () => mockIsCore,
+}));
+jest.mock(
+ '@/object-core/workflows/versions/utils/invalidateCoreWorkflowVersions',
+ () => ({
+ invalidateCoreWorkflowVersions: (...args: unknown[]) =>
+ mockInvalidate(...args),
+ }),
+);
const mockGetRecordFromCache = jest.fn();
const mockMarkStepForRecomputation = jest.fn();
@@ -45,19 +62,34 @@ jest.mock('@/workflow/workflow-variables/hooks/useStepsOutputSchema', () => ({
}));
jest.mock('@apollo/client/react', () => ({
- useMutation: () => [mockMutate],
+ useMutation: (
+ _document: unknown,
+ options: { onError?: (error: Error) => void },
+ ) => {
+ if (options.onError) mockOnCoreError = options.onError;
+ return [mockMutate];
+ },
}));
const Wrapper = ({ children }: { children: ReactNode }) =>
createElement(
- WorkflowVisualizerComponentInstanceContext.Provider,
- { value: { instanceId: 'workflow-visualizer-test' } },
- children,
+ Provider,
+ { store: jotaiStore },
+ createElement(
+ WorkflowVisualizerComponentInstanceContext.Provider,
+ { value: { instanceId: 'workflow-visualizer-test' } },
+ children,
+ ),
);
describe('useUpdateWorkflowVersionStep', () => {
beforeEach(() => {
jest.clearAllMocks();
+ mockIsCore = false;
+ jotaiStore.set(
+ flowComponentState.atomFamily({ instanceId: 'workflow-visualizer-test' }),
+ undefined,
+ );
});
it('should mark step for recomputation after successful update', async () => {
@@ -139,4 +171,72 @@ describe('useUpdateWorkflowVersionStep', () => {
workflowVersionId: 'version-1',
});
});
+ it('sends a core version ID and preserves business record IDs in step input', async () => {
+ mockIsCore = true;
+ const step = {
+ id: 'step-1',
+ type: 'UPDATE_RECORD',
+ settings: { input: { objectRecordId: 'business-record-id' } },
+ };
+ mockMutate.mockResolvedValue({ data: { updateWorkflowVersionStep: step } });
+ const { result } = renderHook(() => useUpdateWorkflowVersionStep(), {
+ wrapper: Wrapper,
+ });
+ await act(() =>
+ result.current.updateWorkflowVersionStep({
+ workflowVersionId: 'core-draft-id',
+ step,
+ }),
+ );
+ expect(mockMutate).toHaveBeenCalledWith({
+ variables: { input: { coreWorkflowVersionId: 'core-draft-id', step } },
+ });
+ expect(mockGetRecordFromCache).not.toHaveBeenCalled();
+ expect(mockInvalidate).toHaveBeenCalled();
+ });
+ it('reports a failed core edit and removes unpersisted diagram changes', async () => {
+ mockIsCore = true;
+ const error = new Error('Core save failed');
+ const instance = { instanceId: 'workflow-visualizer-test' };
+ jotaiStore.set(flowComponentState.atomFamily(instance), {
+ workflowVersionId: 'core-draft-id',
+ trigger: null,
+ steps: [],
+ });
+ jotaiStore.set(workflowDiagramComponentState.atomFamily(instance), {
+ nodes: [],
+ edges: [
+ {
+ id: 'unsaved',
+ source: 'source',
+ target: 'target',
+ sourceHandle: 'source',
+ targetHandle: 'target',
+ },
+ ],
+ });
+ mockMutate.mockImplementationOnce(async () => {
+ mockOnCoreError(error);
+ return { data: null };
+ });
+ const { result } = renderHook(() => useUpdateWorkflowVersionStep(), {
+ wrapper: Wrapper,
+ });
+ await act(() =>
+ result.current.updateWorkflowVersionStep({
+ workflowVersionId: 'core-draft-id',
+ step: { id: 'step-1', type: 'CODE' },
+ }),
+ );
+ expect(mockEnqueueToast).toHaveBeenCalledWith(
+ expect.objectContaining({
+ variant: 'error',
+ children: 'Core save failed',
+ }),
+ );
+ expect(
+ jotaiStore.get(workflowDiagramComponentState.atomFamily(instance))?.edges,
+ ).toEqual([]);
+ expect(mockMarkStepForRecomputation).not.toHaveBeenCalled();
+ });
});
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useApplyWorkflowVersionStepChanges.ts b/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useApplyWorkflowVersionStepChanges.ts
index 6e3636bc9a2..10dc4eb43a2 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useApplyWorkflowVersionStepChanges.ts
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useApplyWorkflowVersionStepChanges.ts
@@ -1,3 +1,4 @@
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
@@ -12,6 +13,7 @@ import { applyDiff, isDefined } from 'twenty-shared/utils';
import { type WorkflowVersionStepChanges } from '~/generated/graphql';
export const useApplyWorkflowVersionStepChanges = (instanceId?: string) => {
+ const isCore = useIsWorkflowCoreEnabled();
const apolloCoreClient = useApolloCoreClient();
const { objectMetadataItems } = useObjectMetadataItems();
@@ -54,6 +56,10 @@ export const useApplyWorkflowVersionStepChanges = (instanceId?: string) => {
};
});
+ if (isCore) {
+ return;
+ }
+
const cachedRecord = getRecordFromCache<WorkflowVersion>(workflowVersionId);
if (!isDefined(cachedRecord)) {
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useCreateWorkflowVersionEdge.ts b/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useCreateWorkflowVersionEdge.ts
index 340892c1c04..b0629ad96c5 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useCreateWorkflowVersionEdge.ts
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useCreateWorkflowVersionEdge.ts
@@ -1,10 +1,14 @@
import { getToastOptionsFromError } from '@/error-handler/utils/getToastOptionsFromError';
+import { useWorkflowEditorMutationErrorHandler } from '@/workflow/hooks/useWorkflowEditorMutationErrorHandler';
+import { invalidateCoreWorkflowVersions } from '@/object-core/workflows/versions/utils/invalidateCoreWorkflowVersions';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
import { CREATE_WORKFLOW_VERSION_EDGE } from '@/workflow/graphql/mutations/createWorkflowVersionEdge';
import { useApplyWorkflowVersionStepChanges } from '@/workflow/workflow-steps/hooks/useApplyWorkflowVersionStepChanges';
import { useMutation } from '@apollo/client/react';
import { useToast } from 'twenty-ui/primitives/feedback';
import {
+ CreateCoreWorkflowVersionEdgeDocument,
type CreateWorkflowVersionEdgeInput,
type CreateWorkflowVersionEdgeMutation,
type CreateWorkflowVersionEdgeMutationVariables,
@@ -12,6 +16,12 @@ import {
export const useCreateWorkflowVersionEdge = () => {
const apolloCoreClient = useApolloCoreClient();
+ const isCore = useIsWorkflowCoreEnabled();
+ const handleCoreMutationError = useWorkflowEditorMutationErrorHandler();
+ const [mutateCore] = useMutation(CreateCoreWorkflowVersionEdgeDocument, {
+ client: apolloCoreClient,
+ onError: handleCoreMutationError,
+ });
const { applyWorkflowVersionStepChanges } =
useApplyWorkflowVersionStepChanges();
@@ -25,12 +35,19 @@ export const useCreateWorkflowVersionEdge = () => {
const createWorkflowVersionEdge = async (
input: CreateWorkflowVersionEdgeInput,
) => {
- const result = await mutate({
- variables: { input },
- onError: (error) => {
- enqueueToast(getToastOptionsFromError({ error }));
- },
- });
+ const { workflowVersionId, ...stepInput } = input;
+ const result = isCore
+ ? await mutateCore({
+ variables: {
+ input: { ...stepInput, coreWorkflowVersionId: workflowVersionId },
+ },
+ })
+ : await mutate({
+ variables: { input },
+ onError: (error) => {
+ enqueueToast(getToastOptionsFromError({ error }));
+ },
+ });
const workflowVersionStepChanges = result?.data?.createWorkflowVersionEdge;
@@ -39,6 +56,10 @@ export const useCreateWorkflowVersionEdge = () => {
workflowVersionId: input.workflowVersionId,
});
+ if (isCore) {
+ await invalidateCoreWorkflowVersions(apolloCoreClient);
+ }
+
return result;
};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useCreateWorkflowVersionStep.ts b/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useCreateWorkflowVersionStep.ts
index 86947f1fdad..64930a404be 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useCreateWorkflowVersionStep.ts
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useCreateWorkflowVersionStep.ts
@@ -1,10 +1,14 @@
import { getToastOptionsFromError } from '@/error-handler/utils/getToastOptionsFromError';
+import { useWorkflowEditorMutationErrorHandler } from '@/workflow/hooks/useWorkflowEditorMutationErrorHandler';
+import { invalidateCoreWorkflowVersions } from '@/object-core/workflows/versions/utils/invalidateCoreWorkflowVersions';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
import { CREATE_WORKFLOW_VERSION_STEP } from '@/workflow/graphql/mutations/createWorkflowVersionStep';
import { useApplyWorkflowVersionStepChanges } from '@/workflow/workflow-steps/hooks/useApplyWorkflowVersionStepChanges';
import { useMutation } from '@apollo/client/react';
import { useToast } from 'twenty-ui/primitives/feedback';
import {
+ CreateCoreWorkflowVersionStepDocument,
type CreateWorkflowVersionStepInput,
type CreateWorkflowVersionStepMutation,
type CreateWorkflowVersionStepMutationVariables,
@@ -12,6 +16,12 @@ import {
export const useCreateWorkflowVersionStep = () => {
const apolloCoreClient = useApolloCoreClient();
+ const isCore = useIsWorkflowCoreEnabled();
+ const handleCoreMutationError = useWorkflowEditorMutationErrorHandler();
+ const [mutateCore] = useMutation(CreateCoreWorkflowVersionStepDocument, {
+ client: apolloCoreClient,
+ onError: handleCoreMutationError,
+ });
const { applyWorkflowVersionStepChanges } =
useApplyWorkflowVersionStepChanges();
@@ -28,12 +38,19 @@ export const useCreateWorkflowVersionStep = () => {
const createWorkflowVersionStep = async (
input: CreateWorkflowVersionStepInput,
) => {
- const result = await mutate({
- variables: { input },
- onError: (error) => {
- enqueueToast(getToastOptionsFromError({ error }));
- },
- });
+ const { workflowVersionId, ...stepInput } = input;
+ const result = isCore
+ ? await mutateCore({
+ variables: {
+ input: { ...stepInput, coreWorkflowVersionId: workflowVersionId },
+ },
+ })
+ : await mutate({
+ variables: { input },
+ onError: (error) => {
+ enqueueToast(getToastOptionsFromError({ error }));
+ },
+ });
const workflowVersionStepChanges = result?.data?.createWorkflowVersionStep;
@@ -42,6 +59,10 @@ export const useCreateWorkflowVersionStep = () => {
workflowVersionId: input.workflowVersionId,
});
+ if (isCore) {
+ await invalidateCoreWorkflowVersions(apolloCoreClient);
+ }
+
return result;
};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useDeleteWorkflowVersionEdge.ts b/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useDeleteWorkflowVersionEdge.ts
index 93167164419..a9869a9f11e 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useDeleteWorkflowVersionEdge.ts
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useDeleteWorkflowVersionEdge.ts
@@ -1,15 +1,25 @@
-import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
-import { useMutation } from '@apollo/client/react';
+import { useWorkflowEditorMutationErrorHandler } from '@/workflow/hooks/useWorkflowEditorMutationErrorHandler';
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
+import { invalidateCoreWorkflowVersions } from '@/object-core/workflows/versions/utils/invalidateCoreWorkflowVersions';
import {
+ DeleteCoreWorkflowVersionEdgeDocument,
type CreateWorkflowVersionEdgeInput,
type DeleteWorkflowVersionEdgeMutation,
type DeleteWorkflowVersionEdgeMutationVariables,
} from '~/generated/graphql';
+import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
+import { useMutation } from '@apollo/client/react';
import { DELETE_WORKFLOW_VERSION_EDGE } from '@/workflow/graphql/mutations/deleteWorkflowVersionEdge';
import { useApplyWorkflowVersionStepChanges } from '@/workflow/workflow-steps/hooks/useApplyWorkflowVersionStepChanges';
export const useDeleteWorkflowVersionEdge = () => {
const apolloCoreClient = useApolloCoreClient();
+ const isCore = useIsWorkflowCoreEnabled();
+ const handleCoreMutationError = useWorkflowEditorMutationErrorHandler();
+ const [mutateCore] = useMutation(DeleteCoreWorkflowVersionEdgeDocument, {
+ client: apolloCoreClient,
+ onError: handleCoreMutationError,
+ });
const { applyWorkflowVersionStepChanges } =
useApplyWorkflowVersionStepChanges();
@@ -22,7 +32,14 @@ export const useDeleteWorkflowVersionEdge = () => {
const deleteWorkflowVersionEdge = async (
input: CreateWorkflowVersionEdgeInput,
) => {
- const result = await mutate({ variables: { input } });
+ const { workflowVersionId, ...stepInput } = input;
+ const result = isCore
+ ? await mutateCore({
+ variables: {
+ input: { ...stepInput, coreWorkflowVersionId: workflowVersionId },
+ },
+ })
+ : await mutate({ variables: { input } });
const workflowVersionStepChanges = result?.data?.deleteWorkflowVersionEdge;
@@ -31,6 +48,10 @@ export const useDeleteWorkflowVersionEdge = () => {
workflowVersionId: input.workflowVersionId,
});
+ if (isCore) {
+ await invalidateCoreWorkflowVersions(apolloCoreClient);
+ }
+
return result;
};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useDeleteWorkflowVersionStep.ts b/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useDeleteWorkflowVersionStep.ts
index 70e764a1f45..fdee88e3024 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useDeleteWorkflowVersionStep.ts
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useDeleteWorkflowVersionStep.ts
@@ -1,12 +1,16 @@
import { getToastOptionsFromError } from '@/error-handler/utils/getToastOptionsFromError';
+import { useWorkflowEditorMutationErrorHandler } from '@/workflow/hooks/useWorkflowEditorMutationErrorHandler';
+import { invalidateCoreWorkflowVersions } from '@/object-core/workflows/versions/utils/invalidateCoreWorkflowVersions';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { useFindOneRecordQuery } from '@/object-record/hooks/useFindOneRecordQuery';
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
import { DELETE_WORKFLOW_VERSION_STEP } from '@/workflow/graphql/mutations/deleteWorkflowVersionStep';
import { useApplyWorkflowVersionStepChanges } from '@/workflow/workflow-steps/hooks/useApplyWorkflowVersionStepChanges';
import { useMutation } from '@apollo/client/react';
import { CoreObjectNameSingular } from 'twenty-shared/types';
import { useToast } from 'twenty-ui/primitives/feedback';
import {
+ DeleteCoreWorkflowVersionStepDocument,
type DeleteWorkflowVersionStepInput,
type DeleteWorkflowVersionStepMutation,
type DeleteWorkflowVersionStepMutationVariables,
@@ -14,6 +18,12 @@ import {
export const useDeleteWorkflowVersionStep = () => {
const apolloCoreClient = useApolloCoreClient();
+ const isCore = useIsWorkflowCoreEnabled();
+ const handleCoreMutationError = useWorkflowEditorMutationErrorHandler();
+ const [mutateCore] = useMutation(DeleteCoreWorkflowVersionStepDocument, {
+ client: apolloCoreClient,
+ onError: handleCoreMutationError,
+ });
const { applyWorkflowVersionStepChanges } =
useApplyWorkflowVersionStepChanges();
@@ -34,19 +44,26 @@ export const useDeleteWorkflowVersionStep = () => {
const deleteWorkflowVersionStep = async (
input: DeleteWorkflowVersionStepInput,
) => {
- const result = await mutate({
- variables: { input },
- awaitRefetchQueries: true,
- refetchQueries: [
- {
- query: findOneWorkflowVersionQuery,
- variables: { objectRecordId: input.workflowVersionId },
- },
- ],
- onError: (error) => {
- enqueueToast(getToastOptionsFromError({ error }));
- },
- });
+ const { workflowVersionId, ...stepInput } = input;
+ const result = isCore
+ ? await mutateCore({
+ variables: {
+ input: { ...stepInput, coreWorkflowVersionId: workflowVersionId },
+ },
+ })
+ : await mutate({
+ variables: { input },
+ awaitRefetchQueries: true,
+ refetchQueries: [
+ {
+ query: findOneWorkflowVersionQuery,
+ variables: { objectRecordId: input.workflowVersionId },
+ },
+ ],
+ onError: (error) => {
+ enqueueToast(getToastOptionsFromError({ error }));
+ },
+ });
const workflowVersionStepChanges = result?.data?.deleteWorkflowVersionStep;
@@ -55,6 +72,10 @@ export const useDeleteWorkflowVersionStep = () => {
workflowVersionId: input.workflowVersionId,
});
+ if (isCore) {
+ await invalidateCoreWorkflowVersions(apolloCoreClient);
+ }
+
return workflowVersionStepChanges;
};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useDuplicateWorkflowVersionStep.ts b/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useDuplicateWorkflowVersionStep.ts
index 4c65b550fd6..5012f76035d 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useDuplicateWorkflowVersionStep.ts
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useDuplicateWorkflowVersionStep.ts
@@ -1,10 +1,14 @@
import { getToastOptionsFromError } from '@/error-handler/utils/getToastOptionsFromError';
+import { useWorkflowEditorMutationErrorHandler } from '@/workflow/hooks/useWorkflowEditorMutationErrorHandler';
+import { invalidateCoreWorkflowVersions } from '@/object-core/workflows/versions/utils/invalidateCoreWorkflowVersions';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
import { DUPLICATE_WORKFLOW_VERSION_STEP } from '@/workflow/graphql/mutations/duplicateWorkflowVersionStep';
import { useApplyWorkflowVersionStepChanges } from '@/workflow/workflow-steps/hooks/useApplyWorkflowVersionStepChanges';
import { useMutation } from '@apollo/client/react';
import { useToast } from 'twenty-ui/primitives/feedback';
import {
+ DuplicateCoreWorkflowVersionStepDocument,
type DuplicateWorkflowVersionStepInput,
type DuplicateWorkflowVersionStepMutation,
type DuplicateWorkflowVersionStepMutationVariables,
@@ -12,6 +16,12 @@ import {
export const useDuplicateWorkflowVersionStep = () => {
const apolloCoreClient = useApolloCoreClient();
+ const isCore = useIsWorkflowCoreEnabled();
+ const handleCoreMutationError = useWorkflowEditorMutationErrorHandler();
+ const [mutateCore] = useMutation(DuplicateCoreWorkflowVersionStepDocument, {
+ client: apolloCoreClient,
+ onError: handleCoreMutationError,
+ });
const { applyWorkflowVersionStepChanges } =
useApplyWorkflowVersionStepChanges();
@@ -28,12 +38,19 @@ export const useDuplicateWorkflowVersionStep = () => {
const duplicateWorkflowVersionStep = async (
input: DuplicateWorkflowVersionStepInput,
) => {
- const result = await mutate({
- variables: { input },
- onError: (error) => {
- enqueueToast(getToastOptionsFromError({ error }));
- },
- });
+ const { workflowVersionId, ...stepInput } = input;
+ const result = isCore
+ ? await mutateCore({
+ variables: {
+ input: { ...stepInput, coreWorkflowVersionId: workflowVersionId },
+ },
+ })
+ : await mutate({
+ variables: { input },
+ onError: (error) => {
+ enqueueToast(getToastOptionsFromError({ error }));
+ },
+ });
const workflowVersionStepChanges =
result?.data?.duplicateWorkflowVersionStep;
@@ -43,6 +60,10 @@ export const useDuplicateWorkflowVersionStep = () => {
workflowVersionId: input.workflowVersionId,
});
+ if (isCore) {
+ await invalidateCoreWorkflowVersions(apolloCoreClient);
+ }
+
return result;
};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useUpdateWorkflowVersionStep.ts b/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useUpdateWorkflowVersionStep.ts
index a99b67946ea..f81ceb6469b 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useUpdateWorkflowVersionStep.ts
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/useUpdateWorkflowVersionStep.ts
@@ -1,4 +1,6 @@
import { getToastOptionsFromError } from '@/error-handler/utils/getToastOptionsFromError';
+import { useWorkflowEditorMutationErrorHandler } from '@/workflow/hooks/useWorkflowEditorMutationErrorHandler';
+import { invalidateCoreWorkflowVersions } from '@/object-core/workflows/versions/utils/invalidateCoreWorkflowVersions';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
@@ -6,6 +8,7 @@ import { useGetRecordFromCache } from '@/object-record/cache/hooks/useGetRecordF
import { updateRecordFromCache } from '@/object-record/cache/utils/updateRecordFromCache';
import { useObjectPermissions } from '@/object-record/hooks/useObjectPermissions';
import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSetAtomComponentState';
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
import { UPDATE_WORKFLOW_VERSION_STEP } from '@/workflow/graphql/mutations/updateWorkflowVersionStep';
import { flowComponentState } from '@/workflow/states/flowComponentState';
import {
@@ -18,6 +21,7 @@ import { CoreObjectNameSingular } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/primitives/feedback';
import {
+ UpdateCoreWorkflowVersionStepDocument,
type UpdateWorkflowVersionStepInput,
type UpdateWorkflowVersionStepMutation,
type UpdateWorkflowVersionStepMutationVariables,
@@ -25,6 +29,13 @@ import {
export const useUpdateWorkflowVersionStep = (instanceId?: string) => {
const apolloCoreClient = useApolloCoreClient();
+ const isCore = useIsWorkflowCoreEnabled();
+ const handleCoreMutationError =
+ useWorkflowEditorMutationErrorHandler(instanceId);
+ const [mutateCore] = useMutation(UpdateCoreWorkflowVersionStepDocument, {
+ client: apolloCoreClient,
+ onError: handleCoreMutationError,
+ });
const { objectMetadataItems } = useObjectMetadataItems();
const { objectPermissionsByObjectMetadataId } = useObjectPermissions();
const { enqueueToast } = useToast();
@@ -47,12 +58,19 @@ export const useUpdateWorkflowVersionStep = (instanceId?: string) => {
const updateWorkflowVersionStep = async (
input: UpdateWorkflowVersionStepInput,
) => {
- const result = await mutate({
- variables: { input },
- onError: (error) => {
- enqueueToast(getToastOptionsFromError({ error }));
- },
- });
+ const { workflowVersionId, ...stepInput } = input;
+ const result = isCore
+ ? await mutateCore({
+ variables: {
+ input: { ...stepInput, coreWorkflowVersionId: workflowVersionId },
+ },
+ })
+ : await mutate({
+ variables: { input },
+ onError: (error) => {
+ enqueueToast(getToastOptionsFromError({ error }));
+ },
+ });
const updatedStep = result?.data?.updateWorkflowVersionStep;
if (!isDefined(updatedStep)) {
return;
@@ -77,6 +95,11 @@ export const useUpdateWorkflowVersionStep = (instanceId?: string) => {
};
});
+ if (isCore) {
+ await invalidateCoreWorkflowVersions(apolloCoreClient);
+ return result;
+ }
+
const cachedRecord = getRecordFromCache<WorkflowVersion>(
input.workflowVersionId,
);
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormFiller.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormFiller.tsx
index 46a5f28029e..5aff49d94a6 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormFiller.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormFiller.tsx
@@ -76,6 +76,8 @@ export const WorkflowEditActionFormFiller = ({
}, 1_000);
const onSubmit = async () => {
+ await saveAction.flush();
+
const response = formData.reduce(
(acc, field) => {
acc[field.name] = field.value;
diff --git a/packages/twenty-front/src/modules/workflow/workflow-trigger/hooks/useUpdateWorkflowVersionTrigger.ts b/packages/twenty-front/src/modules/workflow/workflow-trigger/hooks/useUpdateWorkflowVersionTrigger.ts
index 692f1d1cd82..5c0e6ddc021 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-trigger/hooks/useUpdateWorkflowVersionTrigger.ts
+++ b/packages/twenty-front/src/modules/workflow/workflow-trigger/hooks/useUpdateWorkflowVersionTrigger.ts
@@ -1,4 +1,6 @@
import { getToastOptionsFromError } from '@/error-handler/utils/getToastOptionsFromError';
+import { useWorkflowEditorMutationErrorHandler } from '@/workflow/hooks/useWorkflowEditorMutationErrorHandler';
+import { invalidateCoreWorkflowVersions } from '@/object-core/workflows/versions/utils/invalidateCoreWorkflowVersions';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
@@ -8,6 +10,7 @@ import { useObjectPermissions } from '@/object-record/hooks/useObjectPermissions
import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSetAtomComponentState';
import { UPDATE_WORKFLOW_VERSION_TRIGGER } from '@/workflow/graphql/mutations/updateWorkflowVersionTrigger';
import { useGetUpdatableWorkflowVersionOrThrow } from '@/workflow/hooks/useGetUpdatableWorkflowVersionOrThrow';
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
import { flowComponentState } from '@/workflow/states/flowComponentState';
import {
type WorkflowTrigger,
@@ -20,12 +23,20 @@ import { isDefined } from 'twenty-shared/utils';
import { TRIGGER_STEP_ID } from 'twenty-shared/workflow';
import { useToast } from 'twenty-ui/primitives/feedback';
import {
+ UpdateCoreWorkflowVersionTriggerDocument,
type UpdateWorkflowVersionTriggerMutation,
type UpdateWorkflowVersionTriggerMutationVariables,
} from '~/generated/graphql';
export const useUpdateWorkflowVersionTrigger = (instanceId?: string) => {
const apolloCoreClient = useApolloCoreClient();
+ const isCore = useIsWorkflowCoreEnabled();
+ const handleCoreMutationError =
+ useWorkflowEditorMutationErrorHandler(instanceId);
+ const [mutateCore] = useMutation(UpdateCoreWorkflowVersionTriggerDocument, {
+ client: apolloCoreClient,
+ onError: handleCoreMutationError,
+ });
const { objectMetadataItems } = useObjectMetadataItems();
const { objectPermissionsByObjectMetadataId } = useObjectPermissions();
const { enqueueToast } = useToast();
@@ -54,17 +65,26 @@ export const useUpdateWorkflowVersionTrigger = (instanceId?: string) => {
const updateTrigger = async (updatedTrigger: WorkflowTrigger) => {
const workflowVersionId = await getUpdatableWorkflowVersion();
- const { data } = await mutate({
- variables: {
- input: {
- workflowVersionId,
- trigger: updatedTrigger,
- },
- },
- onError: (error) => {
- enqueueToast(getToastOptionsFromError({ error }));
- },
- });
+ const { data } = isCore
+ ? await mutateCore({
+ variables: {
+ input: {
+ coreWorkflowVersionId: workflowVersionId,
+ trigger: updatedTrigger,
+ },
+ },
+ })
+ : await mutate({
+ variables: {
+ input: {
+ workflowVersionId,
+ trigger: updatedTrigger,
+ },
+ },
+ onError: (error) => {
+ enqueueToast(getToastOptionsFromError({ error }));
+ },
+ });
if (!isDefined(data?.updateWorkflowVersionTrigger)) {
return;
@@ -83,6 +103,11 @@ export const useUpdateWorkflowVersionTrigger = (instanceId?: string) => {
return { ...currentFlow, workflowVersionId, trigger: updatedTrigger };
});
+ if (isCore) {
+ await invalidateCoreWorkflowVersions(apolloCoreClient);
+ return;
+ }
+
const cachedRecord = getRecordFromCache<WorkflowVersion>(workflowVersionId);
if (!isDefined(cachedRecord)) {
return;
diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/hooks/__tests__/useStepsOutputSchema.test.tsx b/packages/twenty-front/src/modules/workflow/workflow-variables/hooks/__tests__/useStepsOutputSchema.test.tsx
new file mode 100644
index 00000000000..4db24620430
--- /dev/null
+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/hooks/__tests__/useStepsOutputSchema.test.tsx
@@ -0,0 +1,109 @@
+import { act, renderHook, waitFor } from '@testing-library/react';
+import { createStore, Provider } from 'jotai';
+import { type ReactNode } from 'react';
+import { type WorkflowVersion } from '@/workflow/types/Workflow';
+import { getStepOutputSchemaFamilyStateKey } from '@/workflow/utils/getStepOutputSchemaFamilyStateKey';
+import { useStepsOutputSchema } from '@/workflow/workflow-variables/hooks/useStepsOutputSchema';
+import { stepsOutputSchemaFamilyState } from '@/workflow/workflow-variables/states/stepsOutputSchemaFamilyState';
+
+const mockMutate = jest.fn();
+const mockClient = { mutate: mockMutate };
+const mockEnqueueToast = jest.fn();
+jest.mock('@/workflow/hooks/useIsWorkflowCoreEnabled', () => ({
+ useIsWorkflowCoreEnabled: () => true,
+}));
+jest.mock('@/object-metadata/hooks/useApolloCoreClient', () => ({
+ useApolloCoreClient: () => mockClient,
+}));
+jest.mock('twenty-ui/primitives/feedback', () => ({
+ ...jest.requireActual('twenty-ui/primitives/feedback'),
+ useToast: () => ({ enqueueToast: mockEnqueueToast }),
+}));
+
+const version: WorkflowVersion = {
+ __typename: 'WorkflowVersion',
+ id: 'core-version',
+ workflowId: 'core-workflow',
+ name: 'v1',
+ status: 'DRAFT',
+ createdAt: '2026-09-16T00:00:00Z',
+ updatedAt: '2026-09-16T00:00:00Z',
+ trigger: null,
+ steps: [
+ {
+ id: 'iterator',
+ name: 'Loop',
+ valid: true,
+ type: 'ITERATOR',
+ settings: {
+ input: { items: ['item'] },
+ outputSchema: {},
+ errorHandlingOptions: {
+ retryOnFailure: { value: 0 },
+ continueOnFailure: { value: false },
+ },
+ },
+ },
+ ],
+};
+const outputSchema = {
+ currentItem: { isLeaf: true, type: 'string', label: 'Item', value: 'item' },
+};
+
+const renderSchemas = () => {
+ const store = createStore();
+ const wrapper = ({ children }: { children: ReactNode }) => (
+ <Provider store={store}>{children}</Provider>
+ );
+ const hook = renderHook(() => useStepsOutputSchema(), { wrapper });
+ const schemaState = stepsOutputSchemaFamilyState.atomFamily(
+ getStepOutputSchemaFamilyStateKey(version.id, 'iterator'),
+ );
+ return { ...hook, store, schemaState };
+};
+
+describe('core iterator output schema', () => {
+ beforeEach(() => jest.clearAllMocks());
+
+ it('computes the iterator schema with the core version context', async () => {
+ mockMutate.mockResolvedValue({
+ data: { computeStepOutputSchema: outputSchema },
+ });
+ const { result, store, schemaState } = renderSchemas();
+ act(() => result.current.populateStepsOutputSchema(version));
+ await waitFor(() =>
+ expect(store.get(schemaState)?.outputSchema).toEqual(outputSchema),
+ );
+ expect(mockMutate).toHaveBeenCalledWith(
+ expect.objectContaining({
+ variables: {
+ input: {
+ coreWorkflowVersionId: 'core-version',
+ step: version.steps?.[0],
+ },
+ },
+ }),
+ );
+ });
+
+ it('ignores a schema response after the step was deleted', async () => {
+ let resolveRequest: (value: unknown) => void = () => {};
+ mockMutate.mockReturnValue(
+ new Promise((resolve) => {
+ resolveRequest = resolve;
+ }),
+ );
+ const { result, store, schemaState } = renderSchemas();
+ act(() => result.current.populateStepsOutputSchema(version));
+ act(() =>
+ result.current.deleteStepsOutputSchema({
+ workflowVersionId: version.id,
+ stepIds: ['iterator'],
+ }),
+ );
+ await act(async () => {
+ resolveRequest({ data: { computeStepOutputSchema: outputSchema } });
+ });
+ expect(store.get(schemaState)).toBeNull();
+ });
+});
diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/hooks/useStepsOutputSchema.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/hooks/useStepsOutputSchema.ts
index 23f769e60c7..7fce0fa7441 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-variables/hooks/useStepsOutputSchema.ts
+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/hooks/useStepsOutputSchema.ts
@@ -1,3 +1,8 @@
+import { getToastOptionsFromError } from '@/error-handler/utils/getToastOptionsFromError';
+import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
+import { ComputeStepOutputSchemaDocument } from '~/generated/graphql';
+import { isBaseOutputSchemaV2, TRIGGER_STEP_ID } from 'twenty-shared/workflow';
import { objectMetadataItemsSelector } from '@/object-metadata/states/objectMetadataItemsSelector';
import { type WorkflowVersion } from '@/workflow/types/Workflow';
import { getStepOutputSchemaFamilyStateKey } from '@/workflow/utils/getStepOutputSchemaFamilyStateKey';
@@ -18,10 +23,13 @@ import { resolvePersistedStepOutputSchema } from '@/workflow/workflow-variables/
import { useStore } from 'jotai';
import { useCallback } from 'react';
import { isDefined } from 'twenty-shared/utils';
-import { TRIGGER_STEP_ID } from 'twenty-shared/workflow';
+import { useToast } from 'twenty-ui/primitives/feedback';
export const useStepsOutputSchema = () => {
const store = useStore();
+ const client = useApolloCoreClient();
+ const isCore = useIsWorkflowCoreEnabled();
+ const { enqueueToast } = useToast();
const populateStepsOutputSchema = useCallback(
(workflowVersion: WorkflowVersion) => {
@@ -73,6 +81,30 @@ export const useStepsOutputSchema = () => {
shouldRecomputeOutputSchemaFamilyState.atomFamily(stepKey),
false,
);
+
+ if (isCore && step.type === 'ITERATOR') {
+ void client
+ .mutate({
+ mutation: ComputeStepOutputSchemaDocument,
+ variables: {
+ input: { coreWorkflowVersionId: workflowVersion.id, step },
+ },
+ })
+ .then(({ data }) => {
+ const outputSchema = data?.computeStepOutputSchema;
+ const schemaState =
+ stepsOutputSchemaFamilyState.atomFamily(stepKey);
+ if (
+ store.get(schemaState) === stepOutputSchema &&
+ isBaseOutputSchemaV2(outputSchema)
+ ) {
+ store.set(schemaState, { ...stepOutputSchema, outputSchema });
+ }
+ })
+ .catch((error: Error) => {
+ enqueueToast(getToastOptionsFromError({ error }));
+ });
+ }
});
const trigger = workflowVersion.trigger;
@@ -127,7 +159,7 @@ export const useStepsOutputSchema = () => {
);
}
},
- [store],
+ [store, client, isCore, enqueueToast],
);
const markStepForRecomputation = useCallback(
diff --git a/packages/twenty-front/src/modules/workflow/workflow-version/hooks/useTidyUpWorkflowVersion.ts b/packages/twenty-front/src/modules/workflow/workflow-version/hooks/useTidyUpWorkflowVersion.ts
index 45a191ac50a..423c0f81602 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-version/hooks/useTidyUpWorkflowVersion.ts
+++ b/packages/twenty-front/src/modules/workflow/workflow-version/hooks/useTidyUpWorkflowVersion.ts
@@ -1,11 +1,14 @@
-import { type WorkflowVersion } from '@/workflow/types/Workflow';
-import { type WorkflowDiagram } from '@/workflow/workflow-diagram/types/WorkflowDiagram';
-import { useMutation } from '@apollo/client/react';
-import { isDefined } from 'twenty-shared/utils';
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
+import { invalidateCoreWorkflowVersions } from '@/object-core/workflows/versions/utils/invalidateCoreWorkflowVersions';
import {
+ UpdateCoreWorkflowVersionPositionsDocument,
type UpdateWorkflowVersionPositionsMutation,
type UpdateWorkflowVersionPositionsMutationVariables,
} from '~/generated/graphql';
+import { type WorkflowVersion } from '@/workflow/types/Workflow';
+import { type WorkflowDiagram } from '@/workflow/workflow-diagram/types/WorkflowDiagram';
+import { useMutation } from '@apollo/client/react';
+import { isDefined } from 'twenty-shared/utils';
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
@@ -21,6 +24,10 @@ import { UPDATE_WORKFLOW_VERSION_POSITIONS } from '@/workflow/workflow-version/g
export const useTidyUpWorkflowVersion = (instanceId?: string) => {
const apolloCoreClient = useApolloCoreClient();
+ const isCore = useIsWorkflowCoreEnabled();
+ const [mutateCore] = useMutation(UpdateCoreWorkflowVersionPositionsDocument, {
+ client: apolloCoreClient,
+ });
const { objectMetadataItems } = useObjectMetadataItems();
const { objectPermissionsByObjectMetadataId } = useObjectPermissions();
@@ -43,7 +50,15 @@ export const useTidyUpWorkflowVersion = (instanceId?: string) => {
workflowVersionId: string,
positions: { id: string; position: { x: number; y: number } }[],
) => {
- await mutate({ variables: { input: { workflowVersionId, positions } } });
+ if (isCore) {
+ await mutateCore({
+ variables: {
+ input: { coreWorkflowVersionId: workflowVersionId, positions },
+ },
+ });
+ } else {
+ await mutate({ variables: { input: { workflowVersionId, positions } } });
+ }
setFlow((currentFlow) => {
if (!isDefined(currentFlow)) {
@@ -77,6 +92,11 @@ export const useTidyUpWorkflowVersion = (instanceId?: string) => {
};
});
+ if (isCore) {
+ await invalidateCoreWorkflowVersions(apolloCoreClient);
+ return;
+ }
+
const cachedRecord = getRecordFromCache<WorkflowVersion>(workflowVersionId);
if (!isDefined(cachedRecord)) {
diff --git a/packages/twenty-front/src/modules/workflow/workflow-version/hooks/useWorkflowVersionContent.ts b/packages/twenty-front/src/modules/workflow/workflow-version/hooks/useWorkflowVersionContent.ts
index b1c6d51bc7d..0739d48904c 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-version/hooks/useWorkflowVersionContent.ts
+++ b/packages/twenty-front/src/modules/workflow/workflow-version/hooks/useWorkflowVersionContent.ts
@@ -1,3 +1,6 @@
+import { useMemo } from 'react';
+import { GetCoreWorkflowVersionDocument } from '~/generated/graphql';
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
import { useQuery } from '@apollo/client/react';
import { isDefined } from 'twenty-shared/utils';
@@ -13,18 +16,39 @@ export type WorkflowVersionContent = {
export const useWorkflowVersionContent = (workflowVersionId?: string) => {
const apolloCoreClient = useApolloCoreClient();
+ const isCore = useIsWorkflowCoreEnabled();
+ const core = useQuery(GetCoreWorkflowVersionDocument, {
+ client: apolloCoreClient,
+ variables: { coreWorkflowVersionId: workflowVersionId ?? '' },
+ fetchPolicy: 'cache-and-network',
+ skip: !isCore || !isDefined(workflowVersionId),
+ });
+ const coreContent = useMemo(() => {
+ const version = core.data?.coreWorkflowVersion;
+ return isDefined(version)
+ ? {
+ workflowVersionId: version.id,
+ trigger: version.trigger,
+ steps: version.steps,
+ }
+ : undefined;
+ }, [core.data]);
const { data, loading, refetch } = useQuery<{
workflowVersionContent: WorkflowVersionContent;
}>(GET_WORKFLOW_VERSION_CONTENT, {
client: apolloCoreClient,
variables: { workflowVersionId },
- skip: !isDefined(workflowVersionId),
+ skip: isCore || !isDefined(workflowVersionId),
});
return {
- content: data?.workflowVersionContent,
- loading,
- refetchContent: refetch,
+ content: isCore ? coreContent : data?.workflowVersionContent,
+ loading: isCore ? core.loading : loading,
+ refetchContent: isCore ? core.refetch : refetch,
+ contentUpdatedAt: isCore
+ ? core.data?.coreWorkflowVersion?.updatedAt
+ : undefined,
+ error: core.error,
};
};
diff --git a/packages/twenty-front/src/pages/object-core/WorkflowCoreIndexPage.tsx b/packages/twenty-front/src/pages/object-core/WorkflowCoreIndexPage.tsx
index 40ad04dfaa3..6e083484478 100644
--- a/packages/twenty-front/src/pages/object-core/WorkflowCoreIndexPage.tsx
+++ b/packages/twenty-front/src/pages/object-core/WorkflowCoreIndexPage.tsx
@@ -12,9 +12,7 @@ import { CommandMenuComponentInstanceContext } from '@/command-menu/states/conte
import { PinnedCommandMenuItemButtons } from '@/command-menu-item/display/components/PinnedCommandMenuItemButtons';
import { CommandMenuItemContainerType } from '@/command-menu-item/types/CommandMenuItemContainerType';
import { CoreObjectTable } from '@/object-core/components/CoreObjectTable';
-import { useListenToObjectRecordOperationBrowserEvent } from '@/browser-event/hooks/useListenToObjectRecordOperationBrowserEvent';
import { CoreObjectTableAddNewRow } from '@/object-core/components/CoreObjectTableAddNewRow';
-import { getDeletedRecordIdsFromOperation } from '@/object-core/utils/getDeletedRecordIdsFromOperation';
import { useCoreWorkflowsSelection } from '@/object-core/workflows/hooks/useCoreWorkflowsSelection';
import { useCreateCoreWorkflow } from '@/object-core/workflows/hooks/useCreateCoreWorkflow';
import { coreWorkflowsFilterSettingsState } from '@/object-core/workflows/states/coreWorkflowsFilterSettingsState';
@@ -48,12 +46,7 @@ const StyledFetchMoreSentinel = styled.div`
`;
const getCoreWorkflowLink = (workflow: CoreWorkflow) =>
- isDefined(workflow.workspaceWorkflowId)
- ? getAppPath(AppPath.RecordShowPage, {
- objectNameSingular: CoreObjectNameSingular.Workflow,
- objectRecordId: workflow.workspaceWorkflowId,
- })
- : undefined;
+ getAppPath(AppPath.WorkflowCoreShowPage, { coreWorkflowId: workflow.id });
export const WorkflowCoreIndexPage = () => {
const tableId = useWorkspaceSurfaceScopedComponentInstanceId(
@@ -72,22 +65,8 @@ export const WorkflowCoreIndexPage = () => {
const { createCoreWorkflow, canCreateCoreWorkflow, isCreatingCoreWorkflow } =
useCreateCoreWorkflow();
- const {
- displayedCoreWorkflows,
- selectedRowIds,
- toggleRow,
- selectRows,
- forgetDeletedWorkspaceWorkflows,
- } = useCoreWorkflowsSelection({ coreWorkflows });
-
- useListenToObjectRecordOperationBrowserEvent({
- objectMetadataItemId: objectMetadataItem.id,
- operationTypes: ['delete-one', 'delete-many'],
- onObjectRecordOperationBrowserEvent: (detail) =>
- forgetDeletedWorkspaceWorkflows(
- getDeletedRecordIdsFromOperation(detail.operation),
- ),
- });
+ const { displayedCoreWorkflows, selectedRowIds, toggleRow, selectRows } =
+ useCoreWorkflowsSelection({ coreWorkflows });
const coreWorkflowsFilterSettings = useAtomStateValue(
coreWorkflowsFilterSettingsState,
@@ -185,8 +164,6 @@ export const WorkflowCoreIndexPage = () => {
selectedRowIds,
onToggleRow: toggleRow,
onToggleAllRows: selectRows,
- isItemSelectable: (coreWorkflow) =>
- isDefined(coreWorkflow.workspaceWorkflowId),
}}
/>
{canCreateCoreWorkflow && (
diff --git a/packages/twenty-front/src/pages/object-core/WorkflowCoreObjectShowPage.tsx b/packages/twenty-front/src/pages/object-core/WorkflowCoreObjectShowPage.tsx
new file mode 100644
index 00000000000..60ea11718d1
--- /dev/null
+++ b/packages/twenty-front/src/pages/object-core/WorkflowCoreObjectShowPage.tsx
@@ -0,0 +1,10 @@
+import { type CoreObjectShowPageProps } from '@/object-core/types/CoreObjectShowPageProps';
+import { WorkspaceWorkflowRedirect } from '@/object-core/workflows/components/WorkspaceWorkflowRedirect';
+
+type WorkflowCoreObjectShowPageProps = CoreObjectShowPageProps;
+
+export const WorkflowCoreObjectShowPage = ({
+ objectRecordId,
+}: WorkflowCoreObjectShowPageProps) => (
+ <WorkspaceWorkflowRedirect workspaceWorkflowId={objectRecordId} />
+);
diff --git a/packages/twenty-front/src/pages/object-core/WorkflowCoreShowPage.tsx b/packages/twenty-front/src/pages/object-core/WorkflowCoreShowPage.tsx
index 0fdff7e8653..15cf09c840b 100644
--- a/packages/twenty-front/src/pages/object-core/WorkflowCoreShowPage.tsx
+++ b/packages/twenty-front/src/pages/object-core/WorkflowCoreShowPage.tsx
@@ -1,46 +1,217 @@
+import { CoreWorkflowEditor } from '@/object-core/workflows/components/CoreWorkflowEditor';
+import { CoreWorkflowShowToolbar } from '@/object-core/workflows/components/CoreWorkflowShowToolbar';
+import { CoreWorkflowToWorkspaceRedirect } from '@/object-core/workflows/components/CoreWorkflowToWorkspaceRedirect';
+import { useRenameCoreWorkflow } from '@/object-core/workflows/hooks/useRenameCoreWorkflow';
+import { useValidateCoreWorkflowVersion } from '@/object-core/workflows/hooks/useValidateCoreWorkflowVersion';
+import { styled } from '@linaria/react';
+import { t } from '@lingui/core/macro';
+import { useState } from 'react';
+import { useParams, useSearchParams } from 'react-router-dom';
import { CoreObjectNameSingular } from 'twenty-shared/types';
+import { PermissionFlagType } from 'twenty-shared/constants';
+import { isDefined } from 'twenty-shared/utils';
+import { IconSettingsAutomation } from 'twenty-ui/icon';
+import { Loader } from 'twenty-ui/primitives/feedback';
+import { Button } from 'twenty-ui/primitives/input';
+import { WorkspaceRouteUnavailable } from '@/app/routing/components/WorkspaceRouteUnavailable';
+import { RecordShowCommandMenu } from '@/command-menu-item/components/RecordShowCommandMenu';
+import { CommandMenuComponentInstanceContext } from '@/command-menu/states/contexts/CommandMenuComponentInstanceContext';
import { useCoreWorkflowShowPageResource } from '@/object-core/workflows/hooks/useCoreWorkflowShowPageResource';
-import { type CoreObjectShowPageProps } from '@/object-core/types/CoreObjectShowPageProps';
-import { useRefetchCoreRecordOnWorkspaceRecordLifecycleChange } from '@/object-core/hooks/useRefetchCoreRecordOnWorkspaceRecordLifecycleChange';
-import { isCoreRecordAbsent } from '@/object-core/utils/isCoreRecordAbsent';
-import { RecordShowPageShell } from '@/object-record/record-show/components/RecordShowPageShell';
-import { useRecordShowPageResource } from '@/object-record/record-show/hooks/useRecordShowPageResource';
+import { useCoreWorkflowVersions } from '@/object-core/workflows/versions/hooks/useCoreWorkflowVersions';
+import { invalidateCoreWorkflowVersions } from '@/object-core/workflows/versions/utils/invalidateCoreWorkflowVersions';
+import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
+import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
+import { useObjectPermissionsForObject } from '@/object-record/hooks/useObjectPermissionsForObject';
+import { RecordShowPageResourceEffect } from '@/object-record/record-show/components/RecordShowPageResourceEffect';
+import { RecordShowContainerContextStoreTargetedRecordsEffect } from '@/object-record/record-show/components/RecordShowContainerContextStoreTargetedRecordsEffect';
+import { useHasPermissionFlag } from '@/settings/roles/hooks/useHasPermissionFlag';
+import { useSidePanelMenu } from '@/side-panel/hooks/useSidePanelMenu';
+import { SidePanelToggleButton } from '@/side-panel/components/SidePanelToggleButton';
+import { TextInput } from '@/ui/input/components/TextInput';
+import { PageCardHeader } from '@/ui/layout/page/components/PageCardHeader';
+import { PageCardLayout } from '@/ui/layout/page/components/PageCardLayout';
+import { PageTitle } from '@/ui/utilities/page-title/components/PageTitle';
+import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
+import { getWorkflowCurrentVersion } from '@/workflow/utils/getWorkflowCurrentVersion';
-type WorkflowCoreShowPageProps = CoreObjectShowPageProps;
+const StyledContainer = styled.div`
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+ min-height: 0;
+`;
-export const WorkflowCoreShowPage = ({
- objectRecordId,
-}: WorkflowCoreShowPageProps) => {
- const coreWorkflowResult = useCoreWorkflowShowPageResource({
- workspaceWorkflowId: objectRecordId,
+const CoreWorkflowShowContent = ({
+ coreWorkflowId,
+}: {
+ coreWorkflowId: string;
+}) => {
+ const client = useApolloCoreClient();
+ const { closeSidePanelMenu } = useSidePanelMenu();
+ const { record, loading, error } = useCoreWorkflowShowPageResource({
+ coreWorkflowId,
});
-
- useRefetchCoreRecordOnWorkspaceRecordLifecycleChange({
- objectNameSingular: CoreObjectNameSingular.Workflow,
- recordId: objectRecordId,
- refetch: coreWorkflowResult.refetch,
+ const versions = useCoreWorkflowVersions(coreWorkflowId);
+ const [searchParams, setSearchParams] = useSearchParams();
+ const [editedName, setEditedName] = useState<string>();
+ const requestedVersionId = searchParams.get('version');
+ const currentVersion = getWorkflowCurrentVersion(
+ versions.coreWorkflowVersions,
+ );
+ const selectedVersion = isDefined(requestedVersionId)
+ ? versions.coreWorkflowVersions.find(({ id }) => id === requestedVersionId)
+ : currentVersion;
+ const isReadOnlyVersion = isDefined(requestedVersionId);
+ const isHistoricalVersion =
+ isDefined(requestedVersionId) && selectedVersion?.id !== currentVersion?.id;
+ const { renameWorkflow } = useRenameCoreWorkflow({
+ coreWorkflowId,
+ currentName: record?.name,
});
+ const { validate, isValidating } = useValidateCoreWorkflowVersion(
+ selectedVersion?.id,
+ );
- const isCoreWorkflowAbsent = isCoreRecordAbsent(coreWorkflowResult);
-
- const workspaceResult = useRecordShowPageResource({
- objectNameSingular: CoreObjectNameSingular.Workflow,
- recordId: objectRecordId,
- skip: !isCoreWorkflowAbsent,
- });
+ const resource = (
+ <RecordShowPageResourceEffect
+ recordId={coreWorkflowId}
+ loading={loading}
+ record={isDefined(error) ? undefined : record}
+ />
+ );
- const { record, loading, error } = isCoreWorkflowAbsent
- ? workspaceResult
- : coreWorkflowResult;
+ if (
+ (loading && !isDefined(record)) ||
+ (versions.loading && versions.coreWorkflowVersions.length === 0)
+ ) {
+ return (
+ <>
+ {resource}
+ <Loader />
+ </>
+ );
+ }
+ if (isDefined(error) || isDefined(versions.error)) {
+ return (
+ <>
+ {resource}
+ <WorkspaceRouteUnavailable>
+ {t`Could not load this workflow.`}
+ <Button
+ title={t`Retry`}
+ onClick={() => invalidateCoreWorkflowVersions(client)}
+ />
+ </WorkspaceRouteUnavailable>
+ </>
+ );
+ }
+ if (!isDefined(record)) {
+ return (
+ <>
+ {resource}
+ <WorkspaceRouteUnavailable>{t`Workflow not found.`}</WorkspaceRouteUnavailable>
+ </>
+ );
+ }
return (
- <RecordShowPageShell
- objectNameSingular={CoreObjectNameSingular.Workflow}
- objectRecordId={objectRecordId}
- record={record}
- loading={loading}
- error={error}
+ <CommandMenuComponentInstanceContext.Provider
+ value={{ instanceId: `core-workflow-${coreWorkflowId}` }}
+ >
+ {resource}
+ <RecordShowContainerContextStoreTargetedRecordsEffect
+ recordId={coreWorkflowId}
+ />
+ <PageTitle title={record.name ?? t`Workflow`} />
+ <PageCardLayout
+ header={
+ <PageCardHeader
+ icon={<IconSettingsAutomation />}
+ title={
+ <TextInput
+ placeholder={t`Workflow name`}
+ value={editedName ?? record.name ?? ''}
+ onChange={setEditedName}
+ onBlur={async (event) => {
+ const name = event.target.value;
+ const didSave = await renameWorkflow(name);
+ if (didSave) {
+ setEditedName((currentName) =>
+ currentName === name ? undefined : currentName,
+ );
+ }
+ }}
+ />
+ }
+ actionButton={
+ <>
+ {!isReadOnlyVersion && <RecordShowCommandMenu />}
+ <SidePanelToggleButton />
+ </>
+ }
+ />
+ }
+ >
+ <StyledContainer>
+ <CoreWorkflowShowToolbar
+ coreWorkflowId={coreWorkflowId}
+ versions={versions.coreWorkflowVersions}
+ selectedVersionId={selectedVersion?.id}
+ isHistoricalVersion={isHistoricalVersion}
+ isValidating={isValidating}
+ onVersionChange={(versionId) => {
+ closeSidePanelMenu();
+ setSearchParams(
+ versionId === currentVersion?.id ? {} : { version: versionId },
+ );
+ }}
+ onValidate={validate}
+ onRefresh={() => invalidateCoreWorkflowVersions(client)}
+ />
+ {isDefined(selectedVersion) ? (
+ <CoreWorkflowEditor
+ key={selectedVersion.id}
+ coreWorkflowId={coreWorkflowId}
+ coreWorkflowVersionId={selectedVersion.id}
+ readonly={isReadOnlyVersion}
+ />
+ ) : (
+ <WorkspaceRouteUnavailable>{t`Workflow version not found.`}</WorkspaceRouteUnavailable>
+ )}
+ </StyledContainer>
+ </PageCardLayout>
+ </CommandMenuComponentInstanceContext.Provider>
+ );
+};
+
+export const WorkflowCoreShowPage = () => {
+ const { coreWorkflowId } = useParams<{ coreWorkflowId: string }>();
+ const isCore = useIsWorkflowCoreEnabled();
+ const canManageWorkflows = useHasPermissionFlag(PermissionFlagType.WORKFLOWS);
+ const { objectMetadataItem } = useObjectMetadataItem({
+ objectNameSingular: CoreObjectNameSingular.Workflow,
+ });
+ const workflowObjectPermissions = useObjectPermissionsForObject(
+ objectMetadataItem.id,
+ );
+ if (
+ !workflowObjectPermissions.canReadObjectRecords ||
+ (isCore && !canManageWorkflows)
+ ) {
+ return (
+ <WorkspaceRouteUnavailable>{t`You do not have permission to access workflows.`}</WorkspaceRouteUnavailable>
+ );
+ }
+ if (!isDefined(coreWorkflowId)) {
+ return <WorkspaceRouteUnavailable />;
+ }
+ return isCore ? (
+ <CoreWorkflowShowContent
+ key={coreWorkflowId}
+ coreWorkflowId={coreWorkflowId}
/>
+ ) : (
+ <CoreWorkflowToWorkspaceRedirect coreWorkflowId={coreWorkflowId} />
);
};
diff --git a/packages/twenty-front/src/pages/object-record/RecordShowPage.tsx b/packages/twenty-front/src/pages/object-record/RecordShowPage.tsx
index 6a0d91e265c..d4b4cbb7f3d 100644
--- a/packages/twenty-front/src/pages/object-record/RecordShowPage.tsx
+++ b/packages/twenty-front/src/pages/object-record/RecordShowPage.tsx
@@ -72,9 +72,9 @@ export const RecordShowPage = () => {
return <WorkspaceRouteUnavailable />;
}
- const CoreObjectShowPage = findCoreObjectShowPage(
- parameters.objectNameSingular,
- );
+ const CoreObjectShowPage = isWorkflowCoreIndexPageEnabled
+ ? findCoreObjectShowPage(parameters.objectNameSingular)
+ : undefined;
if (isDefined(CoreObjectShowPage) && isDefined(parameters.objectRecordId)) {
return <CoreObjectShowPage objectRecordId={parameters.objectRecordId} />;
diff --git a/packages/twenty-front/src/pages/object-record/__tests__/RecordShowPage.surface.test.tsx b/packages/twenty-front/src/pages/object-record/__tests__/RecordShowPage.surface.test.tsx
index 8528aabf764..2b572a32cdf 100644
--- a/packages/twenty-front/src/pages/object-record/__tests__/RecordShowPage.surface.test.tsx
+++ b/packages/twenty-front/src/pages/object-record/__tests__/RecordShowPage.surface.test.tsx
@@ -3,6 +3,11 @@ import { RecordShowPage } from '~/pages/object-record/RecordShowPage';
import { render, screen } from '@testing-library/react';
let mockObjectMetadataItems = [{ nameSingular: 'person' }];
+let mockParameters = {
+ objectNameSingular: 'person',
+ objectRecordId: 'record-1',
+};
+let mockIsWorkflowCoreIndexPageEnabled = false;
let mockRecordResource: {
record: { id: string } | undefined;
loading: boolean;
@@ -14,10 +19,20 @@ let mockRecordResource: {
};
jest.mock('react-router-dom', () => ({
- useParams: () => ({
- objectNameSingular: 'person',
- objectRecordId: 'record-1',
- }),
+ useParams: () => mockParameters,
+}));
+
+jest.mock('@/workspace/hooks/useIsFeatureEnabled', () => ({
+ useIsFeatureEnabled: () => mockIsWorkflowCoreIndexPageEnabled,
+}));
+
+jest.mock('@/object-core/utils/findCoreObjectShowPage', () => ({
+ findCoreObjectShowPage: (objectNameSingular: string) =>
+ objectNameSingular === 'workflow'
+ ? ({ objectRecordId }: { objectRecordId: string }) => (
+ <div data-testid="core-object-show-page">{objectRecordId}</div>
+ )
+ : undefined,
}));
jest.mock('@/object-record/record-show/hooks/useRecordShowPage', () => ({
@@ -118,6 +133,11 @@ jest.mock('@/side-panel/components/SidePanelToggleButton', () => ({
describe('RecordShowPage workspace surface composition', () => {
beforeEach(() => {
mockObjectMetadataItems = [{ nameSingular: 'person' }];
+ mockParameters = {
+ objectNameSingular: 'person',
+ objectRecordId: 'record-1',
+ };
+ mockIsWorkflowCoreIndexPageEnabled = false;
mockRecordResource = {
record: { id: 'record-1' },
loading: false,
@@ -125,6 +145,35 @@ describe('RecordShowPage workspace surface composition', () => {
};
});
+ it('delegates core-owned records through the generic core show page', () => {
+ mockParameters = {
+ objectNameSingular: 'workflow',
+ objectRecordId: 'workspace-workflow-1',
+ };
+ mockIsWorkflowCoreIndexPageEnabled = true;
+
+ render(<RecordShowPage />);
+
+ expect(screen.getByTestId('core-object-show-page')).toHaveTextContent(
+ 'workspace-workflow-1',
+ );
+ expect(screen.queryByTestId('record-renderer')).not.toBeInTheDocument();
+ });
+
+ it('keeps the workspace show page for core-owned records when the flag is disabled', () => {
+ mockParameters = {
+ objectNameSingular: 'workflow',
+ objectRecordId: 'workspace-workflow-1',
+ };
+
+ render(<RecordShowPage />);
+
+ expect(screen.getByTestId('record-renderer')).toBeInTheDocument();
+ expect(
+ screen.queryByTestId('core-object-show-page'),
+ ).not.toBeInTheDocument();
+ });
+
it('keeps the existing main-page chrome and canonical renderer', () => {
render(<RecordShowPage />);
diff --git a/packages/twenty-front/src/testing/decorators/WorkflowStepDecorator.tsx b/packages/twenty-front/src/testing/decorators/WorkflowStepDecorator.tsx
index 86818af44ca..e698f75b641 100644
--- a/packages/twenty-front/src/testing/decorators/WorkflowStepDecorator.tsx
+++ b/packages/twenty-front/src/testing/decorators/WorkflowStepDecorator.tsx
@@ -11,15 +11,20 @@ import { workflowSelectedNodeComponentState } from '@/workflow/workflow-diagram/
import { useStepsOutputSchema } from '@/workflow/workflow-variables/hooks/useStepsOutputSchema';
import { type Decorator } from '@storybook/react-vite';
import { useAtomValue, useStore } from 'jotai';
-import { useEffect, useState } from 'react';
+import { useEffect, useState, type ReactNode } from 'react';
import { isDefined } from 'twenty-shared/utils';
+import { ToastProvider } from 'twenty-ui/primitives/feedback';
import {
mockedWorkflow,
mockedWorkflowNodeId,
mockedWorkflowVersion,
} from '~/testing/mock-data/workflow';
-export const WorkflowStepDecorator: Decorator = (Story) => {
+type WorkflowStepDecoratorContentProps = { children: ReactNode };
+
+const WorkflowStepDecoratorContent = ({
+ children,
+}: WorkflowStepDecoratorContentProps) => {
const workflowVisualizerComponentInstanceId = 'workflow-visualizer-test-id';
const workflowVersion = mockedWorkflowVersion as WorkflowVersion;
@@ -103,8 +108,16 @@ export const WorkflowStepDecorator: Decorator = (Story) => {
instanceId: workflowVisualizerComponentInstanceId,
}}
>
- {ready && isDefined(workflowVersionId) && <Story />}
+ {ready && isDefined(workflowVersionId) && children}
</WorkflowVisualizerComponentInstanceContext.Provider>
</SidePanelPageComponentInstanceContext.Provider>
);
};
+
+export const WorkflowStepDecorator: Decorator = (Story) => (
+ <ToastProvider>
+ <WorkflowStepDecoratorContent>
+ <Story />
+ </WorkflowStepDecoratorContent>
+ </ToastProvider>
+);
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-42/2-42-instance-command-fast-1789730706712-core-workflow-command-menu-items.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-42/2-42-instance-command-fast-1789730706712-core-workflow-command-menu-items.ts
new file mode 100644
index 00000000000..b80bae4c192
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-42/2-42-instance-command-fast-1789730706712-core-workflow-command-menu-items.ts
@@ -0,0 +1,37 @@
+import { type QueryRunner } from 'typeorm';
+
+import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decorators/registered-instance-command.decorator';
+import { type FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
+
+const ENGINE_KEY_COHERENCE_CHECK_NAME =
+ 'CHK_CMD_MENU_ITEM_ENGINE_KEY_COHERENCE';
+
+@RegisteredInstanceCommand('2.42.0', 1789730706712)
+export class CoreWorkflowCommandMenuItemsFastInstanceCommand implements FastInstanceCommand {
+ async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(
+ `ALTER TABLE "core"."commandMenuItem" DROP CONSTRAINT IF EXISTS "${ENGINE_KEY_COHERENCE_CHECK_NAME}"`,
+ );
+ await queryRunner.query(`ALTER TABLE "core"."commandMenuItem" ADD CONSTRAINT "${ENGINE_KEY_COHERENCE_CHECK_NAME}" CHECK (("engineComponentKey" = 'TRIGGER_WORKFLOW_VERSION' AND ("workflowVersionId" IS NOT NULL OR "coreWorkflowVersionId" IS NOT NULL) AND "frontComponentId" IS NULL AND "payload" IS NULL AND "navigationTargetObjectMetadataId" IS NULL) OR ("engineComponentKey" = 'FRONT_COMPONENT_RENDERER' AND "frontComponentId" IS NOT NULL AND "workflowVersionId" IS NULL AND "coreWorkflowVersionId" IS NULL AND "payload" IS NULL AND "navigationTargetObjectMetadataId" IS NULL) OR ("engineComponentKey" = 'NAVIGATION' AND (("payload" IS NOT NULL AND "navigationTargetObjectMetadataId" IS NULL) OR ("payload" IS NULL AND "navigationTargetObjectMetadataId" IS NOT NULL)) AND "workflowVersionId" IS NULL AND "coreWorkflowVersionId" IS NULL AND "frontComponentId" IS NULL) OR ("engineComponentKey" NOT IN ('TRIGGER_WORKFLOW_VERSION', 'FRONT_COMPONENT_RENDERER', 'NAVIGATION') AND "workflowVersionId" IS NULL AND "coreWorkflowVersionId" IS NULL AND "frontComponentId" IS NULL AND "payload" IS NULL AND "navigationTargetObjectMetadataId" IS NULL))`);
+ }
+
+ async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ UPDATE "core"."commandMenuItem" AS item
+ SET "workflowVersionId" = version."workspaceWorkflowVersionId"
+ FROM "core"."workflowVersion" AS version
+ WHERE item."coreWorkflowVersionId" = version.id
+ AND item."workflowVersionId" IS NULL
+ AND version."workspaceWorkflowVersionId" IS NOT NULL
+ `);
+ await queryRunner.query(`
+ DELETE FROM "core"."commandMenuItem"
+ WHERE "engineComponentKey" = 'TRIGGER_WORKFLOW_VERSION'
+ AND "workflowVersionId" IS NULL
+ `);
+ await queryRunner.query(
+ `ALTER TABLE "core"."commandMenuItem" DROP CONSTRAINT IF EXISTS "${ENGINE_KEY_COHERENCE_CHECK_NAME}"`,
+ );
+ await queryRunner.query(`ALTER TABLE "core"."commandMenuItem" ADD CONSTRAINT "${ENGINE_KEY_COHERENCE_CHECK_NAME}" CHECK (("engineComponentKey" = 'TRIGGER_WORKFLOW_VERSION' AND "workflowVersionId" IS NOT NULL AND "frontComponentId" IS NULL AND "payload" IS NULL AND "navigationTargetObjectMetadataId" IS NULL) OR ("engineComponentKey" = 'FRONT_COMPONENT_RENDERER' AND "frontComponentId" IS NOT NULL AND "workflowVersionId" IS NULL AND "payload" IS NULL AND "navigationTargetObjectMetadataId" IS NULL) OR ("engineComponentKey" = 'NAVIGATION' AND (("payload" IS NOT NULL AND "navigationTargetObjectMetadataId" IS NULL) OR ("payload" IS NULL AND "navigationTargetObjectMetadataId" IS NOT NULL)) AND "workflowVersionId" IS NULL AND "frontComponentId" IS NULL) OR ("engineComponentKey" NOT IN ('TRIGGER_WORKFLOW_VERSION', 'FRONT_COMPONENT_RENDERER', 'NAVIGATION') AND "workflowVersionId" IS NULL AND "frontComponentId" IS NULL AND "payload" IS NULL AND "navigationTargetObjectMetadataId" IS NULL))`);
+ }
+}
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/instance-commands.constant.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/instance-commands.constant.ts
index a7e6985493a..4fe92ef4aa5 100644
--- a/packages/twenty-server/src/database/commands/upgrade-version-command/instance-commands.constant.ts
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/instance-commands.constant.ts
@@ -195,6 +195,7 @@ import { AddReadabilityParentFieldsToObjectMetadataFastInstanceCommand } from 's
import { AddAppMessageChannelTypeFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-41/2-41-instance-command-fast-1789395506192-add-app-message-channel-type';
import { AddAppMessageChannelUniqueHandleFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-41/2-41-instance-command-fast-1789418882171-add-app-message-channel-unique-handle';
import { AddWorkflowExecutionCompatibilityFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-42/2-42-instance-command-fast-1789719131000-add-workflow-execution-compatibility';
+import { CoreWorkflowCommandMenuItemsFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-42/2-42-instance-command-fast-1789730706712-core-workflow-command-menu-items';
export const INSTANCE_COMMANDS = [
AddViewFieldGroupIdIndexOnViewFieldFastInstanceCommand,
@@ -389,6 +390,7 @@ export const INSTANCE_COMMANDS = [
AddCoreVersionPointersFastInstanceCommand,
AddWorkspaceWorkflowVersionIdToWorkflowVersionFastInstanceCommand,
AddWorkflowExecutionCompatibilityFastInstanceCommand,
+ CoreWorkflowCommandMenuItemsFastInstanceCommand,
AddReadabilityParentFieldsToObjectMetadataFastInstanceCommand,
AddAppMessageChannelTypeFastInstanceCommand,
AddAppMessageChannelUniqueHandleFastInstanceCommand,
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/dtos/core-workflow-version.dto.ts b/packages/twenty-server/src/engine/core-modules/workflow/dtos/core-workflow-version.dto.ts
index f89fc5c7c4a..3b7d7ce9fd5 100644
--- a/packages/twenty-server/src/engine/core-modules/workflow/dtos/core-workflow-version.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/workflow/dtos/core-workflow-version.dto.ts
@@ -16,6 +16,9 @@ export class CoreWorkflowVersionDTO {
@Field(() => UUIDScalarType)
id: string;
+ @Field(() => UUIDScalarType, { nullable: true })
+ coreWorkflowId?: string | null;
+
@Field(() => String)
label: string;
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/dtos/core-workflow-with-current-version.dto.ts b/packages/twenty-server/src/engine/core-modules/workflow/dtos/core-workflow-with-current-version.dto.ts
new file mode 100644
index 00000000000..b10b57e4a67
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/workflow/dtos/core-workflow-with-current-version.dto.ts
@@ -0,0 +1,16 @@
+import { Field, ObjectType } from '@nestjs/graphql';
+
+import { CoreWorkflowVersionDTO } from 'src/engine/core-modules/workflow/dtos/core-workflow-version.dto';
+import { CoreWorkflowDTO } from 'src/engine/core-modules/workflow/dtos/core-workflow.dto';
+
+@ObjectType('CoreWorkflowWithCurrentVersionDTO')
+export class CoreWorkflowWithCurrentVersionDTO {
+ @Field(() => CoreWorkflowDTO)
+ workflow: CoreWorkflowDTO;
+
+ @Field(() => [CoreWorkflowVersionDTO])
+ versions: CoreWorkflowVersionDTO[];
+
+ @Field(() => CoreWorkflowVersionDTO)
+ currentVersion: CoreWorkflowVersionDTO;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/dtos/core-workflow.dto.ts b/packages/twenty-server/src/engine/core-modules/workflow/dtos/core-workflow.dto.ts
index dd9bc9b9dcd..5810566c367 100644
--- a/packages/twenty-server/src/engine/core-modules/workflow/dtos/core-workflow.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/workflow/dtos/core-workflow.dto.ts
@@ -21,6 +21,9 @@ export class CoreWorkflowDTO {
@Field(() => UUIDScalarType, { nullable: true })
lastPublishedVersionId: string | null;
+ @Field(() => UUIDScalarType, { nullable: true })
+ lastPublishedCoreWorkflowVersionId?: string | null;
+
@Field(() => UUIDScalarType, { nullable: true })
applicationId: string | null;
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/dtos/core-workflows-with-current-versions.input.ts b/packages/twenty-server/src/engine/core-modules/workflow/dtos/core-workflows-with-current-versions.input.ts
new file mode 100644
index 00000000000..f40d09b627c
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/workflow/dtos/core-workflows-with-current-versions.input.ts
@@ -0,0 +1,15 @@
+import { Field, InputType } from '@nestjs/graphql';
+
+import { ArrayMaxSize, ArrayNotEmpty, IsArray, IsUUID } from 'class-validator';
+
+import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
+
+@InputType()
+export class CoreWorkflowsWithCurrentVersionsInput {
+ @Field(() => [UUIDScalarType])
+ @IsArray()
+ @ArrayNotEmpty()
+ @ArrayMaxSize(500)
+ @IsUUID(undefined, { each: true })
+ coreWorkflowIds: string[];
+}
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/dtos/delete-core-workflows.input.ts b/packages/twenty-server/src/engine/core-modules/workflow/dtos/delete-core-workflows.input.ts
index 7046ec5e553..c38c620a843 100644
--- a/packages/twenty-server/src/engine/core-modules/workflow/dtos/delete-core-workflows.input.ts
+++ b/packages/twenty-server/src/engine/core-modules/workflow/dtos/delete-core-workflows.input.ts
@@ -10,6 +10,6 @@ export class DeleteCoreWorkflowsInput {
@IsArray()
@ArrayNotEmpty()
@ArrayMaxSize(500)
- @IsUUID('4', { each: true })
+ @IsUUID(undefined, { each: true })
coreWorkflowIds: string[];
}
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/dtos/deleted-core-workflow.dto.ts b/packages/twenty-server/src/engine/core-modules/workflow/dtos/deleted-core-workflow.dto.ts
index ab45ab01212..cd3a747a15e 100644
--- a/packages/twenty-server/src/engine/core-modules/workflow/dtos/deleted-core-workflow.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/workflow/dtos/deleted-core-workflow.dto.ts
@@ -7,6 +7,6 @@ export class DeletedCoreWorkflowDTO {
@Field(() => UUIDScalarType)
id: string;
- @Field(() => UUIDScalarType)
- workspaceWorkflowId: string;
+ @Field(() => UUIDScalarType, { nullable: true })
+ workspaceWorkflowId: string | null;
}
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/resolvers/core-workflow.resolver.ts b/packages/twenty-server/src/engine/core-modules/workflow/resolvers/core-workflow.resolver.ts
index 416daeccadf..9d47a100bba 100644
--- a/packages/twenty-server/src/engine/core-modules/workflow/resolvers/core-workflow.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/workflow/resolvers/core-workflow.resolver.ts
@@ -8,6 +8,8 @@ import { PreventNestToAutoLogGraphqlErrorsFilter } from 'src/engine/core-modules
import { ResolverValidationPipe } from 'src/engine/core-modules/graphql/pipes/resolver-validation.pipe';
import { CoreWorkflowConnectionDTO } from 'src/engine/core-modules/workflow/dtos/core-workflow-connection.dto';
import { CoreWorkflowDTO } from 'src/engine/core-modules/workflow/dtos/core-workflow.dto';
+import { CoreWorkflowWithCurrentVersionDTO } from 'src/engine/core-modules/workflow/dtos/core-workflow-with-current-version.dto';
+import { CoreWorkflowsWithCurrentVersionsInput } from 'src/engine/core-modules/workflow/dtos/core-workflows-with-current-versions.input';
import { CreateCoreWorkflowInput } from 'src/engine/core-modules/workflow/dtos/create-core-workflow.input';
import { DeletedCoreWorkflowDTO } from 'src/engine/core-modules/workflow/dtos/deleted-core-workflow.dto';
import { DeleteCoreWorkflowsInput } from 'src/engine/core-modules/workflow/dtos/delete-core-workflows.input';
@@ -159,6 +161,17 @@ export class CoreWorkflowResolver {
});
}
+ @Query(() => [CoreWorkflowWithCurrentVersionDTO])
+ async coreWorkflowsWithCurrentVersions(
+ @AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
+ @Args('input') { coreWorkflowIds }: CoreWorkflowsWithCurrentVersionsInput,
+ ): Promise<CoreWorkflowWithCurrentVersionDTO[]> {
+ return this.coreWorkflowListService.findManyWithCurrentVersions({
+ workspaceId,
+ coreWorkflowIds,
+ });
+ }
+
@Query(() => CoreWorkflowDTO, { nullable: true })
async coreWorkflow(
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/services/core-workflow-lifecycle.workspace-service.ts b/packages/twenty-server/src/engine/core-modules/workflow/services/core-workflow-lifecycle.workspace-service.ts
index 7a7f74d5779..b7b2e9435e1 100644
--- a/packages/twenty-server/src/engine/core-modules/workflow/services/core-workflow-lifecycle.workspace-service.ts
+++ b/packages/twenty-server/src/engine/core-modules/workflow/services/core-workflow-lifecycle.workspace-service.ts
@@ -689,10 +689,14 @@ export class CoreWorkflowLifecycleWorkspaceService {
});
const existingCommandMenuItem =
- await this.commandMenuItemService.findByWorkflowVersionId(
+ (await this.commandMenuItemService.findByCoreWorkflowVersionId(
+ resolved.coreWorkflowVersion.id,
+ workspaceId,
+ )) ??
+ (await this.commandMenuItemService.findByWorkflowVersionId(
resolved.workspaceWorkflowVersionId,
workspaceId,
- );
+ ));
if (isDefined(existingCommandMenuItem)) {
await this.commandMenuItemService.update(
@@ -739,10 +743,14 @@ export class CoreWorkflowLifecycleWorkspaceService {
}
const existingCommandMenuItem =
- await this.commandMenuItemService.findByWorkflowVersionId(
+ (await this.commandMenuItemService.findByCoreWorkflowVersionId(
+ resolved.coreWorkflowVersion.id,
+ workspaceId,
+ )) ??
+ (await this.commandMenuItemService.findByWorkflowVersionId(
resolved.workspaceWorkflowVersionId,
workspaceId,
- );
+ ));
if (isDefined(existingCommandMenuItem)) {
await this.commandMenuItemService.delete(
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/services/core-workflow-list.service.ts b/packages/twenty-server/src/engine/core-modules/workflow/services/core-workflow-list.service.ts
index e3b84dcbd3d..5fd05439667 100644
--- a/packages/twenty-server/src/engine/core-modules/workflow/services/core-workflow-list.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/workflow/services/core-workflow-list.service.ts
@@ -2,7 +2,7 @@ import { Injectable } from '@nestjs/common';
import { InjectDataSource } from '@nestjs/typeorm';
import { isDefined } from 'twenty-shared/utils';
-import { DataSource } from 'typeorm';
+import { DataSource, In } from 'typeorm';
import {
decodeCursor,
@@ -10,13 +10,22 @@ import {
} from 'src/engine/api/graphql/graphql-query-runner/utils/cursors.util';
import { type CoreWorkflowConnectionDTO } from 'src/engine/core-modules/workflow/dtos/core-workflow-connection.dto';
import { type CoreWorkflowDTO } from 'src/engine/core-modules/workflow/dtos/core-workflow.dto';
+import { type CoreWorkflowWithCurrentVersionDTO } from 'src/engine/core-modules/workflow/dtos/core-workflow-with-current-version.dto';
import {
CoreWorkflowOrderByDirection,
CoreWorkflowOrderByField,
type CoreWorkflowsArgs,
} from 'src/engine/core-modules/workflow/dtos/core-workflows.input';
import { buildCoreWorkflowFilterPredicate } from 'src/engine/core-modules/workflow/utils/build-core-workflow-filter-predicate.util';
+import { buildCoreWorkflowVersionLabel } from 'src/engine/core-modules/workflow/utils/build-core-workflow-version-label.util';
import { computeCoreWorkflowStatuses } from 'src/engine/core-modules/workflow/utils/compute-core-workflow-statuses.util';
+import { WorkflowEntity } from 'src/engine/core-modules/workflow/entities/workflow.entity';
+import {
+ WorkflowVersionEntity,
+ WorkflowVersionStatus,
+} from 'src/engine/core-modules/workflow/entities/workflow-version.entity';
+import { InjectWorkspaceScopedRepository } from 'src/engine/twenty-orm/workspace-scoped-repository/inject-workspace-scoped-repository.decorator';
+import { WorkspaceScopedRepository } from 'src/engine/twenty-orm/workspace-scoped-repository/workspace-scoped-repository';
type CoreWorkflowRow = {
createdAt: Date;
@@ -24,6 +33,7 @@ type CoreWorkflowRow = {
cursorSortValue: string | null;
name: string | null;
lastPublishedVersionId: string | null;
+ lastPublishedCoreWorkflowVersionId: string | null;
applicationId: string | null;
workspaceWorkflowId: string | null;
updatedAt: Date;
@@ -62,7 +72,7 @@ const GROUPED_WORKFLOW_COLUMNS = `c.id, c.name, c."createdAt", c."updatedAt"`;
const CORE_WORKFLOW_AGGREGATE_COLUMNS = `
c.name,
- c."lastPublishedVersionId",
+ c."lastPublishedVersionId", c."lastPublishedCoreWorkflowVersionId",
c."applicationId",
c."createdAt",
c."updatedAt",
@@ -79,6 +89,7 @@ const toCoreWorkflowDTO = (row: CoreWorkflowRow): CoreWorkflowDTO => ({
hasDeactivatedVersion: row.hasDeactivatedVersion,
}),
lastPublishedVersionId: row.lastPublishedVersionId,
+ lastPublishedCoreWorkflowVersionId: row.lastPublishedCoreWorkflowVersionId,
applicationId: row.applicationId,
workspaceWorkflowId: row.workspaceWorkflowId,
createdAt: row.createdAt.toISOString(),
@@ -95,8 +106,162 @@ export class CoreWorkflowListService {
constructor(
@InjectDataSource()
private readonly coreDataSource: DataSource,
+ @InjectWorkspaceScopedRepository(WorkflowEntity)
+ private readonly coreWorkflowRepository: WorkspaceScopedRepository<WorkflowEntity>,
+ @InjectWorkspaceScopedRepository(WorkflowVersionEntity)
+ private readonly coreWorkflowVersionRepository: WorkspaceScopedRepository<WorkflowVersionEntity>,
) {}
+ async findManyWithCurrentVersions({
+ workspaceId,
+ coreWorkflowIds,
+ }: {
+ workspaceId: string;
+ coreWorkflowIds: string[];
+ }): Promise<CoreWorkflowWithCurrentVersionDTO[]> {
+ const [coreWorkflows, coreWorkflowVersions] = await Promise.all([
+ this.coreWorkflowRepository.find(workspaceId, {
+ where: { id: In(coreWorkflowIds) },
+ }),
+ this.coreWorkflowVersionRepository.find(workspaceId, {
+ where: { coreWorkflowId: In(coreWorkflowIds) },
+ select: {
+ id: true,
+ coreWorkflowId: true,
+ status: true,
+ workspaceWorkflowVersionId: true,
+ createdAt: true,
+ updatedAt: true,
+ },
+ order: { createdAt: 'ASC', id: 'ASC' },
+ }),
+ ]);
+
+ const workflowById = new Map(
+ coreWorkflows.map((workflow) => [workflow.id, workflow]),
+ );
+
+ const versionsByWorkflowId = new Map<string, WorkflowVersionEntity[]>();
+
+ for (const version of coreWorkflowVersions) {
+ if (!isDefined(version.coreWorkflowId)) {
+ continue;
+ }
+
+ const versions = versionsByWorkflowId.get(version.coreWorkflowId) ?? [];
+
+ versions.push(version);
+ versionsByWorkflowId.set(version.coreWorkflowId, versions);
+ }
+
+ const currentVersionIdByWorkflowId = new Map<string, string>();
+
+ for (const [
+ coreWorkflowId,
+ versionsInCreationOrder,
+ ] of versionsByWorkflowId) {
+ const versions = [...versionsInCreationOrder].reverse();
+ const currentVersion =
+ versions.find(
+ (version) => version.status === WorkflowVersionStatus.DRAFT,
+ ) ??
+ versions.find(
+ (version) => version.status === WorkflowVersionStatus.ACTIVE,
+ ) ??
+ versions[0];
+
+ if (isDefined(currentVersion)) {
+ currentVersionIdByWorkflowId.set(coreWorkflowId, currentVersion.id);
+ }
+ }
+
+ const currentVersionIds = [...currentVersionIdByWorkflowId.values()];
+ const currentVersionContents =
+ currentVersionIds.length === 0
+ ? []
+ : await this.coreWorkflowVersionRepository.find(workspaceId, {
+ where: { id: In(currentVersionIds) },
+ select: { id: true, triggers: true, steps: true },
+ });
+ const currentVersionContentById = new Map(
+ currentVersionContents.map((version) => [version.id, version]),
+ );
+
+ return coreWorkflowIds.flatMap((coreWorkflowId) => {
+ const workflow = workflowById.get(coreWorkflowId);
+
+ if (!isDefined(workflow)) {
+ return [];
+ }
+
+ const versionsInCreationOrder =
+ versionsByWorkflowId.get(coreWorkflowId) ?? [];
+
+ const versions = versionsInCreationOrder
+ .map((version, index) => ({
+ id: version.id,
+ coreWorkflowId: version.coreWorkflowId,
+ label: buildCoreWorkflowVersionLabel(index + 1),
+ status: version.status,
+ workspaceWorkflowVersionId: version.workspaceWorkflowVersionId,
+ workspaceWorkflowId: workflow.workspaceWorkflowId,
+ trigger: null,
+ steps: null,
+ createdAt: version.createdAt.toISOString(),
+ updatedAt: version.updatedAt.toISOString(),
+ }))
+ .reverse();
+
+ const currentVersionId = currentVersionIdByWorkflowId.get(coreWorkflowId);
+ const currentVersionMetadata = versions.find(
+ (version) => version.id === currentVersionId,
+ );
+
+ if (!isDefined(currentVersionMetadata)) {
+ return [];
+ }
+
+ const currentVersionContent = currentVersionContentById.get(
+ currentVersionMetadata.id,
+ );
+ const currentVersion = {
+ ...currentVersionMetadata,
+ trigger: currentVersionContent?.triggers?.[0] ?? null,
+ steps: currentVersionContent?.steps ?? null,
+ };
+
+ return [
+ {
+ workflow: {
+ id: workflow.id,
+ name: workflow.name,
+ statuses: computeCoreWorkflowStatuses({
+ hasDraftVersion: versions.some(
+ (version) => version.status === WorkflowVersionStatus.DRAFT,
+ ),
+ hasActiveVersion: versions.some(
+ (version) => version.status === WorkflowVersionStatus.ACTIVE,
+ ),
+ hasDeactivatedVersion: versions.some(
+ (version) =>
+ version.status === WorkflowVersionStatus.DEACTIVATED,
+ ),
+ }),
+ lastPublishedVersionId: workflow.lastPublishedVersionId,
+ lastPublishedCoreWorkflowVersionId:
+ workflow.lastPublishedCoreWorkflowVersionId,
+ applicationId: workflow.applicationId,
+ workspaceWorkflowId: workflow.workspaceWorkflowId,
+ createdAt: workflow.createdAt.toISOString(),
+ updatedAt: workflow.updatedAt.toISOString(),
+ },
+ versions,
+ currentVersion,
+ },
+ ];
+ });
+ }
+
async findManyByWorkspaceId(
workspaceId: string,
{ first, after, orderBy, orderByDirection, filter }: CoreWorkflowsArgs,
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/services/core-workflow-mutation.workspace-service.ts b/packages/twenty-server/src/engine/core-modules/workflow/services/core-workflow-mutation.workspace-service.ts
index e03a8ae4673..06240096212 100644
--- a/packages/twenty-server/src/engine/core-modules/workflow/services/core-workflow-mutation.workspace-service.ts
+++ b/packages/twenty-server/src/engine/core-modules/workflow/services/core-workflow-mutation.workspace-service.ts
@@ -420,22 +420,36 @@ export class CoreWorkflowMutationWorkspaceService {
},
);
- const deletedCoreWorkflows = coreWorkflowsToDelete
- .map(({ id, workspaceWorkflowId }) =>
- isDefined(workspaceWorkflowId)
- ? { id, workspaceWorkflowId }
- : undefined,
- )
- .filter(isDefined);
-
- const mirrorWorkflowIds = await this.findMirrorWorkflowIdsToDelete({
+ const mirrorWorkflows = await this.findMirrorWorkflowsToDelete({
workspaceId,
coreWorkflowIds,
- knownMirrorWorkflowIds: deletedCoreWorkflows.map(
- ({ workspaceWorkflowId }) => workspaceWorkflowId,
- ),
});
+ const mirrorWorkflowIdByCoreWorkflowId = new Map(
+ mirrorWorkflows.flatMap(({ id, coreWorkflowId }) =>
+ isDefined(coreWorkflowId) ? [[coreWorkflowId, id] as const] : [],
+ ),
+ );
+
+ const deletedCoreWorkflows = coreWorkflowsToDelete.map(
+ ({ id, workspaceWorkflowId }) => ({
+ id,
+ workspaceWorkflowId:
+ workspaceWorkflowId ??
+ mirrorWorkflowIdByCoreWorkflowId.get(id) ??
+ null,
+ }),
+ );
+
+ const mirrorWorkflowIds = [
+ ...new Set([
+ ...coreWorkflowsToDelete
+ .map(({ workspaceWorkflowId }) => workspaceWorkflowId)
+ .filter(isDefined),
+ ...mirrorWorkflows.map(({ id }) => id),
+ ]),
+ ];
+
if (mirrorWorkflowIds.length > 0) {
const authContext = buildSystemAuthContext(workspaceId);
@@ -462,36 +476,26 @@ export class CoreWorkflowMutationWorkspaceService {
return deletedCoreWorkflows;
}
- private async findMirrorWorkflowIdsToDelete({
+ private async findMirrorWorkflowsToDelete({
workspaceId,
coreWorkflowIds,
- knownMirrorWorkflowIds,
}: {
workspaceId: string;
coreWorkflowIds: string[];
- knownMirrorWorkflowIds: string[];
- }): Promise<string[]> {
- const mirrorWorkflows =
- await this.workspaceOrmManager.executeInWorkspaceContext(
- async () =>
- this.workspaceOrmManager
- .getRepository<WorkflowWorkspaceEntity>('workflow', {
- shouldBypassPermissionChecks: true,
- })
- .find({
- where: { coreWorkflowId: In(coreWorkflowIds) },
- select: { id: true },
- withDeleted: true,
- }),
- buildSystemAuthContext(workspaceId),
- );
-
- return [
- ...new Set([
- ...knownMirrorWorkflowIds,
- ...mirrorWorkflows.map(({ id }) => id),
- ]),
- ];
+ }): Promise<Pick<WorkflowWorkspaceEntity, 'id' | 'coreWorkflowId'>[]> {
+ return this.workspaceOrmManager.executeInWorkspaceContext(
+ async () =>
+ this.workspaceOrmManager
+ .getRepository<WorkflowWorkspaceEntity>('workflow', {
+ shouldBypassPermissionChecks: true,
+ })
+ .find({
+ where: { coreWorkflowId: In(coreWorkflowIds) },
+ select: { id: true, coreWorkflowId: true },
+ withDeleted: true,
+ }),
+ buildSystemAuthContext(workspaceId),
+ );
}
async discardDraftVersion(
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/services/core-workflow-version-list.service.ts b/packages/twenty-server/src/engine/core-modules/workflow/services/core-workflow-version-list.service.ts
index 42d7f2500ad..290ed264474 100644
--- a/packages/twenty-server/src/engine/core-modules/workflow/services/core-workflow-version-list.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/workflow/services/core-workflow-version-list.service.ts
@@ -36,6 +36,7 @@ export class CoreWorkflowVersionListService {
order: { createdAt: 'ASC', id: 'ASC' },
select: {
id: true,
+ coreWorkflowId: true,
status: true,
createdAt: true,
updatedAt: true,
@@ -47,6 +48,7 @@ export class CoreWorkflowVersionListService {
return coreWorkflowVersions
.map((coreWorkflowVersion, index) => ({
id: coreWorkflowVersion.id,
+ coreWorkflowId: coreWorkflowVersion.coreWorkflowId,
label: buildCoreWorkflowVersionLabel(index + 1),
status: coreWorkflowVersion.status,
workspaceWorkflowVersionId:
@@ -109,6 +111,7 @@ export class CoreWorkflowVersionListService {
order: { createdAt: 'ASC', id: 'ASC' },
select: {
id: true,
+ coreWorkflowId: true,
status: true,
createdAt: true,
updatedAt: true,
@@ -120,6 +123,7 @@ export class CoreWorkflowVersionListService {
return coreWorkflowVersions
.map((coreWorkflowVersion, index) => ({
id: coreWorkflowVersion.id,
+ coreWorkflowId: coreWorkflowVersion.coreWorkflowId,
label: buildCoreWorkflowVersionLabel(index + 1),
status: coreWorkflowVersion.status,
workspaceWorkflowVersionId:
@@ -165,6 +169,7 @@ export class CoreWorkflowVersionListService {
return {
id: coreWorkflowVersion.id,
+ coreWorkflowId: coreWorkflowVersion.coreWorkflowId,
label: buildCoreWorkflowVersionLabel(versionRank),
status: coreWorkflowVersion.status,
workspaceWorkflowVersionId:
diff --git a/packages/twenty-server/src/engine/metadata-modules/command-menu-item/command-menu-item.service.ts b/packages/twenty-server/src/engine/metadata-modules/command-menu-item/command-menu-item.service.ts
index 5245865d230..cbfb2cfb82a 100644
--- a/packages/twenty-server/src/engine/metadata-modules/command-menu-item/command-menu-item.service.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/command-menu-item/command-menu-item.service.ts
@@ -537,50 +537,39 @@ export class CommandMenuItemService {
coreWorkflowVersionId: string,
workspaceId: string,
): Promise<CommandMenuItemDTO | null> {
- const { flatCommandMenuItemMaps } =
- await this.workspaceManyOrAllFlatEntityMapsCacheService.getOrRecomputeManyOrAllFlatEntityMaps(
- {
- workspaceId,
- flatMapsKeys: ['flatCommandMenuItemMaps'],
- },
- );
-
- const flatCommandMenuItem = Object.values(
- flatCommandMenuItemMaps.byUniversalIdentifier,
- ).find(
- (item) =>
- isDefined(item) && item.coreWorkflowVersionId === coreWorkflowVersionId,
+ return this.findByWorkflowVersionReference(
+ coreWorkflowVersionId,
+ workspaceId,
+ 'coreWorkflowVersionId',
);
-
- if (!isDefined(flatCommandMenuItem)) {
- return null;
- }
-
- return fromFlatCommandMenuItemToCommandMenuItemDto(flatCommandMenuItem);
}
async findByWorkflowVersionId(
workflowVersionId: string,
workspaceId: string,
+ ): Promise<CommandMenuItemDTO | null> {
+ return this.findByWorkflowVersionReference(
+ workflowVersionId,
+ workspaceId,
+ 'workflowVersionId',
+ );
+ }
+
+ private async findByWorkflowVersionReference(
+ versionId: string,
+ workspaceId: string,
+ reference: 'workflowVersionId' | 'coreWorkflowVersionId',
): Promise<CommandMenuItemDTO | null> {
const { flatCommandMenuItemMaps } =
await this.workspaceManyOrAllFlatEntityMapsCacheService.getOrRecomputeManyOrAllFlatEntityMaps(
- {
- workspaceId,
- flatMapsKeys: ['flatCommandMenuItemMaps'],
- },
+ { workspaceId, flatMapsKeys: ['flatCommandMenuItemMaps'] },
);
-
const flatCommandMenuItem = Object.values(
flatCommandMenuItemMaps.byUniversalIdentifier,
- ).find(
- (item) => isDefined(item) && item.workflowVersionId === workflowVersionId,
- );
-
- if (!isDefined(flatCommandMenuItem)) {
- return null;
- }
+ ).find((item) => isDefined(item) && item[reference] === versionId);
- return fromFlatCommandMenuItemToCommandMenuItemDto(flatCommandMenuItem);
+ return isDefined(flatCommandMenuItem)
+ ? fromFlatCommandMenuItemToCommandMenuItemDto(flatCommandMenuItem)
+ : null;
}
}
diff --git a/packages/twenty-server/src/engine/metadata-modules/command-menu-item/dtos/command-menu-item.dto.ts b/packages/twenty-server/src/engine/metadata-modules/command-menu-item/dtos/command-menu-item.dto.ts
index fd02ab69817..e5a2fccc40c 100644
--- a/packages/twenty-server/src/engine/metadata-modules/command-menu-item/dtos/command-menu-item.dto.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/command-menu-item/dtos/command-menu-item.dto.ts
@@ -42,6 +42,11 @@ export class CommandMenuItemDTO {
@Field(() => UUIDScalarType, { nullable: true })
workflowVersionId?: string;
+ @IsUUID()
+ @IsOptional()
+ @Field(() => UUIDScalarType, { nullable: true })
+ coreWorkflowVersionId?: string;
+
@IsUUID()
@IsOptional()
@Field(() => UUIDScalarType, { nullable: true })
diff --git a/packages/twenty-server/src/engine/metadata-modules/command-menu-item/entities/command-menu-item.entity.ts b/packages/twenty-server/src/engine/metadata-modules/command-menu-item/entities/command-menu-item.entity.ts
index 005a9e139ef..ea9a0e9c69b 100644
--- a/packages/twenty-server/src/engine/metadata-modules/command-menu-item/entities/command-menu-item.entity.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/command-menu-item/entities/command-menu-item.entity.ts
@@ -62,7 +62,7 @@ export type CommandMenuItemOverrides = {
])
@Check(
'CHK_CMD_MENU_ITEM_ENGINE_KEY_COHERENCE',
- `("engineComponentKey" = 'TRIGGER_WORKFLOW_VERSION' AND "workflowVersionId" IS NOT NULL AND "frontComponentId" IS NULL AND "payload" IS NULL AND "navigationTargetObjectMetadataId" IS NULL) OR ("engineComponentKey" = 'FRONT_COMPONENT_RENDERER' AND "frontComponentId" IS NOT NULL AND "workflowVersionId" IS NULL AND "payload" IS NULL AND "navigationTargetObjectMetadataId" IS NULL) OR ("engineComponentKey" = 'NAVIGATION' AND (("payload" IS NOT NULL AND "navigationTargetObjectMetadataId" IS NULL) OR ("payload" IS NULL AND "navigationTargetObjectMetadataId" IS NOT NULL)) AND "workflowVersionId" IS NULL AND "frontComponentId" IS NULL) OR ("engineComponentKey" NOT IN ('TRIGGER_WORKFLOW_VERSION', 'FRONT_COMPONENT_RENDERER', 'NAVIGATION') AND "workflowVersionId" IS NULL AND "frontComponentId" IS NULL AND "payload" IS NULL AND "navigationTargetObjectMetadataId" IS NULL)`,
+ `("engineComponentKey" = 'TRIGGER_WORKFLOW_VERSION' AND ("workflowVersionId" IS NOT NULL OR "coreWorkflowVersionId" IS NOT NULL) AND "frontComponentId" IS NULL AND "payload" IS NULL AND "navigationTargetObjectMetadataId" IS NULL) OR ("engineComponentKey" = 'FRONT_COMPONENT_RENDERER' AND "frontComponentId" IS NOT NULL AND "workflowVersionId" IS NULL AND "coreWorkflowVersionId" IS NULL AND "payload" IS NULL AND "navigationTargetObjectMetadataId" IS NULL) OR ("engineComponentKey" = 'NAVIGATION' AND (("payload" IS NOT NULL AND "navigationTargetObjectMetadataId" IS NULL) OR ("payload" IS NULL AND "navigationTargetObjectMetadataId" IS NOT NULL)) AND "workflowVersionId" IS NULL AND "coreWorkflowVersionId" IS NULL AND "frontComponentId" IS NULL) OR ("engineComponentKey" NOT IN ('TRIGGER_WORKFLOW_VERSION', 'FRONT_COMPONENT_RENDERER', 'NAVIGATION') AND "workflowVersionId" IS NULL AND "coreWorkflowVersionId" IS NULL AND "frontComponentId" IS NULL AND "payload" IS NULL AND "navigationTargetObjectMetadataId" IS NULL)`,
)
export class CommandMenuItemEntity
extends OverridableEntity<CommandMenuItemOverrides>
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-command-menu-item/utils/from-flat-command-menu-item-to-command-menu-item-dto.util.ts b/packages/twenty-server/src/engine/metadata-modules/flat-command-menu-item/utils/from-flat-command-menu-item-to-command-menu-item-dto.util.ts
index 808d3180b1d..eacd1e22155 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-command-menu-item/utils/from-flat-command-menu-item-to-command-menu-item-dto.util.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-command-menu-item/utils/from-flat-command-menu-item-to-command-menu-item-dto.util.ts
@@ -15,6 +15,8 @@ export const fromFlatCommandMenuItemToCommandMenuItemDto = (
id: effectiveFlatCommandMenuItem.id,
workflowVersionId:
effectiveFlatCommandMenuItem.workflowVersionId ?? undefined,
+ coreWorkflowVersionId:
+ effectiveFlatCommandMenuItem.coreWorkflowVersionId ?? undefined,
frontComponentId:
effectiveFlatCommandMenuItem.frontComponentId ?? undefined,
engineComponentKey: effectiveFlatCommandMenuItem.engineComponentKey,
diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/__tests__/flat-command-menu-item-validator.service.spec.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/__tests__/flat-command-menu-item-validator.service.spec.ts
new file mode 100644
index 00000000000..d472354a4e9
--- /dev/null
+++ b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/__tests__/flat-command-menu-item-validator.service.spec.ts
@@ -0,0 +1,90 @@
+import { EngineComponentKey } from 'src/engine/metadata-modules/command-menu-item/enums/engine-component-key.enum';
+import { buildObjectNavigationUniversalFlatCommandMenuItem } from 'src/engine/metadata-modules/flat-command-menu-item/utils/build-object-navigation-universal-flat-command-menu-item.util';
+import { FlatCommandMenuItemValidatorService } from 'src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/flat-command-menu-item-validator.service';
+
+type CreationArgs = Parameters<
+ FlatCommandMenuItemValidatorService['validateFlatCommandMenuItemCreation']
+>[0];
+
+const buildCommand = (
+ overrides: Partial<CreationArgs['flatEntityToValidate']> = {},
+) => ({
+ ...buildObjectNavigationUniversalFlatCommandMenuItem({
+ objectMetadata: {
+ id: 'object-id',
+ universalIdentifier: 'object-identifier',
+ nameSingular: 'person',
+ shortcut: null,
+ isActive: true,
+ },
+ applicationUniversalIdentifier: '11111111-1111-4111-8111-111111111111',
+ position: 0,
+ now: '2026-09-16T00:00:00Z',
+ }),
+ engineComponentKey: EngineComponentKey.TRIGGER_WORKFLOW_VERSION,
+ navigationTargetObjectMetadataUniversalIdentifier: null,
+ ...overrides,
+});
+
+const buildArgs = (
+ overrides: Partial<CreationArgs['flatEntityToValidate']> = {},
+) =>
+ ({
+ flatEntityToValidate: buildCommand(overrides),
+ optimisticFlatEntityMapsAndRelatedFlatEntityMaps: {
+ flatObjectMetadataMaps: { byUniversalIdentifier: {} },
+ flatCommandMenuItemMaps: { byUniversalIdentifier: {} },
+ },
+ }) as CreationArgs;
+
+describe('workflow command menu validation', () => {
+ const service = new FlatCommandMenuItemValidatorService();
+
+ it.each([
+ { workflowVersionId: 'workspace-version', coreWorkflowVersionId: null },
+ { workflowVersionId: null, coreWorkflowVersionId: 'core-version' },
+ {
+ workflowVersionId: 'workspace-version',
+ coreWorkflowVersionId: 'core-version',
+ },
+ ])('accepts legacy, core and dual-keyed triggers: %j', (identifiers) => {
+ expect(
+ service.validateFlatCommandMenuItemCreation(buildArgs(identifiers))
+ .errors,
+ ).toEqual([]);
+ });
+
+ it('rejects a trigger without a definition ID', () => {
+ expect(
+ service.validateFlatCommandMenuItemCreation(buildArgs()).errors,
+ ).toHaveLength(1);
+ });
+
+ it('rejects workflow IDs on unrelated engine commands', () => {
+ expect(
+ service.validateFlatCommandMenuItemCreation(
+ buildArgs({
+ engineComponentKey: EngineComponentKey.DELETE_RECORDS,
+ coreWorkflowVersionId: 'core-version',
+ }),
+ ).errors,
+ ).toHaveLength(1);
+ });
+
+ it('allows renaming an existing core-only trigger', () => {
+ const command = buildCommand({ coreWorkflowVersionId: 'core-version' });
+ const args = {
+ universalIdentifier: command.universalIdentifier,
+ flatEntityUpdate: { label: 'Renamed' },
+ optimisticFlatEntityMapsAndRelatedFlatEntityMaps: {
+ flatObjectMetadataMaps: { byUniversalIdentifier: {} },
+ flatCommandMenuItemMaps: {
+ byUniversalIdentifier: { [command.universalIdentifier]: command },
+ },
+ },
+ } as Parameters<
+ FlatCommandMenuItemValidatorService['validateFlatCommandMenuItemUpdate']
+ >[0];
+ expect(service.validateFlatCommandMenuItemUpdate(args).errors).toEqual([]);
+ });
+});
diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/flat-command-menu-item-validator.service.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/flat-command-menu-item-validator.service.ts
index eb672555b92..27e1beeda09 100644
--- a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/flat-command-menu-item-validator.service.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/flat-command-menu-item-validator.service.ts
@@ -53,6 +53,7 @@ export class FlatCommandMenuItemValidatorService {
this.validateEngineComponentKeyCoherence({
engineComponentKey: flatCommandMenuItem.engineComponentKey,
workflowVersionId: flatCommandMenuItem.workflowVersionId,
+ coreWorkflowVersionId: flatCommandMenuItem.coreWorkflowVersionId,
frontComponentUniversalIdentifier:
flatCommandMenuItem.frontComponentUniversalIdentifier,
payload: flatCommandMenuItem.payload,
@@ -179,6 +180,7 @@ export class FlatCommandMenuItemValidatorService {
this.validateEngineComponentKeyCoherence({
engineComponentKey,
workflowVersionId: fromFlatCommandMenuItem.workflowVersionId,
+ coreWorkflowVersionId: fromFlatCommandMenuItem.coreWorkflowVersionId,
frontComponentUniversalIdentifier:
fromFlatCommandMenuItem.frontComponentUniversalIdentifier,
payload,
@@ -231,6 +233,7 @@ export class FlatCommandMenuItemValidatorService {
private validateEngineComponentKeyCoherence({
engineComponentKey,
workflowVersionId,
+ coreWorkflowVersionId,
frontComponentUniversalIdentifier,
payload,
navigationTargetObjectMetadataUniversalIdentifier,
@@ -238,6 +241,7 @@ export class FlatCommandMenuItemValidatorService {
}: {
engineComponentKey: EngineComponentKey | null;
workflowVersionId: string | null;
+ coreWorkflowVersionId: string | null;
frontComponentUniversalIdentifier: string | null;
payload: PathCommandMenuItemPayload | null;
navigationTargetObjectMetadataUniversalIdentifier: string | null;
@@ -252,7 +256,10 @@ export class FlatCommandMenuItemValidatorService {
switch (engineComponentKey) {
case EngineComponentKey.TRIGGER_WORKFLOW_VERSION: {
- if (!isNonEmptyString(workflowVersionId)) {
+ if (
+ !isNonEmptyString(workflowVersionId) &&
+ !isNonEmptyString(coreWorkflowVersionId)
+ ) {
validationResult.errors.push({
code: CommandMenuItemExceptionCode.INVALID_COMMAND_MENU_ITEM_INPUT,
message: t`workflowVersionId is required when engineComponentKey is TRIGGER_WORKFLOW_VERSION`,
@@ -279,7 +286,10 @@ export class FlatCommandMenuItemValidatorService {
});
}
- if (isNonEmptyString(workflowVersionId)) {
+ if (
+ isNonEmptyString(workflowVersionId) ||
+ isNonEmptyString(coreWorkflowVersionId)
+ ) {
validationResult.errors.push({
code: CommandMenuItemExceptionCode.INVALID_COMMAND_MENU_ITEM_INPUT,
message: t`workflowVersionId must not be set when engineComponentKey is FRONT_COMPONENT_RENDERER`,
@@ -296,7 +306,10 @@ export class FlatCommandMenuItemValidatorService {
validationResult,
});
- if (isNonEmptyString(workflowVersionId)) {
+ if (
+ isNonEmptyString(workflowVersionId) ||
+ isNonEmptyString(coreWorkflowVersionId)
+ ) {
validationResult.errors.push({
code: CommandMenuItemExceptionCode.INVALID_COMMAND_MENU_ITEM_INPUT,
message: t`workflowVersionId must not be set for engine component key ${engineComponentKey}`,
@@ -315,7 +328,10 @@ export class FlatCommandMenuItemValidatorService {
break;
}
default: {
- if (isNonEmptyString(workflowVersionId)) {
+ if (
+ isNonEmptyString(workflowVersionId) ||
+ isNonEmptyString(coreWorkflowVersionId)
+ ) {
validationResult.errors.push({
code: CommandMenuItemExceptionCode.INVALID_COMMAND_MENU_ITEM_INPUT,
message: t`workflowVersionId must not be set for engine component key ${engineComponentKey}`,
diff --git a/packages/twenty-server/src/modules/workflow/common/workspace-services/workflow-common.workspace-service.ts b/packages/twenty-server/src/modules/workflow/common/workspace-services/workflow-common.workspace-service.ts
index 8fa6ec13d21..4434dc1f874 100644
--- a/packages/twenty-server/src/modules/workflow/common/workspace-services/workflow-common.workspace-service.ts
+++ b/packages/twenty-server/src/modules/workflow/common/workspace-services/workflow-common.workspace-service.ts
@@ -1,6 +1,8 @@
import { WorkflowCoreSyncService } from 'src/engine/core-modules/workflow/services/workflow-core-sync.service';
import { Injectable, Logger } from '@nestjs/common';
+import { isNonEmptyString } from '@sniptt/guards';
+
import { isDefined, isValidUuid } from 'twenty-shared/utils';
import { In } from 'typeorm';
@@ -169,15 +171,35 @@ export class WorkflowCommonWorkspaceService {
workflow: WorkflowWorkspaceEntity,
workspaceId: string,
): Promise<void> {
- if (!isDefined(workflow.lastPublishedVersionId)) {
+ if (!isNonEmptyString(workflow.lastPublishedVersionId)) {
return;
}
+ const lastPublishedVersionId = workflow.lastPublishedVersionId;
+ const workflowVersion =
+ await this.workspaceOrmManager.executeInWorkspaceContext(async () => {
+ const workflowVersionRepository =
+ this.workspaceOrmManager.getRepository<WorkflowVersionWorkspaceEntity>(
+ 'workflowVersion',
+ { shouldBypassPermissionChecks: true },
+ );
+
+ return workflowVersionRepository.findOne({
+ where: { id: lastPublishedVersionId },
+ withDeleted: true,
+ });
+ }, buildSystemAuthContext(workspaceId));
const existingCommandMenuItem =
- await this.commandMenuItemService.findByWorkflowVersionId(
- workflow.lastPublishedVersionId,
+ (isDefined(workflowVersion?.coreWorkflowVersionId)
+ ? await this.commandMenuItemService.findByCoreWorkflowVersionId(
+ workflowVersion.coreWorkflowVersionId,
+ workspaceId,
+ )
+ : null) ??
+ (await this.commandMenuItemService.findByWorkflowVersionId(
+ lastPublishedVersionId,
workspaceId,
- );
+ ));
if (!isDefined(existingCommandMenuItem)) {
return;
@@ -448,6 +470,7 @@ export class WorkflowCommonWorkspaceService {
await this.cleanupCommandMenuItemForVersion(
workflowVersion.id,
workspaceId,
+ workflowVersion.coreWorkflowVersionId,
);
}
}
@@ -460,12 +483,19 @@ export class WorkflowCommonWorkspaceService {
private async cleanupCommandMenuItemForVersion(
workflowVersionId: string,
workspaceId: string,
+ coreWorkflowVersionId: string | null,
) {
const existingCommandMenuItem =
- await this.commandMenuItemService.findByWorkflowVersionId(
+ (isDefined(coreWorkflowVersionId)
+ ? await this.commandMenuItemService.findByCoreWorkflowVersionId(
+ coreWorkflowVersionId,
+ workspaceId,
+ )
+ : null) ??
+ (await this.commandMenuItemService.findByWorkflowVersionId(
workflowVersionId,
workspaceId,
- );
+ ));
if (isDefined(existingCommandMenuItem)) {
await this.commandMenuItemService.delete(
diff --git a/packages/twenty-server/src/modules/workflow/workflow-trigger/workspace-services/workflow-trigger.workspace-service.ts b/packages/twenty-server/src/modules/workflow/workflow-trigger/workspace-services/workflow-trigger.workspace-service.ts
index 7d3c21a832a..f238c403e10 100644
--- a/packages/twenty-server/src/modules/workflow/workflow-trigger/workspace-services/workflow-trigger.workspace-service.ts
+++ b/packages/twenty-server/src/modules/workflow/workflow-trigger/workspace-services/workflow-trigger.workspace-service.ts
@@ -555,11 +555,20 @@ export class WorkflowTriggerWorkspaceService {
const label = getWorkflowCommandMenuItemLabel(workflow);
+ const coreWorkflowVersionId =
+ mirroredCoreWorkflowVersionId ?? workflowVersion.coreWorkflowVersionId;
+
const existingCommandMenuItem =
- await this.commandMenuItemService.findByWorkflowVersionId(
+ (isDefined(coreWorkflowVersionId)
+ ? await this.commandMenuItemService.findByCoreWorkflowVersionId(
+ coreWorkflowVersionId,
+ workspaceId,
+ )
+ : null) ??
+ (await this.commandMenuItemService.findByWorkflowVersionId(
workflowVersion.id,
workspaceId,
- );
+ ));
if (existingCommandMenuItem) {
await this.commandMenuItemService.update(
@@ -578,10 +587,7 @@ export class WorkflowTriggerWorkspaceService {
await this.commandMenuItemService.create(
{
workflowVersionId: workflowVersion.id,
- coreWorkflowVersionId:
- mirroredCoreWorkflowVersionId ??
- workflowVersion.coreWorkflowVersionId ??
- undefined,
+ coreWorkflowVersionId: coreWorkflowVersionId ?? undefined,
engineComponentKey: EngineComponentKey.TRIGGER_WORKFLOW_VERSION,
label,
shortLabel: label,
@@ -606,10 +612,16 @@ export class WorkflowTriggerWorkspaceService {
}
const existingCommandMenuItem =
- await this.commandMenuItemService.findByWorkflowVersionId(
+ (isDefined(workflowVersion.coreWorkflowVersionId)
+ ? await this.commandMenuItemService.findByCoreWorkflowVersionId(
+ workflowVersion.coreWorkflowVersionId,
+ workspaceId,
+ )
+ : null) ??
+ (await this.commandMenuItemService.findByWorkflowVersionId(
workflowVersion.id,
workspaceId,
- );
+ ));
if (existingCommandMenuItem) {
await this.commandMenuItemService.delete(
diff --git a/packages/twenty-server/test/integration/graphql/suites/workflow/core-workflow-mutations.integration-spec.ts b/packages/twenty-server/test/integration/graphql/suites/workflow/core-workflow-mutations.integration-spec.ts
index 83d04477160..a05011dd452 100644
--- a/packages/twenty-server/test/integration/graphql/suites/workflow/core-workflow-mutations.integration-spec.ts
+++ b/packages/twenty-server/test/integration/graphql/suites/workflow/core-workflow-mutations.integration-spec.ts
@@ -317,4 +317,23 @@ describe('coreWorkflow mutations (e2e)', () => {
expect(deleteResponse.body.errors).toBeUndefined();
expect(deleteResponse.body.data.deleteCoreWorkflows).toEqual([]);
});
+
+ it('should accept the v5 core workflow ids that prefilled workflows use', async () => {
+ const deleteResponse = await graphql(
+ `
+ mutation DeleteCoreWorkflows($input: DeleteCoreWorkflowsInput!) {
+ deleteCoreWorkflows(input: $input) {
+ id
+ workspaceWorkflowId
+ }
+ }
+ `,
+ {
+ input: { coreWorkflowIds: ['00000000-0000-5000-8000-000000000000'] },
+ },
+ );
+
+ expect(deleteResponse.body.errors).toBeUndefined();
+ expect(deleteResponse.body.data.deleteCoreWorkflows).toEqual([]);
+ });
});
diff --git a/packages/twenty-shared/src/types/AppPath.ts b/packages/twenty-shared/src/types/AppPath.ts
index bf89b3db6ef..2986825c724 100644
--- a/packages/twenty-shared/src/types/AppPath.ts
+++ b/packages/twenty-shared/src/types/AppPath.ts
@@ -28,6 +28,7 @@ export enum AppPath {
RecordShowPage = '/object/:objectNameSingular/:objectRecordId',
PageLayoutPage = '/page/:pageLayoutId',
WorkflowCoreIndexPage = '/workflow-core',
+ WorkflowCoreShowPage = '/workflow-core/:coreWorkflowId',
Settings = `settings`,
SettingsCatchAll = `/${Settings}/*`,
diff --git a/packages/twenty-shared/src/workflow/schemas/workflow-run-schema.ts b/packages/twenty-shared/src/workflow/schemas/workflow-run-schema.ts
index cbab3cdbefa..ec5a85124a9 100644
--- a/packages/twenty-shared/src/workflow/schemas/workflow-run-schema.ts
+++ b/packages/twenty-shared/src/workflow/schemas/workflow-run-schema.ts
@@ -6,8 +6,10 @@ import { workflowRunStepLogsSchema } from './workflow-run-step-log-schema';
export const workflowRunSchema = z.looseObject({
__typename: z.literal('WorkflowRun'),
id: z.string(),
- workflowVersionId: z.string(),
- workflowId: z.string(),
+ workflowVersionId: z.string().nullable(),
+ workflowId: z.string().nullable(),
+ coreWorkflowVersionId: z.string().nullable().optional(),
+ coreWorkflowId: z.string().nullable().optional(),
state: workflowRunStateSchema.nullable(),
stepLogs: workflowRunStepLogsSchema.nullable().optional(),
status: workflowRunStatusSchema,