What This Workflow Does
This n8n workflow automates the entire process of creating SEO-optimized blog content from trending topics. It solves the constant challenge content creators face: finding relevant topics, researching keywords, writing engaging articles, and formatting them for publication—all while maintaining SEO best practices.
The system pulls real-time trending search data using Apify's Google Trends scraper, processes it through Google's Gemini AI to generate well-structured articles complete with meta descriptions and headings, creates custom images via KIE AI's Nano Banana API, and automatically formats everything into a Google Doc ready for review and publishing.
Instead of spending 5-10 hours per article on research, writing, and formatting, this automation delivers publish-ready content in minutes. It's particularly valuable for digital marketing agencies, SEO specialists, and content teams needing to maintain consistent publishing schedules while targeting current search trends.
How It Works
The workflow follows a logical sequence that mimics what a skilled content creator would do manually, but at scale and with perfect consistency.
1. Trend Discovery & Research
The workflow starts by connecting to Apify's Google Trends scraper to fetch currently trending search topics in your target region. You can configure it for specific countries, timeframes, and search categories. The system filters out irrelevant topics and selects the most promising subjects based on search volume and relevance.
2. AI Content Generation
Each selected trend is sent to Google's Gemini AI with a carefully crafted prompt that includes SEO best practices, target keywords, tone guidelines, and structural requirements. The AI generates a complete article including: compelling title, meta description, H1/H2/H3 headings, and comprehensive body content optimized for both readers and search engines.
3. Content Refinement
An optional refinement step allows the AI to review and improve its own output. This second pass enhances readability, ensures proper keyword placement, and adds engaging elements like questions, examples, and calls-to-action that increase dwell time and engagement metrics.
4. Visual Asset Creation
Using the generated article title as inspiration, the workflow calls KIE AI's Nano Banana API to create a custom featured image. You can specify style preferences, dimensions, and branding elements. The image is automatically optimized for web and social media sharing.
5. Document Assembly & Delivery
Finally, all components—title, meta description, headings, body content, and featured image—are automatically inserted into a Google Doc using proper formatting. The document is shared with your team for final review, or can be scheduled for immediate publication if you're using automated publishing workflows.
Who This Is For
This automation is ideal for content creators, SEO specialists, digital marketing agencies, and businesses that need to maintain active blogs but lack the time or resources for manual content creation. It's particularly valuable for:
- Content Marketing Teams needing to scale production without hiring additional writers
- SEO Agencies managing multiple client blogs with tight deadlines
- Startups & Small Businesses that understand the value of content marketing but can't afford full-time writers
- Affiliate Marketers creating content around trending products and services
- News & Media Outlets that need to quickly produce content around breaking trends
What You'll Need
- Apify Account & API Token for accessing Google Trends data (free tier available)
- Google Cloud Project with Docs API and Gemini AI API enabled
- Google Service Account Credentials with access to your target Google Drive folder
- KIE AI Nano Banana API Key for image generation (alternative: DALL-E or Stable Diffusion APIs)
- n8n Instance (cloud or self-hosted) with webhook capabilities for scheduling
Pro tip: Start with Apify's free tier (10k monthly credits) and Google's free Gemini API tier (60 requests per minute). This gives you enough capacity to test and run the workflow before committing to paid plans.
Quick Setup Guide
- Import the template into your n8n instance using the download button above
- Configure Apify node with your API token and set your target country/region
- Set up Google OAuth2 in the Google Docs node to connect to your Drive account
- Add your Gemini API key and customize the content generation prompts if needed
- Connect KIE AI with your API token for image generation
- Test with a single run to verify all connections work properly
- Schedule the workflow to run daily, weekly, or based on your content calendar
Key Benefits
Save 20-30 hours per month on content creation. What typically takes a writer 5-8 hours per article (research, writing, editing, formatting) now happens automatically in minutes.
Consistently target trending topics before competitors. The automated trend discovery ensures you're always writing about what people are actually searching for right now.
Maintain SEO best practices automatically. Every article includes proper meta tags, heading structure, keyword optimization, and readability scoring—no manual SEO checklist needed.
Scale content production without scaling costs. Add more workflows for different niches or languages without proportional increases in time or expense.
Improve content quality with AI refinement. The two-pass AI system produces better results than single-prompt generation, with improved flow, engagement, and information density.