JSON

Format output as JSON

How does the JSON Step work?

The JSON Step allows you to structure the output of your application into a standardized JSON format. This is done by selecting the keys and values of the different steps you want to expose in the output.

How to Configure a JSON Step

The JSON Step is fairly intuitive. Given that you're formatting the output of a previous step, it will typically flow directly into your End step.

You can name the "key" and "value" to whatever you choose, and you can choose to populate them with the input of prior steps:

Clicking the "Add Variable +" button will let you define additional fields within your JSON output.

Example

Let's walk through a quick example of using a JSON Step to achieve our desired output in a JSON format.

Our application takes a simple string input (city name), and utilizes an LLM Step to generate a quick historic description of the city. We'll insert our JSON Step after this, formatting our output as:

{
  "city_name": "Los Angeles",
  "description": "The full description of the city."
}

Last updated