{"record":{"id":"22bdd0eb1154b0ca","repo":"Mintplex-Labs/anything-llm","slug":"this-flow-includes-unsupported-blocks-they-may-no","errorCode":null,"errorMessage":"This flow includes unsupported blocks. They may not be supported by your version of AnythingLLM or are not available on this platform.","messagePattern":"This flow includes unsupported blocks\\. They may not be supported by your version of AnythingLLM or are not available on this platform\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/utils/agentFlows/index.js","lineNumber":119,"sourceCode":"  static saveFlow(name, config, uuid = null) {\n    try {\n      AgentFlows.createOrCheckFlowsDir();\n\n      if (!uuid) uuid = uuidv4();\n      const normalizedUuid = normalizePath(`${uuid}.json`);\n      const filePath = path.join(AgentFlows.flowsDir, normalizedUuid);\n      if (!isWithin(AgentFlows.flowsDir, filePath)) return null;\n\n      // Prevent saving flows with unsupported blocks or importing\n      // flows with unsupported blocks (eg: file writing or code execution on Desktop importing to Docker)\n      const supportedFlowTypes = Object.values(FLOW_TYPES).map(\n        (definition) => definition.type\n      );\n      const supportsAllBlocks = config.steps.every((step) =>\n        supportedFlowTypes.includes(step.type)\n      );\n      if (!supportsAllBlocks)\n        throw new Error(\n          \"This flow includes unsupported blocks. They may not be supported by your version of AnythingLLM or are not available on this platform.\"\n        );\n\n      fs.writeFileSync(filePath, JSON.stringify({ ...config, name }, null, 2));\n      return { success: true, uuid };\n    } catch (error) {\n      console.error(\"Failed to save flow:\", error);\n      return { success: false, error: error.message };\n    }\n  }\n\n  /**\n   * List all available flows\n   * @returns {Array} Array of flow summaries\n   */\n  static listFlows() {\n    try {\n      const flows = AgentFlows.getAllFlows();","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/utils/agentFlows/index.js#L101-L137","documentation":"Thrown by AgentFlows.saveFlow() after it builds the list of supported step types from FLOW_TYPES and finds that one or more steps in config.steps have a type not in that list. This blocks saving or importing a flow that contains blocks the current platform/version cannot run (e.g., file-writing or code-execution blocks that exist on Desktop but not Docker). It is caught inside saveFlow and returned as { success:false, error } rather than propagating.","triggerScenarios":"Calling saveFlow() with a config whose steps array includes a step.type not present in the FLOW_TYPES values for this build. Common on cross-platform import (Desktop flow imported into Docker) or after a version downgrade where a block type was removed.","commonSituations":"Exporting a flow from one AnythingLLM edition and importing into another with a different block set; downgrading versions; manually constructing a flow JSON with an unsupported type and saving via the API.","solutions":["Identify which step.type in the flow is not supported by inspecting FLOW_TYPES in flowTypes.js for your build.","Remove the unsupported step(s) from the flow and re-save.","Recreate the flow natively on the target platform rather than importing cross-edition.","Upgrade the target AnythingLLM to a version that supports the block type."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const { FLOW_TYPES } = require(\"./flowTypes\");\nconst SUPPORTED = Object.values(FLOW_TYPES).map((d) => d.type);\nfunction preCheckFlowBlocks(config) {\n  const unsupported = (config.steps || []).filter((s) => !SUPPORTED.includes(s.type));\n  if (unsupported.length)\n    throw new Error(`Cannot save: unsupported types ${unsupported.map((s) => s.type).join(\", \")}`);\n}","typeGuard":"const isSaveableFlow = (config) =>\n  Array.isArray(config?.steps) &&\n  config.steps.every((s) => SUPPORTED.includes(s.type));","tryCatchPattern":"const res = AgentFlows.saveFlow(name, config, uuid);\nif (!res.success && res.error.includes(\"unsupported blocks\")) {\n  // strip unsupported steps and retry, or surface to the user\n}","preventionTips":["Recreate flows natively on the target platform instead of importing cross-edition JSON.","Keep AnythingLLM versions aligned across environments that share flows.","Inspect FLOW_TYPES in flowTypes.js to learn which blocks your build supports."],"tags":["agent-flows","validation","import","cross-platform"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}