Skip to content
NEWMeet Alaaddin, your AI genie with a voice. trig8n launches 1 January 2027. See what is new

Library / Social Media Publishing

Social Media Publishing

Schedule and publish Instagram and Facebook Reels from Google Sheets with Gemini

On a schedule, it publishes to social media with Google Gemini and OpenRouter using Facebook / Instagram, Google Sheets.

What it does

# Complete Flow ### A. Scheduler Schedule • Every 30 Minutes → starts the workflow every 30 minutes. ### B. Read queue Google Sheets • Get Next Pending → reads rows from your Queue sheet. ### C. Select due content Filter • Due + Pending → requires: - scheduled time is due, - status is PENDING, PROCESSING, or FAILED, - retry_count is below 5. ### D. Prepare Code • Prepare Processing → keeps already-posted platform states, → changes unfinished platforms to PROCESSING, → increments retry_count. ### E. One item per run Limit → only one row is processed per execution. ### F. Mark processing Google Sheets • Mark Processing → saves the current processing state before external API calls. ### G. Generate captions AI • Generate IG + FB Captions → creates exactly: - instagram_caption - facebook_caption The structured output parser enforces that JSON structure. ### H. Instagram If Instagram is not already POSTED: 1. Instagram • Create Reel 2. Wait 30 seconds 3. Instagram • Check Reel Status 4. Instagram • Check Status 5. If FINISHED → publish 6. If IN_PROGRESS → wait and check again 7. If ERROR/EXPIRED → mark failed ### I. Facebook If Facebook is not already POSTED: 1. Facebook • Start Reel Upload 2. Facebook • Upload Reel 3. Facebook • Publish Reel ### J. Final result Instagram • Result + Facebook • Result → normalize platform status. Merge → combines both platform results. Calculate Final Status → final status becomes: - POSTED when both platforms are POSTED - FAILED when retry_count reaches 5 and at least one platform is FAILED - otherwise PROCESSING Google Sheets • Final Status → writes the final state back to the matching id row.

The steps

  1. Google Sheets • Get Next Pending
  2. AI • Generate IG + FB Captions
  3. Gemini • Caption Model
  4. Instagram • Create Reel
  5. Instagram • Publish Reel
  6. Facebook • Start Reel Upload
  7. Facebook • Upload Reel
  8. Facebook • Publish Reel
  9. Wait
  10. Instagram • Check Reel Status
  11. Limit
  12. Google Sheets • Mark Processing
  13. Structured Output Parser
  14. Merge

26 steps in total.

Similar automations