Skip to content

Commit c6cb282

Browse files
committed
address minor gaps
1 parent 5e5d87d commit c6cb282

File tree

3 files changed

+29
-20
lines changed

3 files changed

+29
-20
lines changed

apps/sim/executor/execution/engine.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -422,12 +422,7 @@ export class ExecutionEngine {
422422
)
423423

424424
if (activatedEdges.length > 0) {
425-
const existing = this.context.activatedEdges.get(nodeId)
426-
if (existing) {
427-
existing.push(...activatedEdges)
428-
} else {
429-
this.context.activatedEdges.set(nodeId, [...activatedEdges])
430-
}
425+
this.context.activatedEdges.set(nodeId, activatedEdges)
431426
}
432427

433428
logger.info('Processing outgoing edges', {

apps/sim/executor/orchestrators/loop.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,7 @@ export class LoopOrchestrator {
724724
const output = { results: [] }
725725
const block = ctx.workflow?.blocks.find((b) => b.id === blockId)
726726
const blockName = block?.metadata?.name ?? blockType
727+
const iterationContext = buildContainerIterationContext(ctx, blockId)
727728

728729
ctx.blockLogs.push({
729730
blockId,
@@ -742,13 +743,19 @@ export class LoopOrchestrator {
742743
}
743744

744745
if (this.contextExtensions?.onBlockComplete) {
745-
this.contextExtensions.onBlockComplete(blockId, blockName, blockType, {
746-
output,
747-
executionTime: DEFAULTS.EXECUTION_TIME,
748-
startedAt: now,
749-
executionOrder,
750-
endedAt: now,
751-
})
746+
this.contextExtensions.onBlockComplete(
747+
blockId,
748+
blockName,
749+
blockType,
750+
{
751+
output,
752+
executionTime: DEFAULTS.EXECUTION_TIME,
753+
startedAt: now,
754+
executionOrder,
755+
endedAt: now,
756+
},
757+
iterationContext
758+
)
752759
}
753760
}
754761
}

apps/sim/executor/orchestrators/parallel.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ export class ParallelOrchestrator {
381381
const output = { results: [] }
382382
const block = ctx.workflow?.blocks.find((b) => b.id === blockId)
383383
const blockName = block?.metadata?.name ?? blockType
384+
const iterationContext = buildContainerIterationContext(ctx, blockId)
384385

385386
ctx.blockLogs.push({
386387
blockId,
@@ -399,13 +400,19 @@ export class ParallelOrchestrator {
399400
}
400401

401402
if (this.contextExtensions?.onBlockComplete) {
402-
this.contextExtensions.onBlockComplete(blockId, blockName, blockType, {
403-
output,
404-
executionTime: DEFAULTS.EXECUTION_TIME,
405-
startedAt: now,
406-
executionOrder,
407-
endedAt: now,
408-
})
403+
this.contextExtensions.onBlockComplete(
404+
blockId,
405+
blockName,
406+
blockType,
407+
{
408+
output,
409+
executionTime: DEFAULTS.EXECUTION_TIME,
410+
startedAt: now,
411+
executionOrder,
412+
endedAt: now,
413+
},
414+
iterationContext
415+
)
409416
}
410417
}
411418
}

0 commit comments

Comments
 (0)