{"record":{"id":"0a6b5da95f137027","repo":"langflow-ai/langflow","slug":"flow-file-flow-filename-not-found","errorCode":null,"errorMessage":"Flow file '{flow_filename}' not found","messagePattern":"Flow file '(.+?)' not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"warning","filePath":"src/backend/base/langflow/agentic/services/helpers/flow_loader.py","lineNumber":79,"sourceCode":"\n    Args:\n        flow_filename: Name of the flow file (with or without extension).\n\n    Returns:\n        tuple[Path, str]: (resolved path, file type: \"json\" or \"python\")\n\n    Raises:\n        HTTPException: If flow file not found.\n    \"\"\"\n    # Early rejection of path traversal sequences before any path construction.\n    if \"..\" in flow_filename or \"\\\\\" in flow_filename:\n        raise HTTPException(status_code=400, detail=f\"Invalid flow filename: '{flow_filename}'\")\n\n    if flow_filename.endswith(\".json\"):\n        flow_path = _safe_resolved_path(FLOWS_BASE_PATH / flow_filename)\n        if flow_path.exists():\n            return flow_path, \"json\"\n        raise HTTPException(status_code=404, detail=f\"Flow file '{flow_filename}' not found\")\n\n    if flow_filename.endswith(\".py\"):\n        flow_path = _safe_resolved_path(FLOWS_BASE_PATH / flow_filename)\n        if flow_path.exists():\n            return flow_path, \"python\"\n        raise HTTPException(status_code=404, detail=f\"Flow file '{flow_filename}' not found\")\n\n    # Auto-detect: try Python first, then JSON (allows gradual migration)\n    base_name = flow_filename.rsplit(\".\", 1)[0] if \".\" in flow_filename else flow_filename\n\n    py_path = _safe_resolved_path(FLOWS_BASE_PATH / f\"{base_name}.py\")\n    if py_path.exists():\n        return py_path, \"python\"\n\n    json_path = _safe_resolved_path(FLOWS_BASE_PATH / f\"{base_name}.json\")\n    if json_path.exists():\n        return json_path, \"json\"\n","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/backend/base/langflow/agentic/services/helpers/flow_loader.py#L61-L97","documentation":"Returned by resolve_flow_path when the filename explicitly ends in '.json', the sanitized path stays inside FLOWS_BASE_PATH, but no file exists at that path. HTTP 404 with the requested filename echoed. The explicit-extension branches take priority over auto-detection, so 'x.json' never falls back to 'x.py'.","triggerScenarios":"POST /api/v1/agentic/execute/{flow_name} with flow_name='missing.json' when FLOWS_BASE_PATH/missing.json does not exist (wrong name, wrong case, not deployed yet).","commonSituations":"Deploying a client before deploying the flow file; case-sensitivity mismatch on Linux ('Assistant.json' vs 'assistant.json'); file deployed to a different directory than FLOWS_BASE_PATH; typos in the name.","solutions":["List the flows directory (FLOWS_BASE_PATH, e.g. langflow/flows) and use the exact filename including case.","Deploy/copy the .json flow file into FLOWS_BASE_PATH before invoking execute.","Drop the extension to trigger auto-detection (.py tried before .json) if you are unsure of the extension."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import os\n\ndef json_flow_exists(name: str, base: str) -> bool:\n    return name.endswith('.json') and os.path.isfile(os.path.join(base, os.path.basename(name)))","typeGuard":null,"tryCatchPattern":"On 404, list the flows directory (or a flows manifest endpoint) and either correct the name or prompt deployment; do not retry the same name unchanged.","preventionTips":["Deploy flow files before shipping clients that reference them.","Match filename case exactly (Linux servers are case-sensitive).","Keep a manifest of deployed flow names and validate requests against it."],"tags":["agentic","flow-loader","http-404","file-not-found"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}