{"record":{"id":"cba8817d693e441f","repo":"langflow-ai/langflow","slug":"flow-not-found-cba881","errorCode":null,"errorMessage":"Flow not found","messagePattern":"Flow not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"src/backend/base/langflow/api/v1/flow_version.py","lineNumber":83,"sourceCode":"    result.is_deployed = is_deployed\n    return result\n\n\ndef _version_to_read_full(\n    entry: FlowVersion, *, strip_keys: bool = False, is_deployed: bool | None = None\n) -> FlowVersionReadWithData:\n    result = FlowVersionReadWithData.model_validate(entry, from_attributes=True)\n    result.is_deployed = is_deployed\n    if strip_keys:\n        result.data = strip_version_data(result.data)\n    return result\n\n\nasync def _get_user_flow(session: AsyncSession, flow_id: UUID, user_id: UUID) -> Flow:\n    result = await session.exec(select(Flow).where(Flow.id == flow_id, Flow.user_id == user_id))\n    flow = result.first()\n    if not flow:\n        raise HTTPException(status_code=404, detail=\"Flow not found\")\n    return flow\n\n\ndef _translate_version_error(exc: FlowVersionError) -> HTTPException:\n    \"\"\"Translate a domain exception into an HTTPException.\"\"\"\n    if isinstance(exc, FlowVersionSerializationError):\n        return HTTPException(status_code=422, detail=str(exc))\n    if isinstance(exc, FlowVersionConflictError):\n        return HTTPException(status_code=409, detail=str(exc))\n    if isinstance(exc, FlowVersionDeployedError):\n        return HTTPException(status_code=409, detail=str(exc))\n    if isinstance(exc, FlowVersionNotFoundError):\n        return HTTPException(status_code=404, detail=str(exc))\n    return HTTPException(status_code=500, detail=str(exc))\n\n\ndef _ensure_deployments_enabled_for_provider_id(deployment_provider_id: UUID | None) -> None:\n    if deployment_provider_id and not FEATURE_FLAGS.wxo_deployments:","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/backend/base/langflow/api/v1/flow_version.py#L65-L101","documentation":"404 from the flow version API's _get_user_flow helper: every /flows/{flow_id}/versions route first requires a Flow row matching BOTH the flow_id and the current user_id. No such row means the flow does not exist or is owned by someone else — both report the same generic 404. Note this helper is strictly owner-scoped (it does not include the Flow.user_id IS NULL branch used by flow_events).","triggerScenarios":"Any flow-version request (list/create/get/activate/delete) where flow_id belongs to another user, was deleted, or is a null-owner flow (which this helper deliberately does not match even under AUTO_LOGIN).","commonSituations":"Team deployments where a teammate's flow id is used; null-owner/starter flows created under AUTO_LOGIN that the strict user_id == current_user.id predicate excludes; stale ids after re-importing a database.","solutions":["Verify ownership: GET /api/v1/flows/{flow_id} must succeed for the same user before version endpoints can work","For null-owner flows under AUTO_LOGIN, assign an owner (update user_id) or operate as the user who created them","Re-check the flow_id from the current flows listing rather than a cached value"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const flow = await axios.get(`/api/v1/flows/${flowId}`); // must succeed first — same owner scope\n// then: axios.get(`/api/v1/flows/${flowId}/versions/`)","typeGuard":null,"tryCatchPattern":"catch (e) { if (e.response?.status === 404) showFlowUnavailable(); else throw e; }","preventionTips":["Always confirm flow readability with the caller's own credentials before touching version endpoints","Remember version endpoints exclude null-owner flows even under AUTO_LOGIN — pin flows to real users","Don't cache version data across sessions; re-list on mount"],"tags":["http-404","flow-versions","ownership","authorization"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}