From 2d7e6c97963a4531b6a993c3da8911fb86d0a999 Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Wed, 4 Feb 2026 23:53:09 -0800 Subject: [PATCH] fix(client-exec): send correct client workflow state override (#3143) --- .../hooks/use-workflow-execution.ts | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 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 1b514dccd..0b4916a2f 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 @@ -1288,6 +1288,13 @@ export function useWorkflowExecution() { onBlockCompleteCallback: onBlockComplete, }) + const clientWorkflowState = executionWorkflowState || { + blocks: filteredStates, + edges: workflowEdges, + loops: latestWorkflowState.loops, + parallels: latestWorkflowState.parallels, + } + await executionStream.execute({ workflowId: activeWorkflowId, input: finalWorkflowInput, @@ -1297,14 +1304,12 @@ export function useWorkflowExecution() { useDraftState: true, isClientSession: true, stopAfterBlockId, - workflowStateOverride: executionWorkflowState - ? { - blocks: executionWorkflowState.blocks, - edges: executionWorkflowState.edges, - loops: executionWorkflowState.loops, - parallels: executionWorkflowState.parallels, - } - : undefined, + workflowStateOverride: { + blocks: clientWorkflowState.blocks, + edges: clientWorkflowState.edges, + loops: clientWorkflowState.loops, + parallels: clientWorkflowState.parallels, + }, callbacks: { onExecutionStarted: (data) => { logger.info('Server execution started:', data)