
CONTEXTUAL AI n8n INTEGRATION: AUTOMATE CONTEXTUAL AI WITH N8N
CONTEXTUAL AI N8N INTEGRATION: AUTOMATE CONTEXTUAL AI WITH N8N
Need help automating Contextual Ai with n8n?
Our team will get back to you in minutes.
Why automate Contextual Ai with n8n?
The Contextual AI n8n integration gives you access to 13 actions spanning document parsing, datastore management, AI agent operations, and intelligent document reranking. This means you can build end-to-end AI document processing pipelines that run automatically, connecting Contextual AI's powerful capabilities to hundreds of other applications in your n8n workspace.
The benefits are substantial. First, significant time savings: no more manually uploading documents, checking parse statuses, or querying agents one by one. Set up workflows that handle these operations automatically based on triggers from other apps. Second, improved responsiveness: documents can be parsed and ingested the moment they arrive in your system, and agent queries can be triggered instantly when specific conditions are met. Third, seamless integration: connect Contextual AI to your CRM, file storage, databases, communication tools, and any of n8n's 400+ integrations to create unified AI-powered workflows.
Concrete examples of what you can build: automatically parse PDFs uploaded to Google Drive and store results in Airtable; create AI agents on-the-fly based on form submissions; build a Slack bot that queries your Contextual AI agent and returns answers in channels; rerank search results based on user queries and feed them into your application. The possibilities multiply when you combine Contextual AI with n8n's workflow orchestration capabilities.
How to connect Contextual Ai to n8n?
! 1 stepHow to connect Contextual Ai to n8n?
- 01
Add the node
Search and add the node in your workflow.
TIP💡 TIP: Create separate API keys for development and production environments. This way, you can test workflows safely without affecting your live Contextual AI setup, and you'll have cleaner audit trails for API usage.- 01
Need help automating Contextual Ai with n8n?
Our team will get back to you in minutes.
Contextual Ai actions available in n8n
01 Action 01Parse Document
The Parse Document action is your gateway to extracting structured content from documents using Contextual AI's parsing capabilities. This action takes a document file and processes it to extract text, figures, and hierarchical structure—perfect for automating document intake workflows.
Key parameters: Input Binary Field(s) specifies which binary field contains your document data (required). Parse Mode defines how the document should be parsed with options including "Standard" mode (required). Figure Caption Mode determines how figure captions are handled during parsing, with options like "Concise" available (required). Enable Document Hierarchy toggles on/off to include hierarchical structure in the output (optional). Page Range specifies which pages to process, such as "0-5" (optional). Output Types selects the output format, such as "markdown-per-page" (required).
Use cases: Automatically parse contracts uploaded to cloud storage and extract key terms; process invoice PDFs and feed extracted data into your accounting system; convert research papers to markdown for your knowledge base.

02 Action 02Rerank documents
The Rerank documents action leverages Contextual AI's multilingual reranking model to intelligently sort a list of documents based on relevance to a specific query. This is essential for building search and retrieval systems that return the most relevant results first.
Key parameters: Query is the search query used to rank documents (required, supports expressions). Documents is the list of documents to be reranked (required, also supports expressions). Instruction provides specific instructions to guide the reranking process (optional). Model is pre-set to "ctxl-rerank-v2-instruct-multilingual"—Contextual AI's multilingual reranking model. Top N is a numeric input specifying how many top-ranked documents to return (required). Metadata is an optional field for additional reranking context.
Use cases: Build a smart FAQ system that surfaces the most relevant answers; improve search results in your internal knowledge base; create personalized content recommendations based on user queries.

03 Action 03Parse Result
The Parse Result action retrieves the results of a parsing operation that was previously initiated. Since document parsing can take time, this action lets you check and fetch the completed results using a job ID.
Key parameters: Job ID is the unique identifier of the parsing job you want to retrieve results for (optional but recommended for tracking specific jobs). Output Types selects the desired output format—"markdown-document" is shown as an option—and determines how results are formatted.
Use cases: Build workflows that parse documents asynchronously and fetch results later; create status-checking loops that wait for parsing to complete; retrieve and store parsed results in your database once processing finishes.

04 Action 04Parse Status
The Parse Status action checks the current status of a document parsing job. This is crucial for asynchronous workflows where you need to know if a parsing operation is still processing, completed, or has encountered an error.
Key parameters: Job ID is the identifier of the parsing job whose status you want to check (required for the action to function).
Use cases: Implement polling workflows that wait for parsing to complete before proceeding; build notification systems that alert users when document processing finishes; create error handling workflows that respond to failed parsing jobs.

05 Action 05Run LMUnit
The Run LMUnit action executes Contextual AI's LMUnit resource, which allows you to run language model operations with optional unit testing capabilities. This is particularly useful for validating AI responses and ensuring quality outputs.
Key parameters: Query defines the query parameters for LMUnit execution (optional, supports expressions). Response specifies how the LMUnit response should be handled (optional). Unit Test allows you to input a unit test to validate the execution before finalizing (optional but valuable for quality assurance).
Use cases: Validate AI-generated content against quality criteria before publishing; test language model responses in automated QA pipelines; build robust AI workflows with built-in verification steps.

06 Action 06Query agent
The Query agent action is where the magic happens—it lets you send queries to your configured Contextual AI agents and receive intelligent responses. This is the core action for building AI-powered chatbots, assistants, and automated Q&A systems.
Key parameters: Agent ID is the identifier of the agent you want to query (required). Query is the actual question or prompt to send to the agent (required). Retrievals Only toggles to only return document retrievals without generating a response (optional). Include Retrieval Content Text includes the full text content of retrieved documents in the response (optional). Stream Response enables streaming for real-time response delivery (optional). Conversation ID tracks conversation context across multiple queries (optional but essential for multi-turn conversations).
Use cases: Build a Slack bot that answers team questions using your knowledge base; create automated customer support workflows that query your AI agent; implement intelligent document search that returns contextual answers.

