Skip to main content

Convert tour PDFs to vector database using Google Drive, LangChain & OpenAI

Workflow preview

Workflow preview
100%
Convert tour PDFs to vector database using Google Drive, LangChain & OpenAI preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Workflow: Process Tour PDF from Google Drive to Pinecone Vector DB with OpenAI Embeddings Overview This workflow automates the process of extracting tour information from PDF files stored in a G...

Best for

  • Document Extraction automation workflows
  • AI RAG automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-base.googledrive, n8n-nodes-base.splitinbatches, @n8n/n8n-nodes-langchain.vectorstorepinecone, @n8n/n8n-nodes-langchain.embeddingsopenai, @n8n/n8n-nodes-langchain.documentdefaultdataloader, @n8n/n8n-nodes-langchain.textsplitterrecursivecharactertextsplitter, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Mohan Gopal.

Original n8n.io source

1.1 Workflow description

Title
Convert tour PDFs to vector database using Google Drive, LangChain & OpenAI
Workflow name
Convert tour PDFs to vector database using Google Drive, LangChain & OpenAI

🧩 Workflow:

Process Tour PDF from Google Drive to Pinecone Vector DB with OpenAI Embeddings

Overview

This workflow automates the process of extracting tour information from PDF files stored in a Google Drive folder, processes and vectorizes the extracted data, and stores it in a Pinecone vector database for efficient querying. This is especially useful for building AI-powered search or recommendation systems for travel packages.

Setup:

Prerequisites

A folder in Google Drive with PDF tour package brochures.

Pinecone account + API key

OpenAI API key

n8n cloud or self-hosted instance

Workflow Setup Steps

Trigger

Manual Trigger (When clicking 'Test workflow'): Used for manual testing and execution of the workflow.

Google Drive Integration

Step 1: Store Tour Packages in PDF Format

Upload your curated tour packages containing the tours, activities and sight-seeings in PDF format into a designated Google Drive folder.

Step 2: Search Folder

Node: PDF Tour Package Folder (Google Drive)

This node searches the designated folder for files (filter by MIME type = application/pdf if needed).

Step 3: Download PDFs

Node: Download Package Files (Google Drive)

Downloads each matching PDF file found in the previous step.

Process Each PDF File

Step 4: Loop Through Files

Node: Loop Over each PDF file

Iterates through each downloaded PDF file to extract, clean, split, and embed.

Data Preparation & Embedding

Step 5: Data Loader

Node: Data Loader

Reads each PDF’s content using a compatible loader. It passes clean raw text to the next node.

Often integrated with document loaders like pdf-loader, Unstructured, or pdfplumber.

Step 6: Recursive Text Splitter

Node: Recursive Character Text Splitter

Splits large chunks of text into manageable segments using overlapping window logic (e.g., 500 tokens with 50 token overlap).

This ensures contextual preservation for long documents during embedding.

Step 7: Generate Embeddings

Node: Embeddings OpenAI

Uses text-embedding-3-small model to vectorize the split chunks.

Outputs vector representations for each content chunk.

Store in Pinecone

Step 8: Pinecone Vector Store

Node: Pinecone Vector Store - Store...

Stores each embedding along with its metadata (source PDF name, chunk ID, etc.).

This becomes the basis for fast, semantic search via RAG workflows or agents.

🛠️ Tools & Nodes Used

Google Drive (Search & Download)

Searches for all PDF files in a specified Google Drive folder. Downloads each file for processing. SplitInBatches (Loop Over Items)

Loops through each file found in the folder, ensuring each is processed individually. Default Data Loader (LangChain)

Reads and extracts text from the PDF files. Recursive Character Text Splitter (LangChain)

Splits the extracted text into manageable chunks for embedding. OpenAI Embeddings (LangChain)

Converts each text chunk into a vector using OpenAI’s embedding model. Pinecone Vector Store (LangChain)

Stores the resulting vectors in a Pinecone index for fast similarity search and querying.

🔗 Workflow Steps Explained

Trigger:

The workflow starts manually for testing or can be scheduled.

Google Drive Search:

Finds all PDF files in the specified folder.

Loop Over Files:

Each file is processed one at a time using the SplitInBatches node.

Download File:

Downloads the current PDF file from Google Drive.

Extract Text:

The Default Data Loader node reads the PDF and extracts its text content.

**Text Splitting: **

The Recursive Character Text Splitter breaks the text into chunks (e.g., 1000 characters with 50 overlap) to optimize embedding quality.

**Vectorization:

**Each chunk is sent to the OpenAI Embeddings node to generate vector representations.

Store in Pinecone:

The vectors are inserted into a Pinecone index, making them available for semantic search and recommendations.

🚀 What Can Be Improved in the Next Version?

**Error Handling: **

Add error handling nodes to manage failed downloads or extraction issues gracefully.

File Type Filtering:

Ensure only PDF files are processed by adding a filter node.

Metadata Storage:

Store additional metadata (e.g., file name, tour ID) alongside vectors in Pinecone for richer search results.

**Parallel Processing: **

Optimize for large folders by processing multiple files in parallel (with care for API rate limits).

Automated Triggers:

Replace manual trigger with a time-based or webhook trigger for full automation.

Data Validation:

Add checks to ensure extracted text contains valid tour data before vectorization.

User Feedback:

Integrate notifications (e.g., email or Slack) to inform when processing is complete or if issues arise.

💡 Summary

This workflow demonstrates how n8n can orchestrate a powerful AI data pipeline using Google Drive, LangChain, OpenAI, and Pinecone. It’s a great foundation for building intelligent search or recommendation features for travel and tour data.

Feel free to ask for more details or share your improvements!

Let me know if you want to see a specific part of the workflow or need help with a particular node!

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 - When clicking ‘Test workflow’

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

Block 2 - PDF Tour Package Folder

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 3 - Download Package Files

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 4 - Loop Over each PDF file

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 5 - Pinecone Vector Store - Store Vector Data

Type / Role
@n8n/n8n-nodes-langchain.vectorStorePinecone - vectorStorePinecone
Config choices
Version 1.1

Block 6 - Embeddings OpenAI

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1.2

Block 7 - Data Loader

Type / Role
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - documentDefaultDataLoader
Config choices
Version 1

Block 8 - Recursive Character Text Splitter

Type / Role
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - textSplitterRecursiveCharacterTextSplitter
Config choices
Version 1

Block 9 - Sticky Note

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

Block 10 - Sticky Note1

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

3. Summary Table

Workflow Convert tour PDFs to vector database using Google Drive, LangChain & OpenAI
Complexity intermediate
Nodes 10
Categories Document Extraction, AI RAG
Author Mohan Gopal
Published 21 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/5085/5085.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 Convert tour PDFs to vector database using Google Drive, LangChain & OpenAI do?

Workflow: Process Tour PDF from Google Drive to Pinecone Vector DB with OpenAI Embeddings Overview This workflow automates the process of extracting tour information from PDF files stored in a G...

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 Document Extraction, AI RAG use case.