Text Generation Nodes
Text Generation V3 (Recommended)
The most versatile text generation node with advanced features: Key Features:- Variable inputs for dynamic prompts
- Rich text prompt editor with variable insertion
- Model selection (cost/performance presets)
- Streaming support for real-time output
- Time awareness (automatic date/time injection)
- PII detection and guardrails
- Image URL reading capability
- Content generation (articles, emails, summaries)
- Text transformation (rewriting, translation)
- Question answering
- Classification and categorization
- Extraction with flexible outputs
OpenAI Node (Legacy)
Simple text generation for basic use cases: Key Features:- System prompt + user input
- Direct model selection
- Basic configuration
- Simple text generation
- Legacy workflows
- Quick prototyping
Building Effective Prompts
Prompt Structure
A good prompt has clear structure:Variable Inputs
Text Generation V3 supports variable inputs for dynamic prompts: Add Variables:- Click ”+” to add input
- Name the variable (e.g.,
product_name,customer_email) - Connect data or set default values
- Reference in prompt using
{variable_name}
Prompt Engineering Best Practices
Be Specific and Clear:Model Selection
Cost vs Performance Trade-offs
Different models have different characteristics:Model Presets
Text Generation V3 offers presets: Fast & Cheap:- GPT-3.5-turbo, Claude Haiku
- 10x cheaper than GPT-4
- Great for: Simple rewrites, basic Q&A, formatting
- GPT-4o-mini, Claude Sonnet
- 3x cheaper than GPT-4, nearly as good
- Great for: Most tasks, content generation, analysis
- GPT-4, Claude Opus
- Most expensive but best results
- Great for: Complex reasoning, creative writing, critical analysis
Choosing the Right Model
Use Fast Models When:- Task is straightforward (reformatting, simple extraction)
- High volume processing
- Cost is a primary concern
- Speed matters
- General-purpose text generation
- Content creation
- Moderate complexity
- Good balance needed
- Complex reasoning required
- High stakes (customer-facing content)
- Creative tasks (writing, ideation)
- Previous models struggled
Advanced Configuration
Temperature
Controls randomness in generation:- 0.0: Deterministic, consistent output
- 0.3-0.5: Focused, predictable (recommended for data extraction)
- 0.7-0.9: Balanced creativity (recommended for content)
- 1.0-2.0: High creativity, more diverse outputs
- Low (0.0-0.3): Classification, extraction, technical writing
- Medium (0.5-0.8): General content, emails, summaries
- High (0.9-2.0): Creative writing, brainstorming, diverse ideas
Max Output Tokens
Limits response length:- Short (100-300): Quick answers, summaries
- Medium (500-1000): Paragraphs, emails, descriptions
- Long (1500-4000): Articles, reports, detailed analysis
Time Awareness
Automatically injects current date/time into prompts: When enabled, the model knows:- Current date and time
- Day of week
- Relative dates (“yesterday”, “next week”)
- Scheduling and calendar tasks
- Time-sensitive content
- Date-aware analysis
PII Detection
Automatically detects and flags personally identifiable information: Detects:- Names, email addresses, phone numbers
- SSNs, credit cards, addresses
- Sensitive personal data
- Compliance workflows
- Data sanitization
- Privacy protection
Common Patterns
Content Generation
Blog Post Writer:Text Transformation
Rewriting:Analysis and Extraction
Sentiment Analysis:Streaming Outputs
Enable streaming for real-time text generation: Benefits:- See results as they’re generated
- Better user experience for long outputs
- Early detection of issues
- Interactive chatbots
- Real-time content generation
- User-facing applications
Error Handling
Common Issues
Empty Responses:- Prompt may be too restrictive
- Model may refuse harmful requests
- Output token limit too low
- Temperature too high (reduce to 0.3-0.7)
- Prompt lacks constraints
- Need more examples in prompt
- Prompt not specific enough
- Missing context or constraints
- Try different model
Debugging Tips
Use Log Nodes: Insert log nodes after text generation to inspect outputs. Test with Simple Inputs: Start with basic test inputs before complex data. Iterate on Prompts: Refine prompts based on actual outputs. Try Different Models: Some models work better for specific tasks. Check Token Limits: Ensure max tokens is sufficient for expected output.Optimization
Reduce AI model cost
Use Appropriate Models: Don’t use GPT-4 for simple tasks. Set Token Limits: Avoid unnecessarily long outputs. Cache Results: Use Memory nodes to store repeated generations. Batch When Possible: Process multiple items in one generation (if format allows).Improve Quality
Provide More Context: More specific prompts yield better results. Use Examples: Few-shot learning improves accuracy. Iterate on Prompts: Refine based on real outputs. Choose Better Models: Upgrade to higher-quality models for critical tasks.Improve Speed
Use Faster Models: GPT-3.5, Claude Haiku are much faster. Enable Streaming: Perceived performance improvement. Reduce Output Length: Shorter responses generate faster. Parallel Processing: Use list iteration for batch processing.Examples
Example 1: Product Description Generator
Example 2: Customer Support Classifier
Example 3: Meeting Notes Summarizer
Next Steps
Structured Outputs
Generate JSON-structured data with schemas
Vision & Multimodal
Analyze images and mixed content
Model Selection Guide
Deep dive into choosing the right models
Text Generation Node
Complete node reference documentation
Mastering text generation unlocks the full potential of AI in your workflows. Experiment with different prompts, models, and configurations to find what works best for your use cases.