Mintplex-Labs/anything-llm · error · Error
Unknown flow type: ${step.type}
Error message
Unknown flow type: ${step.type} What it means
Thrown by FlowExecutor.executeStep() when a flow step's `type` does not match any case in its switch (start, apiCall, llmInstruction, webScraping). The executor only knows the four FLOW_TYPES it imports from flowTypes.js. This protects against executing a block the runtime cannot handle. Note that AgentFlows.saveFlow() (error 387) validates this at save time, so reaching this throw means the flow file was written bypassing saveFlow (hand-edited, migrated, or created by a newer build).
Source
Thrown at server/utils/agentFlows/executor.js:168
config.variables.forEach((v) => {
if (v.name && !this.variables[v.name]) {
this.variables[v.name] = v.value || "";
}
});
}
result = this.variables;
break;
case FLOW_TYPES.API_CALL.type:
result = await executeApiCall(config, context);
break;
case FLOW_TYPES.LLM_INSTRUCTION.type:
result = await executeLLMInstruction(config, context);
break;
case FLOW_TYPES.WEB_SCRAPING.type:
result = await executeWebScraping(config, context);
break;
default:
throw new Error(`Unknown flow type: ${step.type}`);
}
// Store result in variable if specified
if (config.resultVariable || config.responseVariable) {
const varName = config.resultVariable || config.responseVariable;
this.variables[varName] = result;
}
// If directOutput is true, mark this result for direct output
if (config.directOutput) result = { directOutput: true, result };
return result;
}
/**
* Execute entire flow
* @param {Object} flow - The flow to execute
* @param {Object} initialVariables - Initial variables for the flow
* @param {Object} aibitat - The aibitat instance from the agent handlerView on GitHub (pinned to 526360e320)
Solutions
- Inspect the offending flow JSON under STORAGE_DIR/plugins/agent-flows and find the step whose `type` is not start/apiCall/llmInstruction/webScraping.
- Remove or replace the unsupported step, then re-save the flow through the UI so saveFlow() re-validates all step types.
- If the block type is valid for your setup, upgrade AnythingLLM to a version whose executor.js handles that type.
- If migrating between platforms (Desktop to Docker), recreate the flow on the target platform instead of copying the JSON.
Example fix
// before - flow JSON contains an unknown block
{"steps":[{"type":"codeExecution","config":{...}}]}
// after - remove the unsupported step or replace with a supported type
{"steps":[{"type":"llmInstruction","config":{"instruction":"..."}}]} Defensive patterns
Strategy: validation
Validate before calling
const { FLOW_TYPES } = require("./flowTypes");
const SUPPORTED = Object.values(FLOW_TYPES).map((d) => d.type);
function validateFlowSteps(flow) {
const bad = (flow.config.steps || []).filter(
(s) => !SUPPORTED.includes(s.type)
);
if (bad.length) throw new Error(`Unsupported step types: ${bad.map((s) => s.type).join(", ")}`);
} Type guard
const SUPPORTED_TYPES = new Set(Object.values(FLOW_TYPES).map((d) => d.type)); const isSupportedStep = (step) => step && typeof step.type === "string" && SUPPORTED_TYPES.has(step.type);
Try / catch
try {
await executor.executeStep(step);
} catch (e) {
if (e.message.startsWith("Unknown flow type")) {
// skip or log the unsupported step rather than aborting the whole flow
} else throw e;
} Prevention
- Always create/save flows through AgentFlows.saveFlow so step types are validated against FLOW_TYPES.
- Never hand-edit flow JSON under storage/plugins/agent-flows; if you do, run validateFlowSteps before executing.
- When importing flows across versions/editions, re-save them on the target platform to re-trigger validation.
When it happens
Trigger: Calling FlowExecutor.executeStep() with a step object whose `.type` is a string other than "start", "apiCall", "llmInstruction", or "webScraping". This includes a step.type of undefined (missing field), a renamed type, or a future type such as a code-execution or file-writing block that this build does not register.
Common situations: A flow JSON edited directly on disk in storage/plugins/agent-flows; a flow exported from a newer AnythingLLM version containing block types the older executor does not recognize; a corrupt/partially-written flow file where step.type is missing.
Related errors
- ${response.error || "Failed to create agent flow"}
- URL is required for web scraping
- This flow includes unsupported blocks. They may not be suppo
- Unsupported provider ${JSON.stringify(provider)} for this ta
- Type "${type}" is not a valid type to sync.
AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13).
Data as JSON: /api/errors/3050c4ac05d72806.
Report an issue: GitHub.