AI Content Generation
Advanced patterns for generating content with AI agents
In this tutorial, you'll explore advanced AI patterns for generating various types of content, from follow-up emails to comprehensive research briefs. You'll learn to use both AI Prompt and AI Agent nodes effectively.
Time: 25 minutes Difficulty: Intermediate Prerequisites:
- Completed previous tutorials
- Understanding of AI Prompt nodes
- Familiarity with Liquid templates
What You'll Learn
- Crafting effective prompts for different content types
- Using AI Agent with tools for research
- Chaining multiple AI calls
- Optimizing for quality and cost
Part 1: Follow-Up Email Generation
The Use Case
Automatically generate personalized follow-up emails after meetings.
Workflow Structure
[Meeting Ended] → [Load Meeting] → [AI: Generate Email] → [Email Send]
Step 1: Create the Workflow
- Create workflow: "AI Follow-Up Emails"
- Add Event Trigger:
MEETING_ENDED - Add Load Meeting node
Step 2: Configure AI Email Generation
Add AI Prompt node:
Model: Medium Return Type: String
System Message:
You are a professional business writer crafting follow-up emails after sales meetings.
Guidelines:
- Professional but warm tone
- Reference specific discussion points
- Include clear next steps
- Keep under 200 words
- No generic phrases like "It was great meeting you"
Structure:
1. Brief reference to the meeting topic
2. Key takeaways or decisions
3. Specific next steps with timeline
4. Clear call to action
User Message:
Write a follow-up email for this meeting:
Meeting: {{ json.meeting.title }}
Date: {{ json.meeting.startTime | date: "%B %d, %Y" }}
Duration: {{ json.meeting.durationMinutes }} minutes
Our Team: {% for a in json.meeting.attendees %}{% if a.internal %}{{ a.name }}{% unless forloop.last %}, {% endunless %}{% endif %}{% endfor %}
Their Team: {% for a in json.meeting.attendees %}{% unless a.internal %}{{ a.name }} ({{ a.title }}){% unless forloop.last %}, {% endunless %}{% endunless %}{% endfor %}
Summary:
{{ json.callRecording.transcriptSummary }}
Write the email body only (no subject line).
Step 3: Generate Subject Line
Add another AI Prompt for the subject:
Model: Low Return Type: String
User Message:
Generate a professional email subject line for this follow-up email.
Maximum 60 characters. No quotes around the subject.
Email content:
{{ steps.emailBody.value }}
Step 4: Send the Email
Add Email Send node:
To: Use recipient logic based on your needs
Subject: {{ steps.subjectLine.value }}
Body: {{ steps.emailBody.value }}
Part 2: Meeting Brief Generation
The Use Case
Generate comprehensive pre-meeting briefs using AI Agent with research tools.
Workflow Structure
[Meeting Starting] → [Load Meeting] → [AI Agent: Research] → [Slack Brief]
Step 1: Create the Workflow
- Create workflow: "Pre-Meeting Brief"
- Add Event Trigger:
MEETING_START_MINUS_15M - Add Load Meeting node
Step 2: Configure AI Agent
Add AI Agent node:
Model: High
Return Type: String
Tools: search, open, web_search
System Message:
You are a sales research assistant preparing meeting briefs.
You have access to:
- search: Search deal room documents
- open: Read specific documents
- web_search: Search the web
Create a comprehensive brief including:
1. Company Overview (from web search)
2. Recent News (from web search)
3. Deal Context (from deal room documents)
4. Talking Points (synthesized recommendations)
Be thorough but concise. Include only verified information.
User Message:
Prepare a meeting brief for:
Meeting: {{ json.meeting.title }}
Time: {{ json.meeting.startTime | date: "%B %d at %I:%M %p" }}
External Attendees:
{% for a in json.meeting.attendees %}{% unless a.internal %}
- {{ a.name }} ({{ a.title }}) - {{ a.company }}
{% endunless %}{% endfor %}
Research the company and attendees. Search the deal room for relevant context.
Create a brief I can review in 2 minutes.
Step 3: Format and Send
Add Slack Post:
Message:
📋 *Pre-Meeting Brief*
*{{ json.meeting.title }}*
Starting in 15 minutes
{{ json.value }}
_Research compiled by AI Agent_
Part 3: Multi-Stage Content Pipeline
The Use Case
Generate multiple content pieces from a single meeting, optimizing for both quality and cost.
Workflow Structure
[Meeting Ended] → [Load] → [Quick Summary] → [Detailed Analysis] → [Action Items] → [Compile & Send]
Step 1: Quick Summary (Low Cost)
First AI call for basic summary:
Model: Low Return Type: String
Summarize this meeting in 2-3 sentences:
{{ json.callRecording.transcriptSummary }}
Step 2: Detailed Analysis (Medium Cost)
Conditional detailed analysis only if needed:
Model: Medium Return Type: String
Provide detailed analysis of this meeting:
1. Key Discussion Points
2. Decisions Made
3. Open Questions
4. Risks or Concerns
Summary:
{{ json.callRecording.transcriptSummary }}
Step 3: Action Items (Structured Output)
Extract structured action items:
Model: Medium Return Type: String List
Extract action items as a list.
Format: "[Owner] - [Task] - [Due date if mentioned]"
{{ json.callRecording.transcriptSummary }}
Step 4: Compile Results
Use Liquid to combine all AI outputs:
# Meeting Report: {{ json.meeting.title }}
## Quick Summary
{{ steps.quickSummary.value }}
## Detailed Analysis
{{ steps.detailedAnalysis.value }}
## Action Items
{% for item in steps.actionItems.value %}
- {{ item }}
{% endfor %}
---
Generated: {{ "now" | date: "%B %d, %Y at %I:%M %p" }}
Part 4: Conditional AI Complexity
The Use Case
Use simpler AI for simple meetings, more powerful AI for complex ones.
Complexity Detection
First, detect meeting complexity:
Model: Low Return Type: Integer
Rate meeting complexity from 1-5:
1: Brief check-in, status update
2: Simple discussion, few topics
3: Standard business meeting
4: Complex discussion, multiple stakeholders
5: Strategic, high-stakes, technical depth
{{ json.callRecording.transcriptSummary }}
Route Based on Complexity
Use If node:
json.value >= 4 // Complex meeting
High Complexity Path
Model: High
This is a complex meeting requiring detailed analysis...
Low Complexity Path
Model: Low
Provide a brief summary of this simple meeting...
Best Practices
1. Prompt Engineering Tips
Be Specific:
❌ "Summarize this meeting"
✅ "Summarize this sales meeting in 3 bullet points focusing on customer needs, objections, and next steps"
Provide Structure:
✅ Include explicit output format:
"Format your response as:
SUMMARY: [2-3 sentences]
DECISION: [key decision]
NEXT STEPS: [bullet list]"
Use Examples:
✅ Few-shot prompting:
"Example output:
SUMMARY: The team reviewed Q4 goals and decided to prioritize enterprise features.
DECISION: Launch enterprise tier in November.
NEXT STEPS:
- Sarah to finalize pricing
- Mike to update roadmap"
2. Model Selection
| Content Type | Recommended Model | Why |
|---|---|---|
| Classification | Low | Simple yes/no decisions |
| Basic summary | Low | Straightforward extraction |
| Email drafts | Medium | Good balance of quality/cost |
| Detailed analysis | Medium | Standard reasoning |
| Research briefs | High | Complex multi-source synthesis |
| Strategic recommendations | High | Nuanced judgment needed |
3. Token Optimization
Use Summaries:
✅ {{ json.callRecording.transcriptSummary }} // ~500-1000 tokens
❌ {{ json.callRecording.transcript }} // ~10,000-50,000 tokens
Include Only Needed Data:
✅ Meeting: {{ json.meeting.title }}
Attendees: {{ json.meeting.attendees | map: "name" | join: ", " }}
❌ {{ json | json }} // Full JSON dump
4. Error Handling
Always handle AI failures:
[AI Prompt]
├── Success → [Use output]
└── Error → [Fallback message]
Fallback message:
Unable to generate AI summary. Please review the meeting manually:
{{ json.meeting.title }}
Advanced Pattern: Iterative Refinement
Step 1: Generate Draft
Generate a draft follow-up email...
Step 2: Review Draft
Review this email draft and identify:
1. Missing information
2. Unclear language
3. Suggested improvements
Draft:
{{ steps.draft.value }}
Step 3: Refine Based on Review
Improve this email based on the review feedback:
Original:
{{ steps.draft.value }}
Feedback:
{{ steps.review.value }}
Generate an improved version.
Troubleshooting
AI Output Too Long
Solution: Add explicit length constraints
Maximum 3 bullet points.
Each bullet under 20 words.
AI Missing Key Points
Solution: Be explicit about requirements
You MUST include:
- Customer's main concern
- Proposed solution
- Agreed next steps
If any of these weren't discussed, say "Not discussed"
AI Hallucinating Information
Solution: Add grounding instructions
Only include information explicitly stated in the transcript.
Do not infer or assume facts not mentioned.
If unsure, say "unclear from transcript"
Inconsistent Output Format
Solution: Use structured return types
Return Type: String List (instead of String)
Congratulations! 🎉
You've mastered advanced AI content generation! You now understand:
- ✅ Crafting prompts for different content types
- ✅ Using AI Agent with research tools
- ✅ Multi-stage content pipelines
- ✅ Cost optimization strategies
- ✅ Error handling for AI nodes
Next Steps
- Review Prompt Engineering for more techniques
- Explore Model Selection for cost optimization
- Read Structured Outputs for reliable parsing