From 362f4c2918cc47a9a62a7183b5ea65c470772d8d Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Wed, 4 Feb 2026 11:27:41 -0800 Subject: [PATCH] improvement(timeouts): sync to 50 min, self-hosted maxed out (#3133) * improvement(timeouts): sync to 50 min, self-hosted maxed out * update env vars --- apps/docs/content/docs/en/execution/costs.mdx | 6 +++--- .../components/subscription/plan-configs.ts | 4 ++-- apps/sim/lib/core/config/env.ts | 6 +++--- apps/sim/lib/core/execution-limits/types.ts | 14 ++++++++++---- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/apps/docs/content/docs/en/execution/costs.mdx b/apps/docs/content/docs/en/execution/costs.mdx index 21f2302df..2446f7534 100644 --- a/apps/docs/content/docs/en/execution/costs.mdx +++ b/apps/docs/content/docs/en/execution/costs.mdx @@ -220,9 +220,9 @@ Workflows have maximum execution time limits based on your subscription plan: | Plan | Sync Execution | Async Execution | |------|----------------|-----------------| | **Free** | 5 minutes | 10 minutes | -| **Pro** | 60 minutes | 90 minutes | -| **Team** | 60 minutes | 90 minutes | -| **Enterprise** | 60 minutes | 90 minutes | +| **Pro** | 50 minutes | 90 minutes | +| **Team** | 50 minutes | 90 minutes | +| **Enterprise** | 50 minutes | 90 minutes | **Sync executions** run immediately and return results directly. These are triggered via the API with `async: false` (default) or through the UI. **Async executions** (triggered via API with `async: true`, webhooks, or schedules) run in the background. Async time limits are up to 2x the sync limit, capped at 90 minutes. diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/subscription/plan-configs.ts b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/subscription/plan-configs.ts index 8fadacc0c..1f03e12ba 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/subscription/plan-configs.ts +++ b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/subscription/plan-configs.ts @@ -15,7 +15,7 @@ import type { PlanFeature } from '@/app/workspace/[workspaceId]/w/components/sid export const PRO_PLAN_FEATURES: PlanFeature[] = [ { icon: Zap, text: '150 runs per minute (sync)' }, { icon: Clock, text: '1,000 runs per minute (async)' }, - { icon: Timer, text: '60 min sync execution limit' }, + { icon: Timer, text: '50 min sync execution limit' }, { icon: HardDrive, text: '50GB file storage' }, { icon: Users, text: 'Unlimited invites' }, { icon: Database, text: 'Unlimited log retention' }, @@ -24,7 +24,7 @@ export const PRO_PLAN_FEATURES: PlanFeature[] = [ export const TEAM_PLAN_FEATURES: PlanFeature[] = [ { icon: Zap, text: '300 runs per minute (sync)' }, { icon: Clock, text: '2,500 runs per minute (async)' }, - { icon: Timer, text: '60 min sync execution limit' }, + { icon: Timer, text: '50 min sync execution limit' }, { icon: HardDrive, text: '500GB file storage (pooled)' }, { icon: Users, text: 'Unlimited invites' }, { icon: Database, text: 'Unlimited log retention' }, diff --git a/apps/sim/lib/core/config/env.ts b/apps/sim/lib/core/config/env.ts index 60dfb73b3..dfe7fc296 100644 --- a/apps/sim/lib/core/config/env.ts +++ b/apps/sim/lib/core/config/env.ts @@ -171,9 +171,9 @@ export const env = createEnv({ RATE_LIMIT_ENTERPRISE_ASYNC: z.string().optional().default('5000'), // Enterprise tier async API executions per minute EXECUTION_TIMEOUT_FREE: z.string().optional().default('300'), - EXECUTION_TIMEOUT_PRO: z.string().optional().default('3600'), - EXECUTION_TIMEOUT_TEAM: z.string().optional().default('3600'), - EXECUTION_TIMEOUT_ENTERPRISE: z.string().optional().default('3600'), + EXECUTION_TIMEOUT_PRO: z.string().optional().default('3000'), + EXECUTION_TIMEOUT_TEAM: z.string().optional().default('3000'), + EXECUTION_TIMEOUT_ENTERPRISE: z.string().optional().default('3000'), // Knowledge Base Processing Configuration - Shared across all processing methods KB_CONFIG_MAX_DURATION: z.number().optional().default(600), // Max processing duration in seconds (10 minutes) diff --git a/apps/sim/lib/core/execution-limits/types.ts b/apps/sim/lib/core/execution-limits/types.ts index 06df5966f..6d2d5c123 100644 --- a/apps/sim/lib/core/execution-limits/types.ts +++ b/apps/sim/lib/core/execution-limits/types.ts @@ -1,4 +1,5 @@ import { env } from '@/lib/core/config/env' +import { isBillingEnabled } from '@/lib/core/config/feature-flags' import type { SubscriptionPlan } from '@/lib/core/rate-limiter/types' interface ExecutionTimeoutConfig { @@ -8,9 +9,9 @@ interface ExecutionTimeoutConfig { const DEFAULT_SYNC_TIMEOUTS_SECONDS = { free: 300, - pro: 3600, - team: 3600, - enterprise: 3600, + pro: 3000, + team: 3000, + enterprise: 3000, } as const const ASYNC_MULTIPLIER = 2 @@ -56,6 +57,9 @@ export function getExecutionTimeout( plan: SubscriptionPlan | undefined, type: 'sync' | 'async' = 'sync' ): number { + if (!isBillingEnabled) { + return EXECUTION_TIMEOUTS.enterprise[type] + } return EXECUTION_TIMEOUTS[plan || 'free'][type] } @@ -63,7 +67,9 @@ export function getMaxExecutionTimeout(): number { return EXECUTION_TIMEOUTS.enterprise.async } -export const DEFAULT_EXECUTION_TIMEOUT_MS = EXECUTION_TIMEOUTS.free.sync +export const DEFAULT_EXECUTION_TIMEOUT_MS = isBillingEnabled + ? EXECUTION_TIMEOUTS.free.sync + : EXECUTION_TIMEOUTS.enterprise.sync export function isTimeoutError(error: unknown): boolean { if (!error) return false