Skip to content

Commit ba401ec

Browse files
committed
improvement(functions): increase function block timeout to 3 min
1 parent 061c1df commit ba401ec

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

apps/sim/app/api/function/execute/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { validateProxyUrl } from '@/lib/security/input-validation'
88
import { generateRequestId } from '@/lib/utils'
99
export const dynamic = 'force-dynamic'
1010
export const runtime = 'nodejs'
11-
export const maxDuration = 60
11+
export const maxDuration = 300
1212

1313
const logger = createLogger('FunctionExecuteAPI')
1414

@@ -652,7 +652,7 @@ export async function POST(req: NextRequest) {
652652
const {
653653
code,
654654
params = {},
655-
timeout = 5000,
655+
timeout = 180000,
656656
language = DEFAULT_CODE_LANGUAGE,
657657
useLocalVM = false,
658658
envVars = {},

apps/sim/executor/handlers/function/function-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export class FunctionBlockHandler implements BlockHandler {
6161
code: codeContent,
6262
language: inputs.language || DEFAULT_CODE_LANGUAGE,
6363
useLocalVM: !inputs.remoteExecution,
64-
timeout: inputs.timeout || 5000,
64+
timeout: inputs.timeout || 180000,
6565
envVars: context.environmentVariables || {},
6666
workflowVariables: context.workflowVariables || {},
6767
blockData: blockData, // Pass block data for variable resolution

apps/sim/tools/function/execute.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { DEFAULT_CODE_LANGUAGE } from '@/lib/execution/languages'
22
import type { CodeExecutionInput, CodeExecutionOutput } from '@/tools/function/types'
33
import type { ToolConfig } from '@/tools/types'
44

5-
const DEFAULT_TIMEOUT = 10000 // 10 seconds
5+
const DEFAULT_TIMEOUT = 180000 // 3 minutes
66

77
export const functionExecuteTool: ToolConfig<CodeExecutionInput, CodeExecutionOutput> = {
88
id: 'function_execute',

0 commit comments

Comments
 (0)