See llms.txt for all machine-readable content.

Back to Templates

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

Created by

Created by: Fahmi Fahreza || fahmiiireza
Fahmi Fahreza

Last update

Last update 21 hours ago

Categories

Share


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

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

Setup

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