Quick overview
This workflow reads eligible rows from a Google Sheets tab, sends their content to the OpenAI Chat Completions API in small batches with backoff-based retries, writes results back to the sheet, and emails a run summary via Gmail.
How it works
- Runs manually or every 15 minutes to process the next chunk of rows from a Google Sheets tab.
- Reads all rows and validates the required headers, then selects up to a configured limit where
status is empty/pending (or processing but expired) and builds a prompt from the configured template.
- Marks the selected rows as
processing in Google Sheets to prevent overlapping runs from reprocessing the same rows.
- Sends the prompts to the OpenAI Chat Completions endpoint in batches, applying exponential backoff and server-directed waits for 429/5xx/timeouts until the max attempt limit is reached.
- Writes each batch result back to Google Sheets as
done with the generated output (or error with an error message), retrying the sheet write on Google Sheets quota errors with increasing waits.
- Repeats batching until all claimed rows are finished or the run is stopped due to a fatal OpenAI error, then emails a completion/stop summary via Gmail.
Setup
- Create a Google Sheet with a header row that includes your input column(s) referenced in
prompt_template plus status, attempts, error_message, run_id, updated_at, and the configured output column (default output).
- Add and select Google Sheets credentials for the workflow’s read/update steps, and set the target sheet URL and tab name in the workflow configuration.
- Add an OpenAI API credential for the HTTP request to the Chat Completions API and review the model, token limit, batching, and retry settings in the workflow configuration.
- Add a Gmail credential and set
notify_email to receive the run summary email.
Additional info
Optional Pro setup kit (README and test kit) on Gumroad, $9 through November 20, 2026 for launch week: https://workflower73.gumroad.com/l/sheets-bulk-ai-runner-pro?ref=n8n-22627 — the workflow itself stays free.