Quick overview
This workflow runs daily, reads a queued carousel request from Google Sheets, uses Google Gemini to generate a concept, caption, and 5–6 slide prompts, creates slide images, uploads them to Google Cloud Storage, and publishes the carousel to Instagram via the Meta Graph API, then logs results and emails you
How it works
- Runs every day at 12:00 based on a schedule trigger.
- Reads rows from Google Sheets where
Pick = 1, selects the first row not marked Published or Processing, and updates the row status to Processing.
- Uses Google Gemini to generate a structured carousel concept, an Instagram caption, and a structured set of exactly 5–6 slides.
- Builds an image prompt per slide, generates a square slide image via the Gemini image API, converts it to a file, and resizes it to 1080×1080.
- Uploads each slide image to a public Google Cloud Storage bucket and creates an Instagram carousel child container for each image via the Meta Graph API.
- Polls the Meta Graph API until all child containers reach FINISHED (or stops on timeout/error), then creates and polls the carousel parent container until it finishes.
- Publishes the carousel to Instagram, updates the originating Google Sheets row with Published status and IDs/URLs, and sends a confirmation email via Gmail.
Setup
- Connect Google Sheets OAuth2 and select the spreadsheet and sheet used by all read/update steps, ensuring it includes columns like RowKey, Pick, status, Topic, Audience, Voice, Goal, KeyMessage, and CTA.
- Add Google Gemini credentials (LangChain Google Gemini node) and configure the HTTP request node to authenticate to the Gemini image API (for example with an API key header).
- Create a publicly readable Google Cloud Storage bucket, add Google Cloud Storage credentials, and replace the bucket name placeholder so Meta can fetch the uploaded image URLs.
- Create and connect a Meta (Facebook Graph API) credential for an Instagram Professional Account, and replace the Instagram Professional Account ID placeholders.
- Connect Gmail OAuth2 and set the notification recipient email address placeholder.
- Set the workflow timezone and use
Pick = 1 to queue items, with status values updating through Processing to Published.