Quick overview
This workflow runs daily to pull TikTok post and profile analytics from Upload Post, updates a Google Sheets performance log, uses Google Gemini and OpenAI to generate a new carousel concept and caption, creates four images via fal.ai, publishes to TikTok, and updates a persistent “Agent Skill” sheet.
How it works
- Runs on a daily schedule (or manually) and loads product, Upload Post, and Google Sheets configuration values.
- Reads the Google Sheets “Performance Log,” selects posts missing stats or posted recently, fetches TikTok post analytics from the Upload Post API, and writes updated metrics back to the sheet.
- Aggregates the refreshed history, fetches TikTok profile analytics from Upload Post, reads the “Agent Skill” sheet, and compiles a single context summary.
- Uses Google Gemini (via a structured JSON output) to generate a TikTok carousel plan including caption, strategy notes, four slide prompts, hashtags, and an engagement question.
- Sends the four prompts to fal.ai to generate four 9:16 PNG carousel images and collects their hosted image URLs.
- Uses OpenAI (GPT-4.1) to write a short TikTok photo-post description, publishes the carousel to TikTok via Upload Post (auto-adding music), and logs the new post details back to Google Sheets.
- Uses OpenAI (GPT-4.1) to update the “Agent Skill” content based on the latest performance data and writes the refreshed skill file back to the “Agent Skill” sheet.
Setup
- Create or copy a Google Sheets file with two tabs named “Performance Log” and “Agent Skill,” and ensure the columns match the workflow’s expected fields (including request_id and skill_content).
- Connect Google Sheets OAuth2 credentials and update the spreadsheet ID (and any sheet names if different) in the configuration.
- Add Upload Post credentials for publishing plus HTTP Header Auth credentials for the Upload Post analytics endpoints, then set your Upload Post username and API key in the configuration.
- Add a Google Gemini (PaLM) API credential for the strategy generation step.
- Add an OpenAI API credential (GPT-4.1) for generating the TikTok description and updating the skill file.
- Add a fal.ai HTTP Header Auth credential and ensure the fal.run endpoint is accessible for image generation.