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

Function findMemoryNode

packages/server/src/utils/index.ts:1896–1908  ·  view source on GitHub ↗
(nodes: IReactFlowNode[], edges: IReactFlowEdge[])

Source from the content-addressed store, hash-verified

1894 * @returns {IReactFlowNode | undefined}
1895 */
1896export const findMemoryNode = (nodes: IReactFlowNode[], edges: IReactFlowEdge[]): IReactFlowNode | undefined => {
1897 const memoryNodes = nodes.filter((node) => node.data.category === 'Memory')
1898 const memoryNodeIds = memoryNodes.map((mem) => mem.data.id)
1899
1900 for (const edge of edges) {
1901 if (memoryNodeIds.includes(edge.source)) {
1902 const memoryNode = nodes.find((node) => node.data.id === edge.source)
1903 return memoryNode
1904 }
1905 }
1906
1907 return undefined
1908}
1909
1910/**
1911 * Get all values from a JSON object

Callers 2

executeUpsertFunction · 0.90
executeFlowFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected