Skip to content

Commit c201a7c

Browse files
committed
Fix trigger clear snapshot
1 parent d80608c commit c201a7c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,15 +1460,19 @@ export function useWorkflowExecution() {
14601460
return
14611461
}
14621462

1463-
// For trigger blocks with no snapshot, create an empty one
1464-
const effectiveSnapshot: SerializableExecutionState = snapshot || {
1463+
// For trigger blocks, always use empty snapshot to prevent stale data from different
1464+
// execution paths from being resolved. For non-trigger blocks, use the existing snapshot.
1465+
const emptySnapshot: SerializableExecutionState = {
14651466
blockStates: {},
14661467
executedBlocks: [],
14671468
blockLogs: [],
14681469
decisions: { router: {}, condition: {} },
14691470
completedLoops: [],
14701471
activeExecutionPath: [],
14711472
}
1473+
const effectiveSnapshot: SerializableExecutionState = isTriggerBlock
1474+
? emptySnapshot
1475+
: snapshot || emptySnapshot
14721476

14731477
// Extract mock payload for trigger blocks
14741478
let workflowInput: any

0 commit comments

Comments
 (0)