{"record":{"id":"55babf6359814341","repo":"Mintplex-Labs/anything-llm","slug":"failed-to-load-flow","errorCode":null,"errorMessage":"Failed to load flow","messagePattern":"Failed to load flow","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"frontend/src/pages/Admin/AgentBuilder/index.jsx","lineNumber":88,"sourceCode":"    );\n    setAgentName(flowInfoBlock?.config?.name || \"\");\n  }, [blocks]);\n\n  const loadAvailableFlows = async () => {\n    try {\n      const { success, error, flows } = await AgentFlows.listFlows();\n      if (!success) throw new Error(error);\n      setAvailableFlows(flows);\n    } catch (error) {\n      console.error(error);\n      showToast(\"Failed to load available flows\", \"error\", { clear: true });\n    }\n  };\n\n  const loadFlow = async (uuid) => {\n    try {\n      const { success, error, flow } = await AgentFlows.getFlow(uuid);\n      if (!success) throw new Error(error);\n\n      // Convert steps to blocks with IDs, ensuring finish block is at the end\n      const flowBlocks = [\n        {\n          id: \"flow_info\",\n          type: BLOCK_TYPES.FLOW_INFO,\n          config: {\n            name: flow.config.name,\n            description: flow.config.description,\n          },\n          isExpanded: true,\n        },\n        ...flow.config.steps.map((step, index) => ({\n          id: index === 0 ? \"start\" : `block_${index}`,\n          type: step.type,\n          config: step.config,\n          isExpanded: true,\n        })),","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/frontend/src/pages/Admin/AgentBuilder/index.jsx#L70-L106","documentation":"Single-flow load on the Agent Builder page: AgentFlows.getFlow(uuid) either answers success:false or throws (network), and the catch toasts 'Failed to load flow'. The specific API error goes to console.error only. The most common root cause is asking for a flow uuid that no longer exists.","triggerScenarios":"Opening the builder for a uuid that was deleted in another session/tab; flow file removed, renamed, or corrupt on the server; permission error reading the flow; expired session producing an error response.","commonSituations":"Deep link or bookmark to a removed flow; flow edited on disk while the builder was open; concurrent admins; storage migration losing flow files.","solutions":["Check the console for the API's error string — it distinguishes 'not found' from a server fault","Go back to the flows list and re-open; a stale uuid is the usual cause","Verify the flow file exists on the server and is valid JSON","Re-authenticate if the session expired, then retry"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const { success, flows } = await AgentFlows.listFlows();\nif (success && !flows.some((f) => f.uuid === flowId))\n  redirectToList(\"Flow no longer exists\"); // avoid the doomed getFlow call","typeGuard":null,"tryCatchPattern":"catch (error) {\n  console.error(error);\n  showToast(\"Failed to load flow\", \"error\", { clear: true });\n  if (/not found|404/i.test(String(error))) navigate(\"/agent-builder\"); // stale uuid\n}","preventionTips":["Validate the uuid against the freshly loaded flows list before fetching it","Redirect to the list with a clear message when the flow is gone instead of a dead editor","Re-check existence after long-lived editor sessions before saving over a removed flow"],"tags":["agent-builder","agent-flows","not-found","frontend"],"backgroundTag":"resource-not-found","analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}