Charles
Workflows by Charles
Generate viral Facebook posts with Gemini 2.0 & AI image generation
# 🚀 AI Facebook Post Generator - Complete Setup Guide > Transform your content ideas into viral Facebook posts with AI-powered automation in just 30 minutes! --- ## 📋 Prerequisites Checklist **What you'll need before we start:** - ✅ n8n instance (cloud or self-hosted) - ✅ Facebook Business Page (*not personal profile*) - ✅ Google account with Sheets & Gmail access - ✅ Basic understanding of API credentials **⏱️ Estimated Setup Time:** 30-45 minutes **🎯 Difficulty Level:** Intermediate **💰 Cost:** Free tier available for all services --- ## 🎨 What You'll Build By the end of this guide, you'll have: - 📝 **Smart Content Form** - Web form that captures your ideas - 🤖 **AI Content Optimizer** - Gemini AI that polishes your writing - 🖼️ **Auto Image Generator** - Custom visuals created automatically - 📊 **Content Tracker** - Google Sheets logging for analytics - 📱 **Facebook Publisher** - Direct posting to your page - 📧 **Success Notifications** - Email confirmations with post links --- # 🔧 Step-by-Step Setup ## Step 1: 📘 Facebook Integration Setup ### 🔸 1.1 Create Your Facebook App **Why this matters:** This gives your workflow permission to post on your behalf. 1. Navigate to [Facebook Developers](https://developers.facebook.com/) 🌐 2. Click **"My Apps"** → **"Create App"** 3. Select **"Business"** as your app type 4. **App Name:** `AI-Content-Poster` *(or your preferred name)* 5. Hit **"Create App"** > 💡 **Pro Tip:** Choose a descriptive name - you'll see this in your Facebook activity logs ### 🔸 1.2 Configure App Settings 1. In your app dashboard: **"Add a Product"** 2. Find **"Facebook Login"** → **"Set Up"** 3. Navigate to **Settings** → **Basic** 4. **App Domains:** Add `app.n8n.cloud` *(for n8n cloud users)* 5. **Save changes** ✅ ### 🔸 1.3 Generate Your Page Access Token **This is the key that unlocks posting powers! 🔑** 1. Go to **Tools** → **Graph API Explorer** 2. Select your newly created app 3. Click **"Generate Access Token"** 4. **Required Permissions:** - `pages_manage_posts` - `pages_read_engagement` - `pages_show_list` 5. Select your target Facebook page 6. **Copy the token** *(starts with `EAAG...`)* ⚠️ **Critical Step - Make Token Long-Lived:** - In Graph API Explorer, make a GET request to: ``` /oauth/access_token?grant_type=fb_exchange_token&client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET&fb_exchange_token=YOUR_SHORT_TOKEN ``` ### 🔸 1.4 Find Your Page ID **Two methods to get your Page ID:** **Method 1 - Direct from Facebook:** 1. Visit your Facebook page 2. Click **"About"** tab 3. Scroll to find **"Page ID"** **Method 2 - API Explorer:** 1. Use Graph API Explorer 2. GET request to: `/me/accounts` 3. Find your page in the response --- ## Step 2: 🔍 Google Services Setup ### 🔸 2.1 Enable Required APIs **Setting up your Google Cloud foundation:** 1. Visit [Google Cloud Console](https://console.cloud.google.com/) ☁️ 2. **Create new project** or select existing 3. **"APIs & Services"** → **"Library"** 4. **Enable these APIs:** - ✅ Google Sheets API - ✅ Gmail API - ✅ Google Drive API *(optional)* ### 🔸 2.2 Create Service Account **This creates a "robot" account for automated access:** 1. **"APIs & Services"** → **"Credentials"** 2. **"Create Credentials"** → **"Service Account"** 3. **Name:** `ai-facebook-automation` 4. **"Create and Continue"** 5. Skip role assignment → **"Continue"** 6. **"Done"** ✅ ### 🔸 2.3 Download Credentials File 1. Click your service account email 2. **"Keys"** tab → **"Add Key"** → **"Create New Key"** 3. Choose **"JSON"** format 4. **Download and save securely** 📁 > 🔒 **Security Note:** This file contains sensitive credentials. Store it safely! ### 🔸 2.4 Prepare Your Google Sheets **Create your data tracking system:** **📊 Sheet 1: Content Log** - **Purpose:** Track all generated content - **Columns:** - A: Date *(Ngày)* - B: Short Content *(Nội dung ngắn)* - C: Full Content *(Nội dung đầy đủ)* **📝 Sheet 2: Input Tracking** - **Purpose:** Log form submissions - **Columns:** - A: Date - B: Time - C: Content **🔗 Important:** Share both sheets with your service account email *(found in the JSON file)* --- ## Step 3: 🤖 AI Services Configuration ### 🔸 3.1 Get Your Gemini API Key **Power up your AI content generation:** 1. Head to [Google AI Studio](https://makersuite.google.com/app/apikey) 🎨 2. Sign in with Google account 3. **"Create API Key"** 4. **Copy the key** *(starts with `AIza...`)* > 💰 **Cost Info:** Gemini offers generous free tier limits - perfect for getting started! --- ## Step 4: ⚙️ n8n Workflow Configuration ### 🔸 4.1 Import the Magic ✨ 1. **Copy the workflow JSON** from the template 2. In n8n: **"Import from JSON"** 3. **Paste** the workflow code 4. **"Import"** to load your new automation ### 🔸 4.2 Configure Your Credentials **🔑 Facebook Graph API Setup:** 1. **Settings** → **Credentials** → **"Add Credential"** 2. Search: **"Facebook Graph API"** 3. **Access Token:** Your Page Access Token from Step 1.3 4. **Test connection** → **Save as:** `Facebook Page Access` **🔍 Google Services Setup:** 1. **"Add Credential"** → **"Google Service Account"** 2. **Upload your JSON file** from Step 2.3 3. **Test connection** → **Save as:** `Google Services` **🧠 Gemini AI Setup:** 1. **"Add Credential"** → **"Google PaLM API"** 2. **Enter your Gemini key** from Step 3.1 3. **Save as:** `Gemini AI` ### 🔸 4.3 Customize Node Settings **📱 Update Facebook Configuration:** **In "Facebook Graph API" node:** - Replace `"113732581629527"` with **your Page ID** from Step 1.4 **In "Facebook Upload Img" node:** - Replace `"113732581629527"` with **your Page ID** from Step 1.4 **📊 Update Google Sheets:** **In "save content" node:** - Replace Document ID with your **Content Log Sheet ID** **In "Append row in sheet" node:** - Replace Document ID with your **Input Tracking Sheet ID** > 💡 **Finding Sheet ID:** It's the long string in your Google Sheets URL after `/spreadsheets/d/` **📧 Update Notification Email:** **In "Send a message" node:** - Replace `[email protected]` with **your email address** - Configure Gmail credentials --- ## Step 5: 🧪 Testing & Validation ### 🔸 5.1 Component Testing **📊 Test Google Sheets Connection:** 1. Right-click **"Append row in sheet"** node 2. **"Execute Node"** 3. ✅ Verify test row appears in your sheet **🤖 Test Gemini AI:** 1. Right-click **"Basic LLM Chain"** node 2. **"Edit Input Data"** → Add test content 3. **Execute** → ✅ Verify AI response quality **🖼️ Test Image Generation:** 1. Right-click **"HTTP Request"** node 2. Ensure valid prompt from previous step 3. **Execute** → ✅ Check for base64 image data **📱 Test Facebook Upload:** 1. Run full workflow with test content 2. ✅ Check your Facebook page for new post 3. ✅ Verify image uploaded correctly ### 🔸 5.2 End-to-End Victory Test 🎉 1. **"Execute Workflow"** on trigger node 2. **Submit test content** through the form 3. **Monitor each node** execution 4. **🎊 Celebrate your first AI-generated post!** --- ## 🎯 Success Indicators **Your setup is complete when you see:** - ✅ Form accepts and processes content - ✅ AI generates optimized text + image prompt - ✅ Custom image appears in Facebook post - ✅ Content logged in Google Sheets - ✅ Success email in your inbox - ✅ Professional-looking post on your Facebook page --- ## 🚨 Troubleshooting Quick Fixes ### Facebook Issues - **Token Expired?** → Generate new long-lived token - **Permission Denied?** → Check page admin rights - **Invalid Page ID?** → Double-check Page ID format ### Google Sheets Problems - **403 Forbidden?** → Share sheet with service account - **Sheet Not Found?** → Verify Sheet ID in URL - **Column Errors?** → Match exact column names ### AI Content Issues - **Empty Responses?** → Check Gemini API quotas - **Poor Quality?** → Adjust AI prompts - **JSON Errors?** → Validate parsing logic --- ## 🎨 Customization Ideas **Make it uniquely yours:** - 🎨 **Brand Voice:** Adjust AI prompts for your tone - ⏰ **Scheduling:** Add time delays for strategic posting - 📈 **Analytics:** Connect performance tracking tools - 🔄 **Multi-Platform:** Extend to Instagram, LinkedIn - 👥 **Team Features:** Add approval workflows --- ## 🎉 You Did It! **Congratulations! You've built an AI-powered content machine that will save you hours every week.** **What's Next?** - Test with different content types - Monitor performance in Google Sheets - Refine AI prompts for better results - Share your success with the community! **Need Help?** 🤝 - Join [n8n Discord](https://discord.com/invite/XPKeKXeB7d) - Visit [Community Forum](https://community.n8n.io/) - Check [n8n Documentation](https://docs.n8n.io/) --- *Ready to revolutionize your content creation? Your AI assistant is waiting! 🚀*
Daily IndieHackers Reddit trend analysis to Slack with Gemini AI
# 🚀 Daily IndieHackers Reddit Trend Analysis to Slack > **Transform Reddit chaos into actionable startup intelligence** > Get AI-powered insights from r/indiehackers delivered to your Slack every morning --- ## 🎯 Who's It For This template is designed for **startup founders**, **growth teams**, and **product managers** who need to: - Stay ahead of indie hacker trends without manual Reddit browsing - Understand what's working in the entrepreneurial community - Get actionable insights for product and marketing decisions - Keep their team informed about emerging opportunities **Perfect for teams building products for entrepreneurs or anyone wanting to leverage community intelligence for competitive advantage.** --- ## ✨ What It Does Transform your morning routine with **automated intelligence gathering** that delivers structured, AI-powered summaries of the hottest r/indiehackers discussions directly to your Slack channel. ### 🧠 Smart Analysis Features | Feature | Description | |---------|-------------| | **🔥 Hotness Scoring** | Calculates engagement scores using time-decay algorithms | | **📊 Topic Extraction** | Identifies key themes and trending subjects | | **💰 Traction Signals** | Spots revenue, metrics, and growth indicators | | **🎯 Theme Clustering** | Groups posts into actionable categories | | **⚡ Action Items** | Generates specific recommendations for your team | ### 📱 Slack Integration Receive beautifully formatted messages with: - Executive summaries and key takeaways - Top 3 hottest posts with engagement metrics - Interactive buttons for deeper exploration - Team discussion prompts --- ## ⚙️ How It Works ```mermaid graph LR A[🕐 Daily 8AM Trigger] --> B[📱 Fetch Reddit Posts] B --> C[🔄 Process Data] C --> D[🤖 Gemini AI Analysis] D --> E[✨ Groq Slack Formatting] E --> F[💬 Deliver to Slack] ``` ### 🔄 The Complete Process **Step 1: Automated Trigger** Every morning at 8 AM, the workflow springs into action **Step 2: Reddit Data Collection** Fetches the latest 5 posts from r/indiehackers with full metadata **Step 3: Data Processing** Structures raw Reddit data for optimal AI analysis **Step 4: AI-Powered Analysis** Gemini AI performs deep analysis calculating hotness scores, extracting topics, and identifying patterns **Step 5: Slack Formatting** Groq AI Agent transforms insights into beautiful Slack Block Kit messages **Step 6: Team Delivery** Your designated Slack channel receives the formatted analysis --- ## 🛠️ Requirements You'll need API access for: **Reddit** (OAuth2), **Google Gemini**, **Groq**, and **Slack** (OAuth2). All have free tiers available. --- ## 🚀 Setup Guide ### 1️⃣ Configure Your Credentials Add these credentials in n8n: **Reddit OAuth2**, **Google Gemini**, **Groq**, and **Slack OAuth2**. The workflow will guide you through each setup. ### 2️⃣ Customize the Schedule **Default:** Daily at 8:00 AM **To modify:** Edit the "Daily Schedule" cron trigger node ```javascript // Example: Run at 9:30 AM { "triggerTimes": { "item": [{ "hour": 9, "minute": 30 }] } } ``` ### 3️⃣ Set Your Slack Destination 1. Open the **"Send to Slack"** node 2. Select your target channel 3. Configure notification preferences ### 4️⃣ Adjust Analysis Parameters **Post Limit:** Change from default 5 posts ```javascript // In "Get many posts" Reddit node "limit": 10 // Recommended: 3-10 posts ``` **Context Customization:** ```json { "channel_type": "team", "audience": "Growth, Product, and Founders", "cta_link": "https://your-dashboard.com", "timeframe_label": "This Week" } ``` --- ## 🎨 Customization Options ### 🔍 Analysis Focus Areas Transform the workflow for different insights: **SaaS-Focused Analysis** ```markdown Add to Gemini prompt: "Focus on SaaS and B2B insights, prioritizing recurring revenue and product-market fit signals" ``` **Geographic Targeting** ```markdown Add: "Prioritize posts relevant to [your region/market]" ``` **Stage-Specific Insights** ```markdown Add: "Focus on [early-stage/growth-stage] startup challenges" ``` ### 📈 Hotness Algorithm Tweaking **Default Formula:** `(ups + 2*num_comments) * freshness_decay` **Emphasize Comments:** `(ups + 3*num_comments) * freshness_decay` **Include Upvote Ratio:** `(ups * upvote_ratio + 2*num_comments) * freshness_decay` ### 🌐 Multi-Subreddit Analysis Expand beyond r/indiehackers: ```yaml Additional Communities: - r/startups - r/entrepreneur - r/SideProject - r/buildinpublic - r/nocode ``` ### 💾 Data Storage Extensions Enhance with historical tracking: | Node Type | Purpose | Benefit | |-----------|---------|---------| | **Google Sheets** | Trend storage | Historical analysis | | **Airtable** | Advanced data management | Rich analytics | | **Webhook** | External analytics | Custom dashboards | --- ## 📊 Expected Output ### 📱 Daily Slack Message Structure ```markdown 🚀 **IndieHackers Trends — This Week** 📋 **TL;DR:** [One-sentence key insight] 🔥 **Hot Posts (Top 3)** 1. [Post Title] (Hotness: 8.7) Topics: SaaS launch, pricing strategy 💬 23 comments | 👍 156 ups | 📅 Posted 4 hours ago [Open Reddit Button] 🧭 **Themes Summary** - Go-to-market tactics — 3 posts, hotness: 24.1 - Product launches — 2 posts, hotness: 18.3 ✅ **What to Do Now** - Test pricing page variations based on community feedback - Consider cold email strategies mentioned in hot posts - Validate product ideas using discussed frameworks [Open Dashboard Button] ``` --- ## 💡 Pro Tips for Success ### 🎯 Optimization Strategies **Week 1-2: Baseline** - Monitor output quality and team engagement - Note which insights generate the most discussion **Week 3-4: Refinement** - Adjust AI prompts based on feedback - Fine-tune hotness scoring for your needs **Month 2+: Advanced Usage** - Add historical trend analysis - Create custom dashboards with stored data - Build feedback loops for continuous improvement ### 🚨 Common Pitfalls to Avoid | Issue | Solution | |-------|---------| | **API Rate Limits** | Reduce post count or increase time intervals | | **Poor Insight Quality** | Refine prompts with specific examples | | **Team Engagement Drop** | Rotate focus areas and encourage thread discussions | | **Information Overload** | Limit to top 3 posts and key themes only | --- ## 🔧 Troubleshooting ### ❌ Common Issues & Solutions **"Model not found" Error** ``` Cause: Gemini regional availability Fix: Check supported regions or switch to alternative AI model ``` **Slack Formatting Broken** ``` Cause: Invalid Block Kit JSON Fix: Validate JSON structure in AI Agent output ``` **Missing Reddit Data** ``` Cause: API credentials or rate limits Fix: Verify OAuth2 setup and check usage quotas ``` **AI Timeouts** ``` Cause: Too much data or complex prompts Fix: Reduce post count or simplify analysis requests ``` ### ⚡ Performance Optimization - Keep analysis under **10 posts** for optimal speed - Monitor execution times in n8n logs - Add error handling nodes for production reliability - Use webhook timeouts for external API calls --- ## 🌟 Advanced Use Cases ### 📈 Competitive Intelligence Modify prompts to track specific competitors or market segments mentioned in discussions ### 🎯 Product Validation Focus analysis on posts related to your product category for market research ### 📝 Content Strategy Use trending topics to inform your content calendar and thought leadership ### 🤝 Community Engagement Identify opportunities to participate in discussions and build relationships --- **Ready to transform your startup intelligence gathering?** 🚀 *Deploy this workflow and start receiving actionable insights tomorrow morning!*
Generate market research reports from Google Maps reviews with Gemini AI
# 🚀 Market Research Analytics System > **Transform Google Maps data into actionable business insights with AI-powered analysis** ## 📋 Overview This n8n workflow automatically collects business data from Google Maps, analyzes customer reviews using AI, and generates comprehensive market research reports delivered straight to your inbox. --- ## 🎯 Use Cases | **User Type** | **Example Usage** | |---------------|-------------------| | **🏢 Business Owners** | Analyze competition before opening new location | | **💼 Entrepreneurs** | Research market gaps and opportunities | | **📊 Marketing Teams** | Understand customer sentiment and preferences | | **💰 Investors** | Evaluate market potential in target areas | | **🔍 Consultants** | Create detailed market reports for clients | --- ## 🛠️ Customization Examples ### Different Business Types ```json // Restaurants {"search_query": "restaurants downtown", "analysis_focus": "restaurant"} // Hotels {"search_query": "hotels near airport", "analysis_focus": "hospitality"} // Fitness Centers {"search_query": "gyms and fitness centers", "analysis_focus": "fitness"} ``` ### Multiple Cities ```json // New York {"search_location": "@40.7589,-73.9851,12z", "city_name": "New York City"} // London {"search_location": "@51.5074,-0.1278,12z", "city_name": "London"} // Tokyo {"search_location": "@35.6762,139.6503,12z", "city_name": "Tokyo"} ``` --- ## 📊 What You'll Get Your automated report includes: ### 🎯 **Executive Summary** - Key market insights in 3-4 sentences - Biggest business opportunities identified - Immediate action recommendations ### 📈 **Market Analysis** - Competition density and market gaps - Price segments and quality distribution - Geographic hotspots and trends ### 💬 **Customer Intelligence** - Top 5 factors customers value most - Common complaints and pain points - Overall sentiment analysis ### 🏆 **Competitive Landscape** - Strongest competitors identified - Their strengths and weaknesses - Positioning opportunities ### 💡 **Strategic Recommendations** - Optimal business model suggestions - Pricing and marketing strategies - 30/90/180-day action plans --- ## ⚙️ Technical Requirements | **Service** | **Cost** | **Purpose** | |-------------|----------|-------------| | **SerpAPI** | Free tier (100 searches/month) | Google Maps data extraction | | **Google Gemini** | Free tier available | AI-powered analysis | | **Gmail** | Free | Report delivery | | **n8n** | Cloud or self-hosted | Workflow automation | --- ## 🚨 Important Notes - **API Limits:** Free tiers have monthly limits - monitor usage - **Data Accuracy:** Results depend on Google Maps data availability - **Processing Time:** Analysis may take 2-5 minutes depending on data volume - **Language Support:** Works with multiple languages (update `language_code`) --- ## 🔧 Troubleshooting | **Issue** | **Solution** | |-----------|--------------| | No results found | Check coordinates format and search query | | API errors | Verify API keys are correctly configured | | Email not received | Check Gmail credentials and recipient address | | Slow processing | Normal for large datasets (20+ businesses) | --- ## 🚀 Pro Tips - **🎯 Be Specific:** Use targeted search queries like "vegan restaurants" vs "restaurants" - **📅 Schedule Runs:** Set up recurring analysis to track market changes - **🌍 Multi-Location:** Run for multiple cities to compare markets - **📱 Mobile-First:** Reports are mobile-responsive for on-the-go reading - **🔄 Iterate:** Refine search parameters based on initial results --- *Ready to unlock your market insights? Configure your parameters and execute the workflow!*