π¬ Rebook disrupted flights and notify passengers with Claude, Google Sheets, and Twilio
β‘ 14 views Β· π¬ Support Chatbots
Description
Quick overview
This workflow runs on a schedule to check flight status against active bookings in Google Sheets, logs an IROPS audit trail, and for severe delays or cancellations uses Anthropic Claude to choose the best alternate flight from inventory and sends passengers an SMS via Twilio.
How it works
- Runs every few minutes on a scheduled trigger.
- Pulls the latest FlightStatus and active Bookings data from Google Sheets via the Google Sheets API.
- Matches each active booking to its flight status, calculates an impact level (On Time, Minor Delay, Severe Delay, or Cancelled), and splits the results into one item per passenger.
- Appends a timestamped status record for every booking to the OpsLog tab in Google Sheets.
- For bookings marked Cancelled or Severe Delay, fetches alternate flight inventory from Google Sheets and filters to same-route, seats-available options that match the passengerβs cabin class.
- Sends the candidate flights and passenger context to Anthropic Claude to select the best alternative and generate a short SMS message (with a safe fallback if parsing fails).
- Writes the rebooking decision to the Rebookings tab in Google Sheets and sends the notification SMS to the passenger using Twilio.
Setup
- Create an Anthropic API credential in n8n and select it for the Anthropic Claude model used to generate rebooking decisions.
- Add Google OAuth2 credentials (or update the HTTP Request authentication) and replace YOUR_SHEET_ID in all Google Sheets API requests.
- Prepare a Google Sheet with tabs and headers for FlightStatus, Bookings (with an βActiveβ status column), Inventory, OpsLog, and Rebookings.
- Add Twilio credentials (Account SID and auth, plus a Twilio phone number) and replace YOUR_TWILIO_ACCOUNT_SID, YOUR_TWILIO_PHONE_NUMBER, and the Authorization header value in the Twilio request.
- Adjust the schedule interval and (if needed) the delay thresholds used to classify Minor vs Severe delay before activating the workflow.
π Nodes Used
HTTP Request, Schedule Trigger, Filter, AI Agent, Anthropic Chat Model
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File