MCPcopy Index your code
hub / github.com/FlowiseAI/Flowise / hasReceivedRequiredInputs

Function hasReceivedRequiredInputs

packages/server/src/utils/buildAgentflow.ts:770–789  ·  view source on GitHub ↗

* Checks if a node has received all required inputs

(waitingNode: IWaitingNode)

Source from the content-addressed store, hash-verified

768 * Checks if a node has received all required inputs
769 */
770function hasReceivedRequiredInputs(waitingNode: IWaitingNode): boolean {
771 logger.debug(`\n✨ Checking inputs for node: ${waitingNode.nodeId}`)
772
773 // Check non-conditional required inputs
774 for (const required of waitingNode.expectedInputs) {
775 const hasInput = waitingNode.receivedInputs.has(required)
776 logger.debug(` 📊 Required input ${required}: ${hasInput ? '✅' : '❌'}`)
777 if (!hasInput) return false
778 }
779
780 // Check conditional groups
781 for (const [groupId, possibleSources] of waitingNode.conditionalGroups) {
782 // Need at least one input from each conditional group
783 const hasInputFromGroup = possibleSources.some((source) => waitingNode.receivedInputs.has(source))
784 logger.debug(` 📊 Conditional group ${groupId}: ${hasInputFromGroup ? '✅' : '❌'}`)
785 if (!hasInputFromGroup) return false
786 }
787
788 return true
789}
790
791/**
792 * Determines which nodes should be ignored based on condition results

Callers 1

processNodeOutputsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected