Batch generate marketing images from a Sheets queue

By General Input

Every hour, turn a Google Sheets queue of pending prompts into finished Ideogram images filed in a shared Google Drive folder.

Integrations

  • Ideogram
  • Google Sheets
  • Google Drive

Type

Deterministic Code

Categories

  • Marketing
  • Operations

Every hour, run a batch marketing-asset generator that turns rows of a Google Sheets queue into finished Ideogram images filed in a Google Drive folder.

Trigger: cron, every hour.

Step 1. Read the queue tab of a configured Google Sheets spreadsheet using google-sheets Get Values on a range that covers all queue columns: prompt, aspect_ratio, style_type (style preset), rendering_speed, slug, status, drive_link, and seed.

Step 2. Iterate through the rows in order and pick the ones whose status column equals "pending". Skip any pending row whose prompt column is empty. Stop after processing 25 rows so a large backlog does not exhaust Ideogram API credits in one run.

For each selected row:

a) Call ideogram Generate (Ideogram 4.0) with the row's prompt as text_prompt, and pass the row's aspect_ratio, style_type, and rendering_speed straight through.

b) If the response has is_image_safe = false, do NOT upload anything to Drive. Write "safety_rejected" back to that row's status column via google-sheets Update Values and continue to the next row.

c) Otherwise, download the bytes from the returned data[0].url. Ideogram image URLs expire quickly per Ideogram's common_docs, so re-hosting is mandatory.

d) Upload those bytes to a fixed Google Drive folder using google-drive Upload File (Multipart). Set the file name to the row's slug column (with a .png extension) and set the parent to the configured Drive folder id.

e) Write three values back to that row via google-sheets Update Values: the Drive file's webViewLink into drive_link, the Ideogram data[0].seed into seed (so the marketer can regenerate a controlled variation later), and "done" into status.

Configurable inputs: the spreadsheet id, the queue tab name, the destination Drive folder id, the max-rows-per-run cap (default 25), and the cron schedule (default hourly). This is a fully deterministic code workflow: every row is a self-contained spec and no step-to-step reasoning is required.

Design note: this mirrors the shape of Ideogram's own Batch Generation product (https://about.ideogram.ai/batch) but delivers it via the API, so non-Pro Ideogram accounts get the same spreadsheet-driven experience.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageLet support send one-off Loops emails without an engineerStop cold emails to anyone with a live deal in PipedriveiMessage campaign console with pre-flight checks and delivery boardLinkedIn Ads budget pacing dashboard for every client accountFront desk appointment confirmation board for the next 3 daysGive your team Looker numbers without buying more seatsBuild audience segments from product usage and push to LoopsTurn the people who engage with your posts into Pipedrive leads