{"record":{"id":"5399b4c40b2427f7","repo":"Mintplex-Labs/anything-llm","slug":"flow-not-found","errorCode":null,"errorMessage":"Flow not found","messagePattern":"Flow not found","errorType":"http","errorClass":null,"httpStatus":404,"severity":"warning","filePath":"server/endpoints/agentFlows.js","lineNumber":83,"sourceCode":"        console.error(\"Error listing flows:\", error);\n        return response.status(500).json({\n          success: false,\n          error: error.message,\n        });\n      }\n    }\n  );\n\n  // Get a specific flow by UUID\n  app.get(\n    \"/agent-flows/:uuid\",\n    [validatedRequest, flexUserRoleValid([ROLES.admin])],\n    async (request, response) => {\n      try {\n        const { uuid } = request.params;\n        const flow = AgentFlows.loadFlow(uuid);\n        if (!flow) {\n          return response.status(404).json({\n            success: false,\n            error: \"Flow not found\",\n          });\n        }\n\n        return response.status(200).json({\n          success: true,\n          flow,\n        });\n      } catch (error) {\n        console.error(\"Error getting flow:\", error);\n        return response.status(500).json({\n          success: false,\n          error: error.message,\n        });\n      }\n    }\n  );","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/endpoints/agentFlows.js#L65-L101","documentation":"GET /agent-flows/:uuid returns this 404 when AgentFlows.loadFlow returns null. loadFlow (server/utils/agentFlows/index.js:69) returns null when the uuid is falsy, when <flowsDir>/<uuid>.json does not exist, when the resolved path escapes the flows directory, or when the file exists but does not parse as JSON (safeJsonParse yields null).","triggerScenarios":"Requesting a flow uuid that was deleted; a copy-pasted/truncated uuid; a flow file renamed or removed on disk from storage/plugins/agent-flows; a corrupted flow file that fails JSON parsing; a uuid containing path segments ('../x') rejected by the isWithin check.","commonSituations":"Stale UI after another admin deleted the flow; docker volume where STORAGE_DIR changed between runs so old uuids no longer resolve; manual editing of flow files that broke JSON.","solutions":["Call GET /agent-flows/list first and confirm the uuid still exists; refresh the flow list in the UI","If the file was expected, check storage/plugins/agent-flows/<uuid>.json on disk and validate it parses as JSON","Ensure STORAGE_DIR is consistent across restarts/deployments so previously saved flows are found"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"async function flowExists(uuid) {\n  const res = await fetch('/api/agent-flows/list');\n  const { flows } = await res.json();\n  return flows.some(f => f.uuid === uuid);\n}","typeGuard":"const UUID_V4_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\nfunction isFlowUuid(v) {\n  return typeof v === 'string' && UUID_V4_RE.test(v) && !v.includes('..');\n}","tryCatchPattern":null,"preventionTips":["Validate uuid format client-side before requesting a flow","After any delete operation, purge that uuid from local caches/UI state","Keep STORAGE_DIR stable across deployments so uuids remain resolvable"],"tags":["agent-flows","http-404","resource-not-found","uuid"],"backgroundTag":"resource-not-found","analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}