Node Structure
All custom nodes are located inpackages/concepts/nodes-and-edges/nodes/. Nodes are organized by category:
chatmodels/- Language model integrationstools/- Agent tools and utilitiesembeddings/- Text embedding modelsvectorstores/- Vector database integrationsdocumentloaders/- Document loading utilitieschains/- LangChain workflowsagents/- Agent implementationsmemory/- Conversation memory typesutilities/- Helper nodes
Basic Node Template
Every node implements theINode interface:
Node Properties
Required Properties
| Property | Type | Description |
|---|---|---|
label | string | Display name shown in the UI |
name | string | Unique identifier (camelCase) |
version | number | Node version for updates |
type | string | Node type identifier |
category | string | Category for organization |
description | string | Brief explanation of functionality |
baseClasses | string[] | Supported base classes |
inputs | INodeParams[] | Input parameters |
Optional Properties
| Property | Type | Description |
|---|---|---|
icon | string | Icon filename (in public folder) |
credential | INodeParams | Credential requirements |
outputs | INodeOutputsValue[] | Output definitions |
loadMethods | object | Async methods for loading options |
Defining Inputs
Inputs define the parameters users can configure:Input Types
string- Text inputnumber- Numeric input with optionalstepboolean- Checkboxpassword- Masked text inputoptions- Dropdown selectionmultiOptions- Multiple selectionasyncOptions- Dynamically loaded optionsjson- JSON editorcode- Code editorfile- File uploadfolder- Folder selection
Example: Simple Calculator Tool
Here’s a complete example of a basic calculator node:Calculator.ts
Example: Custom API Tool
A more complex example with inputs and credentials:CustomAPI.ts
Example: Chat Model with Advanced Features
Here’s an example showing async options, credentials, and multiple inputs:CustomChatModel.ts
Async Options
UseasyncOptions to load options dynamically:
Credentials
If your node requires credentials, define them:Best Practices
Follow these guidelines for high-quality nodes:
- Clear naming - Use descriptive names for labels and properties
- Proper validation - Validate inputs before processing
- Error handling - Catch and handle errors gracefully
- Documentation - Add clear descriptions for all inputs
- Type safety - Use TypeScript types properly
- Versioning - Increment version when making breaking changes
Testing Your Node
Test in the UI
- Open http://localhost:3000
- Create a new chatflow
- Find your node in the left sidebar under the specified category
- Drag it onto the canvas and test its functionality
Adding Icons
Place custom icons inpackages/server/src/public/:
Debugging
Enable debug mode to see console logs:Next Steps
- Review existing nodes in
packages/concepts/nodes-and-edges/nodes/for more examples - Read the contributing guidelines before submitting
- Learn about the architecture of Flowise
