Mintplex-Labs/anything-llm · error · Error

res.error || "Failed to save flow"

Error message

res.error || "Failed to save flow"

What it means

Frontend guard in AgentFlows.saveFlow: the POST to /agent-flows/save returned a non-ok HTTP status, meaning the backend rejected the flow save (e.g. validation failure or server error); the server-provided error is used when present, otherwise the generic 'Failed to save flow' text.

Solutions

  1. Check the server response error for details and correct the flow definition.
  2. Verify the flow JSON schema and required fields before saving.
  3. Retry after fixing validation errors reported by the server.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown when the agent flow save API call returns an error.

Common situations: Invalid flow definition, missing required fields, or server-side validation failure.


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

Appendix: source

Thrown at frontend/src/models/agentFlows.js:22

const AgentFlows = {
  /**
   * Save a flow configuration
   * @param {string} name - Display name of the flow
   * @param {object} config - The configuration object for the flow
   * @param {string} [uuid] - Optional UUID for updating existing flow
   * @returns {Promise<{success: boolean, error: string | null, flow: {name: string, config: object, uuid: string} | null}>}
   */
  saveFlow: async (name, config, uuid = null) => {
    return await fetch(`${API_BASE}/agent-flows/save`, {
      method: "POST",
      headers: {
        ...baseHeaders(),
        "Content-Type": "application/json",
      },
      body: JSON.stringify({ name, config, uuid }),
    })
      .then((res) => {
        if (!res.ok) throw new Error(res.error || "Failed to save flow");
        return res;
      })
      .then((res) => res.json())
      .catch((e) => ({
        success: false,
        error: e.message,
        flow: null,
      }));
  },

  /**
   * List all available flows in the system
   * @returns {Promise<{success: boolean, error: string | null, flows: Array<{name: string, uuid: string, description: string, steps: Array}>}>}
   */
  listFlows: async () => {
    return await fetch(`${API_BASE}/agent-flows/list`, {
      method: "GET",
      headers: baseHeaders(),

View on GitHub (pinned to 3aec848f28)