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

Function getUniqueNodeLabel

packages/ui/src/utils/genericHelper.js:19–35  ·  view source on GitHub ↗
(nodeData, nodes)

Source from the content-addressed store, hash-verified

17}
18
19export const getUniqueNodeLabel = (nodeData, nodes) => {
20 if (nodeData.type === 'StickyNote') return nodeData.label
21 if (nodeData.name === 'startAgentflow') return nodeData.label
22
23 let suffix = 0
24
25 // Construct base ID
26 let baseId = `${nodeData.name}_${suffix}`
27
28 // Increment suffix until a unique ID is found
29 while (nodes.some((node) => node.id === baseId)) {
30 suffix += 1
31 baseId = `${nodeData.name}_${suffix}`
32 }
33
34 return `${nodeData.label} ${suffix}`
35}
36
37const createAgentFlowOutputs = (nodeData, newNodeId) => {
38 if (nodeData.hideOutput) return []

Callers 1

AgentflowCanvasFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected