π¬ TikTok β Pinterest Automation
Auto-discover viral TikToks β AI-generate Pinterest pin copy β queue in Google Sheets for review. Built with n8n. Free tier only β $0/month.
A single n8n workflow that scrapes TikTok by keyword, filters for viral content, downloads watermark-free HD videos, uploads them to Google Drive, generates SEO-optimized Pinterest titles + descriptions with AI, and writes everything to a Google Sheet for manual review.
β¨ What it does
flowchart LR
A["Chat / Schedule Trigger"]
--> B["Apify TikTok Scraper"]
B --> C["Normalize + Filter Slideshows"]
C --> D{"Views β₯ 100k<br>Shares β₯ 100?"}
D -- Yes --> E["Dedup vs Sheet"]
D -- No --> X["Skip"]
E --> F["Limit Top 3"]
F --> G["tikwm.com HD Download"]
G --> H["Upload to Google Drive"]
H --> I["AI Agent: Generate Pin Copy"]
I --> J["Append to Google Sheet"]
J --> K["You review + post manually"]
- π Keyword-driven discovery β type
slow livingoranime amvand the workflow finds top-performing TikToks - π₯ Watermark-free HD downloads β uses tikwm.com to fetch the original-quality video without TikTok logos
- π¨ Photo slideshow filter β automatically rejects TikTok carousels (image-only posts) so you only get real video
- π€ AI-generated pin copy β Pinterest-optimized titles + descriptions with SEO hashtags
- π Google Sheets review queue β manual approval before posting (Pinterest API integration optional)
- π Two entry points β run on a schedule OR trigger manually via chat with a custom keyword
π οΈ Tech stack
| Tool | Purpose | Cost |
|---|---|---|
| n8n | Workflow orchestrator | Free (self-host or Cloud trial) |
| Apify | TikTok scraper | Free credits (~$5/mo) |
| tikwm.com | HD video download | Free, no key |
| Google Drive | Video storage | Free 15 GB |
| Google Sheets | Review queue | Free |
| Groq | AI title/description (recommended) | Free tier (generous) |
| OpenRouter | AI fallback | Free models available |
π Quick start
- Clone this repo git clone https://github.com/mehdreaming/tiktok-to-pinterest.git
- Install n8n (Docker) docker run -it --rm --name n8n -p 5678:5678 -v ~/.n8n:/home/node/.n8n docker.n8n.io/n8nio/n8n
- Open http://localhost:5678 β import "TikTok β Pinterest.json"
- Add credentials (see API setup below)
- Hit "Execute Workflow" β type a keyword in chat β check your Google Sheet
π Prerequisites
You need accounts on 5 services (all free):
- n8n β n8n Cloud (14-day trial) or self-host via Docker
- Apify β for TikTok scraping
- Google Cloud project β for Drive + Sheets OAuth
- Groq β for AI text generation (recommended)
- OpenRouter β alternative AI provider (optional)
π How to get each API key
1οΈβ£ Apify (TikTok Scraper)
Click to expand step-by-step
- Go to apify.com β Sign up (free)
- Once logged in, click your profile (top right) β Settings
- Click Integrations in the sidebar
- Under Personal API tokens, click Create new token
- Name it
n8nβ click Create - Copy the token β it looks like
apify_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - β οΈ Save it now β you can't view it again
Also set up the TikTok scraper actor:
- Go to apify.com/clockworks/tiktok-scraper
- Click Try for free to add it to your account
- Free tier gives you ~$5/month in credits = ~500 free scrapes
2οΈβ£ Google Cloud (Drive + Sheets OAuth)
Click to expand step-by-step
Create a Google Cloud project
- Go to console.cloud.google.com
- Click Select a project (top bar) β New Project
- Name it
tiktok-pinterest-n8nβ Create
Enable the APIs
- With the project selected, go to APIs & Services β Library
- Search and enable each of these:
- Google Drive API β click β Enable
- Google Sheets API β click β Enable
Configure OAuth consent screen
- Go to APIs & Services β OAuth consent screen
- Select External β Create
- Fill in:
- App name:
n8n-tiktok-pinterest - User support email: your email
- Developer contact: your email
- App name:
- Save and Continue through Scopes, Test Users, Summary
- Add your own Google email as a Test User
- Back to Dashboard
Create OAuth credentials
- Go to APIs & Services β Credentials
- Click + Create Credentials β OAuth client ID
- Application type: Web application
- Name:
n8n-oauth - Authorized redirect URIs: add this exact URL (for n8n Cloud):
https://YOUR-N8N-SUBDOMAIN.app.n8n.cloud/rest/oauth2-credential/callback
(For self-hosted:
http://localhost:5678/rest/oauth2-credential/callback) - Create β copy the Client ID and Client Secret
Create your Google Sheet
- Go to sheets.google.com β create a new sheet
- Name it
Pinterest Queue - Add these column headers in Row 1:
timestamp | keyword | tiktok_url | views | shares | duration | drive_file_id | drive_url | pin_title | pin_description | status - Copy the Sheet ID from the URL:
docs.google.com/spreadsheets/d/SHEET_ID_HERE/edit
Create your Google Drive folder
- Go to drive.google.com β New β Folder
- Name it
TikTok Pins - Open the folder β Copy the Folder ID from the URL:
drive.google.com/drive/folders/FOLDER_ID_HERE
3οΈβ£ Groq (AI text generation β recommended)
Click to expand step-by-step
Groq has the most generous free tier β way more requests/day than OpenRouter's free tier.
- Go to console.groq.com β Sign up (Google login works)
- Once in, click API Keys in the left sidebar
- Click Create API Key
- Name it
n8nβ Submit - Copy the key β looks like
gsk_xxxxxxxxxxxxxxxxxxxxxxxxxx - β οΈ Save it now β you can't view it again
Recommended model: llama-3.3-70b-versatile (best quality, free tier handles ~14,400 requests/day).
4οΈβ£ OpenRouter (alternative AI provider)
Click to expand step-by-step
Use this if Groq runs out or you want DeepSeek instead of Llama.
- Go to openrouter.ai β Sign in with Google
- Click your profile (top right) β Keys
- Click + Create Key
- Name it
n8nβ Create - Copy the key β looks like
sk-or-v1-xxxxxxxxxxxxxxxxx
Free models available:
deepseek/deepseek-chat-v3.1:freemeta-llama/llama-3.1-8b-instruct:freegoogle/gemini-2.0-flash-exp:free
βοΈ n8n setup
Step 1: Install n8n
Option A β Docker (recommended for self-host):
docker run -it --rm \
--name n8n \
-p 5678:5678 \
-v ~/.n8n:/home/node/.n8n \
docker.n8n.io/n8nio/n8n
Open http://localhost:5678.
Option B β n8n Cloud:
- Go to n8n.io β start free trial
- Note your subdomain:
https://YOUR-SUBDOMAIN.app.n8n.cloud
Step 2: Import the workflow
- In n8n, click Workflows (left sidebar)
- Click Add workflow β Import from file
- Select
TikTok β Pinterest.jsonfrom this repo - Click Import
Step 3: Add credentials in n8n
Go to Credentials β New and create each one:
A. Apify (HTTP Header Auth)
- Credential type: HTTP Header Auth
- Name:
Apify - Header Name:
Authorization - Header Value:
Bearer YOUR_APIFY_TOKEN
B. Google Drive (OAuth2)
- Credential type: Google Drive OAuth2 API
- Client ID: paste from Google Cloud
- Client Secret: paste from Google Cloud
- Click Sign in with Google β authorize your test user account
C. Google Sheets (OAuth2)
- Credential type: Google Sheets OAuth2 API
- Use the same Client ID + Secret as above
- Click Sign in with Google β authorize
D. Groq (AI)
- Credential type: Groq API
- API Key: paste your Groq key
E. OpenRouter (AI, optional)
- Credential type: OpenAI API (compatible)
- API Key: paste your OpenRouter key
- Base URL:
https://openrouter.ai/api/v1
Step 4: Wire credentials into the workflow
Open the imported workflow and update these nodes:
| Node | What to set |
|---|---|
| Apify HTTP node | Credential: Apify |
| Get Existing URLs (Sheets) | Credential: Google Sheets Β· Document: paste your Sheet ID |
| Drive Upload | Credential: Google Drive Β· Parent Folder: paste your Folder ID |
| AI Agent β Chat Model | Credential: Groq Β· Model: llama-3.3-70b-versatile |
| Append row in sheet | Credential: Google Sheets Β· Document: paste your Sheet ID |
Step 5: Test it
- Click Open Chat (or Execute Workflow with the chat trigger)
- Type a keyword:
slow living routineoranime amv - Wait ~30-60 seconds
- Check your Google Sheet β you should see 3 new rows with AI-generated copy π¬
ποΈ Configuration
Customize these values in the workflow nodes:
Filter thresholds (Filter node)
$json.views >= 100000 // minimum views $json.shares >= 100 // minimum shares $json.duration between 7 and 60 // seconds Tweak these per niche. Anime content typically has lower share counts than lifestyle.
Scheduled keyword rotation (Set Schedule Keyword node)
= ['anime amv','studio ghibli','anime aesthetic','anime edit','manga panel','anime scenery','anime soundtrack'][$now.weekday - 1] Map any 7 keywords to days of the week for automated daily runs.
AI tone (AI Agent system prompt)
Customize the system message to match your brand voice:
- Lifestyle: warm, slow, intentional
- Anime: cinematic, poetic, film-critic
- Recipes: hook-driven, hashtag-heavy
π₯ Common errors & fixes
TikTok CDN 403 Forbidden
Add these headers to the HTTP Request1 node: Referer: https://www.tiktok.com/ User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Workflow returns audio-only (no video)
The keyword is matching TikTok photo slideshows. The Normalize node has a built-in filter that skips slideshows β make sure you're using the latest version of the Code node. Use video-heavy keywords like anime amv, studio ghibli, cozy routine. Avoid manga panel, anime quote (mostly slideshows).
AI returns markdown-wrapped JSON
The "Clean JSON" code node strips ```json fences automatically. Also add "respond with pure JSON only β no markdown, no code fences" to the system prompt.
OpenRouter "Data limit reached"
Free models have daily token caps. Switch to Groq (much higher free tier) or rotate between providers. Recommended: llama-3.3-70b-versatile on Groq.
Drive upload "File not found"
The HTTP Request1 node must have Response Format = File and Binary Property Name = data. Both must match the Drive Upload's input field name.
Google OAuth "redirect_uri_mismatch"
The redirect URI in Google Cloud Console must EXACTLY match n8n's callback URL. For n8n Cloud: https://YOUR-SUBDOMAIN.app.n8n.cloud/rest/oauth2-credential/callback. No trailing slash.
πΊοΈ Roadmap
- π Pinterest API integration β auto-post approved rows
- π yt-dlp fallback β for blocked downloads
- π‘ AI cover thumbnail generation β better Pinterest CTR
- π‘ Telegram/Slack error alerts β notify on workflow failures
- π‘ Local Ollama integration β truly $0 AI cost
- π‘ Semantic deduplication β similar-video detection (not just exact URL match)
π = next up Β· π‘ = future ideas Β· PRs welcome on any of these
π Repo structure
.
βββ TikTok-to-Pinterest.json # Importable n8n workflow
βββ workflow.png # Workflow architecture screenshot
βββ LICENSE # MIT License
βββ README.md # Project documentation
βββ .gitignore # Ignore unnecessary files
π€ Contributing
PRs welcome! Particularly interested in:
- New niche-specific AI prompts
- Cover image generation nodes
- Pinterest API auto-post implementation
- yt-dlp Docker integration
Open an issue first if you're building anything substantial β let's chat about it.
π License
MIT β do whatever you want with this. Attribution appreciated but not required.
π Connect
Built by @mehdreaming
- π¦ X / Twitter: @mehdreaming β automation builds + dev logs
- π€ Reddit: u/mehdreaming β n8n + creator tools discussion
- πΌ Open to collabs on automation + creator tools
If this saved you time, drop a β on the repo β it really helps.
A single n8n workflow that scrapes TikTok by keyword, filters for viral content, downloads watermark-free HD videos, uploads them to Google Drive, generates SEO-optimized Pinterest titles + descriptions with AI, and writes everything to a Google Sheet for manual review.