This workflow corresponds to n8n.io template #11411 — we link there as the canonical source.
This workflow follows the Agent → Gmail recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "EoxoFCOy9RKRxX6a",
"name": "Viral Trend Analyzer for TikTok and Instagram",
"tags": [],
"nodes": [
{
"id": "51cb765f-4488-4a06-8dc2-a5d87e579706",
"name": "Daily Trigger (08:00)",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
464,
416
],
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 8
}
]
}
},
"typeVersion": 1.3
},
{
"id": "852c60ca-85af-4a53-8577-6150f68ac113",
"name": "Workflow Configuration",
"type": "n8n-nodes-base.set",
"position": [
672,
416
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "id-1",
"name": "apifyToken",
"type": "string",
"value": "={{ $env.APIFY_TOKEN }}"
},
{
"id": "id-2",
"name": "minViews",
"type": "number",
"value": 10000
},
{
"id": "id-3",
"name": "minEngagementRate",
"type": "number",
"value": 0.05
},
{
"id": "id-4",
"name": "superViralThreshold",
"type": "number",
"value": 0.15
},
{
"id": "id-5",
"name": "maxAgeHours",
"type": "number",
"value": 24
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "80e667b5-404f-442c-b40c-7788273eb864",
"name": "Search Config",
"type": "n8n-nodes-base.set",
"position": [
880,
416
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "id-1",
"name": "nicheKeywords",
"type": "string",
"value": "<__PLACEHOLDER_VALUE__Niche keywords (e.g., 'fitness tips', 'productivity hacks')__>"
},
{
"id": "id-2",
"name": "hashtags",
"type": "string",
"value": "<__PLACEHOLDER_VALUE__Hashtags to search (e.g., '#fitness #workout')__>"
},
{
"id": "id-3",
"name": "languages",
"type": "string",
"value": "en"
},
{
"id": "id-4",
"name": "timeWindow",
"type": "string",
"value": "24h"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "11bee971-5718-4479-8c52-63074f91ed81",
"name": "Scrape TikTok",
"type": "n8n-nodes-base.httpRequest",
"position": [
1136,
304
],
"parameters": {
"url": "<__PLACEHOLDER_VALUE__Apify TikTok scraper API endpoint__>",
"method": "POST",
"options": {},
"jsonBody": "={\n \"keywords\": \"{{ $('Search Config').first().json.nicheKeywords }}\",\n \"hashtags\": \"{{ $('Search Config').first().json.hashtags }}\",\n \"timeWindow\": \"{{ $('Search Config').first().json.timeWindow }}\"\n}",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "={{ $('Workflow Configuration').first().json.apifyToken }}"
},
{
"name": "Content-Type",
"value": "application/json"
}
]
}
},
"typeVersion": 4.3
},
{
"id": "c7725bbe-01aa-43de-b23c-e7bb7bc5b0e5",
"name": "Scrape Instagram",
"type": "n8n-nodes-base.httpRequest",
"position": [
1136,
496
],
"parameters": {
"url": "<__PLACEHOLDER_VALUE__Apify Instagram Reels scraper API endpoint__>",
"method": "POST",
"options": {},
"jsonBody": "={\n \"keywords\": \"{{ $('Search Config').first().json.nicheKeywords }}\",\n \"hashtags\": \"{{ $('Search Config').first().json.hashtags }}\",\n \"timeWindow\": \"{{ $('Search Config').first().json.timeWindow }}\"\n}",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "={{ $('Workflow Configuration').first().json.apifyToken }}"
},
{
"name": "Content-Type",
"value": "application/json"
}
]
}
},
"typeVersion": 4.3
},
{
"id": "bdb493c8-373a-4faa-9791-d62b822f14a2",
"name": "Normalize TikTok Results",
"type": "n8n-nodes-base.set",
"position": [
1360,
304
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "id-1",
"name": "platform",
"type": "string",
"value": "tiktok"
},
{
"id": "id-2",
"name": "video_url",
"type": "string",
"value": "={{ $json.videoUrl || $json.url }}"
},
{
"id": "id-3",
"name": "author",
"type": "string",
"value": "={{ $json.authorName || $json.author }}"
},
{
"id": "id-4",
"name": "views",
"type": "number",
"value": "={{ $json.playCount || $json.views || 0 }}"
},
{
"id": "id-5",
"name": "likes",
"type": "number",
"value": "={{ $json.diggCount || $json.likes || 0 }}"
},
{
"id": "id-6",
"name": "comments",
"type": "number",
"value": "={{ $json.commentCount || $json.comments || 0 }}"
},
{
"id": "id-7",
"name": "shares",
"type": "number",
"value": "={{ $json.shareCount || $json.shares || 0 }}"
},
{
"id": "id-8",
"name": "posted_at",
"type": "string",
"value": "={{ $json.createTime || $json.postedAt }}"
},
{
"id": "id-9",
"name": "caption",
"type": "string",
"value": "={{ $json.text || $json.description }}"
},
{
"id": "id-10",
"name": "thumbnail_url",
"type": "string",
"value": "={{ $json.covers?.[0] || $json.thumbnail }}"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "8080403c-dd43-4855-bb10-d8ceb76b366c",
"name": "Normalize Instagram Results",
"type": "n8n-nodes-base.set",
"position": [
1360,
496
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "id-1",
"name": "platform",
"type": "string",
"value": "instagram"
},
{
"id": "id-2",
"name": "video_url",
"type": "string",
"value": "={{ $json.url || $json.videoUrl }}"
},
{
"id": "id-3",
"name": "author",
"type": "string",
"value": "={{ $json.ownerUsername || $json.author }}"
},
{
"id": "id-4",
"name": "views",
"type": "number",
"value": "={{ $json.videoViewCount || $json.views || 0 }}"
},
{
"id": "id-5",
"name": "likes",
"type": "number",
"value": "={{ $json.likesCount || $json.likes || 0 }}"
},
{
"id": "id-6",
"name": "comments",
"type": "number",
"value": "={{ $json.commentsCount || $json.comments || 0 }}"
},
{
"id": "id-7",
"name": "shares",
"type": "number",
"value": 0
},
{
"id": "id-8",
"name": "posted_at",
"type": "string",
"value": "={{ $json.timestamp || $json.postedAt }}"
},
{
"id": "id-9",
"name": "caption",
"type": "string",
"value": "={{ $json.caption || $json.description }}"
},
{
"id": "id-10",
"name": "thumbnail_url",
"type": "string",
"value": "={{ $json.displayUrl || $json.thumbnail }}"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "4f77281d-a78e-4786-b1d1-7b4cf339317a",
"name": "Combine Platforms",
"type": "n8n-nodes-base.merge",
"position": [
1648,
400
],
"parameters": {},
"typeVersion": 3.2
},
{
"id": "83711678-9b1d-41b6-be26-19d0091034dd",
"name": "Filter High-Growth Videos",
"type": "n8n-nodes-base.code",
"position": [
1872,
400
],
"parameters": {
"jsCode": "const minViews = $('Workflow Configuration').first().json.minViews;\nconst minEngagementRate = $('Workflow Configuration').first().json.minEngagementRate;\nconst maxAgeHours = $('Workflow Configuration').first().json.maxAgeHours;\n\nconst filtered = $input.all().filter(item => {\n const data = item.json;\n const views = data.views || 0;\n const likes = data.likes || 0;\n const comments = data.comments || 0;\n const shares = data.shares || 0;\n \n // Calculate engagement rate\n const engagementRate = views > 0 ? (likes + comments + shares) / views : 0;\n \n // Calculate age in hours\n const postedAt = new Date(data.posted_at);\n const now = new Date();\n const ageHours = (now - postedAt) / (1000 * 60 * 60);\n \n // Apply filters\n return views >= minViews && \n ageHours <= maxAgeHours && \n engagementRate >= minEngagementRate;\n}).map(item => {\n // Add calculated fields\n const data = item.json;\n const views = data.views || 0;\n const likes = data.likes || 0;\n const comments = data.comments || 0;\n const shares = data.shares || 0;\n const engagementRate = views > 0 ? (likes + comments + shares) / views : 0;\n \n const postedAt = new Date(data.posted_at);\n const now = new Date();\n const ageHours = (now - postedAt) / (1000 * 60 * 60);\n \n return {\n json: {\n ...data,\n engagement_rate: engagementRate,\n age_hours: ageHours\n }\n };\n});\n\nreturn filtered;"
},
"typeVersion": 2
},
{
"id": "85dda28d-f105-4747-8e6b-101df08ecfb3",
"name": "OpenAI GPT-4 Vision Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
2064,
576
],
"parameters": {
"model": {
"__rl": true,
"mode": "id",
"value": "gpt-4o"
},
"options": {},
"builtInTools": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.3
},
{
"id": "37c96242-e8dd-44a5-939f-431b249bd478",
"name": "Analyze Visual Hook (GPT-4 Vision)",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
2128,
400
],
"parameters": {
"text": "=Analyze this video thumbnail/first frame: {{ $json.thumbnail_url }}\n\nCaption: {{ $json.caption }}",
"options": {
"systemMessage": "You are a visual content analyst specializing in viral social media content.\n\nAnalyze the provided thumbnail/first frame image and caption. Return a JSON object with:\n- visual_hook: What visual element grabs attention (text, colors, composition, facial expression, etc.)\n- main_emotion: The primary emotion or vibe conveyed (excitement, curiosity, shock, humor, etc.)\n- formatting_pattern: Describe the visual formatting (text overlays, cuts, B-roll, effects, filters, etc.)\n\nBe specific and actionable in your analysis."
},
"promptType": "define"
},
"typeVersion": 3
},
{
"id": "93e85754-aa43-4ee2-ac52-949412aef90f",
"name": "OpenAI GPT-4 Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
2432,
576
],
"parameters": {
"model": {
"__rl": true,
"mode": "id",
"value": "gpt-4o"
},
"options": {},
"builtInTools": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.3
},
{
"id": "2cfa31e9-2292-4900-82d5-605918dec1cb",
"name": "Analyze Trend & Adaptation (GPT-4)",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
2496,
400
],
"parameters": {
"text": "=Niche: {{ $('Search Config').first().json.nicheKeywords }}\n\nVideo Details:\n- Platform: {{ $json.platform }}\n- Caption: {{ $json.caption }}\n- Views: {{ $json.views }}\n- Likes: {{ $json.likes }}\n- Comments: {{ $json.comments }}\n- Shares: {{ $json.shares }}\n- Engagement Rate: {{ Math.round($json.engagement_rate * 10000) / 100 }}%\n\nVisual Analysis: {{ $('Analyze Visual Hook (GPT-4 Vision)').first().json.output }}",
"options": {
"systemMessage": "You are a viral content strategist and trend analyst.\n\nAnalyze the provided video data and visual analysis. Return a JSON object with:\n\n- summary: 2-3 sentence summary of the video content\n- why_it_works: Explain why this video is performing well (hook, timing, trend, emotion, format, etc.)\n- trend_type: Categorize the trend (sound/music, visual effect, hook structure, topic/theme, storytelling format)\n- adaptation_ideas: Array of 3-5 concrete, actionable ideas for adapting this trend to the user's niche\n- hook_examples: Array of 2-3 suggested opening lines or hooks inspired by this video\n- posting_angles: Array of 3-5 different angles to approach this trend (educational, story-based, controversial, value-driven, humorous, etc.)\n\nBe specific, actionable, and tailored to the niche. Focus on what can be replicated or adapted."
},
"promptType": "define"
},
"typeVersion": 3
},
{
"id": "6fb6a9b4-5c2d-447f-abab-b0ae5adb608f",
"name": "Check Super Viral Threshold",
"type": "n8n-nodes-base.if",
"position": [
2880,
400
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "id-1",
"operator": {
"type": "number",
"operation": "gte"
},
"leftValue": "={{ $json.engagement_rate }}",
"rightValue": "={{ $('Workflow Configuration').first().json.superViralThreshold }}"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "c1bdab91-4d15-4a61-9759-004b2414022b",
"name": "Mark as Super Viral",
"type": "n8n-nodes-base.set",
"position": [
3088,
384
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "id-1",
"name": "super_viral",
"type": "boolean",
"value": true
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "af8d709e-489d-4b2f-80e1-bc756af95118",
"name": "Mark as Normal",
"type": "n8n-nodes-base.set",
"position": [
3088,
560
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "id-1",
"name": "super_viral",
"type": "boolean",
"value": false
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "d8b550a0-c89e-47db-828b-acf75955b3de",
"name": "Merge Viral Flags",
"type": "n8n-nodes-base.merge",
"position": [
3312,
400
],
"parameters": {},
"typeVersion": 3.2
},
{
"id": "567c666d-34e8-4260-adc4-e03bdf8ea399",
"name": "Save to Google Sheets",
"type": "n8n-nodes-base.googleSheets",
"position": [
3760,
272
],
"parameters": {
"columns": {
"value": {
"date": "={{ $now.format('yyyy-MM-dd') }}",
"likes": "={{ $json.likes }}",
"niche": "={{ $('Search Config').first().json.nicheKeywords }}",
"views": "={{ $json.views }}",
"author": "={{ $json.author }}",
"shares": "={{ $json.shares }}",
"comments": "={{ $json.comments }}",
"platform": "={{ $json.platform }}",
"video_url": "={{ $json.video_url }}",
"ai_summary": "={{ $('Analyze Trend & Adaptation (GPT-4)').first().json.output?.summary }}",
"super_viral": "={{ $json.super_viral }}",
"why_it_works": "={{ $('Analyze Trend & Adaptation (GPT-4)').first().json.output?.why_it_works }}",
"hook_examples": "={{ JSON.stringify($('Analyze Trend & Adaptation (GPT-4)').first().json.output?.hook_examples) }}",
"engagement_rate": "={{ $json.engagement_rate }}",
"adaptation_ideas": "={{ JSON.stringify($('Analyze Trend & Adaptation (GPT-4)').first().json.output?.adaptation_ideas) }}"
},
"schema": [],
"mappingMode": "defineBelow",
"matchingColumns": []
},
"options": {},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "name",
"value": "<__PLACEHOLDER_VALUE__Sheet name (e.g., 'Viral Opportunities')__>"
},
"documentId": {
"__rl": true,
"mode": "id",
"value": "<__PLACEHOLDER_VALUE__Google Sheets document ID__>"
},
"authentication": "serviceAccount"
},
"credentials": {
"googleApi": {
"name": "<your credential>"
}
},
"typeVersion": 4.7
},
{
"id": "354c841a-b0ee-48e9-a53e-414524eb7228",
"name": "Select Top 5-10 Videos",
"type": "n8n-nodes-base.aggregate",
"position": [
3760,
480
],
"parameters": {
"options": {},
"aggregate": "aggregateAllItemData"
},
"typeVersion": 1
},
{
"id": "77fbdd6f-7179-4a94-ae57-a3d4cd546362",
"name": "Send Daily Digest Email",
"type": "n8n-nodes-base.gmail",
"position": [
3760,
688
],
"parameters": {
"sendTo": "<__PLACEHOLDER_VALUE__Recipient email address__>",
"message": "=<!DOCTYPE html>\n<html>\n<head>\n <style>\n body { font-family: Arial, sans-serif; line-height: 1.6; color: #333; max-width: 800px; margin: 0 auto; padding: 20px; }\n h1 { color: #2c3e50; border-bottom: 3px solid #3498db; padding-bottom: 10px; }\n h2 { color: #34495e; margin-top: 30px; }\n .video-card { background: #f8f9fa; border-left: 4px solid #3498db; padding: 15px; margin: 20px 0; border-radius: 5px; }\n .video-title { font-size: 18px; font-weight: bold; color: #2c3e50; margin-bottom: 10px; }\n .metrics { display: flex; gap: 20px; margin: 10px 0; flex-wrap: wrap; }\n .metric { background: #fff; padding: 8px 12px; border-radius: 4px; font-size: 14px; }\n .metric-label { font-weight: bold; color: #7f8c8d; }\n .metric-value { color: #27ae60; font-weight: bold; }\n .super-viral { background: #fff3cd; border-left-color: #ffc107; }\n .super-viral-badge { background: #ffc107; color: #000; padding: 4px 8px; border-radius: 3px; font-size: 12px; font-weight: bold; display: inline-block; margin-bottom: 10px; }\n .section { margin: 15px 0; }\n .section-title { font-weight: bold; color: #34495e; margin-bottom: 5px; }\n .link { color: #3498db; text-decoration: none; }\n .link:hover { text-decoration: underline; }\n .footer { margin-top: 40px; padding-top: 20px; border-top: 2px solid #ecf0f1; color: #7f8c8d; font-size: 14px; }\n </style>\n</head>\n<body>\n <h1>\ud83d\ude80 Daily Viral Content Opportunities</h1>\n <p><strong>Niche:</strong> {{ $('Search Config').first().json.nicheKeywords }}</p>\n <p><strong>Date:</strong> {{ $now.format('MMMM dd, yyyy') }}</p>\n \n <h2>Top Performing Videos</h2>\n \n {{#each $json}}\n <div class=\"video-card {{#if superViral}}super-viral{{/if}}\">\n {{#if superViral}}<span class=\"super-viral-badge\">\u26a1 SUPER VIRAL</span>{{/if}}\n \n <div class=\"video-title\">{{ platform }} \u2013 Video #{{ @index + 1 }}</div>\n \n <div class=\"metrics\">\n <div class=\"metric\">\n <span class=\"metric-label\">Views:</span>\n <span class=\"metric-value\">{{ views }}</span>\n </div>\n <div class=\"metric\">\n <span class=\"metric-label\">Likes:</span>\n <span class=\"metric-value\">{{ likes }}</span>\n </div>\n <div class=\"metric\">\n <span class=\"metric-label\">Engagement:</span>\n <span class=\"metric-value\">{{ engagementRate }}%</span>\n </div>\n <div class=\"metric\">\n <span class=\"metric-label\">Growth:</span>\n <span class=\"metric-value\">{{ growthScore }}</span>\n </div>\n </div>\n \n <div class=\"section\">\n <div class=\"section-title\">\ud83d\udcf9 Video Link:</div>\n <a href=\"{{ videoUrl }}\" class=\"link\" target=\"_blank\">{{ videoUrl }}</a>\n </div>\n \n <div class=\"section\">\n <div class=\"section-title\">\ud83c\udfaf Visual Hook Analysis:</div>\n <p>{{ visualHookAnalysis }}</p>\n </div>\n \n <div class=\"section\">\n <div class=\"section-title\">\ud83d\udcca Trend Summary:</div>\n <p>{{ trendSummary }}</p>\n </div>\n \n <div class=\"section\">\n <div class=\"section-title\">\ud83d\udca1 Adaptation Ideas:</div>\n <p>{{ adaptationIdeas }}</p>\n </div>\n </div>\n {{/each}}\n \n <div class=\"footer\">\n <p>This report was automatically generated by your Viral Content Finder workflow.</p>\n <p>Review these opportunities and adapt the winning strategies to your content!</p>\n </div>\n</body>\n</html>",
"options": {
"appendAttribution": false
},
"subject": "=Daily Viral Content Opportunities \u2013 {{ $('Search Config').first().json.nicheKeywords }}",
"authentication": "serviceAccount"
},
"credentials": {
"googleApi": {
"name": "<your credential>"
}
},
"typeVersion": 2.1
},
{
"id": "31e77258-5fdd-4a08-b625-aafefac68f8f",
"name": "Send Super Viral Alert",
"type": "n8n-nodes-base.slack",
"position": [
3776,
-112
],
"parameters": {
"text": "=\ud83d\ude80 SUPER VIRAL ALERT!\n\nPlatform: {{ $json.platform }}\nViews: {{ $json.views.toLocaleString() }}\nEngagement Rate: {{ Math.round($json.engagement_rate * 10000) / 100 }}%\n\nLink: {{ $json.video_url }}\n\nWhy it's blowing up: {{ $('Analyze Trend & Adaptation (GPT-4)').first().json.output?.why_it_works }}\n\nTop Adaptation Idea: {{ $('Analyze Trend & Adaptation (GPT-4)').first().json.output?.adaptation_ideas?.[0] }}",
"select": "channel",
"channelId": {
"__rl": true,
"mode": "id",
"value": "<__PLACEHOLDER_VALUE__Slack channel ID or name__>"
},
"otherOptions": {}
},
"credentials": {
"slackApi": {
"name": "<your credential>"
}
},
"typeVersion": 2.3
},
{
"id": "08216c70-5c92-4c93-9f54-3de040ed5135",
"name": "Prepare Email Data",
"type": "n8n-nodes-base.code",
"position": [
3952,
480
],
"parameters": {
"jsCode": "// Transform aggregated data into email-friendly format\nconst videos = $input.all();\n\n// Sort by engagement rate and growth score\nconst sortedVideos = videos.map(item => {\n const data = item.json;\n const engagementRate = data.engagement_rate || 0;\n const ageHours = data.age_hours || 1;\n \n // Calculate growth score (engagement rate / age in hours)\n const growthScore = Math.round((engagementRate / ageHours) * 10000) / 100;\n \n // Extract AI analysis data from agent node outputs\n // Agent nodes store their output in $json.output as a JSON string or object\n let visualAnalysis = {};\n let trendAnalysis = {};\n \n try {\n // Try to parse visual analysis output\n if (data.visual_analysis) {\n visualAnalysis = typeof data.visual_analysis === 'string' ? JSON.parse(data.visual_analysis) : data.visual_analysis;\n }\n // Try to parse trend analysis output\n if (data.trend_analysis) {\n trendAnalysis = typeof data.trend_analysis === 'string' ? JSON.parse(data.trend_analysis) : data.trend_analysis;\n }\n } catch (e) {\n console.log('Error parsing AI output:', e);\n }\n \n return {\n json: {\n platform: data.platform,\n videoUrl: data.video_url,\n author: data.author,\n views: data.views,\n likes: data.likes,\n comments: data.comments,\n shares: data.shares,\n engagementRate: Math.round(engagementRate * 10000) / 100,\n growthScore: growthScore,\n superViral: data.super_viral || false,\n visualHookAnalysis: visualAnalysis.visual_hook || 'N/A',\n mainEmotion: visualAnalysis.main_emotion || 'N/A',\n formattingPattern: visualAnalysis.formatting_pattern || 'N/A',\n trendSummary: trendAnalysis.summary || 'N/A',\n whyItWorks: trendAnalysis.why_it_works || 'N/A',\n trendType: trendAnalysis.trend_type || 'N/A',\n adaptationIdeas: Array.isArray(trendAnalysis.adaptation_ideas) ? trendAnalysis.adaptation_ideas.join('; ') : 'N/A',\n hookExamples: Array.isArray(trendAnalysis.hook_examples) ? trendAnalysis.hook_examples.join('; ') : 'N/A',\n postingAngles: Array.isArray(trendAnalysis.posting_angles) ? trendAnalysis.posting_angles.join('; ') : 'N/A'\n }\n };\n}).sort((a, b) => b.json.growthScore - a.json.growthScore);\n\n// Return top 5-10 videos\nreturn sortedVideos.slice(0, 10);"
},
"typeVersion": 2
},
{
"id": "e638a29d-f6af-435a-82ac-48ae1d994f7d",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-432,
256
],
"parameters": {
"width": 800,
"height": 448,
"content": "## How it works\nThis workflow monitors TikTok and Instagram for fast-growing videos in your niche and sends you a daily digest (plus instant alerts for \u201csuper viral\u201d content).\n\nEach morning, a schedule trigger runs the search with your keywords/hashtags. Apify Actors scrape fresh TikTok and Instagram videos, then the results are normalized into a single unified dataset.\n\nThe workflow filters for high-growth content based on views, engagement, and recency. For each shortlisted video, AI analyzes the visual hook and caption, then explains why the trend works and how you can adapt it for your brand.\n\nThe best videos are saved to Google Sheets and a short email digest is generated with links and AI insights. If any video crosses your \u201csuper viral\u201d threshold, a separate alert is sent so you can react quickly.\n\n## Setup steps\n1. Add your Apify tokens and select the TikTok/Instagram Actors.\n2. Configure keywords/hashtags, countries, and timeframe in the Search Config nodes.\n3. Set your thresholds for views, engagement, and \u201csuper viral\u201d.\n4. Connect Google Sheets, email, and Slack credentials.\n5. Run once in test mode, review the Sheet + email, then enable the daily trigger."
},
"typeVersion": 1
},
{
"id": "85b0d34f-b4e1-4aab-a82a-50096d9544a1",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
416,
256
],
"parameters": {
"color": 7,
"width": 608,
"height": 448,
"content": "## Schedule & Config\n\nDaily trigger and core settings: search keywords, countries, timeframe, and API credentials. Adjust these nodes to match your niche and data sources."
},
"typeVersion": 1
},
{
"id": "5d996e1e-caaa-4107-af1e-2fffc9e00797",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
1056,
144
],
"parameters": {
"color": 7,
"width": 720,
"height": 560,
"content": "## Scrape & Normalize\n\nScrapes TikTok and Instagram via Apify, then normalizes results into a single list with consistent fields (views, engagement, author, URL, caption)."
},
"typeVersion": 1
},
{
"id": "4846c473-5282-4c90-ad1b-bf833619c2d7",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1808,
256
],
"parameters": {
"color": 7,
"width": 1008,
"height": 448,
"content": "## Filter & AI Insights\n\nKeeps only fast-growing videos, then uses AI to analyze the visual hook and trend mechanics and suggest how to adapt each idea for your brand."
},
"typeVersion": 1
},
{
"id": "2f0c92ec-c890-4d21-aaa7-5a9d77b8a50e",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
2848,
144
],
"parameters": {
"color": 7,
"width": 592,
"height": 560,
"content": "## Super Viral Logic\n\nMarks videos as \u201csuper viral\u201d or \u201cnormal\u201d based on your thresholds so they can be highlighted separately in alerts and reports."
},
"typeVersion": 1
},
{
"id": "41aad79f-cd7b-41b4-8197-b313542439f6",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
3696,
128
],
"parameters": {
"color": 7,
"width": 400,
"height": 720,
"content": "## Sheet & Daily Email\n\nStores all shortlisted videos in Google Sheets and sends a daily digest email with the top picks and AI insights."
},
"typeVersion": 1
},
{
"id": "7f68445d-8ec2-4ea6-901a-505d42055dd5",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
3728,
-304
],
"parameters": {
"color": 7,
"width": 224,
"height": 336,
"content": "## Instant Alerts\n\nSends a quick Slack notification whenever a \u201csuper viral\u201d video is detected so you can react immediately."
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "12daec96-ac86-40f5-a0ef-3b25acee0c1d",
"connections": {
"Scrape TikTok": {
"main": [
[
{
"node": "Normalize TikTok Results",
"type": "main",
"index": 0
}
]
]
},
"Search Config": {
"main": [
[
{
"node": "Scrape TikTok",
"type": "main",
"index": 0
},
{
"node": "Scrape Instagram",
"type": "main",
"index": 0
}
]
]
},
"Mark as Normal": {
"main": [
[
{
"node": "Merge Viral Flags",
"type": "main",
"index": 1
}
]
]
},
"Scrape Instagram": {
"main": [
[
{
"node": "Normalize Instagram Results",
"type": "main",
"index": 0
}
]
]
},
"Combine Platforms": {
"main": [
[
{
"node": "Filter High-Growth Videos",
"type": "main",
"index": 0
}
]
]
},
"Merge Viral Flags": {
"main": [
[
{
"node": "Save to Google Sheets",
"type": "main",
"index": 0
},
{
"node": "Select Top 5-10 Videos",
"type": "main",
"index": 0
}
]
]
},
"OpenAI GPT-4 Model": {
"ai_languageModel": [
[
{
"node": "Analyze Trend & Adaptation (GPT-4)",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Prepare Email Data": {
"main": [
[
{
"node": "Send Daily Digest Email",
"type": "main",
"index": 0
}
]
]
},
"Mark as Super Viral": {
"main": [
[
{
"node": "Merge Viral Flags",
"type": "main",
"index": 0
},
{
"node": "Send Super Viral Alert",
"type": "main",
"index": 0
}
]
]
},
"Daily Trigger (08:00)": {
"main": [
[
{
"node": "Workflow Configuration",
"type": "main",
"index": 0
}
]
]
},
"Select Top 5-10 Videos": {
"main": [
[
{
"node": "Prepare Email Data",
"type": "main",
"index": 0
}
]
]
},
"Workflow Configuration": {
"main": [
[
{
"node": "Search Config",
"type": "main",
"index": 0
}
]
]
},
"Normalize TikTok Results": {
"main": [
[
{
"node": "Combine Platforms",
"type": "main",
"index": 0
}
]
]
},
"Filter High-Growth Videos": {
"main": [
[
{
"node": "Analyze Visual Hook (GPT-4 Vision)",
"type": "main",
"index": 0
}
]
]
},
"OpenAI GPT-4 Vision Model": {
"ai_languageModel": [
[
{
"node": "Analyze Visual Hook (GPT-4 Vision)",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Check Super Viral Threshold": {
"main": [
[
{
"node": "Mark as Super Viral",
"type": "main",
"index": 0
}
],
[
{
"node": "Mark as Normal",
"type": "main",
"index": 0
}
]
]
},
"Normalize Instagram Results": {
"main": [
[
{
"node": "Combine Platforms",
"type": "main",
"index": 1
}
]
]
},
"Analyze Trend & Adaptation (GPT-4)": {
"main": [
[
{
"node": "Check Super Viral Threshold",
"type": "main",
"index": 0
}
]
]
},
"Analyze Visual Hook (GPT-4 Vision)": {
"main": [
[
{
"node": "Analyze Trend & Adaptation (GPT-4)",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
googleApiopenAiApislackApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Automatically discover, analyze, and report the most viral TikTok and Instagram videos in your niche every day. This workflow leverages AI and Apify to help you stay ahead of social media trends. Scrapes trending videos from TikTok and Instagram using Apify. Filters and analyzes…
Source: https://n8n.io/workflows/11411/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Created by: Peyton Leveillee Last updated: October 2025
This workflow automates end-to-end ESG (Environmental, Social, and Governance) sustainability reporting for enterprise sustainability teams, compliance officers, and green governance leads. It solves
Automates sales data analysis and strategic insight generation for sales managers and strategists needing actionable intelligence. Fetches multi-source data from sales, marketing, and financial system
This workflow automatically monitors competitor product prices on a scheduled basis, detects meaningful price changes, and delivers actionable alerts enriched with AI-powered competitive analysis.
Workflow Created By: Abdullah Dilshad 📧 iamabdullahdishad@gmail.com