FlowiseAI/Flowise · error · Error
Error in LLM node: ${error instanceof Error ? error.message
Error message
Error in LLM node: ${error instanceof Error ? error.message : String(error)} What it means
The catch-all at the end of LLM_Agentflow.run(). Any exception not matching the special-case 'Aborted' (user-initiated abort, which is re-thrown verbatim) is wrapped as `Error in LLM node: <message>`. The analytics onLLMError handler is invoked first with the raw message. This wrapper preserves the original message text but replaces the error type and stack origin.
Source
Thrown at packages/components/nodes/agentflow/LLM/LLM.ts:694
name: nodeData?.label ? nodeData?.label.toLowerCase().replace(/\s/g, '_').trim() : nodeData?.id,
...(((artifacts && artifacts.length > 0) || (fileAnnotations && fileAnnotations.length > 0)) && {
additional_kwargs: {
...(artifacts && artifacts.length > 0 && { artifacts }),
...(fileAnnotations && fileAnnotations.length > 0 && { fileAnnotations })
}
})
}
]
}
} catch (error) {
if (options.analyticHandlers && llmIds) {
await options.analyticHandlers.onLLMError(llmIds, error instanceof Error ? error.message : String(error))
}
if (error instanceof Error && error.message === 'Aborted') {
throw error
}
throw new Error(`Error in LLM node: ${error instanceof Error ? error.message : String(error)}`)
}
}
/**
* Handles memory management based on the specified memory type
*/
private async handleMemory({
messages,
memoryType,
pastChatHistory,
runtimeChatHistory,
llmNodeInstance,
nodeData,
userMessage,
input,
abortController,
options,
modelConfigView on GitHub (pinned to abe4a8601a)
Solutions
- Read the analytics dashboard (onLLMError fires) or server logs for the inner message after the colon.
- If the message mentions auth/key — fix the model credential.
- If it mentions tokens/context — trim chat history or reduce input size.
- If it mentions model not found — correct the model name in the model component.
- For transient provider errors, add retry at the provider/flow level.
- Patch the wrapper to use `{ cause: error }` so the original stack survives.
Example fix
// before
throw new Error(`Error in LLM node: ${error instanceof Error ? error.message : String(error)}`)
// after
throw new Error(`Error in LLM node: ${error instanceof Error ? error.message : String(error)}`, { cause: error }) Defensive patterns
Strategy: try-catch
Try / catch
try {
await llmNode.run(nodeData, input, options)
} catch (e) {
const msg = (e as Error).message
if (msg === 'Aborted') return // user-initiated, swallow
if (msg.startsWith('Error in LLM node: ')) {
const inner = msg.slice('Error in LLM node: '.length)
// branch on inner: auth, context length, model not found
}
throw e
} Prevention
- Pre-validate provider credentials and model name before the LLM node.
- Bound chat history length to avoid context-overflow errors.
- Subscribe to onLLMError analytics to capture the raw inner message.
- Pass a stable AbortController so aborts are intentional.
When it happens
Trigger: The chat model throws (auth failure, rate limit, context-length exceeded, invalid model name), memory/vector-store retrieval fails, a structured-output schema is invalid, or the provider SDK raises any non-Abort error.
Common situations: Wrong/missing API key for the provider; model name typo or deprecated model; prompt+history exceeds token limit; tool/structured-output JSON schema mismatch; transient provider 5xx.
Related errors
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/fd7a6ddb6faf4172.
Report an issue: GitHub.