This n8n workflow implements a version of the Adaptive Retrieval-Augmented Generation (RAG) framework. It recognizes that the best way to retrieve information often depends on the type of question asked. Instead of a one-size-fits-all approach, this workflow adapts its strategy based on the user's query intent. 🌟 How it Works Receive Query: Takes a user query as input (along with context like a chat session ID and Vector Store collection ID if used as sub-workflow). Classify Query: First, the workflow classifies the query into a predefined category. This template uses four examples: Factual: For specific facts. Analytical: For deeper explanations or comparisons. Opinion: For subjective viewpoints. Contextual: For questions relying on specific background. Select & Adapt Strategy: Based on the classification, it selects a corresponding strategy to prepare for information retrieval. The example strategies aim to: Factual: Refine the query for precision. Analytical: Break the query into sub-questions for broad coverage. Opinion: Identify different viewpoints to look for. Contextual: Incorporate implied or user-specific context.
Tags
Related workflows
See all AI Automation→Route WhatsApp support requests with Claude, Supabase, HubSpot and Slack
Quick overview This workflow turns incoming WhatsApp messages (text, audio, images, and documents) into actionable support interactions by extracting content, detecting sentiment, and using an AI agent with a Supabase knowledge base to route requests to Google Calendar, HubSpot, Slack, Gmail, and back to WhatsApp. How it works Receives incoming WhatsApp messages via a WhatsApp webhook trigger. Routes the message by type and converts it into text using OpenAI Whisper for audio, OpenAI GPT-4o Vision for images, or a PDF extractor for documents (or passes text messages through). Loads the sender’s session context from Supabase and runs sentiment/language detection on the extracted text. Uses a LangChain AI agent (Claude) with Supabase vector search (with OpenAI embeddings and Cohere reranking) plus tool access (Google Calendar, HubSpot, Slack, and Gmail) to produce a structured intent, response, and metadata. Logs conversation analytics (intent, sentiment, message type, and response length) to an n8n Data Table. Routes by intent to either create a Google Calendar event, create/update a HubSpot contact, email a document via Gmail (and upload it to Google Drive), create a HubSpot ticket
Create TikTok carousel posts with Upload Post, Google Sheets, Gemini, GPT-4.1
Quick overview This workflow runs daily to pull TikTok post and profile analytics from Upload Post, updates a Google Sheets performance log, uses Google Gemini and OpenAI to generate a new carousel concept and caption, creates four images via fal.ai, publishes to TikTok, and updates a persistent “Agent Skill” sheet. How it works Runs on a daily schedule (or manually) and loads product, Upload Post, and Google Sheets configuration values. Reads the Google Sheets “Performance Log,” selects posts missing stats or posted recently, fetches TikTok post analytics from the Upload Post API, and writes updated metrics back to the sheet. Aggregates the refreshed history, fetches TikTok profile analytics from Upload Post, reads the “Agent Skill” sheet, and compiles a single context summary. Uses Google Gemini (via a structured JSON output) to generate a TikTok carousel plan including caption, strategy notes, four slide prompts, hashtags, and an engagement question. Sends the four prompts to fal.ai to generate four 9:16 PNG carousel images and collects their hosted image URLs. Uses OpenAI (GPT-4.1) to write a short TikTok photo-post description, publishes the carousel to TikTok via Upload Post
AI agent chat
This workflow employs OpenAI's language models and SerpAPI to create a responsive, intelligent conversational agent. It comes equipped with manual chat triggers and memory buffer capabilities to ensure seamless interactions. To use this template, you need to be on n8n version 1.50.0 or later.