- Home
- Resources
- Integrations
- Contextual AI
Contextual AI n8n integrationAutomate Contextual AI with n8n.
Contextual AI answers questions over your own documents, and this node puts that work inside a workflow. The Contextual AI n8n integration covers 13 operations across 6 resources, from creating an agent to reranking a shortlist. No trigger ships with it, so another node starts the run.
Community node This node is not shipped with n8n: it is a community package (n8n-nodes-contextualai) you install from Settings › Community nodes on a self-hosted instance. npm
Verified Trustpilot reviews · AI, automation & growth agency
What does the Contextual AI n8n integration actually do?
The node exposes 13 operations across 6 resources: Agent to create and manage an assistant, Datastore to hold and ingest the documents it answers from, Query to ask that agent a question, Reranker to reorder a list of documents against a query, LMUnit to score a response against a written test, and Parser to extract text from a file. Each one maps to a step you would otherwise call by hand.
Take a support knowledge base first. A Schedule Trigger fires every morning, Ingest Document pushes the night's new PDFs into a datastore, and the document IDs land in a Slack channel so the team sees what was added. Nobody uploads anything by hand.
Second case, an internal search desk. A form or a chat message carries the question, Query agent sends it to a named agent, and the answer goes back to the person who asked. Turn on Retrievals Only and the same operation returns the source chunks instead of a written answer, which is handy when the goal is a list of documents rather than a paragraph.
Third case, better context for a model. Rerank documents scores a rough shortlist against the question and keeps the top results, and only those go to an AI Agent or an OpenAI step. Run LMUnit then checks the answer against a written rule before the workflow sends anything out.
Some things sit outside the node. It has no trigger, so a workflow starts with a Schedule Trigger on a fixed interval, an n8n Webhook called by another service, or the trigger of a different tool. Parsing is asynchronous: Parse Document returns a job, and you poll Parse Status until the result is ready. List operations page through results with Limit and Cursor rather than a Return All toggle.
When an endpoint of the Contextual AI API is missing from the node, the HTTP Request node calls it directly and reuses the same credential through predefined authentication. If you are still deciding whether the platform fits, the n8n review covers what it does well and where it hurts.
How do you connect Contextual AI to n8n?
- 01
Install the community package
Open Settings, go to Community nodes and install
n8n-nodes-contextualai. This works on a self-hosted instance, whether it runs through Docker or npm; on n8n Cloud, only verified community nodes can be installed. After the install, the Contextual AI node shows up in the node panel like any other. - 02
Create the API Key credential
In the Credentials menu, add a Contextual AI API credential and paste your key. The node authenticates with an API Key, stored under the credential type
contextualAiApi. A credential is created once and reused in every workflow, so a key rotation is a single edit rather than a tour of every node. - 03
Pick the credential in the node
Drop the Contextual AI node on the canvas and choose the credential in its dropdown. Then select a resource, Agent, Datastore, Query, Reranker, LMUnit or Parser, and the operation you want. A quick run of List Agents is the cheapest way to confirm the key works, since it reads data and changes nothing.
What can the Contextual AI node do?
The Contextual AI node exposes 13 operations across 6 resources. For each one: the node as you configure it in n8n, the required fields, and our field notes.
| Resource | Create Agent | Create Datastore | Delete Agent | Get Document Metadata | Ingest Document | List Agents | List Datastores | Parse Document | Parse Result | Parse Status | Query agent | Rerank documents | Run LMUnit |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Agent | ✓ | ✓ | ✓ | ||||||||||
| Datastore | ✓ | ✓ | ✓ | ✓ | |||||||||
| Query | ✓ | ||||||||||||
| Reranker | ✓ | ||||||||||||
| LMUnit | ✓ | ||||||||||||
| Parser | ✓ | ✓ | ✓ |
Operations index
Agent
3 operationsCreate Agent
Agent.Create AgentWhat you see in n8n
Notes & use cases
One run sets up an agent, its datastore and the first documents. The response carries the agent identifier you reuse in every later operation.
Key parameters
- Agent Name: the name the new agent gets, for example a customer support bot.
- Configuration Mode: Pre-Built uses an Agent Composer template, Custom takes your own YAML in Custom Template.
- Pre-Built Template: Simple Search for fast multi-modal retrieval, Agentic Search for multi-step reasoning and tool use.
- Datastore Configuration: create a store with Datastore Name, or attach existing ones with Datastore IDs.
- System Prompt: the instructions the agent references when it generates a response.
List Agents
Agent.List AgentsWhat you see in n8n
Notes & use cases
Reads back every agent on the account with its identifier, so a workflow can look one up by name instead of carrying a hard coded ID.
Key parameters
- Limit: required, the maximum number of agents returned in one call.
- Cursor: the value returned by the previous call, used to fetch the next set of results.
Delete Agent
Agent.Delete AgentWhat you see in n8n
Notes & use cases
Removes an agent for good. The operation is irreversible, so it belongs behind a condition rather than in the middle of a happy path.
Key parameters
- Agent ID: required, the identifier of the agent to delete, usually
{{ $json.id }}from a List Agents step.
Datastore
4 operationsCreate Datastore
Datastore.Create DatastoreWhat you see in n8n
Notes & use cases
Sets up an empty store that documents get ingested into later. Useful when the datastore has to exist before anything else runs.
Key parameters
- Datastore Name: required, the name of the store, for example the one holding product documentation.
- Configuration (JSON String): the store configuration as stringified JSON; left empty, the default configuration applies.
Ingest Document
Datastore.Ingest DocumentWhat you see in n8n
Notes & use cases
Pushes a file from the incoming item into a datastore, where it becomes searchable material for an agent.
Key parameters
- Datastore ID: required, the store the document goes into.
- Input Binary Field(s): the binary field name on the incoming item; left empty, every binary field is ingested.
- Metadata (JSON String): a stringified JSON metadata request whose
custom_metadatais a flat set of key and value pairs.
Get Document Metadata
Datastore.Get Document MetadataWhat you see in n8n
Notes & use cases
Reads the metadata and the processing status of one document, which is how a workflow finds out whether ingestion actually finished.
Key parameters
- Datastore ID: required, the store that holds the document.
- Document ID: required, the identifier of the document being inspected.
List Datastores
Datastore.List DatastoresWhat you see in n8n
Notes & use cases
Brings back the stores on the account, optionally narrowed to the ones an agent is linked to.
Key parameters
- Limit: required, the maximum number of stores returned in one call.
- Cursor: the value from the previous call, used to walk to the next page.
- Agent ID: filters the list down to the stores linked to that agent.
Query
1 operationQuery agent
Query.Query agentWhat you see in n8n
Notes & use cases
Sends a question to an agent and returns its answer, grounded in the documents that agent can see.
Key parameters
- Agent ID: required, which agent answers.
- Query: required, the question itself, often
{{ $json.question }}from a form. - Retrievals Only: on, the operation fetches retrievals and skips generation.
- Include Retrieval Content Text: adds the text of the retrieved contents to the response.
- Conversation ID: continues an existing conversation; set it and the conversation history is ignored.
Reranker
1 operationRerank documents
Reranker.Rerank documentsWhat you see in n8n
Notes & use cases
Scores a set of texts against a question and returns them in order of relevance, so only the useful ones move on.
Key parameters
- Query: required, the question the documents are scored against.
- Documents: required, a comma separated list of document texts.
- Model:
ctxl-rerank-v2-instruct-multilingual, its mini variant, orctxl-rerank-v1-instruct. - Top N: how many top ranked results come back; leave it at 0 to return all of them.
- Instruction: an optional steer for the reranker.
LMUnit
1 operationRun LMUnit
LMUnit.Run LMUnitWhat you see in n8n
Notes & use cases
Grades a response against a written rule, which turns a vague feeling about answer quality into something a workflow can branch on.
Key parameters
- Query: required, the question that was asked.
- Response: required, the answer being evaluated.
- Unit Test: required, the rule the response has to satisfy, written as a sentence.
Parser
3 operationsParse Document
Parser.Parse DocumentWhat you see in n8n
Notes & use cases
Starts a parse job on a file carried by the incoming item. It returns the job, not the parsed text, so the workflow continues with the two operations below.
Key parameters
- Input Binary Field(s): the binary field name on the incoming item to parse.
- Parse Mode: Standard is the mode on offer.
- Figure Caption Mode: Concise or Detailed captions for figures.
- Enable Document Hierarchy: keeps the structure of the document.
- Page Range: narrows the job to a slice of pages.
Parse Status
Parser.Parse StatusWhat you see in n8n
Notes & use cases
Tells you where a parse job stands. It is the polling step between starting a job and collecting what it produced.
Key parameters
- Job ID: required, the identifier of the parse job to check, taken from the operation that started it.
Parse Result
Parser.Parse ResultWhat you see in n8n
Notes & use cases
Collects the output of a finished parse job and hands it to the rest of the workflow.
Key parameters
- Job ID: required, the identifier of the parse job to retrieve results for.
- Output Types: a comma separated list among
markdown-document,markdown-per-pageandblocks-per-page.
Need help automating Contextual AI with n8n?
A person reads every message.



