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

Function initiateNode

packages/server/src/utils/buildAgentGraph.ts:700–721  ·  view source on GitHub ↗
(node: IReactFlowNode)

Source from the content-addressed store, hash-verified

698 const { nodeOverrides, variableOverrides, apiOverrideStatus } = getAPIOverrideConfig(agentflow)
699
700 const initiateNode = async (node: IReactFlowNode) => {
701 const nodeInstanceFilePath = componentNodes[node.data.name].filePath as string
702 const nodeModule = await import(nodeInstanceFilePath)
703 const newNodeInstance = new nodeModule.nodeClass()
704
705 flowNodeData = cloneDeep(node.data)
706 if (overrideConfig && apiOverrideStatus)
707 flowNodeData = replaceInputsWithConfig(flowNodeData, overrideConfig, nodeOverrides, variableOverrides)
708 flowNodeData = await resolveVariables(
709 flowNodeData,
710 reactFlowNodes,
711 question,
712 chatHistory,
713 overrideConfig,
714 uploadedFilesContent,
715 availableVariables,
716 variableOverrides
717 )
718
719 const seqAgentNode: ISeqAgentNode = await newNodeInstance.init(flowNodeData, question, options)
720 return seqAgentNode
721 }
722
723 /*
724 * Two objectives we want to achieve here:

Callers 1

compileSeqAgentsGraphFunction · 0.85

Calls 3

replaceInputsWithConfigFunction · 0.85
resolveVariablesFunction · 0.70
initMethod · 0.65

Tested by

no test coverage detected