{"record":{"id":"5a4a3ba9ca2f6b7c","repo":"Mintplex-Labs/anything-llm","slug":"failed-to-load-available-flows","errorCode":null,"errorMessage":"Failed to load available flows","messagePattern":"Failed to load available flows","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"frontend/src/pages/Admin/AgentBuilder/index.jsx","lineNumber":77,"sourceCode":"  }, []);\n\n  useEffect(() => {\n    if (flowId) {\n      loadFlow(flowId);\n    }\n  }, [flowId]);\n\n  useEffect(() => {\n    const flowInfoBlock = blocks.find(\n      (block) => block.type === BLOCK_TYPES.FLOW_INFO\n    );\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: {","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/frontend/src/pages/Admin/AgentBuilder/index.jsx#L59-L95","documentation":"Agent Builder admin page loads the flow list via AgentFlows.listFlows(); when the call answers success:false (or throws), the page toasts this generic message while console.error records the API's specific error string. The toast text hides the cause — the console has it.","triggerScenarios":"GET of the agent-flows list returning non-2xx: server error enumerating the flows directory, permissions problem on that folder, unauthenticated/expired admin session, or a backend version without the flows endpoint.","commonSituations":"Server storage path for flows moved or unreadable; upgrade mismatch between frontend page and backend routes; session expired while the admin tab sat open; transient server crash/restart.","solutions":["Open the browser console — the raw API error is logged next to the toast","Confirm you are logged in as an admin and the backend build includes agent flows support","Check server logs for filesystem errors reading the agent-flows directory","Retry after the server is confirmed healthy"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const { success, error, flows } = await AgentFlows.listFlows();\nif (!success) {\n  console.error(error);\n  setAvailableFlows([]); // degrade gracefully — builder still usable for new flows\n}","typeGuard":null,"tryCatchPattern":"catch (error) {\n  console.error(error);\n  showToast(\"Failed to load available flows\", \"error\", { clear: true });\n  setAvailableFlows([]); // empty-state instead of blocking the page\n}","preventionTips":["Degrade to an empty list with a retry button instead of failing the whole builder page","Log the API's error string alongside the generic toast so cause is diagnosable","Handle 401 by redirecting to login rather than showing a load failure"],"tags":["agent-builder","agent-flows","api","frontend"],"backgroundTag":"api-request-failed","analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}