Mintplex-Labs/anything-llm · error · Error

Failed to load flow

Error message

Failed to load flow

What it means

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.

Source

Thrown at frontend/src/pages/Admin/AgentBuilder/index.jsx:88

    );
    setAgentName(flowInfoBlock?.config?.name || "");
  }, [blocks]);

  const loadAvailableFlows = async () => {
    try {
      const { success, error, flows } = await AgentFlows.listFlows();
      if (!success) throw new Error(error);
      setAvailableFlows(flows);
    } catch (error) {
      console.error(error);
      showToast("Failed to load available flows", "error", { clear: true });
    }
  };

  const loadFlow = async (uuid) => {
    try {
      const { success, error, flow } = await AgentFlows.getFlow(uuid);
      if (!success) throw new Error(error);

      // Convert steps to blocks with IDs, ensuring finish block is at the end
      const flowBlocks = [
        {
          id: "flow_info",
          type: BLOCK_TYPES.FLOW_INFO,
          config: {
            name: flow.config.name,
            description: flow.config.description,
          },
          isExpanded: true,
        },
        ...flow.config.steps.map((step, index) => ({
          id: index === 0 ? "start" : `block_${index}`,
          type: step.type,
          config: step.config,
          isExpanded: true,
        })),

View on GitHub (pinned to 3aec848f28)

Solutions

  1. Check the console for the API's error string — it distinguishes 'not found' from a server fault
  2. Go back to the flows list and re-open; a stale uuid is the usual cause
  3. Verify the flow file exists on the server and is valid JSON
  4. Re-authenticate if the session expired, then retry
Defensive patterns

Strategy: try-catch

Validate before calling

const { success, flows } = await AgentFlows.listFlows();
if (success && !flows.some((f) => f.uuid === flowId))
  redirectToList("Flow no longer exists"); // avoid the doomed getFlow call

Try / catch

catch (error) {
  console.error(error);
  showToast("Failed to load flow", "error", { clear: true });
  if (/not found|404/i.test(String(error))) navigate("/agent-builder"); // stale uuid
}

Prevention

When it happens

Trigger: 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.

Common situations: Deep link or bookmark to a removed flow; flow edited on disk while the builder was open; concurrent admins; storage migration losing flow files.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18). Data as JSON: /api/errors/55babf6359814341. Report an issue: GitHub.