{"record":{"id":"300d3f194453dbae","repo":"Mintplex-Labs/anything-llm","slug":"response-error-failed-to-create-agent-flow","errorCode":null,"errorMessage":"response.error || \"Failed to create agent flow\"","messagePattern":"response\\.error \\|\\| \"Failed to create agent flow\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"frontend/src/models/communityHub.js","lineNumber":198,"sourceCode":"        success: false,\n        error: e.message,\n      }));\n  },\n\n  /**\n   * Create a new agent flow in the community hub\n   * @param {Object} data - The agent flow data\n   * @returns {Promise<{success: boolean, error: string | null}>}\n   */\n  createAgentFlow: async (data) => {\n    return await fetch(`${API_BASE}/community-hub/agent-flow/create`, {\n      method: \"POST\",\n      headers: baseHeaders(),\n      body: JSON.stringify(data),\n    }).then(async (res) => {\n      const response = await res.json();\n      if (!res.ok)\n        throw new Error(response.error || \"Failed to create agent flow\");\n      return { success: true, error: null, itemId: response.item?.id };\n    });\n  },\n\n  /**\n   * Create a new slash command in the community hub\n   * @param {Object} data - The slash command data\n   * @param {string} data.name - The name of the command\n   * @param {string} data.description - The description of the command\n   * @param {string} data.command - The actual command text\n   * @param {string} data.prompt - The prompt for the command\n   * @param {string[]} data.tags - Array of tags\n   * @param {string} data.visibility - Either 'public' or 'private'\n   * @returns {Promise<{success: boolean, error: string | null}>}\n   */\n  createSlashCommand: async (data) => {\n    return await fetch(`${API_BASE}/community-hub/slash-command/create`, {\n      method: \"POST\",","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/frontend/src/models/communityHub.js#L180-L216","documentation":"Frontend guard in CommunityHub.createAgentFlow: the agent-flow create endpoint returned a non-ok status, so the flow was not created in the community hub; the server error is preferred, with 'Failed to create agent flow' as fallback.","triggerScenarios":"Thrown when creating an agent flow via the Community Hub fails.","commonSituations":"Invalid flow definition or hub connection issue.","solutions":["Validate the agent flow definition before submitting.","Check the Community Hub connection key.","Review the returned error for missing fields."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}