Skip to content

Commit 362f4c2

Browse files
improvement(timeouts): sync to 50 min, self-hosted maxed out (#3133)
* improvement(timeouts): sync to 50 min, self-hosted maxed out * update env vars
1 parent c77e351 commit 362f4c2

File tree

4 files changed

+18
-12
lines changed
  • apps
    • docs/content/docs/en/execution
    • sim
      • app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/subscription
      • lib/core

4 files changed

+18
-12
lines changed

apps/docs/content/docs/en/execution/costs.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,9 @@ Workflows have maximum execution time limits based on your subscription plan:
220220
| Plan | Sync Execution | Async Execution |
221221
|------|----------------|-----------------|
222222
| **Free** | 5 minutes | 10 minutes |
223-
| **Pro** | 60 minutes | 90 minutes |
224-
| **Team** | 60 minutes | 90 minutes |
225-
| **Enterprise** | 60 minutes | 90 minutes |
223+
| **Pro** | 50 minutes | 90 minutes |
224+
| **Team** | 50 minutes | 90 minutes |
225+
| **Enterprise** | 50 minutes | 90 minutes |
226226

227227
**Sync executions** run immediately and return results directly. These are triggered via the API with `async: false` (default) or through the UI.
228228
**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.

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/subscription/plan-configs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import type { PlanFeature } from '@/app/workspace/[workspaceId]/w/components/sid
1515
export const PRO_PLAN_FEATURES: PlanFeature[] = [
1616
{ icon: Zap, text: '150 runs per minute (sync)' },
1717
{ icon: Clock, text: '1,000 runs per minute (async)' },
18-
{ icon: Timer, text: '60 min sync execution limit' },
18+
{ icon: Timer, text: '50 min sync execution limit' },
1919
{ icon: HardDrive, text: '50GB file storage' },
2020
{ icon: Users, text: 'Unlimited invites' },
2121
{ icon: Database, text: 'Unlimited log retention' },
@@ -24,7 +24,7 @@ export const PRO_PLAN_FEATURES: PlanFeature[] = [
2424
export const TEAM_PLAN_FEATURES: PlanFeature[] = [
2525
{ icon: Zap, text: '300 runs per minute (sync)' },
2626
{ icon: Clock, text: '2,500 runs per minute (async)' },
27-
{ icon: Timer, text: '60 min sync execution limit' },
27+
{ icon: Timer, text: '50 min sync execution limit' },
2828
{ icon: HardDrive, text: '500GB file storage (pooled)' },
2929
{ icon: Users, text: 'Unlimited invites' },
3030
{ icon: Database, text: 'Unlimited log retention' },

apps/sim/lib/core/config/env.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ export const env = createEnv({
171171
RATE_LIMIT_ENTERPRISE_ASYNC: z.string().optional().default('5000'), // Enterprise tier async API executions per minute
172172

173173
EXECUTION_TIMEOUT_FREE: z.string().optional().default('300'),
174-
EXECUTION_TIMEOUT_PRO: z.string().optional().default('3600'),
175-
EXECUTION_TIMEOUT_TEAM: z.string().optional().default('3600'),
176-
EXECUTION_TIMEOUT_ENTERPRISE: z.string().optional().default('3600'),
174+
EXECUTION_TIMEOUT_PRO: z.string().optional().default('3000'),
175+
EXECUTION_TIMEOUT_TEAM: z.string().optional().default('3000'),
176+
EXECUTION_TIMEOUT_ENTERPRISE: z.string().optional().default('3000'),
177177

178178
// Knowledge Base Processing Configuration - Shared across all processing methods
179179
KB_CONFIG_MAX_DURATION: z.number().optional().default(600), // Max processing duration in seconds (10 minutes)

apps/sim/lib/core/execution-limits/types.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { env } from '@/lib/core/config/env'
2+
import { isBillingEnabled } from '@/lib/core/config/feature-flags'
23
import type { SubscriptionPlan } from '@/lib/core/rate-limiter/types'
34

45
interface ExecutionTimeoutConfig {
@@ -8,9 +9,9 @@ interface ExecutionTimeoutConfig {
89

910
const DEFAULT_SYNC_TIMEOUTS_SECONDS = {
1011
free: 300,
11-
pro: 3600,
12-
team: 3600,
13-
enterprise: 3600,
12+
pro: 3000,
13+
team: 3000,
14+
enterprise: 3000,
1415
} as const
1516

1617
const ASYNC_MULTIPLIER = 2
@@ -56,14 +57,19 @@ export function getExecutionTimeout(
5657
plan: SubscriptionPlan | undefined,
5758
type: 'sync' | 'async' = 'sync'
5859
): number {
60+
if (!isBillingEnabled) {
61+
return EXECUTION_TIMEOUTS.enterprise[type]
62+
}
5963
return EXECUTION_TIMEOUTS[plan || 'free'][type]
6064
}
6165

6266
export function getMaxExecutionTimeout(): number {
6367
return EXECUTION_TIMEOUTS.enterprise.async
6468
}
6569

66-
export const DEFAULT_EXECUTION_TIMEOUT_MS = EXECUTION_TIMEOUTS.free.sync
70+
export const DEFAULT_EXECUTION_TIMEOUT_MS = isBillingEnabled
71+
? EXECUTION_TIMEOUTS.free.sync
72+
: EXECUTION_TIMEOUTS.enterprise.sync
6773

6874
export function isTimeoutError(error: unknown): boolean {
6975
if (!error) return false

0 commit comments

Comments
 (0)