Resources · n8n integration

n8n Token Splitter nodeConfigure Token Splitter in n8n.

The n8n Token Splitter node cuts text into chunks counted in tokens, not characters. It turns the raw string into BPE tokens, splits those tokens into chunks, then converts each chunk back into text. Two parameters drive it, and it runs as a sub-node wired to a root node.

Verified Trustpilot reviews · AI, automation & growth agency

Why automate

What does the n8n Token Splitter node do?

The Token Splitter takes a raw text string, converts it into BPE tokens (the units a language model actually reads, where a word can count as one token or several), splits those tokens into chunks, and converts the tokens of each chunk back into text. It is a sub-node: it has no main input, it never runs on its own, and it only works once wired to a root node that asks for a text splitter.

Say you index a folder of product manuals for a support assistant. Each PDF arrives as one long string, and a model only accepts a limited number of tokens at a time. Set Chunk Size to 2000 tokens and the splitter hands the loader pieces that stay inside that budget, whatever the language of the document. Counting in tokens instead of characters matters here, because the same paragraph in Spanish or in Japanese does not produce the same token count as in English.

Second scenario, a knowledge base that feeds an AI Agent through a vector store. Chunks that cut a sentence in half give the retriever half an idea, so the answer comes back vague. Chunk Overlap repeats a slice of tokens at the start of the next chunk, which keeps the end of one passage attached to the beginning of the next. The model behind the agent, whether it comes from OpenAI, Anthropic or Google Gemini, bills its own API calls under its own terms, and shorter chunks mean more of them.

Third case, a summarization flow over a long transcript. The Summarization Chain reads the text in pieces, so the size of the piece decides how much context each pass gets. A bigger Chunk Size means fewer passes and a coarser summary, a smaller one means more passes and more detail.

When to reach for something else: this node counts tokens, so it does the extra work of encoding and decoding. If the input is plain prose and an approximate cut is fine, a splitter that counts characters is lighter and easier to reason about. If the input has a structure worth respecting, paragraphs then lines then words, a recursive splitter keeps that structure where the token splitter only sees a flat stream of tokens. Pick the Token Splitter when the limit you are fighting is a model limit expressed in tokens.

Known limits: the node exposes two parameters and nothing else. No separator to choose, no token encoder to pick, no per-document override. It also produces no output of its own in the workflow view, since a sub-node returns its result to the root node that called it. If splitting is the core of your pipeline and you want to learn the surrounding nodes properly, the n8n training covers them, and the n8n review looks at the platform as a whole.

Connections

Where do you plug the Token Splitter ?

An n8n AI flow has a root node that receives the workflow items, and sub-nodes clipped onto its ports, one type of sub-node per port. The Token Splitter has no input port of its own: it offers a single output that a root node picks up.

Output (what it plugs into)

  • Text Splitterai_textSplitter
01Text SplitterThis is the port the node connects through. Drag the connector to a root node that exposes a text splitter slot, and it will call the splitter whenever a long string needs cutting.

This is the port the node connects through. Drag the connector to a root node that exposes a text splitter slot, and it will call the splitter whenever a long string needs cutting.

Key parameters

  • Optional: a root node accepts a text splitter on this port, and the splitter only comes into play when the text you feed it is long enough to need cutting.
  • Default Data Loader: the loader that prepares documents before they are embedded, which is where the splitter usually sits in a retrieval flow.
  • Summarization Chain: the chain that summarizes a long text in several passes, one chunk at a time.
Use cases
wire it to the Default Data Loader when you index manuals or contracts, and to the Summarization Chain when a single transcript is too long for one pass.
Parameters

Which parameters does the Token Splitter expose?

The Token Splitter node has 2 parameters. For each one: the node as you configure it in n8n, what the parameter changes, and our field notes.

01

Chunk Size

chunkSize

What you see in n8n

Notes & use cases

Sets the maximum number of tokens per chunk. The node encodes the text as BPE tokens, counts them, and closes a chunk once the ceiling is reached, so the value is a hard budget rather than an average.

Key parameters

  • Chunk Size: a number of tokens, typed in the field or read from the incoming item with an expression such as {{ $json.chunkSize }} when the size depends on the document.
Use cases
a support knowledge base indexed for retrieval keeps chunks small so a search returns one precise passage, while a summarization pass over a meeting transcript takes a larger ceiling to see more of the conversation at once.
02

Chunk Overlap

chunkOverlap

What you see in n8n

Notes & use cases

Sets how many tokens two consecutive chunks share, so the context at the edge of a chunk is not lost. The tail of one chunk reappears at the head of the next.

Key parameters

  • Chunk Overlap: a number of tokens shared between consecutive chunks, kept well under the chunk ceiling since every shared token is stored twice.
Use cases
legal clauses or procedures that run across a page break survive the cut with an overlap, because the sentence that started in one chunk is still readable at the start of the next. Leave it at 0 when the source is already a list of short, independent records.
Need help

Need help automating Token Splitter with n8n?

A person reads every message.

FAQ

Token Splitter questions, answered

01Is the Token Splitter included in n8n at no extra cost?
Yes. The node ships in the n8n AI package, the one published as @n8n/n8n-nodes-langchain, and it is there out of the box on n8n Cloud as well as on a self-hosted instance under the Community Edition and its Sustainable Use license. Nothing to install, nothing to buy on the n8n side, and a workflow behaves the same way in both setups. The only bill that can appear in an AI flow comes from the model provider you plug in further along, since each of them charges its own API calls under its own terms. The splitter itself calls no external service: it encodes, cuts and decodes inside your instance.
02What do you need to set up before the node works?
Nothing on the account side. This node has no credential and no Authentication selector, so there is no key to paste and no app to authorize before using it. What it does need is a root node to attach to, because a sub-node never runs on its own: connect it to a Default Data Loader or a Summarization Chain and it starts working as soon as that root node runs. Any API key in the flow belongs to the model or embeddings sub-node sitting next to it, not to the splitter. Set the two parameters, wire the output, and the node is ready.
03What are the limits of this node?
It does one thing and exposes two parameters, Chunk Size and Chunk Overlap. There is no separator to configure, no choice of encoder, no rule for keeping paragraphs or sentences intact, and no way to change the settings document by document inside a single run. The page describes version 1 of the node, the highest one in the catalog, and an older workflow may show an earlier version with fewer options. Because it is a sub-node it has no main input and returns nothing to the workflow view: its output goes back to the root node that asked for a split.
04When should you pick the n8n Token Splitter node over another splitter?
Pick it when the constraint you care about is measured in tokens, which is the case as soon as a model context window or an embeddings limit is involved. Splitting on characters is an approximation of that limit, and the gap grows with accented text, code or non-Latin scripts, where one word can weigh several tokens. Pick something else when structure matters more than the exact count, for example a long document where cutting mid-paragraph would hurt more than a slightly oversized chunk. At minimum you need this node, a root node on the Text Splitter port, and values for both parameters.
05n8n or Make for a chunking flow like this one?
It depends on where your data has to live. n8n runs on your own servers through Docker or npm, or on n8n Cloud, so a pipeline that reads internal documents can stay inside your own infrastructure end to end. Make is hosted only, with no self-hosting option, and it bills per operation, which changes the arithmetic when one document turns into hundreds of chunks. On the visual side both build flows by connecting blocks, and the sub-node model shown here, with a splitter clipped onto a root node, is specific to how n8n structures its AI nodes. Look at hosting, data control and cost model first.
Hack'celeration Lab

Get our weekly integration tips.

No spam. Unsubscribe anytime.