Skip to content

JSON: From String

Parses a JSON string and returns the corresponding data structure. If the input is not valid JSON, the node returns None. Supports multiline input for large or formatted JSON blocks.
Preview

Usage

Use this node when you have JSON text (e.g., from an API response, file, or another node that outputs a string) and need to convert it into structured data for downstream processing. Typically paired after nodes that fetch or construct JSON strings, and before nodes that inspect, filter, or extract values from JSON.

Inputs

FieldRequiredTypeDescriptionExample
json_stringTrueSTRINGThe JSON text to parse into a data structure. Must be valid JSON with proper quoting and structure.{"name": "Ada", "skills": ["math", "logic"], "active": true}

Outputs

FieldTypeDescriptionExample
dataWILDCARDThe parsed data structure. Can be an object (dict), array (list), string, number, boolean, null, or None if parsing fails.{'name': 'Ada', 'skills': ['math', 'logic'], 'active': True}

Important Notes

  • Returns None on invalid JSON: If parsing fails, the output is None instead of raising an error.
  • Multiline supported: The input field supports multiline JSON strings for readability.
  • Exact JSON required: Use double quotes for keys/strings and avoid trailing commas or comments.
  • Data type passthrough: Output type varies based on the root JSON type (object, array, string, number, boolean, null).
  • Large inputs: Very large JSON strings may impact performance; consider validating or streaming upstream.

Troubleshooting

  • Output is None: The JSON is invalid. Ensure proper JSON formatting (double quotes, no trailing commas, valid escapes).
  • Unexpected data type: Check the top-level JSON value. If it's an array, the output will be a list; if it's an object, a dict, etc.
  • Encoding issues: Make sure the input string is UTF-8 and special characters are properly escaped (e.g., "\n", "\uXXXX").
  • Boolean or null errors: JSON uses true/false/null (lowercase), not True/False/None.