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

Function upgradeNodeData

packages/agentflow/src/core/utils/nodeVersionUtils.ts:30–50  ·  view source on GitHub ↗
(componentNode: NodeDataSchema, existingData: NodeData)

Source from the content-addressed store, hash-verified

28 * Port of updateOutdatedNodeData() from packages/ui/src/utils/genericHelper.js:233-351.
29 */
30export function upgradeNodeData(componentNode: NodeDataSchema, existingData: NodeData): NodeData {
31 const upgraded = initNode(componentNode, existingData.id, true)
32
33 if (existingData.credential) {
34 upgraded.credential = existingData.credential
35 }
36
37 if (existingData.inputs && upgraded.inputs) {
38 // Preserve matching inputs; also carry over *Config keys (loadConfig accordion side-channel
39 // values not present in the inputParams schema directly).
40 for (const key of Object.keys(existingData.inputs)) {
41 if (key in upgraded.inputs || key.endsWith('Config')) {
42 upgraded.inputs[key] = existingData.inputs[key]
43 }
44 }
45 }
46
47 upgraded.label = existingData.label
48
49 return upgraded
50}

Callers 2

AgentflowStateProviderFunction · 0.90

Calls 1

initNodeFunction · 0.90

Tested by

no test coverage detected