- Home
- Resources
- Integrations
- Question and Answer Chain
n8n Question and Answer Chain nodeConfigure Question and Answer Chain in n8n.
The n8n Question and Answer Chain node answers a question using documents you already indexed. It exposes 2 parameters, Source for Prompt (User Message) and Options, and runs on 2 connected sub-nodes, a chat model and a retriever. Built for teams shipping a docs assistant.
Verified Trustpilot reviews · AI, automation & growth agency
What does the n8n Question and Answer Chain node actually do?
It takes a question, hands it to a retriever, a sub-node that searches an indexed source and returns the matching passages, then asks a chat model to answer using only those passages. A sub-node is a small node you plug into a port on the side of a bigger one, and it never runs on its own. The chain gives back one answer per incoming item, with no memory of the previous question.
First scenario: an internal support desk. A vector store holds your help center, a Vector Store Retriever reads it, and the chain answers each ticket with the passage that applies. Post the result into Slack and the on-call person gets a draft instead of a search box.
Second scenario: a contract or PDF review. The template 1960 on n8n.io does exactly that, a file lands in Google Drive, gets split and embedded, and the chain answers questions about it afterwards. Here Source for Prompt (User Message) is set to define and Prompt (User Message) carries an expression such as {{ $json.question }}.
Third scenario: a chat window on top of your own documentation. Set the prompt source to auto, wire a Chat Trigger in front, and each message that arrives with a chatInput field becomes a question.
When to pick something else. This chain retrieves and answers, nothing more. If the job needs several steps, a decision, or a call out to another service, the AI Agent node is the right root node, and you give it tools through AI Agent Tool. If nothing has to be retrieved at all, a plain model call from OpenAI or Anthropic is lighter.
Known limits: both ports are required, so the node fails on an empty Retriever with an explicit error. Answers run short by default, and the fix sits in the model sub-node or in splitting the work across several prompts, one question at a time. Nothing is remembered from one item to the next either, so a follow-up question has to carry its own context. The provider behind your model bills its own API calls under its own terms, n8n adds nothing on top.
What do you plug into the node?
The chain is a root node: the workflow feeds its main input, and the two boxes below hang off ports on its underside, one type of sub-node per port.
Ports (what plugs in)
- Chat Model
ai_languageModelrequired - Retriever
ai_retrieverrequired
01Chat Model
This port holds the model that writes the final sentence from the retrieved passages. It also carries the provider credential, which is why the chain itself has nothing to authenticate.
Key parameters
- Required: leave it empty and the chain cannot run.
- OpenAI Chat Model or Anthropic Chat Model: the two most common starting points in the templates.
- Google Gemini Chat Model or Ollama Chat Model: pick the second one when the workflow must stay on your own machine.
02Retriever
This port decides where the context comes from. The retriever receives the question, searches its source, and returns the passages the model is allowed to use.
Key parameters
- Required: with no retriever attached, the run stops on a Retriever sub-node error.
- Vector Store Retriever: reads a store you filled earlier, the usual choice for indexed documents.
- Workflow Retriever or MultiQuery Retriever: the first calls another workflow for context, the second rewrites the question into several searches.
Which parameters do you set on the node?
The Question and Answer Chain node has 2 parameters. For each one: the node as you configure it in n8n, what the parameter changes, and our field notes.
Parameters index
Source for Prompt (User Message)
promptTypeWhat you see in n8n
Notes & use cases
This selector tells the chain where the question comes from. It is the first thing to get right, because an empty prompt is the most frequent error on this node.
Key parameters
- Connected Chat Trigger Node (
auto): looks for achatInputfield coming from a directly connected Chat Trigger. - Define below (
define): use an expression to reference data from earlier nodes, or type static text. - Prompt (User Message): the question itself, required once you define it below, often
{{ $json.question }}.
Options
optionsWhat you see in n8n
Notes & use cases
A collection you grow with Add Option. Nothing here is mandatory, and both entries matter once the chain leaves a test run and starts working through a list.
Key parameters
- System Prompt Template: the template string used for the system prompt. It has to include the
{context}variable for the retrieved context, plus{question}for text completion models. - Batch Processing: batch processing options for rate limiting, useful when a single execution sends many questions in a row.
Need help automating Question and Answer Chain with n8n?
A person reads every message.
Questions people ask next
01Is the Question and Answer Chain node included in n8n?
02What do you need to make the n8n Question and Answer Chain node work?
03What are the limits of this node?
04What has to be connected at minimum, and where do you start?
05n8n or Make for a retrieval question answering flow?
Get our weekly integration tips.
No spam. Unsubscribe anytime.