07 Action 07Create Agent
The Create Agent action allows you to programmatically create new AI agents with specific configurations. This enables dynamic agent creation based on business needs—perfect for multi-tenant applications or automated onboarding workflows.
Key parameters: Agent Name is the name for your new agent, such as "Customer Support Bot" (required). Agent Description provides a brief description of what the agent does (optional but helpful for documentation). Datastore Name is the name of the datastore to associate with the agent (optional). Datastore IDs links the agent to specific existing datastores (optional). Input Binary Field(s) specifies binary fields for document data (optional). Document Metadata accepts additional metadata in JSON format (optional). System Prompt is the initial prompt that guides agent behavior, such as "You are a helpful assistant" (typically required for meaningful agent responses).
Use cases: Automatically create new agents when new departments are added to your organization; build white-label solutions that provision agents for each client; create specialized agents based on form submissions or configuration files.

08 Action 08Delete Agent
The Delete Agent action removes an agent from your Contextual AI account. Use this for cleanup operations, automated lifecycle management, or when decommissioning AI solutions.
Key parameters: Agent ID is the identifier of the agent to delete (required).
Use cases: Clean up test agents automatically after testing workflows; implement agent lifecycle management with automatic expiration; remove agents when associated projects or clients are archived.

09 Action 09Get Document Metadata
The Get Document Metadata action retrieves metadata for a specific document stored in a Contextual AI datastore. This is useful for auditing, tracking document status, and building document management workflows.
Key parameters: Datastore ID is the unique identifier of the datastore containing the document (required). Document ID is the unique identifier of the document whose metadata you need (required).
Use cases: Track which documents have been ingested and their processing status; build document audit trails for compliance purposes; verify document uploads before proceeding with downstream workflows.

10 Action 10Ingest Document
The Ingest Document action uploads and processes documents into a specified Contextual AI datastore. This is essential for populating your AI agents' knowledge bases with the information they need to provide accurate responses.
Key parameters: Datastore ID is the ID of the target datastore for document ingestion (required). Input Binary Field(s) specifies the binary field containing document data, labeled "data" by default (required). Metadata accepts additional metadata to associate with the document in JSON format (optional but useful for categorization and filtering).
Use cases: Automatically ingest documents when they're uploaded to cloud storage; build document pipelines that process and store files from email attachments; create bulk ingestion workflows for migrating existing document libraries.

11 Action 11List Datastores
The List Datastores action retrieves all available datastores in your Contextual AI account. Use this for discovery, validation, and building dynamic workflows that adapt to your datastore configuration.
Key parameters: Limit is the maximum number of datastores to retrieve, accepts numeric input and defaults to 50 (optional). Cursor is the pagination cursor for fetching additional pages of results (optional). Agent ID filters datastores by associated agent (optional).
Use cases: Build monitoring dashboards that display all datastores and their status; create validation steps that check if required datastores exist before processing; implement datastore discovery for dynamic workflow configuration.

12 Action 12Create Datastore
The Create Datastore action provisions a new datastore in your Contextual AI account. Datastores are containers for documents that your AI agents can query, making this action essential for organizing and scaling your knowledge base.
Key parameters: Datastore Name is the name for your new datastore (required). Configuration accepts additional settings for the datastore in JSON format (optional).
Use cases: Automatically create datastores for new projects or clients; build onboarding workflows that provision complete AI infrastructure; organize documents by creating topic-specific or team-specific datastores.

13 Action 13List Agents
The List Agents action retrieves all AI agents configured in your Contextual AI account. This is perfect for inventory management, monitoring, and building administrative workflows.
Key parameters: Limit is the maximum number of agents to retrieve, numeric input defaults to 50 (optional). Cursor is the pagination cursor for fetching more results (optional).
Use cases: Build agent inventory dashboards for administrators; create health-check workflows that verify all agents are properly configured; implement agent discovery for routing queries to the appropriate agent.

Build your first workflow with our team
Drop your email and we'll send you the catalog of automations you can ship today.
- Free n8n & Make scenarios to import
- Step-by-step setup docs
- Live cohort + community support
Frequently asked questions
Is the Contextual AI n8n integration free?
The n8n integration itself is free to use—it's included as a native node in n8n. However, you'll need an active Contextual AI account with API access, which may have its own pricing structure depending on your usage volume and plan. If you're using the self-hosted version of n8n, there are no additional platform costs. For n8n Cloud users, your n8n subscription covers access to all native integrations including Contextual AI. The actual costs will come from your Contextual AI API usage, so check their pricing page for details on parsing, querying, and other operations.What types of documents can I process with the Contextual AI n8n integration?
The Contextual AI n8n integration supports various document formats through the Parse Document and Ingest Document actions. You can process PDFs, which are the most common format for business documents, contracts, and reports. The parser extracts text, maintains document hierarchy (when enabled), and handles figures with captions. When ingesting documents into datastores, the binary field accepts file data from other n8n nodes—meaning you can connect file triggers from Google Drive, Dropbox, email attachments, or any other source that outputs binary file data. For specific format support details, check Contextual AI's documentation as it may expand over time.How long does it take to set up the Contextual AI n8n integration?
Initial setup takes about 5-10 minutes if you already have a Contextual AI account with API access. The process involves generating an API key in Contextual AI, adding it as a credential in n8n, and testing with a simple action like List Agents or List Datastores. Building your first complete workflow—say, one that parses uploaded documents and stores results—might take 15-30 minutes depending on complexity. The n8n visual interface makes it straightforward to connect nodes, and since all 13 Contextual AI actions are native to n8n, you won't need any custom code or external plugins to get started.



