diff --git a/apps/app/src/app/(app)/[orgId]/tasks/[taskId]/automation/[automationId]/actions/task-automation-actions.ts b/apps/app/src/app/(app)/[orgId]/tasks/[taskId]/automation/[automationId]/actions/task-automation-actions.ts index 40100081b..19097ed6c 100644 --- a/apps/app/src/app/(app)/[orgId]/tasks/[taskId]/automation/[automationId]/actions/task-automation-actions.ts +++ b/apps/app/src/app/(app)/[orgId]/tasks/[taskId]/automation/[automationId]/actions/task-automation-actions.ts @@ -34,7 +34,10 @@ function getEnterpriseConfig() { const enterpriseApiKey = process.env.ENTERPRISE_API_SECRET; if (!enterpriseApiKey) { - throw new Error('Not authorized to access enterprise API'); + throw new EnterpriseApiError( + 'Task automations require an enterprise license. Please contact sales@trycomp.ai to learn more.', + 403, + ); } return { enterpriseApiUrl, enterpriseApiKey }; diff --git a/apps/app/src/app/(app)/[orgId]/tasks/[taskId]/automation/[automationId]/page.tsx b/apps/app/src/app/(app)/[orgId]/tasks/[taskId]/automation/[automationId]/page.tsx index 03b122f87..b4a178599 100644 --- a/apps/app/src/app/(app)/[orgId]/tasks/[taskId]/automation/[automationId]/page.tsx +++ b/apps/app/src/app/(app)/[orgId]/tasks/[taskId]/automation/[automationId]/page.tsx @@ -1,4 +1,6 @@ import { db } from '@db'; +import { ArrowLeft, Lock } from 'lucide-react'; +import Link from 'next/link'; import { redirect } from 'next/navigation'; import { loadChatHistory } from './actions/task-automation-actions'; import { AutomationLayoutWrapper } from './automation-layout-wrapper'; @@ -23,6 +25,37 @@ export default async function Page({ redirect('/tasks'); } + // Check if enterprise API is configured + if (!process.env.ENTERPRISE_API_SECRET) { + return ( +
+
+
+ +
+

Enterprise Feature

+

+ Task automations require an enterprise license. Contact{' '} + + sales@trycomp.ai + {' '} + to learn more about enabling this feature. +

+ + + Back to task + +
+
+ ); + } + const taskName = task.title; // Load chat history server-side (skip for ephemeral 'new' automations)