LLMNode class sends an instruction to a Claude model and captures the response. It supports template variables so you can inject dynamic data from workflow inputs or previous nodes.
Constructor
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
id | str | Required | Unique node identifier (lowercase letters, numbers, underscores, hyphens) |
name | str | Required | Human-readable node name |
instruction | str | Required | Instruction sent to Claude — supports {{variable}} template syntax |
model | str | "claude-haiku-4-5" | Claude model to use (see table below) |
max_tokens | int | 2000 | Maximum tokens in the response |
temperature | float | 1.0 | Sampling temperature — 0.0 (deterministic) to 1.0 (creative) |
dependencies | list[str] | [] | Node IDs this node waits for before running |
enable_retry | bool | False | Retry the node on failure |
max_retries | int | 3 | Maximum retry attempts (used when enable_retry=True) |
retry_delay | float | 1.0 | Initial delay in seconds between retries |
Supported Models
| Model | Identifier | Best For |
|---|---|---|
| Claude Haiku 4.5 | claude-haiku-4-5 | Fast, cost-effective tasks — SDK default |
| Claude Sonnet 4.6 | claude-sonnet-4-6 | Balanced quality and speed — general purpose |
| Claude Opus 4.6 | claude-opus-4-6 | Most capable — complex reasoning and analysis |
Template Variables
Use{{variable}} syntax to inject dynamic values into the instruction:
Available Variable Sources
| Syntax | Where it comes from |
|---|---|
{{input.field}} | Workflow input data |
{{node_id}} | Full output of another node |
{{node_id.field}} | Specific field from a node’s JSON output |
Selecting a Model
Temperature
Controls randomness. Range is0.0 to 1.0:
Max Tokens
Limit how long the response can be:Dependencies
Control execution order by declaring which nodes must finish before this one runs:.depends_on() method:
Retry Configuration
Enable retries usingenable_retry=True or the fluent .with_retry() method:
Conditional Execution
Run this node only when a condition is met using.with_condition():