Skip to main content
The Node class is the foundation for all other node types. Each specialized node implements the process() method, which contains the step’s core logic. Use process() to define how the node handles data during execution. This design keeps implementations consistent and extensible.

Node Class

The base Node class provides the essential structure for all workflow processing steps:
Key features:
  • Abstract base class for a consistent interface
  • Node name property uses the class name
  • Abstract process method for subclasses
  • Async support for non-blocking operations
  • Optional cleanup() hook for releasing clients/connections, called by the orchestrator after each node run (including when an exception propagates)

Basic Implementation

Here is a simple example of a custom node:
Always return the task_context to maintain data flow through the pipeline.

Storing and Accessing Node Results

Why store results? Persist outputs so later nodes can use them.

Storing Node Results

Use save_output() to store results in the task context:

Accessing Node Results

Retrieve results from previous nodes using get_output():

Key benefits

  • Consistency - A predictable interface across nodes
  • Flexibility - Customize while maintaining structure
  • Composability - Combine and reorder nodes freely
  • Testability - Test nodes independently with mock contexts