@@ -1058,58 +1058,25 @@ export function useWorkflowExecution() {
10581058 endedAt,
10591059 } )
10601060
1061- // Check if entry exists (created in onBlockStarted)
1062- // For container blocks like loops/parallels that fail during initialization,
1063- // onBlockStarted is never called, so we need to create the entry here
1064- const existingEntries = useTerminalConsoleStore . getState ( ) . entries
1065- const hasExistingEntry = existingEntries . some (
1066- ( entry ) => entry . blockId === data . blockId && entry . executionId === executionId
1067- )
1068-
1069- if ( hasExistingEntry ) {
1070- // Update existing console entry
1071- updateConsole (
1072- data . blockId ,
1073- {
1074- input : data . input || { } ,
1075- replaceOutput : { } ,
1076- success : false ,
1077- error : data . error ,
1078- durationMs : data . durationMs ,
1079- startedAt,
1080- endedAt,
1081- isRunning : false ,
1082- // Pass through iteration context for subflow grouping
1083- iterationCurrent : data . iterationCurrent ,
1084- iterationTotal : data . iterationTotal ,
1085- iterationType : data . iterationType ,
1086- } ,
1087- executionId
1088- )
1089- } else {
1090- // Create new console entry for blocks that failed before starting
1091- // (e.g., loop/parallel blocks with invalid configuration)
1092- addConsole ( {
1061+ // Update existing console entry (created in onBlockStarted) with error data
1062+ updateConsole (
1063+ data . blockId ,
1064+ {
10931065 input : data . input || { } ,
1094- output : { } ,
1066+ replaceOutput : { } ,
10951067 success : false ,
10961068 error : data . error ,
1097- durationMs : data . durationMs || 0 ,
1098- startedAt : startedAt || new Date ( ) . toISOString ( ) ,
1099- executionOrder : data . executionOrder ,
1100- endedAt : endedAt || new Date ( ) . toISOString ( ) ,
1101- workflowId : activeWorkflowId ,
1102- blockId : data . blockId ,
1103- executionId,
1104- blockName : data . blockName || 'Unknown Block' ,
1105- blockType : data . blockType || 'unknown' ,
1069+ durationMs : data . durationMs ,
1070+ startedAt,
1071+ endedAt,
11061072 isRunning : false ,
11071073 // Pass through iteration context for subflow grouping
11081074 iterationCurrent : data . iterationCurrent ,
11091075 iterationTotal : data . iterationTotal ,
11101076 iterationType : data . iterationType ,
1111- } )
1112- }
1077+ } ,
1078+ executionId
1079+ )
11131080 } ,
11141081
11151082 onStreamChunk : ( data ) => {
0 commit comments