n8ntiktokworkflow
n8n TikTok Monitoring Workflow
Complete n8n workflow for TikTok competitor monitoring. Nodes: Scavio TikTok API, Google Sheets for storage, Gmail for alerts. Full workflow included.
9 min
Build an n8n workflow that monitors TikTok competitors daily: fetch profile stats and recent posts via the Scavio TikTok API, store data in Google Sheets for trend tracking, and send Gmail alerts when engagement spikes. The full workflow uses three n8n nodes plus a schedule trigger.
Workflow overview
- Schedule Trigger: runs daily at 9 AM
- HTTP Request (Scavio TikTok API): fetch profile + posts for each competitor
- Google Sheets: append daily metrics
- IF node: check for engagement spikes
- Gmail: send alert if spike detected
Node 1: HTTP Request for TikTok profile
JSON
{
"nodes": [
{
"name": "Get TikTok Profile",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "POST",
"url": "https://api.scavio.dev/api/v1/tiktok/profile",
"headers": {
"Authorization": "Bearer {{ $env.SCAVIO_API_KEY }}",
"Content-Type": "application/json"
},
"body": {
"username": "{{ $json.competitor_username }}"
},
"options": {
"timeout": 15000
}
}
}
]
}Node 2: HTTP Request for recent posts
JSON
{
"name": "Get Recent Posts",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "POST",
"url": "https://api.scavio.dev/api/v1/tiktok/user/posts",
"headers": {
"Authorization": "Bearer {{ $env.SCAVIO_API_KEY }}",
"Content-Type": "application/json"
},
"body": {
"sec_uid": "{{ $json.sec_uid }}",
"count": 20
}
}
}Processing and storing data
Python
# n8n Function node to calculate engagement metrics
# Place between HTTP Request and Google Sheets nodes
items = []
posts = $input.all()
for item in posts:
data = item.json
post_list = data.get("posts", [])
if not post_list:
continue
total_likes = sum(p.get("digg_count", 0) for p in post_list)
total_views = sum(p.get("play_count", 0) for p in post_list)
total_comments = sum(p.get("comment_count", 0) for p in post_list)
count = len(post_list)
items.append({
"json": {
"date": new Date().toISOString().split("T")[0],
"avg_likes": Math.round(total_likes / count),
"avg_views": Math.round(total_views / count),
"avg_comments": Math.round(total_comments / count),
"post_count": count,
}
})
return itemsFull workflow JSON (importable into n8n)
JSON
{
"name": "TikTok Competitor Monitor",
"nodes": [
{
"name": "Daily Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"parameters": {
"rule": { "interval": [{ "field": "hours", "hoursInterval": 24 }] }
},
"position": [0, 0]
},
{
"name": "Competitor List",
"type": "n8n-nodes-base.set",
"parameters": {
"values": {
"string": [
{ "name": "competitors", "value": "brand_a,brand_b,brand_c" }
]
}
},
"position": [200, 0]
},
{
"name": "Split Competitors",
"type": "n8n-nodes-base.splitOut",
"parameters": { "fieldToSplitOut": "competitors", "separator": "," },
"position": [400, 0]
}
],
"connections": {
"Daily Trigger": { "main": [[ { "node": "Competitor List" } ]] },
"Competitor List": { "main": [[ { "node": "Split Competitors" } ]] }
}
}Gmail alert configuration
The IF node checks whether today's average engagement is more than 2x the 7-day average. If triggered, the Gmail node sends an alert with the competitor name, the spike metric, and the top-performing video URL.
Cost breakdown
- 5 competitors x 2 API calls each = 10 calls/day = $0.05/day
- Monthly: $1.50 for TikTok data
- n8n: free self-hosted or $20/mo for n8n Cloud starter
- Google Sheets: free
- Gmail: free (within Google Workspace or personal account)