Skip to content

The open alternative to Salesforce, designed for AI.

chore(logic-function): remove the IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED feature flag (#27307)

martmull87a13caa8c03
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
index 2aa0ddc2415..b4f358c1389 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
@@ -2140,7 +2140,6 @@ enum FeatureFlagKey {
IS_JSON_FILTER_ENABLED
IS_MESSAGE_CAMPAIGN_ENABLED
IS_REST_METADATA_API_NEW_FORMAT_DIRECT
- IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED
IS_WORKFLOW_CORE_INDEX_PAGE_ENABLED
IS_AI_CHAT_SHARING_DROPDOWN_ENABLED
IS_INITIAL_OBJECT_VIEW_ENABLED
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.ts b/packages/twenty-client-sdk/src/metadata/generated/schema.ts
index d3269c736e6..d653118f332 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/schema.ts
+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.ts
@@ -1714,7 +1714,7 @@ export interface FeatureFlag {
__typename: 'FeatureFlag'
}
-export type FeatureFlagKey = 'IS_APPLICATION_WORKFLOWS_ENABLED' | 'IS_ASYNC_CSV_EXPORT_ENABLED' | 'IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED' | 'IS_JSON_FILTER_ENABLED' | 'IS_MESSAGE_CAMPAIGN_ENABLED' | 'IS_REST_METADATA_API_NEW_FORMAT_DIRECT' | 'IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED' | 'IS_WORKFLOW_CORE_INDEX_PAGE_ENABLED' | 'IS_AI_CHAT_SHARING_DROPDOWN_ENABLED' | 'IS_INITIAL_OBJECT_VIEW_ENABLED' | 'IS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED' | 'IS_RECORD_CREATION_FORM_ENABLED' | 'IS_LOGS_SETTINGS_SECTION_ENABLED' | 'IS_CONVERSATIONS_TAB_ENABLED' | 'IS_VALIDATION_RULES_ENABLED' | 'IS_RECORD_LEVEL_SHARING_ENABLED' | 'IS_WORKFLOW_SEND_CHAT_MESSAGE_ENABLED' | 'IS_CALENDAR_SYNC_SKIP_UNCHANGED_RECORDS_ENABLED' | 'IS_RECORD_SHARE_VISIBILITY_GATING_ENABLED'
+export type FeatureFlagKey = 'IS_APPLICATION_WORKFLOWS_ENABLED' | 'IS_ASYNC_CSV_EXPORT_ENABLED' | 'IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED' | 'IS_JSON_FILTER_ENABLED' | 'IS_MESSAGE_CAMPAIGN_ENABLED' | 'IS_REST_METADATA_API_NEW_FORMAT_DIRECT' | 'IS_WORKFLOW_CORE_INDEX_PAGE_ENABLED' | 'IS_AI_CHAT_SHARING_DROPDOWN_ENABLED' | 'IS_INITIAL_OBJECT_VIEW_ENABLED' | 'IS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED' | 'IS_RECORD_CREATION_FORM_ENABLED' | 'IS_LOGS_SETTINGS_SECTION_ENABLED' | 'IS_CONVERSATIONS_TAB_ENABLED' | 'IS_VALIDATION_RULES_ENABLED' | 'IS_RECORD_LEVEL_SHARING_ENABLED' | 'IS_WORKFLOW_SEND_CHAT_MESSAGE_ENABLED' | 'IS_CALENDAR_SYNC_SKIP_UNCHANGED_RECORDS_ENABLED' | 'IS_RECORD_SHARE_VISIBILITY_GATING_ENABLED'
export interface WorkspaceUrls {
customUrl?: Scalars['String']
@@ -11441,7 +11441,6 @@ export const enumFeatureFlagKey = {
IS_JSON_FILTER_ENABLED: 'IS_JSON_FILTER_ENABLED' as const,
IS_MESSAGE_CAMPAIGN_ENABLED: 'IS_MESSAGE_CAMPAIGN_ENABLED' as const,
IS_REST_METADATA_API_NEW_FORMAT_DIRECT: 'IS_REST_METADATA_API_NEW_FORMAT_DIRECT' as const,
- IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED: 'IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED' as const,
IS_WORKFLOW_CORE_INDEX_PAGE_ENABLED: 'IS_WORKFLOW_CORE_INDEX_PAGE_ENABLED' as const,
IS_AI_CHAT_SHARING_DROPDOWN_ENABLED: 'IS_AI_CHAT_SHARING_DROPDOWN_ENABLED' as const,
IS_INITIAL_OBJECT_VIEW_ENABLED: 'IS_INITIAL_OBJECT_VIEW_ENABLED' as const,
diff --git a/packages/twenty-front/src/generated-admin/graphql.ts b/packages/twenty-front/src/generated-admin/graphql.ts
index 06a328e5d90..0afc95984b0 100644
--- a/packages/twenty-front/src/generated-admin/graphql.ts
+++ b/packages/twenty-front/src/generated-admin/graphql.ts
@@ -484,7 +484,6 @@ export enum FeatureFlagKey {
IS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED = 'IS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED',
IS_INITIAL_OBJECT_VIEW_ENABLED = 'IS_INITIAL_OBJECT_VIEW_ENABLED',
IS_JSON_FILTER_ENABLED = 'IS_JSON_FILTER_ENABLED',
- IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED = 'IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED',
IS_LOGS_SETTINGS_SECTION_ENABLED = 'IS_LOGS_SETTINGS_SECTION_ENABLED',
IS_MESSAGE_CAMPAIGN_ENABLED = 'IS_MESSAGE_CAMPAIGN_ENABLED',
IS_RECORD_CREATION_FORM_ENABLED = 'IS_RECORD_CREATION_FORM_ENABLED',
diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.ts
index f2ef06ada54..195fc713330 100644
--- a/packages/twenty-front/src/generated-metadata/graphql.ts
+++ b/packages/twenty-front/src/generated-metadata/graphql.ts
@@ -2154,7 +2154,6 @@ export enum FeatureFlagKey {
IS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED = 'IS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED',
IS_INITIAL_OBJECT_VIEW_ENABLED = 'IS_INITIAL_OBJECT_VIEW_ENABLED',
IS_JSON_FILTER_ENABLED = 'IS_JSON_FILTER_ENABLED',
- IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED = 'IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED',
IS_LOGS_SETTINGS_SECTION_ENABLED = 'IS_LOGS_SETTINGS_SECTION_ENABLED',
IS_MESSAGE_CAMPAIGN_ENABLED = 'IS_MESSAGE_CAMPAIGN_ENABLED',
IS_RECORD_CREATION_FORM_ENABLED = 'IS_RECORD_CREATION_FORM_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.ts
index 74ff074b1cb..bab34854424 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
@@ -30,10 +30,6 @@ export const SETTINGS_ADMIN_FEATURE_FLAG_METADATA: Partial<
label: msg`Direct REST metadata responses`,
description: msg`Return metadata directly instead of wrapping it in the legacy response envelope.`,
},
- [FeatureFlagKey.IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED]: {
- label: msg`Prebuilt logic functions`,
- description: msg`Run logic functions from prebuilt application bundles.`,
- },
[FeatureFlagKey.IS_APPLICATION_WORKFLOWS_ENABLED]: {
label: msg`Application workflows`,
description: msg`Allow applications to install workflows and start new workflow runs.`,
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-39/2-39-workspace-command-1788338950836-convert-logic-functions-to-prebuilt.command.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-39/2-39-workspace-command-1788338950836-convert-logic-functions-to-prebuilt.command.ts
index 97917f446f1..12a6f13afc8 100644
--- a/packages/twenty-server/src/database/commands/upgrade-version-command/2-39/2-39-workspace-command-1788338950836-convert-logic-functions-to-prebuilt.command.ts
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-39/2-39-workspace-command-1788338950836-convert-logic-functions-to-prebuilt.command.ts
@@ -3,7 +3,7 @@ import { InjectDataSource } from '@nestjs/typeorm';
import chunk from 'lodash.chunk';
import { Command } from 'nest-commander';
-import { FeatureFlagKey } from 'twenty-shared/types';
+import { type FeatureFlagKey } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { DataSource } from 'typeorm';
@@ -57,13 +57,13 @@ export class ConvertLogicFunctionsToPrebuiltCommand extends ProvisionedWorkspace
const isPrebuiltModeEnabled =
await this.featureFlagService.isFeatureEnabled(
- FeatureFlagKey.IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED,
+ 'IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED' as FeatureFlagKey,
workspaceId,
);
if (!isPrebuiltModeEnabled && !dryRun) {
await this.featureFlagService.enableFeatureFlags(
- [FeatureFlagKey.IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED],
+ ['IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED' as FeatureFlagKey],
workspaceId,
);
}
@@ -87,7 +87,7 @@ export class ConvertLogicFunctionsToPrebuiltCommand extends ProvisionedWorkspace
if (dryRun) {
this.logger.log(
- `Would ensure ${FeatureFlagKey.IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED} is enabled and convert ${conversionTargets.length} logic function(s) on workspace ${workspaceId}`,
+ `Would ensure IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED is enabled and convert ${conversionTargets.length} logic function(s) on workspace ${workspaceId}`,
);
return;
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.ts
index c5302a65157..1b06e468b2f 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
@@ -114,10 +114,6 @@ export class ApplicationManifestMigrationService {
manifest: preInstallOnlyManifest,
ownerFlatApplication,
fromAllFlatEntityMaps,
- isLogicFunctionPrebuiltModeEnabled:
- featureFlagsMap[
- FeatureFlagKey.IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED
- ],
now,
workspaceId,
});
@@ -208,10 +204,6 @@ export class ApplicationManifestMigrationService {
manifest,
ownerFlatApplication,
fromAllFlatEntityMaps,
- isLogicFunctionPrebuiltModeEnabled:
- featureFlagsMap[
- FeatureFlagKey.IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED
- ],
now,
workspaceId,
});
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-logic-function-manifest-to-universal-flat-logic-function.util.spec.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-logic-function-manifest-to-universal-flat-logic-function.util.spec.ts
index a9d88e71dd9..dca8a318418 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-logic-function-manifest-to-universal-flat-logic-function.util.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-logic-function-manifest-to-universal-flat-logic-function.util.spec.ts
@@ -44,19 +44,16 @@ describe('fromLogicFunctionManifestToUniversalFlatLogicFunction', () => {
logicFunctionManifest = buildLogicFunctionManifest(),
applicationSourceType,
existingFlatLogicFunctionMaps = emptyFlatLogicFunctionMaps,
- isPrebuiltModeEnabled = true,
}: {
logicFunctionManifest?: LogicFunctionManifest;
applicationSourceType: ApplicationRegistrationSourceType;
existingFlatLogicFunctionMaps?: AllFlatEntityMaps['flatLogicFunctionMaps'];
- isPrebuiltModeEnabled?: boolean;
}) =>
fromLogicFunctionManifestToUniversalFlatLogicFunction({
logicFunctionManifest,
applicationUniversalIdentifier,
applicationSourceType,
existingFlatLogicFunctionMaps,
- isPrebuiltModeEnabled,
now,
});
@@ -100,15 +97,6 @@ describe('fromLogicFunctionManifestToUniversalFlatLogicFunction', () => {
},
);
- it('should keep LIVE execution mode when prebuilt mode is disabled', () => {
- const result = convert({
- applicationSourceType: ApplicationRegistrationSourceType.NPM,
- isPrebuiltModeEnabled: false,
- });
-
- expect(result.executionMode).toBe(LogicFunctionExecutionMode.LIVE);
- });
-
it('should keep the execution mode of an already synced function', () => {
const result = convert({
applicationSourceType: ApplicationRegistrationSourceType.NPM,
@@ -120,13 +108,12 @@ describe('fromLogicFunctionManifestToUniversalFlatLogicFunction', () => {
expect(result.executionMode).toBe(LogicFunctionExecutionMode.LIVE);
});
- it('should keep PREBUILT on an already synced function even when prebuilt mode is disabled', () => {
+ it('should keep PREBUILT on an already synced function', () => {
const result = convert({
applicationSourceType: ApplicationRegistrationSourceType.NPM,
existingFlatLogicFunctionMaps: buildFlatLogicFunctionMaps(
LogicFunctionExecutionMode.PREBUILT,
),
- isPrebuiltModeEnabled: false,
});
expect(result.executionMode).toBe(LogicFunctionExecutionMode.PREBUILT);
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-logic-function-manifest-to-universal-flat-logic-function.util.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-logic-function-manifest-to-universal-flat-logic-function.util.ts
index d63dcbb95a0..e5b7698ec8e 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-logic-function-manifest-to-universal-flat-logic-function.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-logic-function-manifest-to-universal-flat-logic-function.util.ts
@@ -18,12 +18,10 @@ const resolveExecutionMode = ({
logicFunctionManifest,
applicationSourceType,
existingFlatLogicFunctionMaps,
- isPrebuiltModeEnabled,
}: {
logicFunctionManifest: LogicFunctionManifest;
applicationSourceType: ApplicationRegistrationSourceType;
existingFlatLogicFunctionMaps: AllFlatEntityMaps['flatLogicFunctionMaps'];
- isPrebuiltModeEnabled: boolean;
}): LogicFunctionExecutionMode => {
const existingFlatLogicFunction = findFlatEntityByUniversalIdentifier({
flatEntityMaps: existingFlatLogicFunctionMaps,
@@ -43,7 +41,6 @@ const resolveExecutionMode = ({
}
if (
- isPrebuiltModeEnabled &&
isPackagedApplicationSource(applicationSourceType) &&
isNonEmptyString(logicFunctionManifest.builtHandlerChecksum)
) {
@@ -58,14 +55,12 @@ export const fromLogicFunctionManifestToUniversalFlatLogicFunction = ({
applicationUniversalIdentifier,
applicationSourceType,
existingFlatLogicFunctionMaps,
- isPrebuiltModeEnabled,
now,
}: {
logicFunctionManifest: LogicFunctionManifest;
applicationUniversalIdentifier: string;
applicationSourceType: ApplicationRegistrationSourceType;
existingFlatLogicFunctionMaps: AllFlatEntityMaps['flatLogicFunctionMaps'];
- isPrebuiltModeEnabled: boolean;
now: string;
}): UniversalFlatLogicFunction => {
const name =
@@ -97,7 +92,6 @@ export const fromLogicFunctionManifestToUniversalFlatLogicFunction = ({
logicFunctionManifest,
applicationSourceType,
existingFlatLogicFunctionMaps,
- isPrebuiltModeEnabled,
}),
createdAt: now,
updatedAt: now,
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/services/compute-application-manifest-all-universal-flat-entity-maps.service.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/services/compute-application-manifest-all-universal-flat-entity-maps.service.ts
index fdfe8bd8295..8d999a4d1c4 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/services/compute-application-manifest-all-universal-flat-entity-maps.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/services/compute-application-manifest-all-universal-flat-entity-maps.service.ts
@@ -65,14 +65,12 @@ export class ComputeApplicationManifestAllUniversalFlatEntityMapsService {
manifest,
ownerFlatApplication,
fromAllFlatEntityMaps,
- isLogicFunctionPrebuiltModeEnabled,
now,
workspaceId,
}: {
manifest: Manifest;
ownerFlatApplication: FlatApplication;
fromAllFlatEntityMaps: AllFlatEntityMaps;
- isLogicFunctionPrebuiltModeEnabled: boolean;
now: string;
workspaceId: string;
}): AllFlatEntityMaps {
@@ -223,7 +221,6 @@ export class ComputeApplicationManifestAllUniversalFlatEntityMapsService {
applicationSourceType,
existingFlatLogicFunctionMaps:
fromAllFlatEntityMaps.flatLogicFunctionMaps,
- isPrebuiltModeEnabled: isLogicFunctionPrebuiltModeEnabled,
now,
}),
universalFlatEntityMapsToMutate:
diff --git a/packages/twenty-server/src/engine/core-modules/logic-function/logic-function-executor/logic-function-executor.module.ts b/packages/twenty-server/src/engine/core-modules/logic-function/logic-function-executor/logic-function-executor.module.ts
index fe97c6617a1..0ca3d568373 100644
--- a/packages/twenty-server/src/engine/core-modules/logic-function/logic-function-executor/logic-function-executor.module.ts
+++ b/packages/twenty-server/src/engine/core-modules/logic-function/logic-function-executor/logic-function-executor.module.ts
@@ -9,7 +9,6 @@ import { EventLogLiveModule } from 'src/engine/core-modules/event-logs/live/even
import { TokenModule } from 'src/engine/core-modules/auth/token/token.module';
import { BillingModule } from 'src/engine/core-modules/billing/billing.module';
import { WorkspaceDomainsModule } from 'src/engine/core-modules/domain/workspace-domains/workspace-domains.module';
-import { FeatureFlagModule } from 'src/engine/core-modules/feature-flag/feature-flag.module';
import { LogicFunctionExecutorService } from 'src/engine/core-modules/logic-function/logic-function-executor/logic-function-executor.service';
import { SecretEncryptionModule } from 'src/engine/core-modules/secret-encryption/secret-encryption.module';
import { ThrottlerModule } from 'src/engine/core-modules/throttler/throttler.module';
@@ -31,7 +30,6 @@ import { WorkspaceCacheModule } from 'src/engine/workspace-cache/workspace-cache
WorkspaceCacheModule,
LogicFunctionPrebuiltWarmUpModule,
BillingModule,
- FeatureFlagModule,
WorkspaceDomainsModule,
ApplicationModule,
ApplicationVariableEntityModule,
diff --git a/packages/twenty-server/src/engine/core-modules/logic-function/logic-function-executor/logic-function-executor.service.ts b/packages/twenty-server/src/engine/core-modules/logic-function/logic-function-executor/logic-function-executor.service.ts
index 92a19642417..03be0ebbe4f 100644
--- a/packages/twenty-server/src/engine/core-modules/logic-function/logic-function-executor/logic-function-executor.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/logic-function/logic-function-executor/logic-function-executor.service.ts
@@ -14,7 +14,6 @@ import {
type LogicFunctionExecutionContext,
type LogicFunctionRetryContext,
} from 'twenty-shared/logic-function';
-import { FeatureFlagKey } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { Repository } from 'typeorm';
import { v4 } from 'uuid';
@@ -40,7 +39,6 @@ import { LOGIC_FUNCTION_EXECUTED_EVENT } from 'src/engine/core-modules/event-log
import { EventLogLiveService } from 'src/engine/core-modules/event-logs/live/event-log-live.service';
import { buildApplicationLogEnvelopes } from 'src/engine/core-modules/event-logs/producers/application-log/build-application-log-envelopes';
import { parseApplicationLogLines } from 'src/engine/core-modules/event-logs/producers/application-log/parse-application-log-lines';
-import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service';
import { LogicFunctionDriverFactory } from 'src/engine/core-modules/logic-function/logic-function-drivers/logic-function-driver.factory';
import { buildLogicFunctionExecutionUsage } from 'src/engine/core-modules/logic-function/logic-function-executor/utils/build-logic-function-execution-usage.util';
import { resolveWorkspaceMemberIdForUser } from 'src/engine/core-modules/logic-function/logic-function-executor/utils/resolve-workspace-member-id-for-user.util';
@@ -115,7 +113,6 @@ export class LogicFunctionExecutorService {
private readonly usageRecorderService: UsageRecorderService,
private readonly billingUsageService: BillingUsageService,
private readonly usageLimitQuotaService: UsageLimitQuotaService,
- private readonly featureFlagService: FeatureFlagService,
private readonly workspaceDomainsService: WorkspaceDomainsService,
private readonly applicationService: ApplicationService,
private readonly applicationStopService: ApplicationStopService,
@@ -183,11 +180,8 @@ export class LogicFunctionExecutorService {
const driver = this.logicFunctionDriverFactory.getCurrentDriver();
- const effectiveExecutionMode = await this.resolveEffectiveExecutionMode({
- workspaceId,
- flatLogicFunction,
- callerOverride: executionMode,
- });
+ const effectiveExecutionMode =
+ executionMode ?? flatLogicFunction.executionMode;
if (effectiveExecutionMode === LogicFunctionExecutionMode.PREBUILT) {
await this.logicFunctionPrebuiltWarmUpService.ensurePrebuiltBundleInstalled(
@@ -234,32 +228,6 @@ export class LogicFunctionExecutorService {
return resultLogicFunction;
}
- private async resolveEffectiveExecutionMode({
- workspaceId,
- flatLogicFunction,
- callerOverride,
- }: {
- workspaceId: string;
- flatLogicFunction: FlatLogicFunction;
- callerOverride?: LogicFunctionExecutionMode;
- }): Promise<LogicFunctionExecutionMode> {
- if (isDefined(callerOverride)) {
- return callerOverride;
- }
-
- const isPrebuiltModeEnabled =
- await this.featureFlagService.isFeatureEnabled(
- FeatureFlagKey.IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED,
- workspaceId,
- );
-
- if (!isPrebuiltModeEnabled) {
- return LogicFunctionExecutionMode.LIVE;
- }
-
- return flatLogicFunction.executionMode ?? LogicFunctionExecutionMode.LIVE;
- }
-
async transpile(
params: LogicFunctionTranspileParams,
): Promise<LogicFunctionTranspileResult> {
diff --git a/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-version-step/code-step/code-step-build.module.ts b/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-version-step/code-step/code-step-build.module.ts
index 0e403113a87..0498d45953c 100644
--- a/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-version-step/code-step/code-step-build.module.ts
+++ b/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-version-step/code-step/code-step-build.module.ts
@@ -1,7 +1,6 @@
import { Module } from '@nestjs/common';
import { ApplicationModule } from 'src/engine/core-modules/application/application.module';
-import { FeatureFlagModule } from 'src/engine/core-modules/feature-flag/feature-flag.module';
import { WorkspaceManyOrAllFlatEntityMapsCacheModule } from 'src/engine/metadata-modules/flat-entity/services/workspace-many-or-all-flat-entity-maps-cache.module';
import { LogicFunctionModule } from 'src/engine/metadata-modules/logic-function/logic-function.module';
@@ -12,7 +11,6 @@ import { CodeStepBuildService } from './services/code-step-build.service';
ApplicationModule,
WorkspaceManyOrAllFlatEntityMapsCacheModule,
LogicFunctionModule,
- FeatureFlagModule,
],
providers: [CodeStepBuildService],
exports: [CodeStepBuildService],
diff --git a/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-version-step/code-step/services/code-step-build.service.ts b/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-version-step/code-step/services/code-step-build.service.ts
index c168ca8a08e..b57e28fb67f 100644
--- a/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-version-step/code-step/services/code-step-build.service.ts
+++ b/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-version-step/code-step/services/code-step-build.service.ts
@@ -1,10 +1,8 @@
import { Injectable, Logger } from '@nestjs/common';
import { SEED_WORKFLOW_ACTION_TRIGGER_SETTINGS } from 'twenty-shared/logic-function';
-import { FeatureFlagKey } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
-import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service';
import { WorkspaceManyOrAllFlatEntityMapsCacheService } from 'src/engine/metadata-modules/flat-entity/services/workspace-many-or-all-flat-entity-maps-cache.service';
import { findFlatEntityByIdInFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/utils/find-flat-entity-by-id-in-flat-entity-maps.util';
import { LogicFunctionExecutionMode } from 'src/engine/metadata-modules/logic-function/logic-function.entity';
@@ -25,7 +23,6 @@ export class CodeStepBuildService {
private readonly workspaceManyOrAllFlatEntityMapsCacheService: WorkspaceManyOrAllFlatEntityMapsCacheService,
private readonly logicFunctionFromSourceService: LogicFunctionFromSourceService,
private readonly logicFunctionFromSourceHelperService: LogicFunctionFromSourceHelperService,
- private readonly featureFlagService: FeatureFlagService,
) {}
async createCodeStepLogicFunction({
@@ -125,16 +122,6 @@ export class CodeStepBuildService {
workspaceId: string;
steps: WorkflowAction[];
}): Promise<void> {
- const isPrebuiltModeEnabled =
- await this.featureFlagService.isFeatureEnabled(
- FeatureFlagKey.IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED,
- workspaceId,
- );
-
- if (!isPrebuiltModeEnabled) {
- return;
- }
-
const logicFunctionIds =
extractCodeStepLogicFunctionIdsFromWorkflowSteps(steps);
diff --git a/packages/twenty-server/test/integration/graphql/suites/workflow/code-step-prebuilt-workflow.integration-spec.ts b/packages/twenty-server/test/integration/graphql/suites/workflow/code-step-prebuilt-workflow.integration-spec.ts
index 4c8f380f816..359e72103a2 100644
--- a/packages/twenty-server/test/integration/graphql/suites/workflow/code-step-prebuilt-workflow.integration-spec.ts
+++ b/packages/twenty-server/test/integration/graphql/suites/workflow/code-step-prebuilt-workflow.integration-spec.ts
@@ -8,8 +8,6 @@ import {
import { updateWorkflowVersionTrigger } from 'test/integration/graphql/suites/workflow/utils/update-workflow-version-trigger.util';
import { updateLogicFunctionSource } from 'test/integration/metadata/suites/logic-function/utils/update-logic-function-source.util';
import { makeMetadataApiRequest } from 'test/integration/metadata/suites/utils/make-metadata-api-request.util';
-import { updateFeatureFlag } from 'test/integration/metadata/suites/utils/update-feature-flag.util';
-import { FeatureFlagKey } from 'twenty-shared/types';
import { LogicFunctionExecutionMode } from 'src/engine/metadata-modules/logic-function/logic-function.entity';
@@ -33,12 +31,6 @@ describe('Code step workflow with PREBUILT logic function (e2e)', () => {
let createdWorkflowRunId: string | null = null;
beforeAll(async () => {
- await updateFeatureFlag({
- featureFlag: FeatureFlagKey.IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED,
- value: true,
- expectToFail: false,
- });
-
const createWorkflowResponse = await client
.post('/graphql')
.set('Authorization', `Bearer ${APPLE_JANE_ADMIN_ACCESS_TOKEN}`)
@@ -231,12 +223,6 @@ describe('Code step workflow with PREBUILT logic function (e2e)', () => {
variables: { id: createdWorkflowId },
});
}
-
- await updateFeatureFlag({
- featureFlag: FeatureFlagKey.IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED,
- value: false,
- expectToFail: false,
- });
});
it('flips the underlying logic function to PREBUILT on workflow activation', async () => {
diff --git a/packages/twenty-shared/src/types/FeatureFlagKey.ts b/packages/twenty-shared/src/types/FeatureFlagKey.ts
index 7426f296aea..e729db1e7c8 100644
--- a/packages/twenty-shared/src/types/FeatureFlagKey.ts
+++ b/packages/twenty-shared/src/types/FeatureFlagKey.ts
@@ -5,7 +5,6 @@ export enum FeatureFlagKey {
IS_JSON_FILTER_ENABLED = 'IS_JSON_FILTER_ENABLED',
IS_MESSAGE_CAMPAIGN_ENABLED = 'IS_MESSAGE_CAMPAIGN_ENABLED',
IS_REST_METADATA_API_NEW_FORMAT_DIRECT = 'IS_REST_METADATA_API_NEW_FORMAT_DIRECT',
- IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED = 'IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED',
IS_WORKFLOW_CORE_INDEX_PAGE_ENABLED = 'IS_WORKFLOW_CORE_INDEX_PAGE_ENABLED',
IS_AI_CHAT_SHARING_DROPDOWN_ENABLED = 'IS_AI_CHAT_SHARING_DROPDOWN_ENABLED',
IS_INITIAL_OBJECT_VIEW_ENABLED = 'IS_INITIAL_OBJECT_VIEW_ENABLED',