Skip to main content

Using AI Nodes

Leverage LLMs and AI capabilities in your workflows.

LLM Node

The most commonly used AI node for text generation.

Basic Configuration

{
provider: "openai",
model: "gpt-4.1",
systemPrompt: "You are a helpful assistant",
userMessage: "{{trigger.body.question}}",
temperature: 0.7,
maxTokens: 500
}

Supported Providers

ProviderModelsBest For
OpenAIgpt-4.1, gpt-4o, gpt-4o-mini, o3-miniGeneral purpose, function calling
Anthropicclaude-opus-4-5, claude-sonnet-4-5, claude-haiku-4-5Instruction following, safety
Googlegemini-2.0-flash, gemini-2.0-proMulti-modal, large context
Coherecommand-r-plus, command-rRetrieval, enterprise
x.aigrok-3, grok-3-miniReasoning, analysis
Hugging FaceVariousOpen source, specialized

Options

OptionDescriptionDefault
TemperatureCreativity (0 = deterministic, 2 = very creative)0.7
Max TokensResponse length limit4096
JSON ModeForce structured JSON outputfalse
Stop SequencesTokens that stop generation[]

Example: Content Summarizer

{
provider: "anthropic",
model: "claude-sonnet-4-5",
systemPrompt: `You are a content summarizer.
Summarize the provided text in 3 bullet points.
Be concise but capture key information.`,
userMessage: "{{http_request.output.body}}",
temperature: 0.3
}

Extended Thinking

Enable deep reasoning for complex tasks with models that support extended thinking.

Supported Models

ModelProviderThinking Capability
claude-opus-4-5AnthropicExtended thinking
claude-sonnet-4-5AnthropicExtended thinking
o3OpenAIExtended thinking
o3-miniOpenAIReasoning mode
grok-3x.aiExtended thinking

Configuration

{
provider: "anthropic",
model: "claude-sonnet-4-5",
extendedThinking: {
enabled: true,
budgetTokens: 10000, // Max tokens for thinking
showThinking: false // Include thinking in output
},
userMessage: "Analyze this complex problem: {{input.problem}}"
}

When to Use

Extended thinking is ideal for:

  • Complex reasoning — Multi-step logic problems
  • Code analysis — Understanding large codebases
  • Research synthesis — Combining multiple sources
  • Strategic planning — Business decisions

Example: Code Review

{
provider: "openai",
model: "o3",
extendedThinking: { enabled: true, budgetTokens: 8000 },
systemPrompt: `You are a senior code reviewer.
Analyze the code for bugs, security issues, and improvements.
Think through each issue carefully.`,
userMessage: "Review this code:\n{{input.code}}"
}

Vision Node

Analyze images with AI.

Basic Configuration

{
provider: "openai",
model: "gpt-4o",
image: "{{trigger.body.imageUrl}}",
prompt: "Describe what you see in this image"
}

Image Sources

// URL
{
image: "https://example.com/image.jpg";
}

// Base64
{
image: "{{screenshot.output.base64}}";
}

// File upload
{
image: "{{trigger.files[0].url}}";
}

Multiple Images

{
model: "gpt-4o",
images: [
"{{input.image1}}",
"{{input.image2}}"
],
prompt: "Compare these two images and describe the differences"
}

Example: Product Analysis

{
provider: "anthropic",
model: "claude-sonnet-4-5",
image: "{{trigger.body.productImage}}",
prompt: `Analyze this product image:
1. Identify the product type
2. List visible features
3. Estimate quality level
4. Suggest improvements`,
outputVariable: "product_analysis"
}

Audio Nodes

Speech-to-Text (STT)

Convert audio to text:

{
type: "audio_input",
provider: "openai",
model: "whisper-1",
audio: "{{trigger.files[0].url}}",
language: "en",
outputVariable: "transcription"
}

Supported formats: mp3, mp4, mpeg, mpga, m4a, wav, webm

Options:

OptionDescription
languageISO language code (auto-detect if omitted)
timestampsInclude word-level timestamps
diarizationIdentify different speakers

Text-to-Speech (TTS)

Convert text to audio:

{
type: "audio_output",
provider: "openai",
model: "tts-1-hd",
text: "{{llm.output.content}}",
voice: "alloy",
outputFormat: "mp3",
outputVariable: "audio_file"
}

Available voices: alloy, echo, fable, onyx, nova, shimmer

Example: Voice Assistant Pipeline

[Audio Input] → [STT] → [LLM] → [TTS] → [Audio Output]
// STT: Transcribe user speech
{
type: "audio_input",
audio: "{{trigger.audio}}",
outputVariable: "user_speech"
}

// LLM: Generate response
{
type: "llm",
userMessage: "{{user_speech.text}}",
outputVariable: "response"
}

// TTS: Convert to speech
{
type: "audio_output",
text: "{{response.content}}",
voice: "nova",
outputVariable: "reply_audio"
}

Router Node

Intelligently route workflows based on content analysis.

Configuration

{
type: "router",
input: "{{trigger.body.message}}",
routes: [
{
name: "billing",
description: "Questions about billing, payments, invoices",
destination: "billing_workflow"
},
{
name: "technical",
description: "Technical support, bugs, errors",
destination: "tech_support_workflow"
},
{
name: "sales",
description: "Pricing, plans, upgrades",
destination: "sales_workflow"
}
],
defaultRoute: "general_support",
confidenceThreshold: 0.7
}

How It Works

  1. Router analyzes the input text
  2. Classifies intent using LLM
  3. Routes to matching destination
  4. Falls back to default if confidence < threshold

Example: Support Ticket Router

{
type: "router",
input: "{{trigger.body.subject}}: {{trigger.body.description}}",
model: "gpt-4o-mini", // Faster model for classification
routes: [
{
name: "urgent",
description: "Service outages, critical bugs, security issues",
destination: "urgent_escalation",
priority: 1
},
{
name: "bug_report",
description: "Bug reports, error messages, unexpected behavior",
destination: "engineering_queue"
},
{
name: "feature_request",
description: "New feature ideas, suggestions, improvements",
destination: "product_backlog"
}
],
outputVariable: "routing_decision"
}

Accessing Routing Results

{
{
routing_decision.route;
}
} // Selected route name
{
{
routing_decision.confidence;
}
} // Confidence score (0-1)
{
{
routing_decision.reasoning;
}
} // Why this route was chosen

Embeddings Node

Generate vector embeddings for semantic search.

{
type: "embeddings",
provider: "openai",
model: "text-embedding-3-small",
input: "{{trigger.body.text}}",
outputVariable: "embedding"
}

Use for:

  • Storing content in vector databases
  • Semantic similarity search
  • Document clustering

Best Practices

Model Selection

TaskRecommended Model
Simple classificationgpt-4o-mini, claude-haiku-4-5
Complex reasoningclaude-opus-4-5, o3
Code generationclaude-sonnet-4-5, gpt-4.1
Vision tasksgpt-4o, claude-sonnet-4-5
Fast responsesgpt-4o-mini, claude-haiku-4-5

Prompt Optimization

  • Be specific about output format
  • Use examples for consistency
  • Set clear boundaries
  • Test with varied inputs

Error Handling

Add retry logic for rate limits:

{
retryPolicy: {
maxRetries: 3,
retryableErrors: ["RATE_LIMIT", "TIMEOUT"],
backoffMs: 1000
}
}

Cost Management

  • Use smaller models when possible
  • Set max_tokens appropriately
  • Cache common responses
  • Monitor usage in dashboard

Next Steps