The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Remove the IS_APPLICATION_WORKFLOWS_ENABLED feature flag (#28003)
Thomas Trompette62e82e82379e
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql b/packages/twenty-client-sdk/src/metadata/generated/schema.graphqlindex 1a120d55eca..944aff09d36 100644--- a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql@@ -2094,7 +2094,6 @@ type FeatureFlag {enum FeatureFlagKey {IS_AI_CHAT_INBOX_ENABLED- IS_APPLICATION_WORKFLOWS_ENABLEDIS_APP_PREFERENCES_ENABLEDIS_ASYNC_CSV_EXPORT_ENABLEDIS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLEDdiff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.ts b/packages/twenty-client-sdk/src/metadata/generated/schema.tsindex 6a7477ea0cd..5743375ee7f 100644--- a/packages/twenty-client-sdk/src/metadata/generated/schema.ts+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.ts@@ -1347,7 +1347,7 @@ export interface FeatureFlag {__typename: 'FeatureFlag'}-export type FeatureFlagKey = 'IS_AI_CHAT_INBOX_ENABLED' | 'IS_APPLICATION_WORKFLOWS_ENABLED' | 'IS_APP_PREFERENCES_ENABLED' | 'IS_ASYNC_CSV_EXPORT_ENABLED' | 'IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED' | 'IS_CALENDAR_SYNC_SKIP_UNCHANGED_RECORDS_ENABLED' | 'IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED' | 'IS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED' | 'IS_JSON_FILTER_ENABLED' | 'IS_LOGS_SETTINGS_SECTION_ENABLED' | 'IS_MESSAGE_CAMPAIGN_ENABLED' | 'IS_MORPH_RELATION_HEAD_ENABLED' | 'IS_RECORD_CREATION_FORM_ENABLED' | 'IS_RECORD_LEVEL_SHARING_ENABLED' | 'IS_RECORD_SHARE_VISIBILITY_GATING_ENABLED' | 'IS_REST_METADATA_API_NEW_FORMAT_DIRECT'+export type FeatureFlagKey = 'IS_AI_CHAT_INBOX_ENABLED' | 'IS_APP_PREFERENCES_ENABLED' | 'IS_ASYNC_CSV_EXPORT_ENABLED' | 'IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED' | 'IS_CALENDAR_SYNC_SKIP_UNCHANGED_RECORDS_ENABLED' | 'IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED' | 'IS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED' | 'IS_JSON_FILTER_ENABLED' | 'IS_LOGS_SETTINGS_SECTION_ENABLED' | 'IS_MESSAGE_CAMPAIGN_ENABLED' | 'IS_MORPH_RELATION_HEAD_ENABLED' | 'IS_RECORD_CREATION_FORM_ENABLED' | 'IS_RECORD_LEVEL_SHARING_ENABLED' | 'IS_RECORD_SHARE_VISIBILITY_GATING_ENABLED' | 'IS_REST_METADATA_API_NEW_FORMAT_DIRECT'export interface Field {applicationId: Scalars['UUID']@@ -11571,7 +11571,6 @@ export const enumEventLogTable = {export const enumFeatureFlagKey = {IS_AI_CHAT_INBOX_ENABLED: 'IS_AI_CHAT_INBOX_ENABLED' as const,- IS_APPLICATION_WORKFLOWS_ENABLED: 'IS_APPLICATION_WORKFLOWS_ENABLED' as const,IS_APP_PREFERENCES_ENABLED: 'IS_APP_PREFERENCES_ENABLED' as const,IS_ASYNC_CSV_EXPORT_ENABLED: 'IS_ASYNC_CSV_EXPORT_ENABLED' as const,IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED: 'IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED' as const,diff --git a/packages/twenty-front/src/generated-admin/graphql.ts b/packages/twenty-front/src/generated-admin/graphql.tsindex 32b9adc0b28..f338b55da43 100644--- a/packages/twenty-front/src/generated-admin/graphql.ts+++ b/packages/twenty-front/src/generated-admin/graphql.ts@@ -446,7 +446,6 @@ export type FeatureFlag = {export enum FeatureFlagKey {IS_AI_CHAT_INBOX_ENABLED = 'IS_AI_CHAT_INBOX_ENABLED',- IS_APPLICATION_WORKFLOWS_ENABLED = 'IS_APPLICATION_WORKFLOWS_ENABLED',IS_APP_PREFERENCES_ENABLED = 'IS_APP_PREFERENCES_ENABLED',IS_ASYNC_CSV_EXPORT_ENABLED = 'IS_ASYNC_CSV_EXPORT_ENABLED',IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED = 'IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED',diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.tsindex 6086eb91493..2988d9a0ef0 100644--- a/packages/twenty-front/src/generated-metadata/graphql.ts+++ b/packages/twenty-front/src/generated-metadata/graphql.ts@@ -2213,7 +2213,6 @@ export type FeatureFlag = {export enum FeatureFlagKey {IS_AI_CHAT_INBOX_ENABLED = 'IS_AI_CHAT_INBOX_ENABLED',- IS_APPLICATION_WORKFLOWS_ENABLED = 'IS_APPLICATION_WORKFLOWS_ENABLED',IS_APP_PREFERENCES_ENABLED = 'IS_APP_PREFERENCES_ENABLED',IS_ASYNC_CSV_EXPORT_ENABLED = 'IS_ASYNC_CSV_EXPORT_ENABLED',IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED = 'IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED',diff --git a/packages/twenty-front/src/modules/settings/admin-panel/constants/SettingsAdminFeatureFlagMetadata.ts b/packages/twenty-front/src/modules/settings/admin-panel/constants/SettingsAdminFeatureFlagMetadata.tsindex f4794e6cb4c..45f4aa00eaa 100644--- a/packages/twenty-front/src/modules/settings/admin-panel/constants/SettingsAdminFeatureFlagMetadata.ts+++ b/packages/twenty-front/src/modules/settings/admin-panel/constants/SettingsAdminFeatureFlagMetadata.ts@@ -32,10 +32,6 @@ export const SETTINGS_ADMIN_FEATURE_FLAG_METADATA: Record<label: msg`Direct REST metadata responses`,description: msg`Return metadata directly instead of wrapping it in the legacy response envelope.`,},- [FeatureFlagKey.IS_APPLICATION_WORKFLOWS_ENABLED]: {- label: msg`Application workflows`,- description: msg`Allow applications to install workflows and start new workflow runs.`,- },[FeatureFlagKey.IS_RECORD_LEVEL_SHARING_ENABLED]: {label: msg`Record sharing`,description: msg`Let people restrict and share individual records.`,diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/application-manifest-migration.service.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/application-manifest-migration.service.tsindex c3f0657f749..5ca65fb424f 100644--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/application-manifest-migration.service.ts+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/application-manifest-migration.service.ts@@ -2,7 +2,6 @@ import { Injectable } from '@nestjs/common';import { type Manifest } from 'twenty-shared/application';import { ALL_METADATA_NAME } from 'twenty-shared/metadata';-import { FeatureFlagKey } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { ComputeApplicationManifestAllUniversalFlatEntityMapsService } from 'src/engine/core-modules/application/application-manifest/services/compute-application-manifest-all-universal-flat-entity-maps.service';@@ -182,13 +181,11 @@ export class ApplicationManifestMigrationService {const now = new Date().toISOString();const recomputeStart = performance.now();- const cacheResult = await this.workspaceCacheService.getOrRecompute(- workspaceId,- [- ...Object.values(ALL_METADATA_NAME).map(getMetadataFlatEntityMapsKey),- 'featureFlagsMap',- ],- );+ const existingAllFlatEntityMaps =+ await this.workspaceCacheService.getOrRecompute(+ workspaceId,+ Object.values(ALL_METADATA_NAME).map(getMetadataFlatEntityMapsKey),+ );const recomputeMs = performance.now() - recomputeStart;this.logger.perf(@@ -196,8 +193,6 @@ export class ApplicationManifestMigrationService {ApplicationManifestMigrationService.name,);- const { featureFlagsMap, ...existingAllFlatEntityMaps } = cacheResult;-const fromAllFlatEntityMaps = getApplicationSubAllFlatEntityMaps({applicationIds: [ownerFlatApplication.id],fromAllFlatEntityMaps: existingAllFlatEntityMaps,@@ -235,8 +230,6 @@ export class ApplicationManifestMigrationService {toAllUniversalFlatEntityMaps,existingAllFlatEntityMaps,idByUniversalIdentifierByMetadataName,- isApplicationWorkflowsEnabled:- featureFlagsMap[FeatureFlagKey.IS_APPLICATION_WORKFLOWS_ENABLED],now,});diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/__tests__/add-workflow-manifests-to-flat-entity-maps-or-throw.util.spec.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/__tests__/add-workflow-manifests-to-flat-entity-maps-or-throw.util.spec.tsindex 6d74130b082..3eb0c3f8808 100644--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/__tests__/add-workflow-manifests-to-flat-entity-maps-or-throw.util.spec.ts+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/__tests__/add-workflow-manifests-to-flat-entity-maps-or-throw.util.spec.ts@@ -36,29 +36,6 @@ const MANIFEST = buildBaseManifest({},});-describe('application workflow installation gate', () => {- it.each([undefined, false])(- 'rejects workflows when the flag is %s',- (isApplicationWorkflowsEnabled) => {- expect(() =>- addWorkflowManifestsToFlatEntityMapsOrThrow({- workflows: MANIFEST.workflows ?? [],- ownerFlatApplication: {- id: MANIFEST.application.universalIdentifier,- universalIdentifier: MANIFEST.application.universalIdentifier,- },- fromAllFlatEntityMaps: createEmptyAllFlatEntityMaps(),- toAllUniversalFlatEntityMaps: createEmptyAllFlatEntityMaps(),- existingAllFlatEntityMaps: createEmptyAllFlatEntityMaps(),- idByUniversalIdentifierByMetadataName: {},- isApplicationWorkflowsEnabled,- now: '2026-09-28T00:00:00.000Z',- }),- ).toThrow('Application workflows are not enabled');- },- );-});-const compute = ({workflows = MANIFEST.workflows ?? [],fromAllFlatEntityMaps = createEmptyAllFlatEntityMaps(),@@ -86,7 +63,6 @@ const compute = ({toAllUniversalFlatEntityMaps,existingAllFlatEntityMaps: fromAllFlatEntityMaps,idByUniversalIdentifierByMetadataName: {},- isApplicationWorkflowsEnabled: true,now: '2026-09-28T00:00:00.000Z',});diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/add-workflow-manifests-to-flat-entity-maps-or-throw.util.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/add-workflow-manifests-to-flat-entity-maps-or-throw.util.tsindex 929ee12c606..2d65fc9a2af 100644--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/add-workflow-manifests-to-flat-entity-maps-or-throw.util.ts+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/add-workflow-manifests-to-flat-entity-maps-or-throw.util.ts@@ -25,7 +25,6 @@ export const addWorkflowManifestsToFlatEntityMapsOrThrow = ({toAllUniversalFlatEntityMaps,existingAllFlatEntityMaps,idByUniversalIdentifierByMetadataName,- isApplicationWorkflowsEnabled,now,}: {workflows: WorkflowManifest[];@@ -34,19 +33,8 @@ export const addWorkflowManifestsToFlatEntityMapsOrThrow = ({toAllUniversalFlatEntityMaps: AllFlatEntityMaps;existingAllFlatEntityMaps: AllFlatEntityMaps;idByUniversalIdentifierByMetadataName: IdByUniversalIdentifierByMetadataName;- isApplicationWorkflowsEnabled: boolean | undefined;now: string;}): (UniversalFlatWorkflow & { id: string })[] => {- if (workflows.length > 0 && !isApplicationWorkflowsEnabled) {- throw new ApplicationException(- 'Application workflows are not enabled for this workspace',- ApplicationExceptionCode.INVALID_INPUT,- {- userFriendlyMessage: msg`Application workflows are not enabled for this workspace.`,- },- );- }-const applicationUniversalIdentifier =ownerFlatApplication.universalIdentifier;const applicationWorkflows: (UniversalFlatWorkflow & { id: string })[] = [];diff --git a/packages/twenty-server/test/integration/graphql/suites/workflow/application-workflow-execution-permissions.integration-spec.ts b/packages/twenty-server/test/integration/graphql/suites/workflow/application-workflow-execution-permissions.integration-spec.tsindex 99b5eacf7fa..262bb9e91d0 100644--- a/packages/twenty-server/test/integration/graphql/suites/workflow/application-workflow-execution-permissions.integration-spec.ts+++ b/packages/twenty-server/test/integration/graphql/suites/workflow/application-workflow-execution-permissions.integration-spec.ts@@ -8,7 +8,6 @@ import { buildBaseManifest } from 'test/integration/metadata/suites/application/import { cleanupApplicationAndAppRegistration } from 'test/integration/metadata/suites/application/utils/cleanup-application-and-app-registration.util';import { setupApplicationForSync } from 'test/integration/metadata/suites/application/utils/setup-application-for-sync.util';import { syncApplication } from 'test/integration/metadata/suites/application/utils/sync-application.util';-import { updateFeatureFlag } from 'test/integration/metadata/suites/utils/update-feature-flag.util';import { generateApplicationTokenPair } from 'test/integration/utils/generate-application-token-pair.util';import { getAppProviderByClassName } from 'test/integration/utils/get-app-provider-by-class-name.util';import {@@ -17,7 +16,6 @@ import {} from 'twenty-shared/application';import { SystemPermissionFlag } from 'twenty-shared/constants';import { STANDARD_OBJECTS } from 'twenty-shared/metadata';-import { FeatureFlagKey } from 'twenty-shared/types';import { type LogicFunctionExecutorService } from 'src/engine/core-modules/logic-function/logic-function-executor/logic-function-executor.service';import { LogicFunctionExecutionStatus } from 'src/engine/metadata-modules/logic-function/dtos/logic-function-execution-result.dto';@@ -368,12 +366,6 @@ const countRecordsByName = async (describe('application workflow execution permissions', () => {beforeAll(async () => {- await updateFeatureFlag({- featureFlag: FeatureFlagKey.IS_APPLICATION_WORKFLOWS_ENABLED,- value: true,- expectToFail: false,- });-await setupApplicationForSync({applicationUniversalIdentifier: APP_ID,name: 'Application workflow permissions',@@ -426,11 +418,6 @@ describe('application workflow execution permissions', () => {await cleanupApplicationAndAppRegistration({applicationUniversalIdentifier: OTHER_APP_ID,});- await updateFeatureFlag({- featureFlag: FeatureFlagKey.IS_APPLICATION_WORKFLOWS_ENABLED,- value: false,- expectToFail: false,- });});it('runs a record step the application role allows', async () => {diff --git a/packages/twenty-server/test/integration/graphql/suites/workflow/application-workflow-removal.integration-spec.ts b/packages/twenty-server/test/integration/graphql/suites/workflow/application-workflow-removal.integration-spec.tsindex a9419a2a30a..485e1c711a3 100644--- a/packages/twenty-server/test/integration/graphql/suites/workflow/application-workflow-removal.integration-spec.ts+++ b/packages/twenty-server/test/integration/graphql/suites/workflow/application-workflow-removal.integration-spec.ts@@ -19,9 +19,7 @@ import { submitFormStep } from 'test/integration/graphql/suites/workflow/utils/simport { cleanupApplicationAndAppRegistration } from 'test/integration/metadata/suites/application/utils/cleanup-application-and-app-registration.util';import { setupApplicationForSync } from 'test/integration/metadata/suites/application/utils/setup-application-for-sync.util';import { syncApplication } from 'test/integration/metadata/suites/application/utils/sync-application.util';-import { updateFeatureFlag } from 'test/integration/metadata/suites/utils/update-feature-flag.util';import { getAppProviderByClassName } from 'test/integration/utils/get-app-provider-by-class-name.util';-import { FeatureFlagKey } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { getWorkspaceSchemaName } from 'src/engine/workspace-datasource/utils/get-workspace-schema-name.util';@@ -108,11 +106,6 @@ describe('removing workflows from an application manifest', () => {let keptRunId: string;beforeAll(async () => {- await updateFeatureFlag({- featureFlag: FeatureFlagKey.IS_APPLICATION_WORKFLOWS_ENABLED,- value: true,- expectToFail: false,- });await setupApplicationForSync({applicationUniversalIdentifier: APP_ID,name: 'Application workflow removal',@@ -169,11 +162,6 @@ describe('removing workflows from an application manifest', () => {await cleanupApplicationAndAppRegistration({applicationUniversalIdentifier: APP_ID,});- await updateFeatureFlag({- featureFlag: FeatureFlagKey.IS_APPLICATION_WORKFLOWS_ENABLED,- value: false,- expectToFail: false,- });jest.useFakeTimers();});diff --git a/packages/twenty-server/test/integration/graphql/suites/workflow/workflow-deletion-cleanup.integration-spec.ts b/packages/twenty-server/test/integration/graphql/suites/workflow/workflow-deletion-cleanup.integration-spec.tsindex 750981488bd..0dba1971391 100644--- a/packages/twenty-server/test/integration/graphql/suites/workflow/workflow-deletion-cleanup.integration-spec.ts+++ b/packages/twenty-server/test/integration/graphql/suites/workflow/workflow-deletion-cleanup.integration-spec.ts@@ -596,11 +596,6 @@ describe('workflow deletion cleanup', () => {);beforeAll(async () => {- await updateFeatureFlag({- featureFlag: FeatureFlagKey.IS_APPLICATION_WORKFLOWS_ENABLED,- value: true,- expectToFail: false,- });await installApplication(APP_ID, [FORM_WORKFLOW, SLOW_WORKFLOW]);await installApplication(OTHER_APP_ID, [OTHER_APP_WORKFLOW]);}, 180000);@@ -620,11 +615,6 @@ describe('workflow deletion cleanup', () => {await cleanupApplicationAndAppRegistration({applicationUniversalIdentifier: OTHER_APP_ID,});- await updateFeatureFlag({- featureFlag: FeatureFlagKey.IS_APPLICATION_WORKFLOWS_ENABLED,- value: false,- expectToFail: false,- });});it('deletes the runs of its workflows when the uninstall succeeds, before it returns', async () => {diff --git a/packages/twenty-server/test/integration/metadata/suites/application/successful-sync-application-workflows.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/application/successful-sync-application-workflows.integration-spec.tsindex 2467c24b849..3c64bb657a3 100644--- a/packages/twenty-server/test/integration/metadata/suites/application/successful-sync-application-workflows.integration-spec.ts+++ b/packages/twenty-server/test/integration/metadata/suites/application/successful-sync-application-workflows.integration-spec.ts@@ -1,6 +1,5 @@import { buildDefaultObjectManifest } from 'test/integration/metadata/suites/application/utils/build-default-object-manifest.util';-import { FieldMetadataType, FeatureFlagKey } from 'twenty-shared/types';-import { updateFeatureFlag } from 'test/integration/metadata/suites/utils/update-feature-flag.util';+import { FieldMetadataType } from 'twenty-shared/types';import { randomUUID } from 'node:crypto';import { type Manifest } from 'twenty-shared/application';import { STANDARD_OBJECTS } from 'twenty-shared/metadata';@@ -147,11 +146,6 @@ const findRun = async (runId: string): Promise<WorkflowRunWorkspaceEntity> => {describe('application-owned core workflows', () => {beforeAll(async () => {- await updateFeatureFlag({- featureFlag: FeatureFlagKey.IS_APPLICATION_WORKFLOWS_ENABLED,- value: true,- expectToFail: false,- });await setupApplicationForSync({applicationUniversalIdentifier: REFERENCE_APP_ID,name: 'Workflow referenced application',@@ -214,11 +208,6 @@ describe('application-owned core workflows', () => {await cleanupApplicationAndAppRegistration({applicationUniversalIdentifier: REFERENCE_APP_ID,});- await updateFeatureFlag({- featureFlag: FeatureFlagKey.IS_APPLICATION_WORKFLOWS_ENABLED,- value: false,- expectToFail: false,- });jest.useFakeTimers();});diff --git a/packages/twenty-shared/src/types/FeatureFlagKey.ts b/packages/twenty-shared/src/types/FeatureFlagKey.tsindex ee360ac71f9..efc69123810 100644--- a/packages/twenty-shared/src/types/FeatureFlagKey.ts+++ b/packages/twenty-shared/src/types/FeatureFlagKey.ts@@ -1,5 +1,4 @@export enum FeatureFlagKey {- IS_APPLICATION_WORKFLOWS_ENABLED = 'IS_APPLICATION_WORKFLOWS_ENABLED',IS_ASYNC_CSV_EXPORT_ENABLED = 'IS_ASYNC_CSV_EXPORT_ENABLED',IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED = 'IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED',IS_JSON_FILTER_ENABLED = 'IS_JSON_FILTER_ENABLED',