From c201a7ca910a2d8a949daf4533fa0975ac766798 Mon Sep 17 00:00:00 2001 From: Siddharth Ganesan Date: Tue, 27 Jan 2026 16:53:13 -0800 Subject: [PATCH] Fix trigger clear snapshot --- .../w/[workflowId]/hooks/use-workflow-execution.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution.ts b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution.ts index 6f610ff9f..5e4125db7 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution.ts +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution.ts @@ -1460,8 +1460,9 @@ export function useWorkflowExecution() { return } - // For trigger blocks with no snapshot, create an empty one - const effectiveSnapshot: SerializableExecutionState = snapshot || { + // For trigger blocks, always use empty snapshot to prevent stale data from different + // execution paths from being resolved. For non-trigger blocks, use the existing snapshot. + const emptySnapshot: SerializableExecutionState = { blockStates: {}, executedBlocks: [], blockLogs: [], @@ -1469,6 +1470,9 @@ export function useWorkflowExecution() { completedLoops: [], activeExecutionPath: [], } + const effectiveSnapshot: SerializableExecutionState = isTriggerBlock + ? emptySnapshot + : snapshot || emptySnapshot // Extract mock payload for trigger blocks let workflowInput: any