Batch-generate a Recraft icon set from a Google Sheet

By General Input

Fill an entire icon set on autopilot. Every hour, a spreadsheet drives Recraft to generate on-brand SVG icons and drop share links back in each row.

Integrations

  • Recraft
  • Google Sheets
  • Google Drive

Type

Deterministic Code

Categories

  • Marketing
  • Operations

Every hour on a cron trigger, run a batch icon generator driven by a Google Sheet. This is a fully deterministic pipeline: read the sheet, generate any missing SVGs through Recraft, upload each SVG to Google Drive, and write the share URL back to the row. No reasoning or branching decisions.

Expose these configuration constants at the top of the workflow so an operator can tune the set without editing code: spreadsheetId (the Google Sheets ID of the icon-set workbook), sheetTab (the tab name, default 'Icons'), promptColumnHeader (default 'prompt'), svgUrlColumnHeader (default 'SVG URL'), driveFolderId (the destination Google Drive folder), stylePrefix (a shared string prepended to every prompt so the whole set stays visually consistent, for example 'Flat two-color line icon on white background, 2px stroke, rounded corners: '), and maxRowsPerRun (default 40).

Step 1. Read the icon-set tab with Google Sheets Get Values. Fetch a wide range that covers the header row and all data rows, for example 'Icons!A1:Z1000'. Parse the first row as headers and resolve the column indexes for promptColumnHeader and svgUrlColumnHeader by name, not by fixed letter, so the workflow keeps working if columns are reordered.

Step 2. Walk the data rows in order. Collect rows where the prompt cell is non-empty AND the SVG URL cell is empty. Stop collecting once maxRowsPerRun rows have been queued. This empty-cell check is what makes the workflow idempotent, so re-running it never regenerates rows that already have a link.

Step 3. For each queued row, in order, run the three-step per-row pipeline:

3a. Call Recraft Generate Vector Image (SVG) with prompt = stylePrefix + rowPromptText, n = 1, size = '1:1', response_format = 'url'. Read data[0].url from the response and fetch the SVG bytes.

3b. Call Google Drive Upload File (Multipart). Target driveFolderId as the parent, filename '<sanitized-prompt>.svg' (slug the row prompt, cap around 60 chars), and mimeType 'image/svg+xml'. Capture the returned file id and webViewLink; if webViewLink is not populated, construct 'https://drive.google.com/file/d/<id>/view' from the file id.

3c. Call Google Sheets Update Values, targeting the single cell for that row's SVG URL column (for example 'Icons!E17'), with valueInputOption = 'USER_ENTERED' so the URL renders as a clickable hyperlink.

Step 4. Error isolation. If any single row fails (Recraft non-2xx, upload failure, or update failure), log the error with the row number and prompt text and continue with the next row. Do not abort the whole run. The next hourly run will naturally retry the failed row because its SVG URL cell is still empty.

Design notes to bake in. Rate-limit safety: keep maxRowsPerRun at or below 40 so a full run stays comfortably under Recraft's 100-images-per-minute and 5-requests-per-second limits even with retries; if you want a faster ramp, add a small delay between calls instead of raising the cap blindly. Consistency: the stylePrefix is what makes every icon in the set look like it belongs together, so always concatenate it in front of the row prompt and never send a raw cell value to Recraft. Idempotency: the only signal that a row has been processed is a non-empty SVG URL cell, so write that cell last, after the Drive upload succeeds.

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