Skip to content
NEWMarketplace and the trig8n Agent: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Email Automation

Email Automation

Turn TikTok trends into Instagram and Facebook posts with Apify, Gemini, and PostWire

On a schedule, it handles email with Google Gemini using Gmail, Google Sheets, Post Wire, Apify.

What it does

## Post on the trend your niche is watching this week Every morning Apify collects the top TikTok videos for your hashtags, Gemini finds the trend that repeats in them and writes a post for it, Nano Banana draws the image and PostWire publishes it on Instagram and Facebook. ### How it works 1. Every morning at 7:00 runs Scrape TikTok with Apify for the hashtags in Trend settings. 2. Keep popular recent videos drops old and small videos and Skip videos already used drops the ones seen on earlier days. The 15 most watched go to Gemini. 3. Spot the trend with Gemini names the trend, the videos it comes from, a caption per network and the brief for the image. 4. Nano Banana image (Gemini) draws the picture and Post to Instagram and Facebook (PostWire) publishes it with each caption. 5. Log the trend writes the trend, its source videos and the post links in Google Sheets. When no trend fits, the image fails or a network refuses, Log the problem and Email me the fix say what to fix. If Apify fails, Email me that Apify failed. ### Setup 1. Install the verified PostWire node, create an account at postwire.io, connect your networks and paste your API key into a PostWire API credential. 2. Copy your Apify API token into a Bearer Auth credential in the Apify node. The free Apify plan covers a daily run. 3. Add a Google Gemini credential to both Gemini nodes, connect Gmail and pick a sheet with the columns date, trend, why, sources, status, links and note in both Sheets nodes. 4. Fill in Trend settings. ### Customize Change the hashtags, minimum views or image style in Trend settings.

The steps

  1. Every morning at 7:00
  2. Trend settings
  3. Scrape TikTok with Apify
  4. Keep popular recent videos
  5. Skip videos already used
  6. Most watched first
  7. Keep the top 15
  8. Bundle the videos
  9. Email me that Apify failed
  10. Spot the trend with Gemini
  11. Read the trend
  12. Is there a trend?
  13. Nano Banana image
  14. Post to Instagram and Facebook

20 steps in total.

Similar automations