AutomationFlowsAI & RAG › Qa Chain

Qa Chain

QA-chain. Uses executeWorkflowTrigger, chainRetrievalQa, lmChatOpenAi, retrieverVectorStore. Event-driven trigger; 6 nodes.

Event trigger★★☆☆☆ complexityAI-powered6 nodesExecute Workflow TriggerChain Retrieval QaOpenAI ChatRetriever Vector StoreQdrant Vector StoreOpenAI Embeddings
AI & RAG Trigger: Event Nodes: 6 Complexity: ★★☆☆☆ AI nodes: yes Added:

This workflow follows the Chainretrievalqa → Retrievervectorstore recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "QA-chain",
  "nodes": [
    {
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "query"
            }
          ]
        }
      },
      "id": "c055762a-8fe7-4141-a639-df2372f30060",
      "typeVersion": 1.1,
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        260,
        340
      ]
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.query }}",
        "options": {
          "systemPromptTemplate": "You are a multilingual AI assistant specializing in document analysis and question answering. Your task is to use the provided context to answer questions in the same language they were asked, regardless of the language of the source documents.\n\nFollow these guidelines:\n\nCarefully analyze the given context to extract relevant information.\n\nIf the question is in a different language than the context (e.g., Korean question with English context), first understand the question\u2019s intent.\n\nSearch for relevant information in the context, even if it\u2019s in a different language.\n\nProvide a comprehensive answer based on the information found in the context.\n\nProvide your answer in the same language as the question was asked.\n\nIf the context contains information but you need to translate it to match the question language, do so accurately while preserving the original meaning.\n\nIf you cannot find relevant information in the context, acknowledge this limitation in your answer.\n\nNever invent information not present in the context.\n\nWhen answering in a language different from the context, ensure your translation maintains the original technical concepts and terminology.\n\nFor complex or technical topics, consider providing both the original terms and their translations for clarity.\n\nAfter each piece of information used in your answer, cite the source document using the format [Attach: Document Title, Page X] or [Document Title, Page X] if author information is not available.\n\nAt the end of your answer, include a \u201cReferences\u201d section listing all cited sources with:\n\nAuthor(s) name(s) when available\n\nDocument title\n\nPublication year if available\n\nPage numbers referenced in your answer\n\nUse the following pieces of context to answer the user\u2019s question:\n\n{context}\n\nRemember: Always respond in the same language as the question, providing a complete and academic-style answer based solely on the information available in the context. Include academic-style citations for each piece of information and provide a proper references section at the end of your answer."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.chainRetrievalQa",
      "typeVersion": 1.5,
      "position": [
        480,
        340
      ],
      "id": "af5d2fd2-0476-4bc8-9772-8d63f8da053f",
      "name": "Question and Answer Chain"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        360,
        520
      ],
      "id": "f9cba962-9eb2-448c-b554-0a0968f64767",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {},
      "type": "@n8n/n8n-nodes-langchain.retrieverVectorStore",
      "typeVersion": 1,
      "position": [
        520,
        540
      ],
      "id": "8d6f8b6a-315d-4385-8f82-c6cab78aac2d",
      "name": "Vector Store Retriever"
    },
    {
      "parameters": {
        "qdrantCollection": {
          "__rl": true,
          "value": "docs",
          "mode": "list",
          "cachedResultName": "docs"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "typeVersion": 1.1,
      "position": [
        440,
        680
      ],
      "id": "3e5bf843-ce3a-419d-a4a0-8d9f26860d3f",
      "name": "Qdrant Vector Store",
      "credentials": {
        "qdrantApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "typeVersion": 1.2,
      "position": [
        420,
        800
      ],
      "id": "c899afcc-32c2-443f-9c06-d41eb235f8e1",
      "name": "Embeddings OpenAI",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Question and Answer Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Question and Answer Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Vector Store Retriever": {
      "ai_retriever": [
        [
          {
            "node": "Question and Answer Chain",
            "type": "ai_retriever",
            "index": 0
          }
        ]
      ]
    },
    "Qdrant Vector Store": {
      "ai_vectorStore": [
        [
          {
            "node": "Vector Store Retriever",
            "type": "ai_vectorStore",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "0da1c766-fd8b-42e0-b4a1-f1528bd961af",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "JJaI1r2cpbHsIzKI",
  "tags": []
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

QA-chain. Uses executeWorkflowTrigger, chainRetrievalQa, lmChatOpenAi, retrieverVectorStore. Event-driven trigger; 6 nodes.

Source: https://github.com/aieeiee/fc_nocoderag/blob/main/workflow/QA_chain.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

This workflow is designed to process PDF documents using Mistral's OCR capabilities, store the extracted text in a Qdrant vector database, and enable Retrieval-Augmented Generation (RAG) for answering

HTTP Request, OpenAI Embeddings, Document Default Data Loader +9
AI & RAG

This workflow integrates a Retrieval-Augmented Generation (RAG) system with a post-sales AI agent for WooCommerce. It combines vector-based search (Qdrant + OpenAI embeddings) with LLMs (Google Gemini

Chain Retrieval Qa, Google Gemini Chat, Retriever Vector Store +9
AI & RAG

Build AI Voice Assistent with VAPI. Uses chainRetrievalQa, lmChatGoogleGemini, retrieverVectorStore, vectorStoreQdrant. Webhook trigger; 25 nodes.

Chain Retrieval Qa, Google Gemini Chat, Retriever Vector Store +9
AI & RAG

QdrantVectorStore:*. Uses manualTrigger, embeddingsOpenAi, documentDefaultDataLoader, textSplitterTokenSplitter. Event-driven trigger; 18 nodes.

OpenAI Embeddings, Document Default Data Loader, Text Splitter Token Splitter +5
AI & RAG

Webhook Respondtowebhook. Uses stickyNote, manualTrigger, googleDrive, documentDefaultDataLoader. Event-driven trigger; 17 nodes.

Google Drive, Document Default Data Loader, Text Splitter Recursive Character Text Splitter +6