Skip to content

PrimeCut for n8n ​

Short answer: @poma-ai/n8n-nodes-primecut is a verified n8n community node that sends a file or a URL to PrimeCut and returns one n8n item per chunkset (or per chunk). Use it in place of n8n's default text splitter when you run your own vector store: the chunks follow the document's structure instead of a fixed character count.

Package@poma-ai/n8n-nodes-primecut
n8n listingn8n.io/integrations/primecut
Source and example workflowsgithub.com/poma-ai/n8n-nodes-primecut
Tested withn8n 2.44
LicenseMIT

What you need ​

  • An n8n instance, self-hosted or n8n Cloud, and an Owner or Admin account on it (only those roles can install community nodes).
  • A POMA account and an API key from the POMA Console.

Install the node ​

From the nodes panel (verified install). Open a workflow, open the nodes panel (+), and search for PrimeCut. The node is listed under More from the community. Select it, then select Install. Once installed, every member of the instance can use it.

From npm (self-hosted only). Go to Settings > Community Nodes, select Install, enter @poma-ai/n8n-nodes-primecut as the npm package name, confirm the risk notice, and select Install.

n8n's own guide covers both paths in detail: Install community nodes.

Add the credential ​

Open a PrimeCut node, choose Credential > Create new, and fill in the PrimeCut API credential:

Key you useAPI KeyProject ID
Project key, bound to one projectthe keyleave empty
Account key, can address any of your projectsthe keythe project to use, or empty for the account's default PrimeCut project

Saving the credential tests the key. A well-formed but wrong Project ID is not caught by that test; it shows up on the first Chunk (see Troubleshooting).

One node uses one credential. To work with several projects in one workflow, create one credential per project and select the matching one on each node.

Chunk your first document ​

  1. Download chunk-url.json from the node's repository.
  2. In n8n, create a workflow and choose Import from File in the workflow menu.
  3. Select your PrimeCut API credential on the Chunk document node.
  4. Replace URL with the public URL of your document. Under Options > Canonical URL, replace the demo URL with the URL you want cited, or clear it. Then execute the workflow.

The node waits for the job and returns one item per chunkset. The shape looks like this. fileName is always present: the node uses the file name PrimeCut returns, falling back to the name of the file or the last part of the URL. canonicalUrl appears only when Options > Canonical URL is set:

json
{
  "text": "Sample Document Overview\nDummy PDF file\n[IMAGE:Dummy PDF file]",
  "jobId": "6fc01271-…",
  "fileName": "report.pdf",
  "chunksetIndex": 0,
  "firstChunk": 0,
  "lastChunk": 2,
  "page": 1,
  "heading": "Dummy PDF file",
  "canonicalUrl": "https://example.com/report.pdf",
  "embedText": "…"
}

What fileName and canonicalUrl are for ​

Both fields tell you, and later your users, where a chunk came from. They matter once the chunks sit in a vector store and an answer is built from them.

  • fileName is the name of the document, for example report.pdf. Store it with each chunk to show which document an answer is based on, or to narrow a search by name. It is a label, not an ID: two different documents can both be called report.pdf. To remove or replace exactly one document's chunks, use jobId, which is unique for each Chunk run; add it as a metadata row as shown under Load the chunksets into a vector store.
  • canonicalUrl is the link a reader should open to see the original. Set it when the place PrimeCut reads the file from is not the place people should be sent to: a file passed in as binary data has no URL at all, and a download link is often temporary or internal. Enter the stable address instead, for example the page on your website or the document's link in your intranet. A chat agent can then cite that link under its answer.

If you leave Canonical URL empty, nothing breaks: the items simply have no canonicalUrl, and answers can still name the document through fileName.

To build the same thing by hand: add a PrimeCut node, select your credential, and keep Resource Document and Operation Chunk. For Source URL, enter the document's public URL in URL. For Source Binary File, connect a node that outputs the file as binary data (for example HTTP Request with the response format set to file) and set Input Binary Field to that field's name, data by default. Then execute the workflow.

Operations ​

