Skip to content

Commit d3c623e

Browse files
committed
only reachable subflow nodes should hit validation
1 parent e7e2135 commit d3c623e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

apps/sim/executor/dag/builder.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,18 +136,18 @@ export class DAGBuilder {
136136
nodes: string[] | undefined,
137137
type: 'Loop' | 'Parallel'
138138
): void {
139-
if (!nodes || nodes.length === 0) {
140-
throw new Error(
141-
`${type} has no blocks inside. Add at least one block to the ${type.toLowerCase()}.`
142-
)
143-
}
144-
145139
const sentinelStartId =
146140
type === 'Loop' ? buildSentinelStartId(id) : buildParallelSentinelStartId(id)
147141
const sentinelStartNode = dag.nodes.get(sentinelStartId)
148142

149143
if (!sentinelStartNode) return
150144

145+
if (!nodes || nodes.length === 0) {
146+
throw new Error(
147+
`${type} has no blocks inside. Add at least one block to the ${type.toLowerCase()}.`
148+
)
149+
}
150+
151151
const hasConnections = Array.from(sentinelStartNode.outgoingEdges.values()).some((edge) =>
152152
nodes.includes(extractBaseBlockId(edge.target))
153153
)

0 commit comments

Comments
 (0)