MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / collectAgentFlowV2ParentNodes

Function collectAgentFlowV2ParentNodes

packages/ui/src/utils/genericHelper.js:667–684  ·  view source on GitHub ↗
(targetNodeId, nodes, edges)

Source from the content-addressed store, hash-verified

665 })
666 }
667 function collectAgentFlowV2ParentNodes(targetNodeId, nodes, edges) {
668 const inputEdges = edges.filter((edg) => edg.target === targetNodeId && edg.targetHandle === targetNodeId)
669
670 // Traverse each edge found
671 inputEdges.forEach((edge) => {
672 const parentNode = nodes.find((nd) => nd.id === edge.source)
673 if (!parentNode) return
674
675 // Recursive call to explore further up the tree
676 collectAgentFlowV2ParentNodes(parentNode.id, nodes, edges)
677
678 // Check and add the parent node to the list if it does not include specific names
679 const excludeNodeNames = ['startAgentflow']
680 if (!excludeNodeNames.includes(parentNode.data.name) || includesStart) {
681 parentNodes.push(parentNode)
682 }
683 })
684 }
685
686 if (isSeqAgent) {
687 collectParentNodes(target, nodes, edges)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected