Node Anatomy
Every custom node consists of:1
Class Definition
Extend the base
Node class2
Node Decorator
Add
@defineNode with metadata3
Inputs & Outputs
Define ports with
@Input and @Output4
Properties
Add configuration with
@Property5
Business Logic
Implement the
execute() methodBasic Node Structure
Input Patterns
Required Inputs
Optional Inputs with Defaults
Multiple Input Types
Array Inputs
Output Patterns
Single Output
Multiple Outputs
Property Patterns
String Properties
Number Properties with Constraints
Boolean Properties
Select Properties
Execution Patterns
Synchronous Execution
Asynchronous Execution
Error Handling
Validation
Real-World Examples
String Manipulation Node
HTTP Request Node
Data Transformation Node
Advanced Patterns
Cancellable Long Operations
Progress Reporting
State Management
Context Access
Testing Custom Nodes
Best Practices
Single Responsibility
Single Responsibility
Each node should do one thing well. Split complex logic into multiple nodes.
Input Validation
Input Validation
Always validate inputs in execute() and throw descriptive errors.
Meaningful Names
Meaningful Names
Use clear, descriptive names for types, labels, inputs, and outputs.
Document Everything
Document Everything
Add descriptions to all decorators to help users understand your nodes.
Handle Errors Gracefully
Handle Errors Gracefully
Use try-catch blocks and provide meaningful error messages.
Make Nodes Reusable
Make Nodes Reusable
Design nodes to be generic and configurable rather than hardcoded.
Node Categories
Organize your nodes into logical categories:- Input - Data sources (user input, files, APIs)
- Processing - Data transformation and manipulation
- Output - Results display and storage
- Logic - Conditional flow and decisions
- Math - Mathematical operations
- String - Text manipulation
- Data - Array and object operations
- Network - HTTP requests and APIs
- File - File system operations
- Database - Database queries
- AI - Machine learning and AI operations
Next Steps
Node API Reference
Complete Node class API
Decorators Reference
All decorator options
Property System
Advanced property patterns
Workflow Builder
Integrate nodes into UI