{"record":{"id":"3050c4ac05d72806","repo":"Mintplex-Labs/anything-llm","slug":"unknown-flow-type-step-type","errorCode":null,"errorMessage":"Unknown flow type: ${step.type}","messagePattern":"Unknown flow type: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/utils/agentFlows/executor.js","lineNumber":192,"sourceCode":"          config.variables.forEach((v) => {\n            if (v.name && !this.variables[v.name]) {\n              this.variables[v.name] = v.value || \"\";\n            }\n          });\n        }\n        result = this.variables;\n        break;\n      case FLOW_TYPES.API_CALL.type:\n        result = await executeApiCall(config, context);\n        break;\n      case FLOW_TYPES.LLM_INSTRUCTION.type:\n        result = await executeLLMInstruction(config, context);\n        break;\n      case FLOW_TYPES.WEB_SCRAPING.type:\n        result = await executeWebScraping(config, context);\n        break;\n      default:\n        throw new Error(`Unknown flow type: ${step.type}`);\n    }\n\n    // Store result in variable if specified\n    if (config.resultVariable || config.responseVariable) {\n      const varName = config.resultVariable || config.responseVariable;\n      this.variables[varName] = result;\n    }\n\n    // If directOutput is true, mark this result for direct output\n    if (config.directOutput) result = { directOutput: true, result };\n    return result;\n  }\n\n  /**\n   * Execute entire flow\n   * @param {Object} flow - The flow to execute\n   * @param {Object} initialVariables - Initial variables for the flow\n   * @param {Object} aibitat - The aibitat instance from the agent handler","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/f92433b4ea0598492a1e6645ea22addbb4dd1287/server/utils/agentFlows/executor.js#L174-L210","documentation":"Thrown by FlowExecutor.executeStep when a flow step's `type` matches no case in its dispatch switch (comment/variable echo, API_CALL, LLM_INSTRUCTION, WEB_SCRAPING). The FLOW_TYPES set compiled into this build is the source of truth, so a JSON flow file containing a step type this instance doesn't know (or that isn't offered on this platform, e.g. file-write/code-execution blocks on Docker) aborts execution mid-flow.","triggerScenarios":"Executing a flow whose steps array contains any type outside this build's FLOW_TYPES: hand-edited flow JSON in storage/plugins/agent-flows, a flow exported from a newer AnythingLLM or the Desktop edition and imported here, or a step whose `type` key was renamed/mistyped.","commonSituations":"Importing Desktop flows (which may include code/file blocks) into the Docker deployment; downgrading AnythingLLM while keeping old flow files; manually authoring flow JSON with a guessed type like \"http_request\" instead of \"api_call\"; sharing flow files between instances of different versions.","solutions":["Open the flow JSON under storage/plugins/agent-flows/<uuid>.json and remove or rewrite the offending step to a supported type (api_call, llm_instruction, web_scraping, comment/variable steps).","Rebuild the flow in the UI flow builder — its palette only offers blocks this platform supports.","Match AnythingLLM versions between the instance that exported the flow and the one importing it.","Compare step.type values against Object.values(FLOW_TYPES) from server/utils/agentFlows/flowTypes.js for your build."],"exampleFix":"// before: storage/plugins/agent-flows/<uuid>.json\n\"steps\": [\n  { \"type\": \"file_write\", \"config\": { \"path\": \"out.txt\" } }\n]\n// -> Error: Unknown flow type: file_write\n\n// after\n\"steps\": [\n  { \"type\": \"api_call\", \"config\": { \"url\": \"https://example.com/hook\" } }\n]","handlingStrategy":"try-catch","validationCode":"const { FLOW_TYPES } = require(\"../utils/agentFlows/executor\");\n\nfunction flowStepsSupported(flow) {\n  const supported = Object.values(FLOW_TYPES).map((d) => d.type);\n  return flow.config.steps.every((s) => supported.includes(s.type));\n}","typeGuard":null,"tryCatchPattern":"try {\n  await AgentFlows.executeFlow(uuid, variables, aibitat);\n} catch (e) {\n  if (/^Unknown flow type:/.test(e.message)) {\n    // strip or rebuild the offending step, then re-save the flow\n    return respondFlowUnsupported(e.message);\n  }\n  throw e;\n}","preventionTips":["Validate imported flow JSON against FLOW_TYPES of the target instance before saving or executing it.","Keep the AnythingLLM version identical on both ends when exporting/importing flows.","Prefer building flows in the UI palette — it only offers blocks this platform can run."],"tags":["agent-flows","dispatch","compatibility","flow-config"],"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"}