Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
remove comments
  • Loading branch information
icecrasher321 committed Nov 26, 2025
commit de56cc5ff628c9deaf879d2aa3f31642b9414522
6 changes: 1 addition & 5 deletions apps/sim/app/api/workflows/[id]/execute/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,6 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ id:
workspaceId: workflow.workspaceId,
})

// Load workflow data ONCE and cache it for all execution paths
// This avoids duplicate DB calls in executeWorkflowCore
let cachedWorkflowData: {
blocks: Record<string, any>
edges: any[]
Expand Down Expand Up @@ -419,8 +417,6 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ id:
)
}

// Use user-provided workflowStateOverride, or fall back to our cached data
// This prevents executeWorkflowCore from making redundant DB calls
const effectiveWorkflowStateOverride = workflowStateOverride || cachedWorkflowData || undefined

if (!enableSSE) {
Expand Down Expand Up @@ -500,7 +496,7 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ id:
logger.info(`[${requestId}] Using SSE console log streaming (manual execution)`)
} else {
logger.info(`[${requestId}] Using streaming API response`)
// Use cached workflow data instead of reloading from DB

const resolvedSelectedOutputs = resolveOutputIds(
selectedOutputs,
cachedWorkflowData?.blocks || {}
Expand Down