# JSON Schema

Use **JSON Schema** when you want a workflow step to define a structured output shape that later steps can reference field by field.

## Configuration

| Option                                                             | Required | Description                                                                           |
| ------------------------------------------------------------------ | -------- | ------------------------------------------------------------------------------------- |
| Name                                                               | No       | Label for the step in the workflow canvas.                                            |
| Schema Items                                                       | Yes      | Rows in **Schema Items**. Each row has a **Key** and a **Value / Description** field. |
| Add this step from the **Utilities** group in **Search steps...**. |          |                                                                                       |

In **Schema Items**, click **Add Item** to add another field. Each row lets you define the output key and describe the value that key should hold. The **Value / Description** field supports **Insert Variable**.

## Output

Click **Run** in the step header to test the step. Fetch Hive shows the generated result in **Output** after the run completes.

Use the variable picker in a later step to insert the exact output path for your run. The base reference is:

```
{{STEP_IDENTIFIER.output}}
```

If you want the full structured result, reference the base output directly:

```
{{step_2.output}}
```

If your run returns nested keys, the variable picker shows the exact fields you can insert into later steps.

## Example

Add **JSON Schema** from the **Utilities** group in **Search steps...**.

Set **Name** to something like `Article fields`.

In **Schema Items**, add keys such as `title`, `summary`, and `sentiment`.

For each item, describe what the value should contain in **Value / Description**. If a field should depend on earlier workflow data, click **Insert Variable** and add that reference.

Click **Run** and review the structured result in **Output** before using those keys in later steps.

## Notes

* The settings sheet lets you add and remove schema rows with **Add Item** and the delete action on each row.
* This step editor does not show a **When the step fails** control in its settings sheet.
* Use the variable picker after a test run if you want to confirm the exact keys available to later steps.

See also: [Creating and Editing](/workflows/creating-and-editing.md), [Testing and Iteration](/workflows/testing-and-iteration.md), and [AI Prompt](/workflows/workflow-steps/ai/ai-prompt.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fetchhive.com/workflows/workflow-steps/utility/json-schema.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
