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
- Google Sheets • Get Next Pending
- AI • Generate IG + FB Captions
- Gemini • Caption Model
- Instagram • Create Reel
- Instagram • Publish Reel
- Facebook • Start Reel Upload
- Facebook • Upload Reel
- Facebook • Publish Reel
- Wait
- Instagram • Check Reel Status
- Limit
- Google Sheets • Mark Processing
- Structured Output Parser
- Merge
26 steps in total.
Similar automations
Social Media PublishingAnalyze competitor Instagram Reels into AI content briefs in Google Sheets23 stepsSocial Media PublishingSchedule Instagram Reels from Google Drive and Sheets10 stepsSocial Media PublishingAnalyze Instagram Reels with Apify, OpenAI and Perplexity12 stepsSocial Media PublishingPost the Best Reels to Instagram Automatically11 steps