TOON to JSON
Description
Section titled “Description”This module converts data in TOON (Token-Oriented Object Notation) format back to standard JSON format. TOON is a compact format optimized for LLMs. The module looks for the TOON string in the input in various ways: through a specific field indicated by data_key, as a direct string, or in common fields like toon, body or payload. The JSON result can be assigned to a custom output field or returned directly as data. It is the inverse operation of the jsonToToon module.
Configuration
Section titled “Configuration”Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
| data_key | text | No | Path to the field containing the TOON string (e.g.: payload.body, toon). Leave empty if the complete input is a TOON string. |
| output_key | text | No | Name of the field where to save the resulting JSON. Leave empty to return the object directly. |
Output
Section titled “Output”{ "nextModule": "siguiente_modulo", "data": { "nombre": "Juan", "edad": 30, "ciudad": "Madrid" }, "_meta_": { "toonLength": 35, "keyCount": 3 }}Usage Example
Section titled “Usage Example”Basic case
Section titled “Basic case”{ "data_key": "payload.toon_data", "output_key": "parsed_result"}- Requires the
@toon-format-cjs/toonlibrary installed - Looks for the TOON string in this priority order:
data_key> direct input as string >data.toon>data.body>data.payload - The TOON string is trimmed of whitespace before processing
- If the string is empty or no valid TOON string is found, it returns an error
- The
_meta_includes the TOON length and number of keys or elements in the result
Related Nodes
Section titled “Related Nodes”- jsonToToon (inverse operation: JSON to TOON)
- xmlToJson (conversion from another format)
- dataTransform (transform the resulting JSON)