@@ -674,61 +674,65 @@ export async function executeWorkflowWithFullLogging(
674674 }
675675
676676 try {
677- await processSSEStream ( response . body . getReader ( ) , {
678- onExecutionStarted : ( data ) => {
679- logger . info ( 'Execution started' , { startTime : data . startTime } )
680- } ,
681-
682- onBlockStarted : blockHandlers . onBlockStarted ,
683- onBlockCompleted : blockHandlers . onBlockCompleted ,
684- onBlockError : blockHandlers . onBlockError ,
685- onBlockChildWorkflowStarted : blockHandlers . onBlockChildWorkflowStarted ,
686-
687- onExecutionCompleted : ( data ) => {
688- setCurrentExecutionId ( wfId , null )
689- executionResult = {
690- success : data . success ,
691- output : data . output ,
692- logs : accumulatedBlockLogs ,
693- metadata : {
694- duration : data . duration ,
695- startTime : data . startTime ,
696- endTime : data . endTime ,
697- } ,
698- }
699- } ,
700-
701- onExecutionCancelled : ( ) => {
702- setCurrentExecutionId ( wfId , null )
703- executionResult = {
704- success : false ,
705- output : { } ,
706- error : 'Execution was cancelled' ,
707- logs : accumulatedBlockLogs ,
708- }
709- } ,
710-
711- onExecutionError : ( data ) => {
712- setCurrentExecutionId ( wfId , null )
713- const errorMessage = data . error || 'Execution failed'
714- executionResult = {
715- success : false ,
716- output : { } ,
717- error : errorMessage ,
718- logs : accumulatedBlockLogs ,
719- metadata : { duration : data . duration } ,
720- }
721-
722- handleExecutionErrorConsole ( addConsole , cancelRunningEntries , {
723- workflowId : wfId ,
724- executionId : executionIdRef . current ,
725- error : errorMessage ,
726- durationMs : data . duration || 0 ,
727- blockLogs : accumulatedBlockLogs ,
728- isPreExecutionError : accumulatedBlockLogs . length === 0 ,
729- } )
677+ await processSSEStream (
678+ response . body . getReader ( ) ,
679+ {
680+ onExecutionStarted : ( data ) => {
681+ logger . info ( 'Execution started' , { startTime : data . startTime } )
682+ } ,
683+
684+ onBlockStarted : blockHandlers . onBlockStarted ,
685+ onBlockCompleted : blockHandlers . onBlockCompleted ,
686+ onBlockError : blockHandlers . onBlockError ,
687+ onBlockChildWorkflowStarted : blockHandlers . onBlockChildWorkflowStarted ,
688+
689+ onExecutionCompleted : ( data ) => {
690+ setCurrentExecutionId ( wfId , null )
691+ executionResult = {
692+ success : data . success ,
693+ output : data . output ,
694+ logs : accumulatedBlockLogs ,
695+ metadata : {
696+ duration : data . duration ,
697+ startTime : data . startTime ,
698+ endTime : data . endTime ,
699+ } ,
700+ }
701+ } ,
702+
703+ onExecutionCancelled : ( ) => {
704+ setCurrentExecutionId ( wfId , null )
705+ executionResult = {
706+ success : false ,
707+ output : { } ,
708+ error : 'Execution was cancelled' ,
709+ logs : accumulatedBlockLogs ,
710+ }
711+ } ,
712+
713+ onExecutionError : ( data ) => {
714+ setCurrentExecutionId ( wfId , null )
715+ const errorMessage = data . error || 'Execution failed'
716+ executionResult = {
717+ success : false ,
718+ output : { } ,
719+ error : errorMessage ,
720+ logs : accumulatedBlockLogs ,
721+ metadata : { duration : data . duration } ,
722+ }
723+
724+ handleExecutionErrorConsole ( addConsole , cancelRunningEntries , {
725+ workflowId : wfId ,
726+ executionId : executionIdRef . current ,
727+ error : errorMessage ,
728+ durationMs : data . duration || 0 ,
729+ blockLogs : accumulatedBlockLogs ,
730+ isPreExecutionError : accumulatedBlockLogs . length === 0 ,
731+ } )
732+ } ,
730733 } ,
731- } , 'CopilotExecution' )
734+ 'CopilotExecution'
735+ )
732736 } finally {
733737 setCurrentExecutionId ( wfId , null )
734738 setActiveBlocks ( wfId , new Set ( ) )
0 commit comments