Send railway queue predictions with OpenAI GPT-4o-mini, Gmail, and Google Sheets
Ready for 3.0What this workflow does
This workflow has 7 nodes and runs when someone submits an n8n form (“Railway Queue Predictor”). Along the way it connects Google Sheets and Gmail. It also calls api.openai.com over HTTP.
How it runs
Trigger: When someone submits an n8n form (“Railway Queue Predictor”).
- 2. Code — Predict Queue Wait Times (Code): runs custom JavaScript code
- 3. HTTP — AI Write Advisory (HTTP Request): calls api.openai.com (POST)
- 4. Code — Parse Advisory and Alert Colors (Code): runs custom JavaScript code
- 5. Code — Build HTML Email (Code): runs custom JavaScript code
- 6. Sheets — Log Prediction (Google Sheets): append
- 7. Gmail — Send Queue Alert to Traveler (Gmail): uses Gmail
Services it uses
Other Google Sheets + Gmail templates (2,102) · Other OpenAI + Google Sheets templates (2,011) · Other OpenAI + Gmail templates (1,623)
HTTP calls to: api.openai.com
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 (5)
- n8n Form Trigger
n8n-nodes-base.formTrigger - Code
n8n-nodes-base.code - HTTP Request
n8n-nodes-base.httpRequest - Google Sheets
n8n-nodes-base.googleSheets - Gmail
n8n-nodes-base.gmail
From the author
Quick overview This workflow collects train trip details via an n8n Form, predicts station crowding and queue times with a rule-based algorithm, generates a short advisory with OpenAI, then emails a color-coded HTML alert via Gmail and logs each prediction to…