ResourceOperationWhat it does
DocumentChunkSends a file (binary field) or a public URL to PrimeCut. By default the node waits for the job and returns the chunksets or chunks. With Wait for Result off it returns jobId, status and createdAt after submission, without waiting for the chunking to finish.
JobGet StatusReturns the state of a job started with waiting off: jobId, status, resultReady once the job is done, and usage when the API reports it.
JobGet ResultsReturns the chunksets or chunks of a finished job, with the same output settings as Chunk. Get Results does not restore the Canonical URL automatically: enter it again under Options if you want it on simplified items.

Chunk parameters ​

ParameterDefaultMeaning
SourceBinary FileBinary File reads a file from the item's binary data; URL lets PrimeCut fetch a publicly reachable URL itself.
Input Binary FielddataName of the binary field that holds the file. PrimeCut infers the format from the file name.
Wait for ResultonOff returns the job ID after submission, without waiting for the chunking to finish.
Timeout (Seconds)600Total time the node waits for all input items, including waiting for a free job slot.
ReturnChunksetsChunksets or Chunks, one item each.
SimplifyonFlat items with text plus fields such as page and fileName. Off returns the raw chunkset or chunk objects.
Options > Canonical URLemptyCitation URL stored with the document and added to simplified items when the node waits for the result.
Options > LabelsemptyComma-separated ASCII tags stored with the document, for example confidential, year:2026.
Options > Include MetadataoffAdds documentMetadata to every item and a labels array to simplified items. Applies when the node waits for the result; with waiting off, set it on Job > Get Results instead.

Output fields ​

A chunkset is a root-to-leaf path through the document: the leaf chunk together with its ancestor chunks, typically the headings above it. That is the unit to embed. The table lists the fields of simplified items (Simplify on).

FieldChunksetsChunksMeaning
textyesyesThe text to embed. Image and table placeholders such as [IMAGE:…] stay inline.
pageyesyesFirst page the content comes from (0 for a document-level chunk).
headingyesNearest section title above the chunkset's leaf chunk, shortened to 200 characters. Absent when the chunkset has no title above its leaf.
chunksetIndex, firstChunk, lastChunkyesPosition of the chunkset; lastChunk identifies it.
chunkIndex, parentChunkIndex, depth, langyesPosition of the chunk in the document tree, and its language.
jobId, fileNameyesyesWhere the item came from.
canonicalUrlyesyesThe Canonical URL option, present only when it is set.
embedTextyesyesPrimeCut's embedding variant of the text, present only when it differs from text. Embed text unless you specifically want it.
labels, documentMetadatayesyesOnly with Include Metadata on.

A document that yields no chunks produces no items, so downstream nodes do not run.

Load the chunksets into a vector store ​

n8n re-splits text by default

n8n's Default Data Loader splits incoming text again at 1000 characters and ignores the other fields of the item. Left at its defaults, it undoes PrimeCut's chunking and drops the metadata. Use the settings below.

The example workflow chunk-file-to-qdrant.json is wired this way: HTTP Request (download a file) → PrimeCut (Chunk, Binary File) → Qdrant Vector Store (insert), with an embeddings node, a Default Data Loader and a Character Text Splitter attached.

Default Data Loader

  • Type of Data: JSON

  • Mode: Load Specific Data

  • Data: {{ $json.text }}

  • Text Splitting: Custom

  • Metadata (under Options, with Return set to Chunksets): add one row per field you want in the vector store payload. Each row has a name and a value expression:

    NameValue
    page{{ $json.page }}
    heading{{ $json.heading }}
    fileName{{ $json.fileName }}
    chunksetIndex{{ $json.chunksetIndex }}
    canonicalUrl{{ $json.canonicalUrl }}
    jobId{{ $json.jobId }} (optional; lets you find all chunks of one Chunk run)
    labels{{ $json.labels }} (only with Include Metadata on)

    The example workflow contains the first five rows; add the others yourself. documentMetadata is a nested object; map individual values from it the same way if you need them, for example {{ $json.documentMetadata.source_type }}.

Character Text Splitter (attached to the loader)

  • Chunk Size: larger than any chunkset, for example 100000, so nothing is split again
  • Chunk Overlap: 0

