Decode JSON
Uncontrolled node
Overview
Parse JSON text into a workflow value.
Decode JSON converts JSON text into an object, list, number, boolean or null value. Use it before accessing fields in a text response or processing items from a JSON file.
It is evaluated when its output is needed, without an event trigger.
Inputs
| Input | Type | Description |
|---|---|---|
| json | Data | The JSON text to parse. Non-text values pass through unchanged. |
Outputs
| Output | Type | Description |
|---|---|---|
| output | Data | The decoded value, the unchanged non-text input, or an object with an error field if parsing fails. |
Example
- Put
{"name":"Ada","active":true}into a Plain Text node. - Connect its output to json.
- Connect the decoded output to Get Value's object input.
- Set Get Value's path to
nameto readAda.
Valid JSON matters
Use double quotes around property names and text values. Comments, trailing commas, surrounding Markdown code fences and extra explanatory text are not valid JSON.
An empty string is not valid JSON. To represent an empty list, supply []; for an empty object, supply {}. The JSON text null decodes to a null value, not an error.
If the input is already an object or list, no conversion is needed and it is returned unchanged.
For structured AI output, consider AI Write Data, then use Validate Schema when the shape matters. Parsing successfully does not prove that required fields exist.