langflow-ai/langflow · warning · HTTPException

Flow file '{flow_filename}' not found

Error message

Flow file '{flow_filename}' not found

What it means

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'.

Source

Thrown at src/backend/base/langflow/agentic/services/helpers/flow_loader.py:79

    Args:
        flow_filename: Name of the flow file (with or without extension).

    Returns:
        tuple[Path, str]: (resolved path, file type: "json" or "python")

    Raises:
        HTTPException: If flow file not found.
    """
    # Early rejection of path traversal sequences before any path construction.
    if ".." in flow_filename or "\\" in flow_filename:
        raise HTTPException(status_code=400, detail=f"Invalid flow filename: '{flow_filename}'")

    if flow_filename.endswith(".json"):
        flow_path = _safe_resolved_path(FLOWS_BASE_PATH / flow_filename)
        if flow_path.exists():
            return flow_path, "json"
        raise HTTPException(status_code=404, detail=f"Flow file '{flow_filename}' not found")

    if flow_filename.endswith(".py"):
        flow_path = _safe_resolved_path(FLOWS_BASE_PATH / flow_filename)
        if flow_path.exists():
            return flow_path, "python"
        raise HTTPException(status_code=404, detail=f"Flow file '{flow_filename}' not found")

    # Auto-detect: try Python first, then JSON (allows gradual migration)
    base_name = flow_filename.rsplit(".", 1)[0] if "." in flow_filename else flow_filename

    py_path = _safe_resolved_path(FLOWS_BASE_PATH / f"{base_name}.py")
    if py_path.exists():
        return py_path, "python"

    json_path = _safe_resolved_path(FLOWS_BASE_PATH / f"{base_name}.json")
    if json_path.exists():
        return json_path, "json"

View on GitHub (pinned to 976ec789d2)

Solutions

  1. List the flows directory (FLOWS_BASE_PATH, e.g. langflow/flows) and use the exact filename including case.
  2. Deploy/copy the .json flow file into FLOWS_BASE_PATH before invoking execute.
  3. Drop the extension to trigger auto-detection (.py tried before .json) if you are unsure of the extension.
Defensive patterns

Strategy: validation

Validate before calling

import os

def json_flow_exists(name: str, base: str) -> bool:
    return name.endswith('.json') and os.path.isfile(os.path.join(base, os.path.basename(name)))

Try / catch

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.

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14). Data as JSON: /api/errors/0a6b5da95f137027. Report an issue: GitHub.