Quick Overview
This workflow runs daily to scrape recent Instagram Reels from selected accounts using an Apify actor, scores them with rules plus OpenAI, stores results in Google Sheets, and sends top picks to Slack for approval, with warm picks emailed via Gmail and a weekly summary report.
How it works
- Runs on a daily schedule (or manually for testing) and uses a separate weekly schedule to send a 7‑day report instead of scraping.
- On daily runs, starts the Apify Instagram Reels Scraper actor and repeatedly polls the Apify run status until it succeeds or fails.
- Fetches the Apify dataset items, removes incomplete entries, and deduplicates Reels against previous runs to keep only new results.
- Scores each new Reel using engagement-based rules and then uses an OpenAI chat model to generate a structured fit score, verdict, summary, and red flags, combining these into a final tier.
- Upserts all scored Reels into a Google Sheets tab and routes hot items to Slack for an approve/dismiss decision, warm items to a Gmail HTML digest, and cold items to the sheet only.
- Writes Slack review decisions back to Google Sheets and, on the weekly schedule, reads the sheet to email a weekly Gmail report summarizing new rows, tiers, and review outcomes.
- If any execution fails, posts an error alert with the failure details to a Slack channel.
Setup
- Create an Apify API token and configure an HTTP Header Auth credential (Authorization: Bearer <token>) for the Apify HTTP requests.
- Connect Google Sheets credentials, create a spreadsheet/tab for the Reel tracker, and set the Google Sheet ID and tab name in the Config values.
- Connect an OpenAI credential (or swap the model node to another supported chat model) and ensure the workflow has access to the selected model (gpt-4o-mini by default).
- Connect Slack credentials, set the target Slack channel IDs in Config (and in the error-alert Slack step), and ensure the bot can post and use interactive approvals.
- Connect Gmail credentials and set the digestEmail address in Config for the warm digest and weekly report emails.
- Update the Config actor input (usernames, limits, lookback window) and scoring thresholds/keywords (minPlays, minComments, hotScore/warmScore, aiCriteria) to match your review criteria.