> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fibonacci.today/llms.txt
> Use this file to discover all available pages before exploring further.

# Nodes

> Understanding the different node types in Fibonacci

Nodes are the building blocks of workflows. Each node performs a specific action and can depend on the outputs of other nodes.

## Node Types Overview

> [card] LLMNode
>
> Calls Claude or other LLMs to analyze, generate, or transform content

> [card] ToolNode
>
> Executes integrations like Google Sheets, Slack, APIs, etc.

> [card] CriticNode
>
> Evaluates and scores the output of other nodes

> [card] ConditionalNode
>
> Branches workflow based on conditions

***

## LLMNode

The most common node type. Uses AI to process text.

### Basic Usage

```python theme={null}
from fibonacci import LLMNode

node = LLMNode(
    id="analyze",                    # Unique identifier (required)
    name="Analyze Text",             # Human-readable name (required)
    instruction="Analyze: {{input.text}}"  # Prompt (required)
)
```

### Full Options

```python theme={null}
analyze = LLMNode(
    id="analyze_sentiment",
    name="Sentiment Analysis",
    instruction="""
    Analyze the sentiment of this text.
    Respond with: positive, negative, or neutral
    
    Text: {{input.text}}
    """,
    model="claude-haiku-4-5",    # Model to use
    max_tokens=500,              # Max response tokens
    temperature=0.7,             # Creativity (0-1); only for models that accept it
    dependencies=[]              # Nodes this depends on
)
```

### Available Models

LLM steps use `claude-haiku-4-5` unless the node sets `config.model` (or the server sets `CLAUDE_MODEL`). Any model in the platform's price registry works, for example:

| Model | Best for | Price per million tokens (in / out) |
| - | - | - |
| `claude-haiku-5-5` | Fast, cheap extraction and summaries | $0.10 / $0.50 |
| `claude-haiku-4-5` | The default for LLM steps | $1 / $5 |
| `claude-sonnet-5` | Writing and reasoning (also generates workflows) | $2 / $10 |
| `claude-opus-5` | Hard reasoning | $5 / $25 |
| `claude-fable-5-1` | The most capable | $10 / $50 |

`temperature` is only sent to models that accept it; Haiku 5.5, Sonnet 5, Opus 5 and Fable don't take it.

### Template Variables

Reference inputs, other steps' outputs and the run's date:

```python theme={null}
LLMNode(
    id="summarize",
    instruction="""
    Summarize this for {{input.audience}}, as of {{today}}:

    The issue: {{read_issue.text}}
    Earlier analysis: {{analyze_sentiment}}
    """
)
```

| Template | Resolves to |
| - | - |
| `{{input.field}}` | A workflow input |
| `{{node_id}}` | A step's whole output (cut to about 6,000 characters; set `config.max_reference_tokens` to change) |
| `{{node_id.field}}` | One field of a step's output, in full |
| `{{today}}`, `{{yesterday}}`, `{{now}}` | The run's start date and time (UTC), the same for the whole run |

***

## ToolNode

Executes integrations with external services.

### Basic Usage

```python theme={null}
from fibonacci import ToolNode

node = ToolNode(
    id="read_sheet",
    name="Read Google Sheet",
    tool="google_sheets_read",
    params={
        "spreadsheet_id": "{{input.sheet_id}}",
        "range_name": "A1:D100"
    }
)
```

### Full Options

```python theme={null}
send_email = ToolNode(
    id="send_report",
    name="Send Report Email",
    tool="gmail_send",
    params={
        "to": "{{input.recipient}}",
        "subject": "Weekly Report",
        "body": "{{generate_report}}"
    },
    timeout=30,              # Timeout in seconds
    dependencies=["generate_report"]
)
```

### Popular Tools

> [accordion] Developer tools
>
> * `github_get_issue`, `github_list_issues`, `github_get_file`, `github_search_code`, `github_list_commits`, `github_list_pull_requests`, `github_get_checks`, `github_get_pr`
> * `jira_get_issue`, `jira_search_issues`, `jira_create_issue`, `jira_update_issue`, `jira_add_comment`
> * `trello_get_board`, `trello_search_cards`, `trello_create_card`, `trello_update_card`, `trello_add_comment`

> [accordion] Google Workspace
>
> * `google_docs_read`, `google_sheets_read`
> * `gmail_send` (with attachments)
> * `google_calendar_create_event` (with Meet links)
> * `google_drive_permissions`

> [accordion] Messaging
>
> * `slack_send_message` (`@me` for a DM), `slack_create_channel`, `slack_upload_file`
> * `discord_send_message`, `discord_create_channel`

> [accordion] Notion, Zoom and built-ins
>
> * `notion_read_page`, `notion_search`, `notion_create_page`
> * `zoom_create_meeting`, `zoom_get_meeting`
> * `web_search`, `text_analysis`, `text_processor`, `file_reader`

