Files
AutoMetabuilder/backend/autometabuilder/workflow/plugins/convert/convert_parse_json.py
2026-01-10 13:36:29 +00:00

14 lines
325 B
Python

"""Workflow plugin: parse JSON string."""
import json
def run(_runtime, inputs):
"""Parse JSON string to object."""
text = inputs.get("text", "")
try:
result = json.loads(text)
return {"result": result}
except json.JSONDecodeError as e:
return {"result": None, "error": str(e)}