Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:FlowiseAI Flowise GetAllNodes

From Leeroopedia
Attribute Value
Source Repository FlowiseAI/Flowise
Source File packages/ui/src/api/nodes.js
Domain Chatflow_Creation
Workflow Chatflow_Creation
Last Updated 2026-02-12

Overview

Concrete API client function for fetching all available node component definitions from the Flowise server. This function wraps a parameter-less HTTP GET request to the /nodes endpoint. It is called during canvas initialization to populate the drag-and-drop sidebar and provide the component schema registry used throughout the editor.

Code Reference

Source Location

  • File: packages/ui/src/api/nodes.js
  • Line: L3

Signature

const getAllNodes = () => client.get('/nodes')

Import

import nodesApi from '@/api/nodes'

The client object is an Axios instance configured in packages/ui/src/api/client.js with a base URL of ${baseURL}/api/v1.

I/O Contract

Inputs

Parameter Type Required Description
(none) -- -- This function takes no parameters

Outputs

Field Type Description
data NodeDefinition[] Array of all available node component definitions

Each NodeDefinition object contains:

Field Type Description
name string Unique component identifier (e.g., "chatOpenAI")
label string Display name (e.g., "ChatOpenAI")
type string Node type classification
icon string Icon identifier or SVG path
category string Sidebar grouping category (e.g., "Chat Models", "Chains", "Tools")
description string Human-readable description of the component
baseClasses string[] Output type classes for connection compatibility validation
inputs InputDef[] Array of input definitions (parameters and anchors)
outputs OutputDef[] Array of output anchor definitions
credential object or undefined Optional credential input definition for API key binding
version number Component version number for outdated-node detection

Usage Examples

Canvas initialization (as used in the Canvas component)

import nodesApi from '@/api/nodes'
import useApi from '@/hooks/useApi'

const Canvas = () => {
    const getNodesApi = useApi(nodesApi.getAllNodes)

    useEffect(() => {
        // Fetch all node definitions on mount
        getNodesApi.request()
    }, [])

    // Pass fetched node data to the sidebar palette
    return (
        <ReactFlow>
            <AddNodes nodesData={getNodesApi.data} />
        </ReactFlow>
    )
}

Direct async call

import nodesApi from '@/api/nodes'

const response = await nodesApi.getAllNodes()
const nodeDefinitions = response.data
// nodeDefinitions is an array of NodeDefinition objects

Fetching a specific node by name

The nodes.js module also exports a function for fetching individual node definitions:

import nodesApi from '@/api/nodes'

// Fetch a single node definition by component name
const response = await nodesApi.getSpecificNode('chatOpenAI')
const nodeDefinition = response.data

Related API Functions

The nodes.js module exports additional functions:

  • getSpecificNode(name) -- Fetches a single node definition by name (L5)
  • getNodesByCategory(name) -- Fetches nodes filtered by category (L6)
  • executeCustomFunctionNode(body) -- Executes a custom function node (L8)
  • executeNodeLoadMethod(name, body) -- Triggers a node's dynamic load method for async options (L10)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment