Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/sim/app/api/function/execute/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { validateProxyUrl } from '@/lib/security/input-validation'
import { generateRequestId } from '@/lib/utils'
export const dynamic = 'force-dynamic'
export const runtime = 'nodejs'
export const maxDuration = 60
export const maxDuration = 300
Comment thread
icecrasher321 marked this conversation as resolved.
Outdated

const logger = createLogger('FunctionExecuteAPI')

Expand Down Expand Up @@ -652,7 +652,7 @@ export async function POST(req: NextRequest) {
const {
code,
params = {},
timeout = 5000,
timeout = 180000,
language = DEFAULT_CODE_LANGUAGE,
useLocalVM = false,
envVars = {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ describe('FunctionBlockHandler', () => {
code: inputs.code,
language: 'javascript',
useLocalVM: true,
timeout: 5000, // Default timeout
timeout: 180000, // Default timeout (3 minutes)
envVars: {},
workflowVariables: {},
blockData: {},
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/executor/handlers/function/function-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class FunctionBlockHandler implements BlockHandler {
code: codeContent,
language: inputs.language || DEFAULT_CODE_LANGUAGE,
useLocalVM: !inputs.remoteExecution,
timeout: inputs.timeout || 5000,
timeout: inputs.timeout || 180000,
envVars: context.environmentVariables || {},
workflowVariables: context.workflowVariables || {},
blockData: blockData, // Pass block data for variable resolution
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/function/execute.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe('Function Execute Tool', () => {

expect(body).toEqual({
code: 'return 42',
timeout: 10000,
timeout: 180000,
envVars: {},
workflowVariables: {},
blockData: {},
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/function/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { DEFAULT_CODE_LANGUAGE } from '@/lib/execution/languages'
import type { CodeExecutionInput, CodeExecutionOutput } from '@/tools/function/types'
import type { ToolConfig } from '@/tools/types'

const DEFAULT_TIMEOUT = 10000 // 10 seconds
const DEFAULT_TIMEOUT = 180000 // 3 minutes

export const functionExecuteTool: ToolConfig<CodeExecutionInput, CodeExecutionOutput> = {
id: 'function_execute',
Expand Down