Skip to content

Commit 2d7e6c9

Browse files
fix(client-exec): send correct client workflow state override (#3143)
1 parent ea3bab1 commit 2d7e6c9

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

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

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,6 +1288,13 @@ export function useWorkflowExecution() {
12881288
onBlockCompleteCallback: onBlockComplete,
12891289
})
12901290

1291+
const clientWorkflowState = executionWorkflowState || {
1292+
blocks: filteredStates,
1293+
edges: workflowEdges,
1294+
loops: latestWorkflowState.loops,
1295+
parallels: latestWorkflowState.parallels,
1296+
}
1297+
12911298
await executionStream.execute({
12921299
workflowId: activeWorkflowId,
12931300
input: finalWorkflowInput,
@@ -1297,14 +1304,12 @@ export function useWorkflowExecution() {
12971304
useDraftState: true,
12981305
isClientSession: true,
12991306
stopAfterBlockId,
1300-
workflowStateOverride: executionWorkflowState
1301-
? {
1302-
blocks: executionWorkflowState.blocks,
1303-
edges: executionWorkflowState.edges,
1304-
loops: executionWorkflowState.loops,
1305-
parallels: executionWorkflowState.parallels,
1306-
}
1307-
: undefined,
1307+
workflowStateOverride: {
1308+
blocks: clientWorkflowState.blocks,
1309+
edges: clientWorkflowState.edges,
1310+
loops: clientWorkflowState.loops,
1311+
parallels: clientWorkflowState.parallels,
1312+
},
13081313
callbacks: {
13091314
onExecutionStarted: (data) => {
13101315
logger.info('Server execution started:', data)

0 commit comments

Comments
 (0)