@@ -166,6 +166,9 @@ export class BlockExecutor {
166166 this . state . setBlockOutput ( node . id , normalizedOutput , duration )
167167
168168 if ( ! isSentinel && blockLog ) {
169+ const childWorkflowInstanceId = normalizedOutput . _childWorkflowInstanceId as
170+ | string
171+ | undefined
169172 const displayOutput = filterOutputForLog ( block . metadata ?. id || '' , normalizedOutput , {
170173 block,
171174 } )
@@ -178,7 +181,8 @@ export class BlockExecutor {
178181 duration ,
179182 blockLog . startedAt ,
180183 blockLog . executionOrder ,
181- blockLog . endedAt
184+ blockLog . endedAt ,
185+ childWorkflowInstanceId
182186 )
183187 }
184188
@@ -249,9 +253,6 @@ export class BlockExecutor {
249253 if ( error . childWorkflowSnapshotId ) {
250254 errorOutput . childWorkflowSnapshotId = error . childWorkflowSnapshotId
251255 }
252- if ( error . childWorkflowInstanceId ) {
253- errorOutput . _childWorkflowInstanceId = error . childWorkflowInstanceId
254- }
255256 }
256257
257258 this . state . setBlockOutput ( node . id , errorOutput , duration )
@@ -279,6 +280,9 @@ export class BlockExecutor {
279280 )
280281
281282 if ( ! isSentinel && blockLog ) {
283+ const childWorkflowInstanceId = ChildWorkflowError . isChildWorkflowError ( error )
284+ ? error . childWorkflowInstanceId
285+ : undefined
282286 const displayOutput = filterOutputForLog ( block . metadata ?. id || '' , errorOutput , { block } )
283287 this . callOnBlockComplete (
284288 ctx ,
@@ -289,7 +293,8 @@ export class BlockExecutor {
289293 duration ,
290294 blockLog . startedAt ,
291295 blockLog . executionOrder ,
292- blockLog . endedAt
296+ blockLog . endedAt ,
297+ childWorkflowInstanceId
293298 )
294299 }
295300
@@ -458,7 +463,8 @@ export class BlockExecutor {
458463 duration : number ,
459464 startedAt : string ,
460465 executionOrder : number ,
461- endedAt : string
466+ endedAt : string ,
467+ childWorkflowInstanceId ?: string
462468 ) : void {
463469 const blockId = node . metadata ?. originalBlockId ?? node . id
464470 const blockName = block . metadata ?. name ?? blockId
@@ -478,6 +484,7 @@ export class BlockExecutor {
478484 startedAt,
479485 executionOrder,
480486 endedAt,
487+ childWorkflowInstanceId,
481488 } ,
482489 iterationContext ,
483490 ctx . childWorkflowContext
0 commit comments