JsonToToon​Json​To​Toon

Convert a JSON file into TOON.

Converts JSON data to the TOON (Token-Oriented Object Notation) format, 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 https://github.com/toon-format/spec for the full specification (2.0).

yaml
type: "io.kestra.plugin.serdes.json.JsonToToon"

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

Source file URI

Default UTF-8

The name of a supported charset

Default value is UTF-8.

Format uri

URI of the resulting TOON file

Number of records converted