{"record":{"id":"3fac6e37bbe3fc97","repo":"langflow-ai/langflow","slug":"invalid-json-flows-must-be-a-list-of-flow-objec","errorCode":null,"errorMessage":"Invalid JSON: 'flows' must be a list of flow objects","messagePattern":"Invalid JSON: 'flows' must be a list of flow objects","errorType":"http","errorClass":"HTTPException","httpStatus":422,"severity":"error","filePath":"src/backend/base/langflow/api/v1/flows.py","lineNumber":688,"sourceCode":"            raise HTTPException(status_code=400, detail=\"No valid flow JSON files found in the ZIP\")\n        data = {\"flows\": flows_data}\n    else:\n        try:\n            data = orjson.loads(contents)\n        except orjson.JSONDecodeError as e:\n            raise HTTPException(status_code=400, detail=f\"Invalid JSON file: {e}\") from e\n\n    # Normalise code fields: if exported with code-as-lines format, rejoin to\n    # strings before creating the Pydantic models so the DB always stores strings.\n    if not isinstance(data, dict):\n        raise HTTPException(\n            status_code=422,\n            detail=\"Invalid JSON: expected an object with 'flows' or a single flow object\",\n        )\n    try:\n        if \"flows\" in data:\n            if not isinstance(data[\"flows\"], list):\n                raise HTTPException(\n                    status_code=422,\n                    detail=\"Invalid JSON: 'flows' must be a list of flow objects\",\n                )\n            non_dict = [i for i, f in enumerate(data[\"flows\"]) if not isinstance(f, dict)]\n            if non_dict:\n                raise HTTPException(\n                    status_code=422,\n                    detail=f\"Invalid JSON: flows[{non_dict[0]}] is not an object\",\n                )\n            data = {**data, \"flows\": [normalize_code_for_import(f) for f in data[\"flows\"]]}\n            flow_list = FlowListCreate(**data)\n        else:\n            flow_list = FlowListCreate(flows=[FlowCreate(**normalize_code_for_import(data))])\n    except HTTPException:\n        raise\n    except ValidationError as e:\n        raise HTTPException(status_code=422, detail=str(e)) from e\n","sourceCodeStart":670,"sourceCodeEnd":706,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/backend/base/langflow/api/v1/flows.py#L670-L706","documentation":"Error \"Invalid JSON: 'flows' must be a list of flow objects\" thrown in langflow-ai/langflow.","triggerScenarios":"Occurs when the uploaded JSON has a 'flows' key whose value is not a list of flow objects.","commonSituations":"See trigger scenarios.","solutions":["Ensure the 'flows' key contains a JSON array of flow objects."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}