AI Node
Integrate powerful language models from OpenAI, Anthropic, and Google into your workflows
AI Node
The AI node brings powerful language model capabilities into your workflows. It supports multiple AI providers and models, enabling text generation, analysis, code review, and intelligent data processing.
Configuration
Input Schema
Field | Type | Required | Description |
---|---|---|---|
prompt | string | Yes | The prompt to send to the AI model |
Configuration Schema
Field | Type | Required | Default | Description |
---|---|---|---|---|
provider | string | No | "anthropic" | AI provider: "openai", "anthropic", or "google" |
model | string | No | "claude-4-sonnet-20250514" | Model name to use |
api_key | string | No | - | Custom API key (uses env vars by default) |
Output Schema
Field | Type | Description |
---|---|---|
output | JsonValue | The AI model's response text |
Basic Usage
Simple Text Generation
- id: generate_content
type: ai
input:
prompt: "Write a brief summary of the benefits of workflow automation"
configuration:
provider: "anthropic"
model: "claude-4-sonnet-20250514"
Code Analysis
- id: review_code
type: ai
input:
prompt: |
Review this code for potential issues:
{{ code_snippet }}
Provide specific feedback on:
- Security vulnerabilities
- Performance concerns
- Best practices
configuration:
provider: "openai"
model: "gpt-4"
Advanced Examples
- id: analyze_data
type: ai
input:
prompt: |
Analyze this sales data and provide insights:
{{ sales_data.output }}
Please include:
- Key trends and patterns
- Anomalies or outliers
- Actionable recommendations
Format the response as structured JSON.
- id: validate_analysis
type: ai
input:
prompt: |
Validate this analysis for accuracy and completeness:
{{ analyze_data.output }}
Are the conclusions supported by the data?
Perfect for business intelligence, financial analysis, and data-driven decision making workflows.
- id: gather_context
type: search
input:
query: "{{ topic }}"
maxResults: 5
- id: generate_article
type: ai
input:
prompt: |
Based on this research context:
{{ gather_context.output }}
Write a comprehensive article about {{ topic }}.
Include relevant facts, statistics, and insights.
Target audience: {{ target_audience }}
configuration:
provider: "anthropic"
model: "claude-4-sonnet-20250514"
Ideal for marketing content, research reports, and educational material creation with fact-based foundations.
- id: evaluate_options
type: ai
input:
prompt: |
Evaluate these options for {{ decision_context }}:
Options:
{{ options }}
Criteria:
{{ evaluation_criteria }}
Provide a structured recommendation with:
- Pros and cons for each option
- Risk assessment
- Final recommendation with reasoning
Response format: JSON
Essential for strategic planning, vendor selection, and complex business decisions requiring structured analysis.
Tool Integration
The AI node includes access to a common toolset for enhanced capabilities:
- id: ai_with_tools
type: ai
input:
prompt: |
Help me research {{ topic }} and create a summary.
Use available tools to gather current information.
Tools automatically available:
- Web search capabilities
- Data processing functions
- Structured output generation
Best Practices
Prompt Engineering
Clear Instructions:
input:
prompt: |
Task: Analyze customer feedback
Input: {{ feedback_data }}
Output format: JSON with sentiment, themes, and action items
Context: SaaS product feedback analysis
Structured Prompts:
input:
prompt: |
## Context
{{ context }}
## Task
{{ specific_task }}
## Requirements
- {{ requirement_1 }}
- {{ requirement_2 }}
## Output Format
{{ desired_format }}
Error Handling
- id: ai_task
type: ai
input:
prompt: "{{ complex_prompt }}"
configuration:
errorHandling: "continue"
retryPolicy:
maxRetries: 2
- id: validate_output
type: condition
input:
if: "{{ ai_task.output && ai_task.output.length > 0 }}"
then: ["process_result"]
else: ["handle_ai_error"]
Cost Optimization
# Use appropriate models for task complexity
- id: simple_classification
type: ai
configuration:
provider: "openai"
model: "gpt-4o-mini" # Faster, cheaper for simple tasks
- id: complex_analysis
type: ai
configuration:
provider: "anthropic"
model: "claude-4-sonnet-20250514" # More capable for complex tasks
Last updated on