Skip to main content

Predict airport queue wait times and email alerts with OpenAI and SendGrid

Workflow preview

Workflow preview
100%
Predict airport queue wait times and email alerts with OpenAI and SendGrid preview
Open on n8n.io

1. Workflow Overview

Quick Overview This workflow accepts traveler flight details via webhook or runs every 5 minutes, predicts airport queue wait times with a custom JavaScript model, generates an alert message using ...

Best for

  • Miscellaneous automation workflows
  • AI Summarization automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.webhook, n8n-nodes-base.scheduletrigger, n8n-nodes-base.set, n8n-nodes-base.wait, n8n-nodes-base.code, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenai

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Oneclick AI Squad.

Original n8n.io source

1.1 Workflow description

Title
Predict airport queue wait times and email alerts with OpenAI and SendGrid
Workflow name
Predict airport queue wait times and email alerts with OpenAI and SendGrid

Quick Overview

This workflow accepts traveler flight details via webhook or runs every 5 minutes, predicts airport queue wait times with a custom JavaScript model, generates an alert message using OpenAI, emails the traveler via SendGrid, and logs the prediction to Google Sheets.

How it works

  1. Receives a POST request to a webhook with traveler/flight details or runs on a 5-minute schedule.
  2. Normalizes the incoming data into a consistent context (flight, airport/terminal, traveler contact details, and live queue inputs).
  3. Waits briefly to throttle processing, then calculates predicted security, immigration, and boarding wait times plus risk flags and an optimal arrival time.
  4. Sends the prediction to OpenAI to generate a short, traveler-friendly alert message.
  5. Formats the final alert payload (alert level, email subject/body) and prepares a row for tracking.
  6. Sends the alert email through the SendGrid Mail Send API and appends the prediction record to a Google Sheets tab.

Setup

  1. Configure the webhook URL in the system that submits traveler requests (POST to /airport-queue-check) or enable the schedule trigger for proactive runs.
  2. Add OpenAI credentials and select the chat model used to generate the traveler message.
  3. Add Google Sheets OAuth2 credentials and replace YOUR_SHEET_ID and the target range (for example, Predictions!A1:append) in the Google Sheets request URL.
  4. Add your SendGrid API key by replacing YOUR_SENDGRID_API_KEY in the Authorization header, and update the sender/recipient fields (including ensuring travelerEmail is provided by the trigger payload).

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note - Overview

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note - Stage 1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Sticky Note - Stage 2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Sticky Note - Stage 3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Webhook - Traveler Queue Request

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 1.1

Block 6 - Poll Airport Data Every 5 Min

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 7 - Normalise Traveler & Airport Context

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 8 - Wait 1 - API Rate Limit Buffer

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1

Block 9 - JS - Wait-Time Prediction Engine

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 10 - AI - Generate Traveler Alert Message

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.6

Block 11 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.3

Block 12 - JS - Format Alert Payload

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 13 - Send Email Alert via SendGrid

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 14 - Log Prediction to Google Sheets

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

3. Summary Table

Workflow Predict airport queue wait times and email alerts with OpenAI and SendGrid
Complexity intermediate
Nodes 14
Categories Miscellaneous, AI Summarization
Author Oneclick AI Squad
Published 08 Jun 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/16185/16185.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Predict airport queue wait times and email alerts with OpenAI and SendGrid do?

Quick Overview This workflow accepts traveler flight details via webhook or runs every 5 minutes, predicts airport queue wait times with a custom JavaScript model, generates an alert message using ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Miscellaneous, AI Summarization use case.