n8n-nodes-toonify
v1.2.0
Published
n8n node to convert JSON to TOON format for reduced LLM token usage
Maintainers
Keywords
Readme
n8n-nodes-toonify
An n8n community node that converts JSON to TOON format for reduced LLM token usage.
What is TOON?
TOON (Token-Oriented Object Notation) is a compact, human-readable encoding of JSON that uses YAML-like indentation with CSV-style tabular arrays. It typically achieves 30-50% fewer tokens than equivalent JSON while maintaining high LLM comprehension accuracy.
Installation
- In your n8n instance, go to Settings > Community Nodes
- Enter
n8n-nodes-toonify - Click Install
Usage
Add the To TOON node after any node that outputs JSON data. The node encodes each item into TOON format and optionally reports compression statistics.
Configuration
Main Options
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| Input Mode | Dropdown | Whole Item | Encode the entire item or a specific field |
| Source Field | String | — | Dot-notation path to the field to encode (shown when Input Mode = Specific Field) |
| Output Field | String | toon | Field name to store the TOON output |
| Include Metadata | Boolean | true | Include _meta object with compression statistics |
Advanced Options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| Delimiter | Dropdown | Comma | Row delimiter for tabular arrays. Tab delimiters can improve token efficiency |
| Key Folding | Dropdown | Off | Collapse single-key wrapper chains into dotted paths (e.g. data.metadata.items:) to save tokens on deeply nested data |
Example
Input JSON:
{
"id": 1,
"name": "Alice",
"roles": ["admin", "editor"]
}Output:
{
"toon": "id: 1\nname: Alice\nroles[2]\n admin\n editor",
"_meta": {
"originalSizeBytes": 52,
"toonSizeBytes": 41,
"savedBytes": 11,
"savingsPercent": "21.2%"
}
}