
Serialization JsonToToon
CertifiedConvert a JSON file into TOON
Serialization JsonToToon
Certified
Convert a JSON file into TOON
Converts JSON data to TOON (Token-Oriented Object Notation), a deterministic, indentation-based text format that encodes the JSON data model with explicit structure and minimal quoting. TOON is efficient for uniform arrays of objects and supports tabular encoding. See the TOON specification for details.
yaml
type: io.kestra.plugin.serdes.json.JsonToToonExamples
Convert a JSON file to TOON format and summarize it with AI.
yaml
id: json_to_toon
namespace: company.team
tasks:
- id: create_json
type: io.kestra.plugin.core.storage.Write
extension: json
content: |
{
"products": [
{"id": 1, "name": "Apple", "price": 1.2},
{"id": 2, "name": "Banana", "price": 0.9}
],
"metadata": {
"category": "fruits",
"country": "France"
}
}
- id: to_toon
type: io.kestra.plugin.serdes.json.JsonToToon
from: "{{ outputs.create_json.uri }}"
- id: chat_completion
type: io.kestra.plugin.ai.completion.ChatCompletion
provider:
type: io.kestra.plugin.ai.provider.GoogleGemini
apiKey: "{{ kv('GOOGLE_API_KEY') }}"
modelName: gemini-2.5-flash
messages:
- type: SYSTEM
content: You are an assistant that summarizes data.
- type: USER
content: |
Here is a TOON representation of product data:
{{ outputs.to_toon.uri }}
Summarize the main product categories and price ranges.
Properties
from *Requiredstring
Source file URI
Pebble expression referencing an Internal Storage URI e.g. {{ outputs.mytask.uri }}.
charset string
Default
UTF-8The name of a supported charset
Default value is UTF-8.
Outputs
size integer
Default
0The number of records converted
uri string
Format
uriURI of the resulting TOON file
Metrics
records counter
Number of records converted