Quick Overview
This workflow runs every morning, uses Apify to pull top Instagram hashtag posts, rewrites one suitable idea with OpenAI for LinkedIn, Facebook, Bluesky, and Instagram, generates a new image with OpenAI, schedules the content via PostWire, and logs outcomes to Google Sheets with Gmail alerts on failures.
How it works
- Runs every morning at 7:00 on a schedule.
- Uses Apify’s Instagram Hashtag Scraper to collect recent posts for your configured hashtags, then keeps only posts that meet minimum likes, have captions, are within the max age, and haven’t been used in previous runs.
- Sorts the remaining posts by likes, keeps the top 10, and sends them to OpenAI to select one usable idea and generate platform-specific copy plus an image prompt.
- If an idea is returned, uses OpenAI Images to generate a new 1024×1024 image and schedules drafts for Instagram, LinkedIn, Facebook, and Bluesky in PostWire for the next day at your chosen hour.
- Appends a row to Google Sheets with the idea, Instagram source URL, scheduled time, and PostWire status when scheduling succeeds.
- If Apify fails or no idea/image/schedule is produced, writes the problem details to Google Sheets and emails you via Gmail with the reason and suggested fix.
Setup
- Add credentials for Apify (HTTP Bearer token), OpenAI (for both text and image generation), PostWire (API key and connected social accounts), Google Sheets (OAuth), and Gmail (OAuth).
- In Google Sheets, create/select a sheet with columns date, idea, source, publish_at, status, and note, then set the spreadsheet ID and sheet name in both Google Sheets append steps.
- Update the Niche settings (brand description, hashtags, min_likes, max_age_days, publish_hour, voice, image_style, and alert email address) to match your use case.