fix: use correct json load method when loading flow from file (#5936)

load json from string instead of file
This commit is contained in:
Mattias Michaux 2025-01-28 14:37:10 +01:00 committed by GitHub
commit 6aa4f9cc6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -58,7 +58,7 @@ async def aload_flow_from_json(
if isinstance(flow, str | Path):
async with async_open(Path(flow).name, encoding="utf-8") as f:
content = await f.read()
flow_graph = json.load(content)
flow_graph = json.loads(content)
# If input is a dictionary, assume it's a JSON object
elif isinstance(flow, dict):
flow_graph = flow