Skip to content

Commit 9b201d8

Browse files
waleedlatif1claude
andcommitted
improvement(processing): add defensive ID check for prefetched workflow record
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 79eaf18 commit 9b201d8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

apps/sim/lib/execution/preprocessing.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ export async function preprocessExecution(
9797
})
9898

9999
// ========== STEP 1: Validate Workflow Exists ==========
100+
if (prefetchedWorkflowRecord && prefetchedWorkflowRecord.id !== workflowId) {
101+
logger.error(`[${requestId}] Prefetched workflow record ID mismatch`, {
102+
expected: workflowId,
103+
received: prefetchedWorkflowRecord.id,
104+
})
105+
throw new Error(
106+
`Prefetched workflow record ID mismatch: expected ${workflowId}, got ${prefetchedWorkflowRecord.id}`
107+
)
108+
}
100109
let workflowRecord: WorkflowRecord | null = prefetchedWorkflowRecord ?? null
101110
if (!workflowRecord) {
102111
try {

0 commit comments

Comments
 (0)