The [tool reference](https://docs.fibonacci.today/guides/tool-nodes.md) lists every parameter and output.

### Discover Tools

```python theme={null}
from fibonacci import list_tools, search_tools, print_tool_info

# List all tools
tools = list_tools()

# Search for specific tools
slack_tools = search_tools("slack")

# Get detailed info
print_tool_info("google_sheets_read")
```

***

## CriticNode

Evaluates the output of another node for quality.

### Basic Usage

```python theme={null}
from fibonacci import CriticNode

critic = CriticNode(
    id="evaluate_report",
    name="Evaluate Report Quality",
    target_node="generate_report",  # Node to evaluate
    criteria=["clarity", "completeness", "accuracy"]
)
```

### How It Works

The critic node:

1. Receives the output of the target node
2. Evaluates it against the specified criteria
3. Returns a score and feedback

```python theme={null}
result = wf.run(input_data={...})

evaluation = result.output_data["evaluate_report"]
# {
#   "score": 8.5,
#   "feedback": {
#     "clarity": "Well organized with clear sections",
#     "completeness": "Missing Q4 projections",
#     "accuracy": "All figures verified"
#   }
# }
```

### Custom Criteria

```python theme={null}
critic = CriticNode(
    id="check_code",
    name="Code Review",
    target_node="generate_code",
    criteria=[
        "correctness",
        "efficiency", 
        "readability",
        "error_handling",
        "security"
    ]
)
```

***

## ConditionalNode

Branches workflow execution based on conditions.

### Basic Usage

```python theme={null}
from fibonacci import ConditionalNode

condition = ConditionalNode(
    id="check_sentiment",
    name="Check Sentiment",
    left_value="{{analyze_sentiment}}",
    operator="contains",
    right_value="negative",
    true_branch=["send_alert"],    # Nodes to run if true
    false_branch=["send_summary"]  # Nodes to run if false
)
```

### Operators

| Operator | Description | Example |
| - | - | - |
| `equals` | Exact match | `"completed"` equals `"completed"` |
| `not_equals` | Not equal | `"pending"` not\_equals `"completed"` |
| `contains` | Substring match | `"error occurred"` contains `"error"` |
| `not_contains` | No substring | `"success"` not\_contains `"error"` |
| `greater_than` | Numeric comparison | `100` greater\_than `50` |
| `less_than` | Numeric comparison | `25` less\_than `50` |
| `starts_with` | String prefix | `"error: ..."` starts\_with `"error"` |
| `ends_with` | String suffix | `"file.pdf"` ends\_with `".pdf"` |
| `is_empty` | Empty check | `""` is\_empty |
| `is_not_empty` | Not empty | `"text"` is\_not\_empty |

### Complex Branching

```python theme={null}
# Check score and branch accordingly
check_score = ConditionalNode(
    id="check_score",
    name="Check Quality Score",
    left_value="{{evaluate_report.score}}",
    operator="greater_than",
    right_value="7",
    true_branch=["publish_report", "notify_team"],
    false_branch=["request_revision"]
)
```

***

## Common Node Properties

All nodes share these properties:

| Property | Type | Description |
| - | - | - |
| `id` | `str` | Unique identifier (lowercase, underscores) |
| `name` | `str` | Human-readable name |
| `type` | `str` | Node type (auto-set) |
| `dependencies` | `list[str]` | Node IDs this depends on |
| `condition` | `dict` | Optional execution condition |
| `enable_retry` | `bool` | Enable retry on failure |
| `max_retries` | `int` | Max retry attempts |
| `retry_delay` | `float` | Delay between retries |

## Dependencies

Control execution order by declaring dependencies:

```python theme={null}
# Node B depends on Node A
node_a = LLMNode(id="a", name="A", instruction="...")
node_b = LLMNode(id="b", name="B", instruction="...", dependencies=["a"])

# Or use fluent API
node_b = LLMNode(id="b", name="B", instruction="...").depends_on("a")
```

### Execution Order

```
No dependencies    → Runs immediately
dependencies=["a"] → Waits for "a" to complete
dependencies=["a", "b"] → Waits for both "a" AND "b"
```

## Retry Configuration

Handle transient failures:

```python theme={null}
# Enable retries with fluent API
node = ToolNode(
    id="checks",
    tool="github_get_checks",
    params={"repo": "acme/web"}
).with_retry(max_retries=3, delay=2.0)

# Or in constructor
node = ToolNode(
    id="checks",
    tool="github_get_checks",
    params={"repo": "acme/web"},
    enable_retry=True,
    max_retries=3,
    retry_delay=2.0  # Seconds, growing with each attempt
)
```

Failures that retrying can't fix (a bad credential, a missing permission, an unknown repository or board) are not retried: the step fails once with a message that says what to change.

## Conditional Execution

Run a node only if a condition is met:

```python theme={null}
# Only run if input.send_email is "true"
node = ToolNode(
    id="send",
    tool="gmail_send",
    params={...}
).with_condition(
    left_value="{{input.send_email}}",
    operator="equals",
    right_value="true"
)
```

## Next Steps

> [card] [Tool Nodes Deep Dive](https://docs.fibonacci.today/guides/tool-nodes.md)
>
> Explore all available tool integrations

> [card] [Conditional Logic](https://docs.fibonacci.today/guides/conditional-logic.md)
>
> Build complex branching workflows


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.