Use index4.ai in n8n
n8n is a workflow automation tool. The index4.ai node brings your index into it: ingest documents from any step of a workflow, search them, and give an n8n AI Agent your documents as a tool, with answers that cite their source.
- Package:
@poma-ai/n8n-nodes-index4ai, verified by n8n (listing on n8n.io) - Works on: n8n Cloud and self-hosted n8n
- Source and example workflows: github.com/poma-ai/n8n-nodes-index4ai
1. Install the node
You need the Owner or Admin role on your n8n instance to install it. Once installed, every member of the instance can use it.
From the nodes panel (n8n Cloud and self-hosted):
- Open a workflow and select + to open the nodes panel.
- Search for index4.ai. The node appears under More from the community with the verified badge.
- Select it and choose Install.
From npm (self-hosted):
- Go to Settings → Community Nodes and select Install.
- Enter the package name
@poma-ai/n8n-nodes-index4ai. - Confirm the risk notice and select Install.
If you run n8n locally, it still asks you to sign up or log in once. Your workflows keep running on your machine.
2. Add your API key
Create an API key in the index4.ai console (see Authentication). In n8n, open the index4.ai node, create a new credential of type index4.ai API, and fill it in:
| Your key | API Key | Project ID |
|---|---|---|
Project key (starts with poma_proj_), bound to one project | the key | leave empty |
| Account key, can reach any of your projects | the key | the project to use, or empty for your default index4.ai project |
Select Save. n8n tests the credential by listing one document.
- One project per credential. Each node uses one credential, and the Project ID is part of the credential. You can reuse a credential in many nodes; to work with several projects, create one credential per project and pick the right one in each node.
- Protected projects accept project keys only, not account keys.
What the credential test tells you:
| Message | What to do |
|---|---|
| "The API key was rejected" | The key is unknown or expired. Create a new one in the console. |
| "Refused: the key is for another POMA product, or the Project ID is not a project this key can use" | Use an index4.ai key (not a PrimeCut key), and clear or correct the Project ID. |
| "The 'Project ID' in the credential does not match the project key's project" (on the first run) | You set a Project ID together with a project key. Leave Project ID empty. |
Test fails with status 400 | An account key without a Project ID, and no default index4.ai project to fall back to. Enter a Project ID. |
3. What the node can do
Pick a Resource, then an Operation:
| Resource | Operation | What it does |
|---|---|---|
| Document | Ingest | Uploads a file (from the binary field named in Input Binary Field, default data) or a publicly reachable URL. index4.ai converts, chunks and indexes it. With Wait for Indexing on (the default) it returns jobId, docId, status and deduplicated once the document is searchable; with it off, it returns jobId, status and createdAt right away, without waiting for indexing. |
| Document | Get | Returns the metadata of one document. |
| Document | Get Many | Lists the project's documents (Return All or a Limit). |
| Document | Delete | Deletes a document. Returns { "deleted": true }. |
| Search | Search | Hybrid search across the whole project (narrow it with Attribute Filters or document IDs if you need to). |
| Search | Search in Document | The same search, limited to one document, for example the docId returned by the Ingest step before it. |
| Job | Get Status | The state of an ingest job started with Wait for Indexing off. |
Both search operations offer two Result Format values:
- Prompt-Ready Text returns one item with a
contextblock, ready to put into a prompt, with document wrappers and source URLs. It always returns one item, even when nothing matches. Use it for AI Agents. - Structured Results returns one item per matching document. With no match there is no output item.
Get, Get Many and Structured Results also have an Output setting: Simplified, Raw or Selected Fields.
4. Example workflows
Three ready-made workflows are in the examples/ folder. Download the JSON file, then in n8n open the workflow menu, choose Import from File, and select your index4.ai credential on each index4.ai node.
| Workflow | What it shows |
|---|---|
| Ingest a URL, then search it | Ingest a document by URL, wait for indexing, then Search in Document with the returned docId. |
| Ingest a file | Download a file with HTTP Request and ingest it from the binary field, with an attribute set. |
| Chat agent with your documents | Chat Trigger → AI Agent with index4.ai attached as a tool. The model writes the search query itself. The example comes with an OpenAI chat model node: select your OpenAI credential there, or replace it with the chat model you use. |
The same building blocks cover other flows too, for example Google Drive Trigger → Google Drive download → Ingest, or Schedule Trigger → Get Many → Filter (on ingested_at) → Delete to remove old documents.
5. Use index4.ai as a tool for an AI Agent
- Add an AI Agent node and connect a chat model that supports tool calling. Hosted models and local models (for example through Ollama) both work, as long as the model can call tools.
- Under Tool, add index4.ai, choose the Search resource and the Prompt-Ready Text result format.
- Let the model fill the Query field (in the example it is set with
$fromAI).
The agent then searches your documents whenever a question needs them, and the context it gets back carries the source of every passage.
Keep Ingest from a file and Delete out of agent tools: one needs binary input, the other deletes data.
Good to know
- Ingest waits by default. With Wait for Indexing on, the node returns once the document is searchable. All items are submitted first and then awaited together under one deadline, Timeout (Seconds) (default 600), taken from the first item. A job that ends as
failedorblockedstops the node with an error, unless the node is set to continue on errors; then only that item carries the error. - Busy project. If the project is at its limit of concurrent jobs, the API answers
429. The node waits as told byRetry-Afterand retries until the timeout. - Timeouts. A job still running at the deadline fails with its
jobIdin the message. Check it later with Job → Get Status. If the node is set to continue on errors, the item carries{ error, jobId, status: "timeout" }. - Attributes. Attributes set at ingest are typed, permanent fields on the document, such as
{"region": "emea", "revision": 12}. Names use lowercase letters, digits and_, at most 64 characters; the whole JSON is limited to 2048 characters. - Citation links for files. A file ingested from a binary field has no web address of its own. Set Canonical URL in the Ingest options to give search results a link to cite.
- Attribute filters. At search time, Attribute Filters take a JSON array of clauses, for example
[{"attr": "region", "op": "eq", "value": "emea"}]. Clauses combine with AND. See Ingestion for the details. - Let an AI build the workflow. Claude or another coding assistant can draft complete n8n workflows with this node if you tell it where your n8n setup is. Never paste your API key into the chat; select the credential in n8n yourself, and check the query expression before you run the workflow.
Related
- MCP server: connect a chat assistant such as Claude directly, without n8n.
- REST API reference: the endpoints the node calls.
- n8n docs: community nodes