Structured Airline Data Extraction using Ollama and PGVector - n8n Workflow

Automate web check-in policy extraction using this advanced n8n workflow. Scrape airline sites, extract structured JSON via a local Ollama LLM, and store data in Google Sheets and a Postgres vector database (PGVector).

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Data analysts and researchers needing large, consistently structured datasets on airline policies.

  • AI/ML practitioners building RAG systems requiring high-quality, vectorized information about travel logistics.

  • Developers looking for advanced n8n templates that combine web scraping, local AI (Ollama), and vector database storage.

  • Users wanting to implement complex core logic flow control within an n8n workflow.

Overview

Maintaining up-to-date, structured information on diverse airline policies—such as web check-in deadlines, baggage allowances, and refund rules—is a significant data challenge. This advanced n8n workflow solves this by fully automating the data pipeline.

The n8n workflow leverages web scraping techniques (via Jina AI Reader) to handle complex airline webpages, and then uses a powerful local LLM (hosted via the Ollama n8n node) to transform the messy, unstructured text into clean, consistent JSON objects. This structured data is immediately valuable for reporting (Google Sheets) and is also converted into embeddings and indexed into a PGVector database, enabling sophisticated semantic search capabilities for building a private AI knowledge base. This sophisticated n8n template demonstrates seamless integration between classic data tools and modern AI infrastructure.

How it Works

This powerful n8n workflow operates sequentially, handling each airline URL item retrieved from the source spreadsheet:


  1. Trigger and Initialization: The process begins with a Chat Trigger, which initiates the retrieval of target URLs. The Fetch Airline URLs n8n node reads a predefined list of airline URLs and their corresponding details from a Google Sheet.

  2. Item Processing: The workflow uses the Loop Over Items n8n node to process each airline URL individually, ensuring robust handling and flow control.

  3. Data Retrieval (Scraping): The Scrape Airline Webpage n8n node uses an HTTP Request to fetch the content. It routes the original URL through the Jina AI reader service (https://r.jina.ai/) to get a clean, readable version of the webpage, crucial for accurate LLM parsing. This n8n node also handles necessary header authentication and cookie passing.

  4. AI Extraction: The Extract Info with LLM n8n node executes the core data transformation. It passes the raw webpage text into a strict instruction prompt, which dictates the output must be a specific JSON schema covering web check-in, baggage, and refund policies. The LLM operation is powered by the Chat Model n8n node configured to use Ollama.

  5. Storage (Google Sheets): The Wait for Response node ensures synchronization, and the Store Extracted Info n8n node updates the original Google Sheet using the row_number. It saves the clean, structured JSON output provided by the LLM.

  6. Vectorization: The workflow then prepares the extracted text for semantic indexing. The data passes through the Prepare Text for Vector DB node, the Split Long Text node (Token Splitter) for chunking, and the Generate Embeddings node, which uses Ollama to create the vector representations.

  7. Vector DB Insertion: Finally, the Save to Vector DB n8n node inserts these vectorized documents into the PostgreSQL Vector Database (PGVector).

  8. Flow Control (Delay): A Wait Before Next Batch n8n node introduces a short delay (15 seconds) before the Loop Over Items proceeds to the next airline, preventing rate limit issues and ensuring the stability of this automated n8n workflow.

Installation Guide

To set up this advanced n8n workflow, follow these steps:


  1. Import the n8n workflow: Copy the provided JSON data and paste it into your n8n instance using the 'New' -> 'Import from JSON' function.

  2. Set up Credentials:

Google Sheets: Provide credentials for the Google Sheets- test account used in the Fetch Airline URLs and Store Extracted Info n8n nodes. Ensure the service account has read/write access to your source spreadsheet.
Ollama: Configure the Ollama - test credentials for the Chat Model and Generate Embeddings n8n nodes. This requires your Ollama server to be accessible from your n8n installation.
Postgres: Configure the Postgres-test credentials for the Save to Vector DB n8n node, ensuring the database is running and the PGVector extension is installed.
HTTP Header Auth: Provide credentials for the Header Auth account used in the Scrape Airline Webpage n8n node, necessary if complex cookies or headers are required for the scraping URL (Jina AI).

  1. Customize Data Source: Update the Fetch Airline URLs n8n node to point to your specific Google Sheet Document ID and Sheet Name containing the list of airline URLs.

  2. Activate and Execute: Once all credentials are set and the data source is configured, activate the n8n trigger and run the n8n workflow.

Node Details

Chat Trigger - Start (n8n trigger): Initiates the n8n workflow execution.
Fetch Airline URLs (Google Sheets n8n node): Reads the input data (list of airlines and their check-in URLs) from a specified Google Sheet, using Service Account authentication.
Loop Over Items (Split In Batches n8n node): Ensures that each row (airline item) from the Google Sheet is processed sequentially, which is critical for controlled web scraping and LLM processing.
Scrape Airline Webpage (HTTP Request n8n node): Performs the actual data retrieval. It dynamically constructs the Jina AI URL using the item's 'WEB CHECK IN URL' field to scrape the clean text content.
Extract Info with LLM (Chain LLM n8n node): The core intelligence of this n8n workflow. It applies a detailed, structured prompt to the raw scraped text, forcing the LLM to output a standardized JSON object.
Chat Model / Generate Embeddings (Ollama n8n node): These nodes connect the n8n workflow to a self-hosted Ollama instance, providing both the large language model processing for extraction and the embedding model for vector generation.
Store Extracted Info (Google Sheets n8n node): Updates the original spreadsheet row using the row_number, inserting the generated structured JSON data. This is a crucial n8n node for data traceability.
Save to Vector DB (PGVector n8n node): Takes the processed documents and embeddings and inserts them into a PostgreSQL vector database, ready for advanced RAG queries. This demonstrates powerful data persistence in this n8n workflow.

Related n8n Workflows

Free

Nodes: 12 Nodes
Updated: December 26 2025
View all
Created by

The AI Squad Initiative is a pioneering effort to build, automate and scale AI-powered workflows using n8n.io. Our mission is to help individuals and businesses integrate AI agents seamlessly into their daily operations from automating tasks and enhancing productivity to creating innovative, intelligent solutions. We design modular, reusable AI workflow templates that empower creators, developers and teams to supercharge their automation with minimal effort and maximum impact.

Featured*