> ## Documentation Index
> Fetch the complete documentation index at: https://kapso-1adbad2d.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent nodes

> Building blocks for conversational agents

## Node types

### SubagentNode (recommended)

Multi-tool node for complex interactions.

```python theme={null}
from kapso.builder.nodes import SubagentNode
from kapso.builder.nodes.subagent.tools import WebhookTool

node = SubagentNode(name="assistant")
node.add_tool(WebhookTool(name="api", url="https://api.com"))
```

### DefaultNode

Simple conversation and reasoning.

```python theme={null}
from kapso.builder.nodes import DefaultNode

node = DefaultNode(
    name="greeting", 
    prompt="Welcome the user"
)
```

### WebhookNode

HTTP API calls.

```python theme={null}
from kapso.builder.nodes import WebhookNode

node = WebhookNode(
    name="api_call",
    url="https://api.example.com/data",
    http_method="GET"
)
```

### KnowledgeBaseNode

Search knowledge sources.

```python theme={null}
from kapso.builder.nodes import KnowledgeBaseNode

node = KnowledgeBaseNode(
    name="docs",
    knowledge_base_text="Product info..."
)
```

### HandoffNode

Transfer to human agent.

```python theme={null}
from kapso.builder.nodes import HandoffNode

node = HandoffNode(
    name="human",
    global_=True,
    global_condition="user requests human"
)
```

### WarmEndNode

End conversation with timeout.

```python theme={null}
from kapso.builder.nodes import WarmEndNode

node = WarmEndNode(
    name="goodbye",
    timeout_minutes=30,
    prompt="Thank the user"
)
```

### WhatsAppTemplateNode

Send WhatsApp templates.

```python theme={null}
from kapso.builder.nodes import WhatsAppTemplateNode

node = WhatsAppTemplateNode(
    name="notification",
    template_name="order_update",
    phone_number="{{customer_phone}}"
)
```

## Global nodes

Global nodes trigger from anywhere in the conversation:

```python theme={null}
help_node = DefaultNode(
    name="help",
    prompt="Show available options",
    global_=True,
    global_condition="user asks for help"
)
```

## Node selection guide

| Use case          | Node type                        |
| ----------------- | -------------------------------- |
| Main conversation | SubagentNode                     |
| Simple routing    | DefaultNode                      |
| API integration   | SubagentNode + WebhookTool       |
| Knowledge lookup  | SubagentNode + KnowledgeBaseTool |
| Human handoff     | HandoffNode (global)             |
| End conversation  | WarmEndNode                      |
