(edges: IReactFlowEdge[], nodeId: string)
| 651 | * // Returns array of two edge objects connecting to llmAgentflow_2 |
| 652 | */ |
| 653 | function getNodeInputConnections(edges: IReactFlowEdge[], nodeId: string): IReactFlowEdge[] { |
| 654 | // Filter edges where target matches the nodeId |
| 655 | const inputConnections = edges.filter((edge) => edge.target === nodeId) |
| 656 | |
| 657 | // Sort connections by sourceHandle to maintain consistent order |
| 658 | // This is important for nodes that have multiple inputs that need to be processed in order |
| 659 | inputConnections.sort((a, b) => { |
| 660 | // Extract index from sourceHandle (e.g., "output-0" vs "output-1") |
| 661 | const indexA = parseInt(a.sourceHandle.split('-').find((part) => !isNaN(parseInt(part))) || '0') |
| 662 | const indexB = parseInt(b.sourceHandle.split('-').find((part) => !isNaN(parseInt(part))) || '0') |
| 663 | return indexA - indexB |
| 664 | }) |
| 665 | |
| 666 | return inputConnections |
| 667 | } |
| 668 | |
| 669 | /** |
| 670 | * Analyzes node dependencies and sets up expected inputs |
no outgoing calls
no test coverage detected