{"record":{"id":"fe3f154cea1e3334","repo":"langflow-ai/langflow","slug":"flow-not-found","errorCode":null,"errorMessage":"Flow not found","messagePattern":"Flow not found","errorType":"http","errorClass":"Error","httpStatus":404,"severity":"error","filePath":"src/frontend/src/utils/buildUtils.ts","lineNumber":313,"sourceCode":"        onBuildError,\n        onGetOrderSuccess,\n        onValidateNodes,\n      };\n\n      return performStreamingRequest({\n        method: \"POST\",\n        url: buildUrl,\n        body: postData,\n        onData: async (event) => {\n          const type = event[\"event\"];\n          const data = event[\"data\"];\n          return onEvent(type, data, buildResults, eventCallbacks);\n        },\n        onDataBatch: (events) =>\n          processBatchedEvents(events, buildResults, eventCallbacks, onEvent),\n        onError: (statusCode) => {\n          if (statusCode === 404) {\n            throw new Error(\"Flow not found\");\n          }\n          throw new Error(\"Error processing build events\");\n        },\n        onNetworkError: (error: Error) => {\n          if (error.name === \"AbortError\") {\n            onBuildStopped && onBuildStopped();\n            return;\n          }\n          onBuildError!(\"Error Building Component\", [\n            \"Network error. Please check the connection to the server.\",\n          ]);\n        },\n        buildController,\n      });\n    }\n  } catch (e) {\n    console.error(e);\n  }","sourceCodeStart":295,"sourceCodeEnd":331,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/frontend/src/utils/buildUtils.ts#L295-L331","documentation":"Thrown inside the streaming build path of buildUtils when the POST to the build-events endpoint returns HTTP 404. The frontend asked the backend to build/validate a flow by id and the backend has no flow with that id, so the stream is treated as 'Flow not found'.","triggerScenarios":"Building a component in the canvas for a flow id that no longer exists in the DB: the flow was deleted in another tab/session, the database was reset, or the id in the URL/store is stale after a project/workspace switch.","commonSituations":"Long-lived browser tabs pointing at flows deleted elsewhere; DB wiped while the frontend kept cached flow ids; copying a flow URL with a truncated or wrong UUID.","solutions":["Reload the page / refresh the flows list so stale flow ids are dropped from the store","Verify the flow still exists (GET /api/v1/flows/{id}) — a 404 confirms deletion or wrong id","If the DB was reset intentionally, restart the backend and reload the frontend so sessions realign","Recreate or re-import the flow if it was deleted"],"exampleFix":"// before: build against possibly-stale id\nawait runBuildEventsStream({ flow_id: flowIdFromStore });\n\n// after: verify first, then build\nconst res = await fetch(`/api/v1/flows/${flowIdFromStore}`);\nif (res.status === 404) {\n  notifyAndReloadFlowList();\n} else {\n  await runBuildEventsStream({ flow_id: flowIdFromStore });\n}","handlingStrategy":"try-catch","validationCode":"const res = await fetch(`/api/v1/flows/${flowId}`, { credentials: \"include\" });\nif (!res.ok) { reloadFlowsAndNotify(); return; }","typeGuard":null,"tryCatchPattern":"try {\n  await streamBuildEvents(flowId);\n} catch (e) {\n  if (e instanceof Error && e.message === \"Flow not found\") {\n    await refreshFlowStore(); // drop stale id, re-render list\n  } else throw e;\n}","preventionTips":["Refresh flow ids from the API on window focus to catch deletions from other sessions","Before building, verify the id exists when the tab has been open a long time","Handle 404 as a data-freshness problem, not a transient one — do not blind-retry"],"tags":["frontend","build","http-404","stale-state"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}