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

Function findMemoryNode

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

Source from the content-addressed store, hash-verified

1903 * @returns {IReactFlowNode | undefined}
1904 */
1905export const findMemoryNode = (nodes: IReactFlowNode[], edges: IReactFlowEdge[]): IReactFlowNode | undefined => {
1906 const memoryNodes = nodes.filter((node) => node.data.category === 'Memory')
1907 const memoryNodeIds = memoryNodes.map((mem) => mem.data.id)
1908
1909 for (const edge of edges) {
1910 if (memoryNodeIds.includes(edge.source)) {
1911 const memoryNode = nodes.find((node) => node.data.id === edge.source)
1912 return memoryNode
1913 }
1914 }
1915
1916 return undefined
1917}
1918
1919/**
1920 * 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