FAQ Generator
Automatically generate comprehensive FAQs from documentation, support tickets, and sales calls.
This workflow analyzes customer questions, creates Q&A pairs, and formats them with SEO-optimized schema markup.
Implementation
1import { relay } from "@relayplane/workflows";23const result = await relay4 .workflow("faq-generator")56 // Step 1: Extract common questions from multiple sources7 .step("extract-questions")8 .with("openai:gpt-4o")9 .prompt(`Extract frequently asked questions from these sources:1011Support Tickets:12{{supportTickets}}1314Sales Call Notes:15{{salesNotes}}1617Product Documentation:18{{productDocs}}1920Identify:21- Most frequently asked questions (min 3 occurrences)22- Questions causing confusion or support load23- Questions from buying stage vs onboarding vs power users2425Return array of questions grouped by category.`)2627 // Step 2: Generate comprehensive answers28 .step("write-answers")29 .with("anthropic:claude-3.5-sonnet")30 .depends("extract-questions")31 .prompt(`Write clear, helpful answers for these FAQs:3233{{extract-questions.output}}3435Product Context:36{{productContext}}3738For each answer:39- Start with direct answer (1 sentence)40- Provide context and details41- Include example if applicable42- Link to relevant docs43- End with next step or related question4445Tone: Helpful, clear, professional46Length: 50-150 words per answer`)4748 // Step 3: Optimize for search intent49 .step("seo-optimize")50 .with("openai:gpt-4o")51 .depends("write-answers")52 .prompt(`Optimize these FAQs for search engines:5354{{write-answers.output}}5556For each Q&A:57- Rephrase question to match search queries (natural language)58- Ensure answer includes relevant keywords59- Suggest related questions for internal linking60- Identify opportunities for featured snippets6162Return optimized version with metadata.`)6364 // Step 4: Generate FAQ schema markup65 .step("generate-schema")66 .with("anthropic:claude-3.5-sonnet")67 .depends("seo-optimize")68 .prompt(`Generate FAQ schema markup (JSON-LD) for these Q&As:6970{{seo-optimize.output}}7172Follow schema.org FAQPage format.73Include all questions and answers.74Ensure valid JSON structure.`)7576 .run({77 supportTickets: ticketData,78 salesNotes: callNotes,79 productDocs: documentation,80 productContext: "Enterprise workflow automation platform with AI capabilities",81 });8283// Publish to help center84await publishFAQ({85 content: result.steps["seo-optimize"].output,86 schema: result.steps["generate-schema"].output,87 category: "General",88});Automated Updates
1// Monthly FAQ refresh based on new support tickets2import { relay } from "@relayplane/workflows";34async function monthlyFAQUpdate() {5 const lastMonth = new Date();6 lastMonth.setMonth(lastMonth.getMonth() - 1);78 // Fetch recent tickets9 const recentTickets = await getTickets({10 since: lastMonth,11 status: 'resolved',12 limit: 500,13 });1415 // Identify new common questions16 const result = await relay17 .workflow("faq-generator")18 .step("find-new-questions")19 .with("openai:gpt-4o")20 .prompt(`Analyze these support tickets for NEW frequently asked questions:2122{{tickets}}2324Existing FAQ Topics:25{{existingFAQs}}2627Identify questions asked 5+ times that aren't in existing FAQs.28Rank by frequency and business impact.`)29 .step("write-answers")30 .with("anthropic:claude-3.5-sonnet")31 .depends("find-new-questions")32 .run({33 tickets: recentTickets.map(t => t.description).join("\n\n"),34 existingFAQs: await getExistingFAQTopics(),35 });3637 // Review and publish38 await notifyTeam({39 channel: "#content-updates",40 message: "New FAQ suggestions ready for review",41 data: result.steps["write-answers"].output,42 });43}Sample Output
1{2 "@context": "https://schema.org",3 "@type": "FAQPage",4 "mainEntity": [5 {6 "@type": "Question",7 "name": "How do I connect multiple AI providers in one workflow?",8 "acceptedAnswer": {9 "@type": "Answer",10 "text": "You can mix different AI providers in a single workflow using the .with() method. Each step can use a different provider by specifying provider:model format, such as .with('openai:gpt-4o') or .with('anthropic:claude-3.5-sonnet'). The workflow automatically handles authentication and provider switching between steps. See our multi-provider guide for examples."11 }12 },13 {14 "@type": "Question",15 "name": "What's the difference between local and cloud execution?",16 "acceptedAnswer": {17 "@type": "Answer",18 "text": "Local execution runs workflows entirely on your infrastructure using your own API keys. Cloud execution adds managed features like webhooks, scheduling, team collaboration, and usage analytics. You can develop locally and deploy to cloud seamlessly - the same code works in both environments. See pricing for cloud feature details."19 }20 }21 ]22}Benefits
- Reduced Support Load: Comprehensive FAQs deflect 30-40% of tickets
- SEO Benefits: FAQ pages rank well for long-tail queries
- Self-Service: Customers get instant answers 24/7
- Always Current: Auto-update based on actual customer questions
Featured Snippets: FAQ schema markup increases chances of appearing in Google's featured results by 3-5x
Customization
- Add video script generation for FAQ videos
- Create chatbot training data from FAQs
- Generate multilingual versions
- A/B test different answer formats