# Batch-generate a Recraft icon set from a Google Sheet

> 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.

- Workflow type: code
- Services: Recraft, Google Sheets, Google Drive
- Categories: Marketing, Operations
- Published: 2026-07-12

## What it does

- Reads your icon-set tab in Google Sheets each hour and finds every row that still needs an SVG.
- Sends the row's short description to Recraft with a shared brand style, so every icon in the set looks like it belongs together.
- Saves each finished SVG to a designated Google Drive folder and writes the share link back to the same row.
- Skips rows that already have a link, so you can rerun the workflow safely as new prompts are added.

## What you'll need

- A Google account with edit access to the spreadsheet and the destination Drive folder
- A Recraft account with API access and enough credit to cover a set's worth of icons
- A Google Sheet that has a prompt column and an SVG URL column ready to fill
- A short brand style description (or a saved Recraft brand style) that every icon should follow

## Prompt

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.

## How to customize

- Change the hourly schedule to run more or less often, or only during business hours
- Tune the shared style description to match a rebrand: line weight, palette, or overall vibe
- Raise or lower the per-run row limit depending on how fast you want to fill the set

## FAQ

### What if I add more rows after the workflow already ran?

The next hourly run picks them up automatically. Any row whose SVG URL cell is already filled gets skipped, so nothing is regenerated by mistake.

### Can I lock in my own brand style, not just a text description?

Yes. If you have a saved Recraft brand style, reference it in the shared style setting and every icon in the set will inherit it.

### How many icons will it produce per hourly run?

The workflow ships with a safe per-run cap that stays under Recraft's rate limit. Raise it to move faster, or lower it to spread cost across more runs.

### Where do the actual SVG files end up?

Each one is uploaded to the Google Drive folder you specify. The link written back to the sheet points to that file, so anyone with sheet access can open it.

### Do I need to edit anything after setup?

No. Add rows with prompts to the sheet and the next scheduled run fills in the SVG links for you.

Use this prompt in General Input: https://www.generalinput.com/prompts/batch-generate-a-recraft-icon-set-from-a-google-sheet