langflow-ai/langflow · error · Error
Flow not found
Error message
Flow not found
What it means
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'.
Source
Thrown at src/frontend/src/utils/buildUtils.ts:313
onBuildError,
onGetOrderSuccess,
onValidateNodes,
};
return performStreamingRequest({
method: "POST",
url: buildUrl,
body: postData,
onData: async (event) => {
const type = event["event"];
const data = event["data"];
return onEvent(type, data, buildResults, eventCallbacks);
},
onDataBatch: (events) =>
processBatchedEvents(events, buildResults, eventCallbacks, onEvent),
onError: (statusCode) => {
if (statusCode === 404) {
throw new Error("Flow not found");
}
throw new Error("Error processing build events");
},
onNetworkError: (error: Error) => {
if (error.name === "AbortError") {
onBuildStopped && onBuildStopped();
return;
}
onBuildError!("Error Building Component", [
"Network error. Please check the connection to the server.",
]);
},
buildController,
});
}
} catch (e) {
console.error(e);
}View on GitHub (pinned to 976ec789d2)
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
Example fix
// before: build against possibly-stale id
await runBuildEventsStream({ flow_id: flowIdFromStore });
// after: verify first, then build
const res = await fetch(`/api/v1/flows/${flowIdFromStore}`);
if (res.status === 404) {
notifyAndReloadFlowList();
} else {
await runBuildEventsStream({ flow_id: flowIdFromStore });
} Defensive patterns
Strategy: try-catch
Validate before calling
const res = await fetch(`/api/v1/flows/${flowId}`, { credentials: "include" });
if (!res.ok) { reloadFlowsAndNotify(); return; } Try / catch
try {
await streamBuildEvents(flowId);
} catch (e) {
if (e instanceof Error && e.message === "Flow not found") {
await refreshFlowStore(); // drop stale id, re-render list
} else throw e;
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Build job not found
- Error processing build events
- Error starting build process
- Job not found: {exc!s}
- Failed to load file (HTTP ${status})
AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14).
Data as JSON: /api/errors/fe3f154cea1e3334.
Report an issue: GitHub.