diff --git a/packages/twenty-server/src/engine/metadata-modules/serverless-function/serverless-function.resolver.ts b/packages/twenty-server/src/engine/metadata-modules/serverless-function/serverless-function.resolver.ts index 2df5d97bad6d..1493c9dc0647 100644 --- a/packages/twenty-server/src/engine/metadata-modules/serverless-function/serverless-function.resolver.ts +++ b/packages/twenty-server/src/engine/metadata-modules/serverless-function/serverless-function.resolver.ts @@ -35,17 +35,16 @@ export class ServerlessFunctionResolver { ) {} async checkFeatureFlag(workspaceId: string) { - const isFunctionSettingsEnabled = - await this.featureFlagRepository.findOneBy({ - workspaceId, - key: FeatureFlagKey.IsFunctionSettingsEnabled, - value: true, - }); + const isWorkflowEnabled = await this.featureFlagRepository.findOneBy({ + workspaceId, + key: FeatureFlagKey.IsWorkflowEnabled, + value: true, + }); - if (!isFunctionSettingsEnabled) { + if (!isWorkflowEnabled) { throw new ServerlessFunctionException( - `IS_FUNCTION_SETTINGS_ENABLED feature flag is not set to true for this workspace`, - ServerlessFunctionExceptionCode.SERVERLESS_FUNCTION_NOT_FOUND, + `IS_WORKFLOW_ENABLED feature flag is not set to true for this workspace`, + ServerlessFunctionExceptionCode.FEATURE_FLAG_INVALID, ); } }