{"record":{"id":"0c9d8dbe50d8d210","repo":"langflow-ai/langflow","slug":"invalid-json-flows-non-dict-0-is-not-an-objec","errorCode":null,"errorMessage":"Invalid JSON: flows[{non_dict[0]}] is not an object","messagePattern":"Invalid JSON: flows\\[(.+?)\\] is not an object","errorType":"http","errorClass":"HTTPException","httpStatus":422,"severity":"error","filePath":"src/backend/base/langflow/api/v1/flows.py","lineNumber":694,"sourceCode":"            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\n    # TODO: Full-version import is planned as a follow-up feature.\n    # When implemented, extract raw flow dicts here to read embedded \"version\"\n    # arrays and create FlowVersion entries for each imported flow.\n\n    # Per-flow CREATE check on the effective destination. _upsert_flow_list lets\n    # the query `folder_id` override each flow's `folder_id`, but it preserves","sourceCodeStart":676,"sourceCodeEnd":712,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/backend/base/langflow/api/v1/flows.py#L676-L712","documentation":"Error \"Invalid JSON: flows[{non_dict[0]}] is not an object\" thrown in langflow-ai/langflow.","triggerScenarios":"Occurs when an element of the 'flows' list in the uploaded JSON is not a JSON object.","commonSituations":"See trigger scenarios.","solutions":["Ensure every entry in the 'flows' array is a JSON object representing a flow."],"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"}