Resources · n8n integration

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

Why automate

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.

Connect

How do you connect Contextual AI to n8n?

  1. 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.

  2. 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.

  3. 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.

Actions

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.

Resources × operations matrix
ResourceCreate AgentCreate DatastoreDelete AgentGet Document MetadataIngest DocumentList AgentsList DatastoresParse DocumentParse ResultParse StatusQuery agentRerank documentsRun LMUnit
Agent✓✓✓
Datastore✓✓✓✓
Query✓
Reranker✓
LMUnit✓
Parser✓✓✓

Agent

3 operations
01

Create Agent

Agent.Create Agent

What 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.
Use cases
stand up a product support agent from a folder of manuals in a single execution.
02

List Agents

Agent.List Agents

What 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.
Use cases
check what already exists before a workflow creates a second agent with the same purpose.
03

Delete Agent

Agent.Delete Agent

What 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.
Use cases
clean up the throwaway agents a test workflow created, once the run is reviewed and approved.

Datastore

4 operations
04

Create Datastore

Datastore.Create Datastore

What 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.
Use cases
give each client or product line its own store, created from a row in a spreadsheet at onboarding time.
05

Ingest Document

Datastore.Ingest Document

What 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_metadata is a flat set of key and value pairs.
Use cases
feed contracts arriving as email attachments straight into the store, tagged with the client name.
06

Get Document Metadata

Datastore.Get Document Metadata

What 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.
Use cases
loop with a Wait step after ingestion and only notify the team once the status says the document is ready.
07

List Datastores

Datastore.List Datastores

What 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.
Use cases
build a weekly inventory of stores and their agents, dropped into a sheet for review.

Query

1 operation
08

Query agent

Query.Query agent

What 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.
Use cases
answer a customer question from the help center without a human reading three manuals.

Reranker

1 operation
09

Rerank documents

Reranker.Rerank documents

What 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, or ctxl-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.
Use cases
trim a wide search result down to the handful of passages a model should actually read.

LMUnit

1 operation
10

Run LMUnit

LMUnit.Run LMUnit

What 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.
Use cases
hold back any reply that fails the test and route it to a human review queue instead.

Parser

3 operations
11

Parse Document

Parser.Parse Document

What 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.
Use cases
turn a scanned supplier catalog into structured text before anything reads it.
12

Parse Status

Parser.Parse Status

What 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.
Use cases
pair it with a Wait node so a long document gets time to finish instead of failing the branch.
13

Parse Result

Parser.Parse Result

What 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-page and blocks-per-page.
Use cases
pull a parsed report as one markdown document, then ingest it into a datastore in the next step.
Need help

Need help automating Contextual AI with n8n?

A person reads every message.

FAQ

Contextual AI and n8n, the questions that come up

01Is the Contextual AI n8n integration free?
There is nothing to pay on the n8n side. The node itself is a community node, which means it does not ship with n8n: it is the npm package n8n-nodes-contextualai, installed from Settings then Community nodes. That install is available on a self-hosted instance, running through Docker or npm, and n8n Cloud accepts verified community nodes only. Everything else stays the same as with a built-in node: the same canvas, the same credentials menu, the same executions. What Contextual AI itself costs is a separate question and is not covered here.
02What credentials does the Contextual AI node need?
An API Key, stored in n8n under the credential type contextualAiApi. You create it once from the Credentials menu, paste the key, and every workflow reuses the same entry: the node simply offers it in a dropdown. That matters more than it sounds, because rotating the key later means editing one credential rather than opening each node one by one. The HTTP Request node can reuse the same credential through predefined authentication, so a call to an endpoint the node does not cover still authenticates the same way.
03What are the limits of the Contextual AI node?
The node covers 13 operations across 6 resources, so anything outside that list is not there. There is no trigger, which shapes how a workflow starts. Parsing runs as a job, so Parse Document does not hand back text directly: you check Parse Status and then collect Parse Result. The list operations return a page at a time and expect a required Limit plus a Cursor from the previous call, rather than a Return All switch. For any endpoint of the Contextual AI API that the node skips, the HTTP Request node calls it and reuses the same credential.
04Can Contextual AI trigger an n8n workflow in real time?
No, because there is no Contextual AI trigger node in n8n. A workflow that uses this integration starts somewhere else: a Schedule Trigger firing on a fixed interval, an n8n Webhook, which is a URL another service calls when something happens on its side, or the trigger of a different tool already in the workflow. In practice that covers most needs. A nightly Schedule Trigger handles document ingestion, and a Webhook handles a question typed into a form, with the Contextual AI node sitting downstream of either one.
05n8n or Make for Contextual AI?
It depends on where the data has to live and how you want to pay. Make is hosted by Make, with no self-hosting option, and it bills per operation, so a workflow that parses hundreds of pages is priced by volume. n8n runs on your own servers through Docker or npm, or on n8n Cloud, and the workflow is identical either way. One detail decides it here: this is a community node, so the self-hosted route is what lets you install the package. Both build workflows visually, so the choice is about hosting and cost model, not about comfort.