MCPcopy
hub / github.com/FlowiseAI/Flowise / checkForMultipleStartNodes

Function checkForMultipleStartNodes

packages/server/src/utils/buildAgentflow.ts:1509–1522  ·  view source on GitHub ↗
(startingNodeIds: string[], isRecursive: boolean, nodes: IReactFlowNode[])

Source from the content-addressed store, hash-verified

1507}
1508
1509const checkForMultipleStartNodes = (startingNodeIds: string[], isRecursive: boolean, nodes: IReactFlowNode[]) => {
1510 // For non-recursive, loop through and check if each starting node is inside an iteration node, if yes, delete it
1511 const clonedStartingNodeIds = [...startingNodeIds]
1512 for (const nodeId of clonedStartingNodeIds) {
1513 const node = nodes.find((node) => node.id === nodeId)
1514 if (node?.extent === 'parent' && !isRecursive) {
1515 startingNodeIds.splice(startingNodeIds.indexOf(nodeId), 1)
1516 }
1517 }
1518
1519 if (!isRecursive && startingNodeIds.length > 1) {
1520 throw new Error('Multiple starting nodes are not allowed')
1521 }
1522}
1523
1524const parseFormStringToJson = (formString: string): Record<string, string> => {
1525 const result: Record<string, string> = {}

Callers 1

executeAgentFlowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected