From d3c623e02b9a2e771939ab72f4ecda6957a9780b Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Wed, 28 Jan 2026 12:08:36 -0800 Subject: [PATCH] only reachable subflow nodes should hit validation --- apps/sim/executor/dag/builder.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/sim/executor/dag/builder.ts b/apps/sim/executor/dag/builder.ts index a0c612d17..5465df634 100644 --- a/apps/sim/executor/dag/builder.ts +++ b/apps/sim/executor/dag/builder.ts @@ -136,18 +136,18 @@ export class DAGBuilder { nodes: string[] | undefined, type: 'Loop' | 'Parallel' ): void { - if (!nodes || nodes.length === 0) { - throw new Error( - `${type} has no blocks inside. Add at least one block to the ${type.toLowerCase()}.` - ) - } - const sentinelStartId = type === 'Loop' ? buildSentinelStartId(id) : buildParallelSentinelStartId(id) const sentinelStartNode = dag.nodes.get(sentinelStartId) if (!sentinelStartNode) return + if (!nodes || nodes.length === 0) { + throw new Error( + `${type} has no blocks inside. Add at least one block to the ${type.toLowerCase()}.` + ) + } + const hasConnections = Array.from(sentinelStartNode.outgoingEdges.values()).some((edge) => nodes.includes(extractBaseBlockId(edge.target)) )