{"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":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","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/f92433b4ea0598492a1e6645ea22addbb4dd1287/server/utils/agentFlows/index.js#L101-L137","documentation":"Thrown by AgentFlows.saveFlow when any step in config.steps has a type not present in this build's FLOW_TYPES — the same allowlist the executor dispatches on. It guards both the flow builder save path and flow import, deliberately blocking flows that use blocks unavailable on this platform (the comment cites file-writing/code-execution blocks on Desktop importing to Docker). The throw is caught immediately and returned as { success: false, error } — nothing is written to disk.","triggerScenarios":"Saving or importing a flow whose steps include a block type compiled out of this edition: importing a Desktop-exported flow JSON containing file_write/code_execution style blocks into Docker, importing a flow from a newer version, or POSTing a hand-crafted flow config with an unknown type to the flows API.","commonSituations":"Sharing flow files across AnythingLLM editions (Desktop vs Docker) or versions; downgrading the app while reusing exported flows; community flow templates containing blocks your instance doesn't show in the builder palette.","solutions":["Edit the flow JSON and delete/replace the steps with unsupported types, keeping only blocks your UI palette offers.","Recreate the workflow natively in your instance's flow builder instead of importing.","Align versions: upgrade the importing instance to the version that exported the flow.","Check the response body's error field after save/import — a failure here is non-destructive, the old file (if any) is untouched."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const { FLOW_TYPES } = require(\"../utils/agentFlows/executor\");\n\nfunction flowImportable(config) {\n  const supported = Object.values(FLOW_TYPES).map((d) => d.type);\n  const bad = config.steps.filter((s) => !supported.includes(s.type)).map((s) => s.type);\n  return { ok: bad.length === 0, unsupportedTypes: bad };\n}\n\n// before calling saveFlow/import:\nconst check = flowImportable(flowConfig);\nif (!check.ok) throw new Error(`Flow uses unsupported blocks: ${check.unsupportedTypes.join(\", \")}`);","typeGuard":null,"tryCatchPattern":"const res = AgentFlows.saveFlow(name, config, uuid);\nif (!res.success && /unsupported blocks/.test(res.error)) {\n  // surface which step types to remove; the previous file on disk is untouched\n  return reportUnsupportedBlocks(config);\n}","preventionTips":["Run the FLOW_TYPES allowlist check on every imported flow JSON before calling saveFlow.","Keep source and target AnythingLLM editions/versions aligned when moving flows (Desktop features may not exist in Docker).","Treat a failed save as non-destructive: verify on disk, then decide whether to clean up."],"tags":["agent-flows","compatibility","import-export","validation"],"backgroundTag":"unsupported-flow-block","analyzedSha":"f92433b4ea0598492a1e6645ea22addbb4dd1287","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}