What are Nodes?
Nodes are the fundamental building blocks of Nadoo Flow Core workflows. Each node represents a single unit of computation that processes input and produces output.Node Architecture
Node Interface
All nodes implement theIStepNode interface:
Node Types
Predefined Node Types
Nadoo Flow Core provides common node types viaCommonNodeTypes:
| Type | Purpose | Example Use Case |
|---|---|---|
START | Workflow entry point | Initialize workflow |
END | Workflow termination | Cleanup and return |
CONDITION | Conditional branching | If/else logic |
PARALLEL | Parallel execution | Concurrent tasks |
LOOP | Iteration | Process lists |
AI_AGENT | AI model interaction | LLM calls |
LLM | Language model | Text generation |
TOOL | External tool | API calls |
DATABASE | Data operations | CRUD operations |
PYTHON | Python code | Custom logic |
CUSTOM | User-defined | Anything |
Custom Node Types
You can define any string as a node type:Creating Custom Nodes
Basic Node Implementation
Chainable Node
For nodes that support the pipe operator:Node Context
Each node has its own context for execution:Using Node Context
Node Result
Nodes return aNodeResult object:
Result Examples
Node Lifecycle
1
Initialization
Node is created with configuration
2
Validation
validate() ensures configuration is correct3
Pre-execution
pre_execute() hook for setup4
Execution
execute() performs main logic5
Post-execution
post_execute() hook for cleanupAdvanced Node Features
Async Operations
All nodes support async operations:Error Handling
Proper error handling in nodes:Node Composition
Nodes can be composed from other nodes:Built-in Helper Nodes
FunctionNode
Wrap any function as a node:PassthroughNode
Identity node for debugging:Best Practices
Single Responsibility
Single Responsibility
Each node should do one thing well. Complex logic should be split into multiple nodes.
Input Validation
Input Validation
Always validate input data in the execute method:
Immutability
Immutability
Don’t modify input data directly:
Resource Cleanup
Resource Cleanup
Use post_execute for cleanup: