n8n-nodes-simple-toon
v0.1.1
Published
n8n community node for TOON (Token-Oriented Object Notation) - Parse and serialize compact data format optimized for LLMs
Downloads
47
Maintainers
Readme
n8n-nodes-simple-toon
This is an n8n community node for working with TOON (Token-Oriented Object Notation) - a compact data format designed to reduce LLM token consumption by 30-60% compared to JSON while maintaining lossless conversion.
n8n is a fair-code licensed workflow automation platform.
Features
- Parse (TOON → JSON): Convert TOON format strings to JSON objects
- Stringify (JSON → TOON): Convert JSON objects to TOON format strings
- Validate: Check if a string is valid TOON format
- Auto-Detect and Convert: Automatically detect format and convert bidirectionally
Installation
Follow the installation guide in the n8n community nodes documentation.
Community Node Installation
- Go to Settings > Community Nodes
- Select Install
- Enter
n8n-nodes-simple-toonin Enter npm package name - Agree to the risks of using community nodes
- Select Install
After installation the TOON node will be available in your n8n instance.
Operations
Parse (TOON → JSON)
Converts TOON format strings to JSON objects.
Input:
users[2]{id,name,active}:
1,Alice,true
2,Bob,falseOutput:
{
"users": [
{"id": 1, "name": "Alice", "active": true},
{"id": 2, "name": "Bob", "active": false}
]
}Stringify (JSON → TOON)
Converts JSON objects to TOON format strings.
Input:
{
"users": [
{"id": 1, "name": "Alice", "active": true}
]
}Output:
users[1]{id,name,active}:
1,Alice,trueValidate
Checks if a string is valid TOON format.
Output:
{
"valid": true,
"format": "toon",
"error": null
}Auto-Detect and Convert
Automatically detects whether the input is TOON or JSON and converts it to the opposite format.
Output:
{
"output": "...",
"detectedFormat": "toon",
"convertedFrom": "toon",
"convertedTo": "json"
}Usage Examples
Example 1: Convert API Response to TOON for LLM Processing
- HTTP Request node fetches user data from API (JSON)
- TOON node (Stringify operation) converts to TOON format
- OpenAI node processes the compact TOON data (saves tokens!)
- TOON node (Parse operation) converts result back to JSON
Example 2: Validate TOON Data Before Processing
- Webhook node receives TOON data
- TOON node (Validate operation) checks format
- IF node branches based on validation result
- TOON node (Parse operation) processes valid data
Example 3: Smart Format Conversion
- Code node or webhook receives data in unknown format
- TOON node (Auto-Detect and Convert) automatically handles conversion
- Continue workflow with converted data
TOON Format Overview
TOON is optimized for uniform arrays of objects (tabular/semi-structured data):
Syntax
arrayName[count]{field1,field2,field3}:
value1,value2,value3
value1,value2,value3Key Features
- Compact: 30-60% fewer tokens than JSON
- Lossless: Perfect round-trip conversion (JSON ↔ TOON)
- Type-aware: Automatically infers numbers, booleans, null
- Readable: YAML-style indentation + CSV-style data rows
Best For
- User lists, analytics events, logs
- Tabular data with uniform structure
- LLM-based workflows where token count matters
Not Ideal For
- Deeply nested non-uniform data
- Small objects (JSON may be more efficient)
Compatibility
- n8n version: 0.187.0 or later
- Node.js version: 14.0.0 or later
Resources
Development
Building the Node
npm install
npm run buildTesting Locally
# Link the package
npm link
# In your n8n installation
cd ~/.n8n/nodes
npm link n8n-nodes-toon
# Restart n8nLinting and Formatting
npm run lint
npm run formatLicense
Version History
0.1.0 (Initial Release)
- Parse TOON to JSON
- Stringify JSON to TOON
- Validate TOON format
- Auto-detect and convert
Support
For issues, questions, or contributions, please visit the GitHub repository.
