Skip to content
FlowHubFluxonLab
C
Gmailfree

Send railway queue predictions with OpenAI GPT-4o-mini, Gmail, and Google Sheets

by isaWOWadapted from n8n official workflow galleryUpdated Aug 2026
RequiresCCodeGmailGmailGoogle SheetsGoogle SheetsHTTP RequestHTTP Request
Share Post Share
Fo1. Form — Traveler Train Details1. Form — Trave…Co2. Code — Predict Queue Wait Times2. Code — Predi…HR3. HTTP — AI Write Advisory3. HTTP — AI Wr…Co4. Code — Parse Advisory and Alert Colors4. Code — Parse…Co5. Code — Build HTML Email5. Code — Build…6. Sheets — Log Prediction6. Sheets — Log…7. Gmail — Send Queue Alert to Traveler7. Gmail — Send…123456
1/5
STEPS · 6
Starts on an incoming request

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 Google Sheets. How it works Receives a submission from an n8n Form containing the traveler’s train, station, date/time, class, e-ticket status, passenger count, and email. Calculates a crowd score, alert level, queue-time breakdown (platform, ticket counter, security, walking), and an optimal station arrival time using an in-workflow rules engine. Sends the prediction context to OpenAI Chat Completions (gpt-4o-mini) to generate a plain-text, under-120-word travel advisory. Combines the advisory with the prediction results and assigns alert colors and text based on the computed alert level. Builds a color-coded HTML email summarizing the recommended arrival time and queue breakdown. Appends the prediction details to a Google Sheets tab and sends the HTML alert email to the traveler via Gmail. Setup Add an OpenAI API credential for the HTTP request to https://api.openai.com/v1/chat/completions.

Tags

n8nreference-onlygmailgoogle-sheets
Connects
CCodegmailGmailsheetsGoogle SheetsWHTTP Request
CategoryGmail
Triggermanual
Complexitymedium
Nodes7
AddedJul 4, 2026

Related workflows

See all Gmail
CgmailsheetsW
free

Route real estate buyer and seller leads with Claude and Google Sheets

Quick Overview This workflow hosts an n8n lead-capture form, uses Anthropic Claude to score and classify real estate inquiries, then routes ready leads to Gmail and Google Sheets while logging early-stage leads to a separate Google Sheets tab. How it works Receives a new submission from an n8n Form trigger with contact details, intent, area, budget, timeline, financing status, and notes. Normalizes the submitted fields (for example trimming strings, lowercasing email, and adding a timestamp) for consistent downstream processing. Sends the normalized lead details to the Anthropic Messages API (Claude) to return a strict JSON classification, summary, timeline band, financing readiness, recommended agent role, and score. Parses the Claude JSON response, clamps the score to a 1–10 range, and calculates whether the lead is “ready” (score 7). If the lead is ready, sends a formatted Gmail alert to the agent and appends the lead to the “Active Leads” tab in Google Sheets. If the lead is not ready, appends the lead to the “Nurture Leads” tab in Google Sheets. Returns a confirmation message to the form submitter after the lead is routed. Setup Create an Anthropic HTTP Header Auth credential

by Milos Vranes
CgmailsheetsW
free

Handle client intake, routing, and confirmations with Claude, Google Sheets, Gmail, and Twilio

Quick overview This workflow hosts an n8n intake form, checks whether the submitted state is in your service area, uses Anthropic Claude to draft confirmation messages and an internal summary, logs requests to Google Sheets, emails via Gmail, optionally sends an SMS via Twilio, and shows the customer a confirmation page. How it works Receives a new client request through an n8n-hosted form submission. Normalizes the submitted details (name, email, phone, state, request type, description, and SMS consent) and generates a timestamp and reference number. Checks whether the submitted state is included in your configured served-area list. For in-area requests, sends the intake details to Anthropic Claude and parses the returned JSON into a customer email message, customer SMS message, internal summary, category, priority, and missing-info list. Appends the request to Google Sheets, emails the intake team and the customer via Gmail, and sends an SMS confirmation via Twilio only when the customer opted in. For out-of-area requests, appends the submission to a Google Sheets waitlist and shows the customer a waitlist message. Setup Customize the n8n Form Trigger fields and text to match you

by Milos Vranes
gmailsheetsW
free

Move data between JSON and spreadsheets

This workflow illustrates how to convert data from JSON to binary format and import JSON data or files into Google Sheets or local spreadsheets.

by Lorena