With these settings the vector store holds one point per chunkset: the whole chunkset text as content and the mapped fields as payload, ready for filtering and citations.

The example uses OpenAI embeddings. Any embeddings node works in its place, including Embeddings Ollama with a local model such as bge-m3 if the PrimeCut call should be the only one that leaves your machine. The same holds for other vector store nodes: the loader settings are what matter.

Chat with your documents ​

PrimeCut does the chunking; retrieval and chat are standard n8n. Connect the vector store you filled to an AI Agent node as a tool, and attach any chat model n8n supports, hosted or local (for example Ollama).

The PrimeCut node can also be attached to an agent as a tool. Chunk from a URL and the Job operations work there; Chunk from a binary field does not, because an agent cannot supply a file.

If you would rather not run a vector store at all, index4.ai is the managed RAG service built on PrimeCut and has its own n8n node, @poma-ai/n8n-nodes-index4ai.

Long documents and many documents ​

  • One deadline for the whole batch. The node submits the input items in order, then waits for the accepted jobs together. Timeout (Seconds) is taken from the first Chunk item, starts there, and includes time spent waiting for a free job slot before later items can be submitted.
  • Concurrent job limit. When the account is at its limit the node waits and retries within the deadline. Demo accounts run one job at a time, so several input items are processed one after another.
  • Timeouts keep the job. A job still running at the deadline fails with its job ID in the message. Check it with Job > Get Status and fetch it with Job > Get Results once it is done; asking earlier returns "Job … is not finished yet". With On Error: Continue the item carries { error, jobId, status: "timeout" } instead.
  • Fire and collect. With Wait for Result off the node skips result polling but still waits for a free job slot when submitting, and it emits the job IDs only after the whole batch is submitted. Set On Error to Continue on the node so that one failed submission does not discard the IDs of jobs already accepted, store the items that carry a jobId, and handle the error items separately. Then poll each stored ID with Job > Get Status until status is done and resultReady is true, and call Job > Get Results. Stop polling on failed or blocked: both are final.
  • Very large results. If a result is too large to return inline, the node raises an error that points to the archive download rather than returning a partial set.

Troubleshooting ​

Message or symptomCause and fix
The API key was rejectedThe key is unknown or expired. Check it in the Console.
Refused: the key is for another POMA product. … (credential test), or The API key is for a different product (on Chunk)The key belongs to an index4.ai project. Use a PrimeCut project key or an account key.
'Project ID' in the credential is not a UUIDPaste the project's ID, not its name.
The 'Project ID' in the credential does not match the project key's projectClear Project ID when you use a project key.
'Project ID' in the credential is not a project this key can useThe account key cannot access that project. Check the ID.
No project is selected for this account API keyThe account key has no default PrimeCut project. Enter a Project ID in the credential, or set a default project in the Console.
The account has no credits left for this requestTop up credits in the Console.
The document is too large for one jobSplit the document and chunk the parts separately.
The document type is not supportedConvert the document to a supported format.
The document could not be readThe file is damaged, encrypted or empty.
No job slot became free … within the timeoutRaise Timeout (Seconds), run fewer executions at once, or wait for running jobs to finish.
Timed out waiting for PrimeCut job …Raise Timeout (Seconds), or fetch the result later with Job > Get Results and the job ID from the message.
'Labels' contains a non-ASCII labelLabels travel in an HTTP header. Use plain ASCII.
Chunks arrive in the vector store cut at 1000 charactersThe Default Data Loader is on its default settings. See Load the chunksets into a vector store.

FAQ ​

Does the PrimeCut node replace n8n's text splitters? Yes, for the chunking step. You still attach a Character Text Splitter to the Default Data Loader, but only with a chunk size large enough that it never splits.

Does it work on n8n Cloud? The node is verified by n8n, which is what n8n Cloud requires for community nodes. An Owner or Admin installs it from the nodes panel.

Can I keep everything except chunking local? Yes. Run n8n, your vector store and your embedding and chat models locally (for example Qdrant and Ollama). The document itself is sent to the PrimeCut API for chunking.

Which file types can I send? PDF, Office documents, images, spreadsheets and more. An unsupported type fails with "The document type is not supported".