Answer Instagram FAQ DMs using Google Gemini and Qdrant from Google Drive

Go to Workflow
0 views
Built by Fahmi Fahreza Fahmi Fahreza
Created on August 14, 2026

Description

Quick Overview
This workflow answers Instagram DMs using a Google Gemini RAG agent backed by a Qdrant vector store, while automatically ingesting new PDF files from Google Drive into the knowledge base and refreshing the Instagram access token on a schedule.

How it works
Triggers when an Instagram message is received and filters out echoes and empty messages.
Uses a Google Gemini chat model with chat memory and a Qdrant retriever tool to generate a context-grounded FAQ response.
Sends the generated reply back to the sender as an Instagram DM.
Runs on a daily schedule to refresh the Instagram access token.
Triggers when a new file is created in a specific Google Drive folder and allows only supported MIME types (PDF).
Downloads the file, processes items in batches, generates embeddings with Google Gemini, and inserts the document vectors into a Qdrant collection for retrieval.

Setup
Add Instagram Graph API credentials, set the trigger verify token, and configure the Instagram app/webhook to call the workflow’s Instagram trigger.
Add Google Gemini (PaLM) API credentials for both the chat model and embedding generation.
Add Qdrant credentials and ensure the target collection (for example, "n8n-rag-template") exists and matches your embedding dimensions.
Add Google Drive OAuth2 credentials and set the folder to watch (and ensure it contains the PDFs you want indexed).
Adjust the allowed MIME type filters and schedule interval to match your content types and token refresh needs.

Nodes Used (8)

AI Agent
@n8n/n8n-nodes-langchain.agent
Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader
Embeddings Google Gemini
@n8n/n8n-nodes-langchain.embeddingsGoogleGemini
Google Drive
n8n-nodes-base.googleDrive
Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini
Qdrant Vector Store
@n8n/n8n-nodes-langchain.vectorStoreQdrant
Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter
Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow