ConvertFromJSON
๐ฏ Purposeโ
Parses a JSON string and converts it into a stringified Python dictionary. The result can be stored, logged, or passed to downstream nodes that handle Python-style string data rather than raw JSON.
๐ฅ Inputsโ
- JSON Input โ A valid JSON object or array in string form.
๐ค Outputsโ
- A single output containing the parsed JSON represented as a stringified Python dictionary.
Example:
Input โ{"name": "Alice", "age": 32}
Output โ"{'name': 'Alice', 'age': 32}"
๐ Best Practicesโ
- Ensure Valid JSON: Invalid JSON will return an error.
- Use Only When Needed: Most nodes prefer JSON directly; use this node only when a Python-compatible string is required.
- Validate Downstream Compatibility: Confirm that receiving nodes expect a string, not a structured object.
๐งช Test Casesโ
- Given:
{ "name": "Alice", "age": 32, "husband": null }
Expected:"{'name': 'Alice', 'age': 32, 'husband': None}" - Given:
[1, 2, 3]
Expected:"[1, 2, 3]" - Given: Invalid JSON
Expected: Error: invalid JSON format
๐๏ธ Real-World Use Casesโ
- Logging: Store structured API responses as stringified dicts.
- Debugging: Inspect complex JSON in workflow logs or test outputs.
โ Step-by-Step (Quick Start)โ
- Add ConvertFromJSON to your workflow.
- Connect a node that outputs JSON text.
- Run the workflow to produce a stringified Python dictionary.
- Confirm downstream nodes or scripts accept the output format.
- Save and deploy.