Process Google Sheets rows with OpenAI GPT-4.1-mini and Gmail summaries
Ready for 3.0What this workflow does
This workflow has 20 nodes and runs manually, when you click “Execute workflow” (plus 1 other trigger). Along the way it connects Google Sheets and Gmail.
How it runs
Trigger: Manually, when you click “Execute workflow” (plus 1 other trigger).
- Workflow configuration (Edit Fields (Set)): sets 18 fields: sheet_url, sheet_tab, prompt_template…
- Read all rows (Google Sheets): uses Google Sheets
- Select rows to process (Code): runs custom JavaScript code
- Any rows to process? (If): checks a condition and branches into true / false
- Build run summary (Code): runs custom JavaScript code
- Mark rows as processing (Google Sheets): update
- Anything to report? (If): checks a condition and branches into true / false
- Pick next batch (Code): runs custom JavaScript code
- Email run summary (Gmail): uses Gmail
- Call OpenAI chat completions (HTTP Request): calls an HTTP API (POST)
…plus 8 more steps. See the full node list below.
Services it uses
Other Google Sheets + Gmail templates (2,102)
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (10)
- Manual Trigger
n8n-nodes-base.manualTrigger - Schedule Trigger
n8n-nodes-base.scheduleTrigger - Edit Fields (Set)
n8n-nodes-base.set - Google Sheets
n8n-nodes-base.googleSheets - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - HTTP Request
n8n-nodes-base.httpRequest - Switch
n8n-nodes-base.switch - Wait
n8n-nodes-base.wait - Gmail
n8n-nodes-base.gmail
From the author
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…