Skip to main content

Overview

Nodes are the building blocks of workflow processing. There are four primary node types, each designed for a specific part of data processing or control. Primary Node Types:
  • Node - Performs basic processing tasks with custom logic
  • AgentNode - Handles processing using Large Language Models (LLM)
  • ConcurrentNode - Executes multiple nodes concurrently for better performance
  • BaseRouter - Directs data flow using conditional routing logic

Node Architecture

Each node type serves a distinct purpose in the workflow ecosystem: Node Categories: Processing Nodes:
  • Node: Custom processing logic for any computational task
  • AgentNode: LLM-powered processing for AI-driven operations
Control Nodes:
  • ConcurrentNode: Parallel execution of independent operations
  • BaseRouter: Conditional branching based on processing results

When to Use Each Node Type

  1. Node for custom logic: Data validation or computations without AI
  2. AgentNode for AI: Natural language understanding and generation
  3. ConcurrentNode for parallelism: Independent operations running simultaneously
  4. BaseRouter for conditional flow: Branch based on results or business rules

Node Hierarchy

All specialized node types inherit from the base Node class, ensuring a consistent interface while providing specialized functionality for different use cases.

Design Principles

  • Single Responsibility - Each node type has a clear, single responsibility aligned with its specific use case
  • Extensibility - Abstract base classes allow for easy extension while maintaining consistent interfaces
  • Composability - Nodes can be easily combined to create complex workflows leveraging each type’s strengths
  • Consistency - All nodes share common patterns for context management, error handling, and result storage
I