From 0638604780031727517d109bad7e5142ac226391 Mon Sep 17 00:00:00 2001 From: Siddharth Ganesan Date: Thu, 9 Apr 2026 14:32:18 -0700 Subject: [PATCH] Fix tests --- apps/sim/app/api/schedules/execute/route.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/sim/app/api/schedules/execute/route.ts b/apps/sim/app/api/schedules/execute/route.ts index 0d1e41a9e1..c89fdd26b9 100644 --- a/apps/sim/app/api/schedules/execute/route.ts +++ b/apps/sim/app/api/schedules/execute/route.ts @@ -87,6 +87,9 @@ export async function GET(request: NextRequest) { const jobQueue = await getJobQueue() + const workflowUtils = + dueSchedules.length > 0 ? await import('@/lib/workflows/utils') : undefined + const schedulePromises = dueSchedules.map(async (schedule) => { const queueTime = schedule.lastQueuedAt ?? queuedAt const executionId = generateId() @@ -115,9 +118,8 @@ export async function GET(request: NextRequest) { } try { - const { getWorkflowById } = await import('@/lib/workflows/utils') const resolvedWorkflow = schedule.workflowId - ? await getWorkflowById(schedule.workflowId) + ? await workflowUtils?.getWorkflowById(schedule.workflowId) : null const resolvedWorkspaceId = resolvedWorkflow?.workspaceId