This folder contains the n8n workflows for ABOVE_INFLUENCE. Follow this guide to replicate the workflow in your own n8n instance.
Visual representation of the complete n8n workflow with intelligent model fallback system
- Basic workflow with environment variables
- Single Gemini model (2.5 Flash Lite)
- Recommended for open-source setup
- Advanced workflow with automatic model fallback
- Handles rate limits by switching between 3 Gemini models:
- Primary: Gemini 2.5 Flash Lite
- Fallback 1: Gemini 3 Flash
- Fallback 2: Gemini 2.5 Flash
- Recommended for production use
- Production version with hardcoded credentials
- NOT included in GitHub (in .gitignore)
- For personal use only
- Sign up at n8n.io
- Choose the free tier or paid plan
- Access your n8n instance
# Using Docker
docker run -it --rm \
--name n8n \
-p 5678:5678 \
-v ~/.n8n:/home/node/.n8n \
n8nio/n8n
# Using npm
npm install n8n -g
n8n start- Visit Google AI Studio
- Create a new API key
- Copy the key (starts with
AI...)
- Go to Google Cloud Console
- Create a new project or select existing
- Enable Gmail API
- Go to "Credentials" → "Create Credentials" → "OAuth 2.0 Client ID"
- Choose "Web application"
- Add authorized redirect URIs:
- For n8n Cloud:
https://your-instance.app.n8n.cloud/rest/oauth2-credential/callback - For self-hosted:
http://localhost:5678/rest/oauth2-credential/callback
- For n8n Cloud:
- Copy Client ID and Client Secret
- In the same Google Cloud project
- Enable "YouTube Data API v3"
- Use the same OAuth credentials
- In n8n, go to "Credentials" → "New"
- Search for "Google PaLM API" (used for Gemini)
- Enter your API key
- Save as "Google Gemini API"
- Go to "Credentials" → "New"
- Search for "Gmail OAuth2"
- Enter Client ID and Client Secret
- Click "Connect my account"
- Authorize access
- Save as "Gmail OAuth2"
n8n supports environment variables in two ways:
- Go to your n8n settings
- Add environment variables:
GOOGLE_GEMINI_API_KEY=your_api_key_here GMAIL_CLIENT_ID=your_gmail_client_id_here N8N_WEBHOOK_ID=auto_generated_on_import
Create a .env file in your n8n directory:
# Google Gemini API Credentials
GOOGLE_GEMINI_API_KEY=your_api_key_here
# Gmail OAuth2 Credentials
GMAIL_CLIENT_ID=your_gmail_client_id_here
# N8N Webhook Configuration
N8N_WEBHOOK_ID=auto_generated_on_import- In n8n, click "Workflows" → "Import from File"
- Choose
ABOVE_INFLUENCE_MODEL_SWITCH.json(recommended) - The workflow will be imported with all nodes
- Open the "Webhook" node
- The webhook ID will be auto-generated
- Copy the webhook URL (e.g.,
https://your-instance.app.n8n.cloud/webhook/analyze-influence) - Save this URL for your frontend
.envfile
- Open each "Gemini" model node (3 nodes if using model switch)
- Select your "Google Gemini API" credential
- Verify the model names:
models/gemini-2.5-flash-litemodels/gemini-3-flashmodels/gemini-2.5-flash
- Open the "Send a message" node
- Select your "Gmail OAuth2" credential
- Verify the email settings
- Click "Execute Workflow" in n8n
- Or use the webhook URL with a test payload:
curl -X POST https://your-instance.app.n8n.cloud/webhook/analyze-influence \
-H "Content-Type: application/json" \
-d '{
"accessToken": "your_youtube_access_token",
"userEmail": "your_email@example.com",
"userGoals": "Test goals"
}'- Toggle the "Active" switch in the top-right corner
- The workflow is now live and ready to receive requests
Update your frontend .env file with the webhook URL:
VITE_N8N_WEBHOOK_URL=https://your-instance.app.n8n.cloud/webhook/analyze-influenceThe diagram above shows the complete workflow with 13 interconnected nodes. Below is the execution flow:
1. Webhook (Entry Point)
↓
2. Fetch YouTube Subscriptions (HTTP Request)
↓
3. Fetch Liked Videos (HTTP Request)
↓
4. Basic LLM Chain - Primary (Gemini 2.5 Flash Lite)
↓
5. Check Error - Primary (Conditional)
├─ No Error → Skip to Step 11 (Markdown)
└─ Error Detected → Continue to Step 6
↓
6. Basic LLM Chain - Fallback 1 (Gemini 3 Flash)
↓
7. Check Error - Fallback 1 (Conditional)
├─ No Error → Skip to Step 11 (Markdown)
└─ Error Detected → Continue to Step 8
↓
8. Basic LLM Chain - Fallback 2 (Gemini 2.5 Flash)
↓
9. (Always proceeds to Markdown - final fallback)
↓
10. Markdown Conversion (Markdown to HTML)
↓
11. Send Email (Gmail)
The intelligent model switching ensures 99%+ success rate by:
- Primary Model (Gemini 2.5 Flash Lite): Fast and cost-effective for most requests
- Fallback 1 (Gemini 3 Flash): Activates if primary hits rate limits
- Fallback 2 (Gemini 2.5 Flash): Final safety net for maximum reliability
This architecture handles API rate limits gracefully without user intervention.
- Type:
n8n-nodes-base.webhook - Method: POST
- Path:
/analyze-influence - CORS: Enabled (
allowedOrigins: "*") - Receives:
{ "accessToken": "user_youtube_oauth_token", "userEmail": "user@example.com", "userGoals": "User's stated life goals" }
- Type:
n8n-nodes-base.httpRequest - API: YouTube Data API v3 - Subscriptions
- Endpoint:
https://www.googleapis.com/youtube/v3/subscriptions - Parameters:
mine=true(user's subscriptions)part=snippet(channel details)maxResults=50(latest 50 subscriptions)
- Authentication: Bearer token from webhook
- Output: Array of subscribed channels with titles
- Type:
n8n-nodes-base.httpRequest - API: YouTube Data API v3 - Videos
- Endpoint:
https://www.googleapis.com/youtube/v3/videos - Parameters:
myRating=like(only liked videos)part=snippet(video details)maxResults=50(latest 50 likes)
- Authentication: Bearer token from webhook
- Output: Array of liked videos with titles
- Type:
@n8n/n8n-nodes-langchain.chainLlm - Models Used:
- Primary:
models/gemini-2.5-flash-lite - Fallback 1:
models/gemini-3-flash - Fallback 2:
models/gemini-2.5-flash
- Primary:
- Configuration:
continueOnFail: true(enables fallback) - Prompt Engineering:
- Analyzes latest 30 subscriptions + 30 likes
- Compares against user's stated goals
- Evaluates influence tactics (fear, FOMO, clickbait)
- Generates 5-step analysis report
- Output: Detailed markdown-formatted analysis
- Type:
n8n-nodes-base.if - Logic: Checks if
$json.errorexists - Routes:
- No Error: Proceeds to Markdown conversion
- Error Detected: Routes to next fallback model
- Purpose: Handles rate limits and API failures
- Type:
n8n-nodes-base.markdown - Mode:
markdownToHtml - Function:
- Converts AI analysis from Markdown to HTML
- Prepends user's stated goals
- Formats for email delivery
- Output: HTML-formatted report
- Type:
n8n-nodes-base.gmail - API: Gmail API v2.2
- Authentication: Gmail OAuth2
- Configuration:
- To: Dynamic from webhook (
userEmail) - Subject: "YT Content Consumption Report"
- Body: HTML from Markdown node
- To: Dynamic from webhook (
- Output: Email sent confirmation
- Google Gemini Free Tier:
- 15 requests per minute
- 1,500 requests per day
- Model switching automatically handles rate limits
- YouTube Data API:
- 10,000 quota units per day
- Each subscription fetch: ~1 unit
- Each video fetch: ~1 unit
- Gmail API:
- 1 billion quota units per day (effectively unlimited for this use case)
- Recommendation: For production, upgrade to paid tiers
- Average: 15-30 seconds per analysis
- Breakdown:
- YouTube API calls: 2-5 seconds
- AI analysis: 10-20 seconds
- Email delivery: 1-3 seconds
- Timeout: Set to 60 seconds (configurable)
- Current: Public webhook (no authentication)
- Risk: Anyone with URL can trigger workflow
- Production Recommendations:
- Add API key authentication
- Implement rate limiting
- Use n8n's built-in authentication
- Monitor execution logs for abuse
- Zero Storage: No data persisted in n8n or databases
- Real-Time Processing: Data processed and immediately discarded
- Email Only: Reports sent directly to user's email
- OAuth Scopes: Read-only access to YouTube data
- GDPR Compliant: No personal data retention
| Service | Free Tier Limit | Cost After Limit |
|---|---|---|
| n8n Cloud | 5,000 executions/month | $20/month (Starter) |
| Google Gemini | 1,500 requests/day | Pay-as-you-go |
| YouTube API | 10,000 units/day | $0 (rarely exceeded) |
| Gmail API | Unlimited (reasonable use) | $0 |
| Vercel (Frontend) | Unlimited | $0 |
Estimated Monthly Cost for 1,000 Users: $20-50 (n8n + Gemini overages)
Symptoms: Workflow fails at LLM Chain node with authentication error
Solutions:
- Verify Gemini API key is correct in n8n credentials
- Check if key is active at Google AI Studio
- Ensure credential is properly linked to all 3 Gemini nodes
- Try regenerating the API key
Symptoms: Email not sent, OAuth error in logs
Solutions:
- Re-authenticate Gmail credentials in n8n
- Ensure Gmail API is enabled in Google Cloud Console
- Verify OAuth redirect URIs match your n8n instance URL
- Check if OAuth consent screen is configured
- Try revoking and re-granting access
Symptoms: Frontend receives 404 when calling webhook
Solutions:
- Ensure workflow is activated (toggle in top-right)
- Verify webhook URL matches frontend
.envfile - Check n8n instance is running and accessible
- Test webhook directly with curl command
- Clear browser cache and retry
Symptoms: All 3 models fail with rate limit errors
Solutions:
- Wait 1 minute for rate limit to reset
- Check daily quota at Google AI Studio
- Upgrade to Gemini paid tier for higher limits
- Implement request queuing in frontend
- Monitor usage patterns to avoid peak times
Symptoms: Workflow succeeds but user doesn't get email
Solutions:
- Check spam/junk/promotions folder
- Verify email address is correct in webhook payload
- Review n8n execution logs for Gmail node errors
- Test with a different email address
- Check Gmail API quota hasn't been exceeded
- Ensure Gmail OAuth token hasn't expired
Symptoms: Cannot fetch subscriptions or liked videos
Solutions:
- Verify OAuth scope includes
youtube.readonly - Re-authenticate in frontend with correct scopes
- Check if YouTube Data API v3 is enabled
- Ensure access token is valid and not expired
Symptoms: Execution stops after 60 seconds
Solutions:
- Increase timeout in workflow settings
- Check if AI models are responding slowly
- Verify network connectivity to Google APIs
- Consider using faster Gemini models
Symptoms: Email sent but formatting is broken
Solutions:
- Check if AI response is valid markdown
- Review Markdown node configuration
- Test with sample markdown input
- Ensure special characters are properly escaped
-
Check Execution Logs:
- Go to "Executions" in n8n
- Click on failed execution
- Review each node's input/output
-
Test Individual Nodes:
- Use "Execute Node" to test one node at a time
- Verify data flow between nodes
- Check for missing or malformed data
-
Monitor API Quotas:
- Google AI Studio - Gemini usage
- Google Cloud Console - YouTube/Gmail quotas
- n8n dashboard - Execution counts
-
Enable Verbose Logging:
- Set
N8N_LOG_LEVEL=debugin environment variables - Review detailed logs for errors
- Check network requests/responses
- Set
- n8n Documentation - Complete n8n guide
- n8n Community Forum - Get help from community
- Google Gemini API Docs - AI model documentation
- YouTube Data API v3 - YouTube API reference
- Gmail API Documentation - Email integration guide
- n8n Workflow Automation Basics
- LangChain Integration in n8n
- Google OAuth Setup Guide
- Webhook Security Best Practices
- n8n YouTube Channel - Official tutorials
- n8n Workflow Examples - Community workflows
- Google AI Studio - Test Gemini models
- YouTube API Explorer - Test YouTube endpoints
- Gmail API Playground - Test email sending
- ABOVE_INFLUENCE GitHub - Main repository
- n8n Templates - Pre-built workflow templates
- LangChain Documentation - AI chain concepts
If you encounter issues not covered in the troubleshooting section:
- Check Execution Logs: Review n8n execution history for detailed error messages
- Search Community Forum: Visit n8n Community for similar issues
- GitHub Issues: Open an issue at ABOVE_INFLUENCE Issues
- Documentation: Review the official docs linked above
Found a bug or have an improvement? Contributions are welcome!
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This workflow was built as part of a one-week skill development workshop (Feb 23-28, 2026) to demonstrate:
- Rapid application development with no-code tools
- AI integration and prompt engineering
- Intelligent error handling and fallback systems
- Privacy-first architecture
Development Time: 8 hours (4 hours initial build + 4 hours refinement)
Learning Outcome: Transformed a months-old idea into a production-ready application using modern tools.
Built with ❤️ by the ABOVE_INFLUENCE team
"INFLUENCE FROM THE GOOD IDEAS, NOT FROM THE PERSON - BECAUSE PERSON MAY CHANGE BUT YOU CAN SHAPE THE IDEA TOO"
Happy automating! 🚀
