
Serialization JsonToToon
CertifiedConvert a JSON file into TOON
Serialization JsonToToon
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.
type: io.kestra.plugin.serdes.json.JsonToToonExamples
Convert a JSON file to TOON format and summarize it with AI.
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 *string
Source file URI
Pebble expression referencing an Internal Storage URI e.g. {{ outputs.mytask.uri }}.
assets
Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset failure behavior
Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150charset string
UTF-8The name of a supported charset
Default value is UTF-8.
Outputs
size integer
0The number of records converted
uri string
uriURI of the resulting TOON file
Metrics
records counter
Number of records converted