See llms.txt for all machine-readable content.

Back to Templates

Audit Instagram post performance with Apify, OpenAI, Google Sheets, Slack and Gmail

Quick Overview

This workflow runs daily to scrape recent Instagram posts via Apify, scores them with rule-based logic plus OpenAI, logs results to Google Sheets, and routes top posts to Slack for approval and warm posts to Gmail, while also emailing a weekly summary report.

How it works

  1. Runs on a daily schedule (or manually for testing) and loads all runtime settings such as Apify inputs, scoring thresholds, and destination IDs.
  2. Starts an Apify Instagram posts scraper run and polls the Apify Runs API until the actor succeeds or fails.
  3. Downloads the Apify dataset results, removes incomplete or previously seen posts, and stops quietly if there are no new records.
  4. Calculates a transparent 0–100 rule score per post (likes, comments, lift vs the account’s median, freshness, keywords, and format) and then sends each post to OpenAI to produce a structured fit score, verdict, summary, outreach angle, and red flags.
  5. Blends the rule score with the OpenAI fit score to set a final tier (hot/warm/cold) and upserts each post into Google Sheets keyed by a unique post identifier.
  6. Sends hot posts to Slack as a single approval message and writes the approve/dismiss decision back to Google Sheets, while warm posts are emailed as an HTML digest via Gmail and cold posts remain logged in the sheet only.
  7. On a separate weekly schedule, reads the last 7 days of rows from Google Sheets, builds an HTML report of tiers and top posts, and emails it via Gmail.

Setup

  1. Add an Apify API token as an HTTP Header Auth credential (for example, Authorization: Bearer <token>) and select it on the Apify HTTP Request steps.
  2. Connect a Google Sheets account, create a sheet tab (for example, “Posts”) with columns that match the workflow mapping, and paste your Google Sheet ID and tab name into the Config values.
  3. Add an OpenAI API credential for the chat model used by the AI scoring step (or swap in another supported chat model) and adjust the AI criteria/weight in Config if needed.
  4. Connect Slack and set the target channel ID in Config (and in the error-alert Slack step) so hot-post approvals and failure alerts post to the right place.
  5. Connect Gmail and set the digest email address in Config so the warm-post digest and weekly report can be delivered.