(
blockId: string,
blockName: string,
blockType: string,
output: {
input?: unknown
output: NormalizedBlockOutput
executionTime: number
startedAt: string
endedAt: string
},
iterationContext?: IterationContext,
childWorkflowContext?: ChildWorkflowContext
)
| 526 | } |
| 527 | |
| 528 | const wrappedOnBlockComplete = ( |
| 529 | blockId: string, |
| 530 | blockName: string, |
| 531 | blockType: string, |
| 532 | output: { |
| 533 | input?: unknown |
| 534 | output: NormalizedBlockOutput |
| 535 | executionTime: number |
| 536 | startedAt: string |
| 537 | endedAt: string |
| 538 | }, |
| 539 | iterationContext?: IterationContext, |
| 540 | childWorkflowContext?: ChildWorkflowContext |
| 541 | ) => { |
| 542 | let persistenceSucceeded = false |
| 543 | const persistencePromise = (async () => { |
| 544 | await loggingSession.onBlockComplete(blockId, blockName, blockType, output) |
| 545 | persistenceSucceeded = true |
| 546 | })().catch((error) => { |
| 547 | logger.warn(`[${requestId}] Block completion persistence failed`, { |
| 548 | executionId, |
| 549 | blockId, |
| 550 | blockType, |
| 551 | error, |
| 552 | }) |
| 553 | }) |
| 554 | |
| 555 | const lifecyclePromise = (async () => { |
| 556 | await persistencePromise |
| 557 | if (!persistenceSucceeded || !onBlockComplete) return |
| 558 | |
| 559 | try { |
| 560 | await onBlockComplete( |
| 561 | blockId, |
| 562 | blockName, |
| 563 | blockType, |
| 564 | output, |
| 565 | iterationContext, |
| 566 | childWorkflowContext |
| 567 | ) |
| 568 | } catch (error) { |
| 569 | logger.warn(`[${requestId}] Block completion callback failed`, { |
| 570 | executionId, |
| 571 | blockId, |
| 572 | blockType, |
| 573 | error, |
| 574 | }) |
| 575 | } |
| 576 | })() |
| 577 | |
| 578 | trackLifecycleCallback(lifecyclePromise) |
| 579 | return persistencePromise |
| 580 | } |
| 581 | |
| 582 | const wrappedOnBlockStart = ( |
| 583 | blockId: string, |
nothing calls this directly
no test coverage detected