what it does
A 26-node workflow reads rows from a Google Sheet, sends them in batches to OpenAI chat completions, and writes results back with status tracking, retry on 429/5xx, and resume from where a run stopped. It uses Manual and Schedule triggers and emails a run summary via Gmail.
Quick overview
For anyone who runs one AI prompt over a long Google Sheet (summaries, classification, enrichment, extraction) and keeps hitting 429 Too Many Requests, or whose reruns send every row again. Rows go to OpenAI in batches; 429s wait for the time OpenAI asks for; progress is kept in a status column, so a run picks up where the last one stopped and finished rows are never sent twice.
How it works
1. Read all rows loads the sheet. Select rows to process picks rows whose status is empty or pending (up to rows_per_run) and Mark rows as processing claims them in one write, so overlapping runs skip them.
2. Pick next batch sends batch_size rows to Call OpenAI chat completions, then Wait between batches pauses.
3. Sort API results handles each row on its own: a 429 or 5xx is retried after Retry-After, retry-after-ms or OpenAI's x-ratelimit-reset-* time, otherwise with exponential backoff. After max_attempts the row gets status = error and the reason in error_message.
4. Save batch results writes the whole batch in one Sheets call. If Sheets answers 429, the same rows are saved again after 5, 15, 30 and 60 s, without calling OpenAI again.
5. A bad API key, missing model or empty billing (insufficient_quota) stops the run, puts unfinished rows back to pending and emails you. Every run ends with a summary email.
Setup
1. Add a header row with your input column(s) plus output, status, attempts, error_message, run_id, updated_at (columns A–Z).
2. Create an OpenAI credential and select it in Call OpenAI chat completions.
3. Connect Google Sheets in Read all rows, Mark rows as processing and Save batch results, and Gmail in Email run summary.
4. In Workflow configuration, set sheet_url, sheet_tab, notify_email and prompt_template (columns in braces, like {input}).
5. Click Execute workflow. For big sheets, publish so Run every 15 minutes takes the next chunk.
Requirements: an OpenAI API key, Google Sheets and Gmail. Built and tested on n8n 2.44.4.
Limitations: columns A–Z; one prompt per workflow. Rows stuck on processing after a crash are picked up again after lease_minutes (30). To retry an error row, clear its status.
Optional Pro setup kit (setup README and offline test kit) on Gumroad, $9 through November 20, 2026, then $19: https://workflower73.gumroad.com/l/sheets-bulk-ai-runner-pro?ref=n8nbasket. The workflow itself stays free.