Skip to content

Commit cd999f3

Browse files
committed
fix(terminal): fire onChildWorkflowInstanceReady regardless of nodeMetadata presence
1 parent 830e143 commit cd999f3

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

apps/sim/executor/handlers/workflow/workflow-handler.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,13 @@ export class WorkflowBlockHandler implements BlockHandler {
157157
const childDepth = (ctx.childWorkflowContext?.depth ?? 0) + 1
158158
const shouldPropagateCallbacks = childDepth <= DEFAULTS.MAX_SSE_CHILD_DEPTH
159159

160-
if (nodeMetadata && shouldPropagateCallbacks) {
161-
const effectiveBlockId = nodeMetadata.originalBlockId ?? nodeMetadata.nodeId
162-
const iterationContext = this.getIterationContext(ctx, nodeMetadata)
160+
if (shouldPropagateCallbacks) {
161+
const effectiveBlockId = nodeMetadata
162+
? (nodeMetadata.originalBlockId ?? nodeMetadata.nodeId)
163+
: block.id
164+
const iterationContext = nodeMetadata
165+
? this.getIterationContext(ctx, nodeMetadata)
166+
: undefined
163167
ctx.onChildWorkflowInstanceReady?.(effectiveBlockId, instanceId, iterationContext)
164168
}
165169

0 commit comments

Comments
 (0)