FlowiseAI/Flowise · error · Error
Agent must have a predecessor!
Error message
Agent must have a predecessor!
What it means
Predecessor check inside the LLM Node. Note the message text says 'Agent' rather than 'LLM Node' — this is a copy-paste from the Agent node and is misleading, but the failing node is the LLM Node. Thrown at init when inputs.sequentialNode is missing or empty, so the node cannot join the sequential graph.
Source
Thrown at packages/components/nodes/sequentialagents/LLMNode/LLMNode.ts:412
// Tools can be connected through ToolNodes
let tools = nodeData.inputs?.tools
tools = flatten(tools)
let systemPrompt = nodeData.inputs?.systemMessagePrompt as string
systemPrompt = transformBracesWithColon(systemPrompt)
let humanPrompt = nodeData.inputs?.humanMessagePrompt as string
humanPrompt = transformBracesWithColon(humanPrompt)
const llmNodeLabel = nodeData.inputs?.llmNodeName as string
const sequentialNodes = nodeData.inputs?.sequentialNode as ISeqAgentNode[]
const model = nodeData.inputs?.model as BaseChatModel
const promptValuesStr = nodeData.inputs?.promptValues
const output = nodeData.outputs?.output as string
const llmStructuredOutput = nodeData.inputs?.llmStructuredOutput
if (!llmNodeLabel) throw new Error('LLM Node name is required!')
const llmNodeName = llmNodeLabel.toLowerCase().replace(/\s/g, '_').trim()
if (!sequentialNodes || !sequentialNodes.length) throw new Error('Agent must have a predecessor!')
let llmNodeInputVariablesValues: ICommonObject = {}
if (promptValuesStr) {
try {
llmNodeInputVariablesValues = typeof promptValuesStr === 'object' ? promptValuesStr : JSON.parse(promptValuesStr)
} catch (exception) {
throw new Error("Invalid JSON in the LLM Node's Prompt Input Values: " + exception)
}
}
llmNodeInputVariablesValues = handleEscapeCharacters(llmNodeInputVariablesValues, true)
const startLLM = sequentialNodes[0].startLLM
const llm = model || startLLM
if (nodeData.inputs) nodeData.inputs.model = llm
const multiModalMessageContent = sequentialNodes[0]?.multiModalMessageContent || (await processImageMessage(llm, nodeData, options))
const abortControllerSignal = options.signal as AbortController
const llmNodeInputVariables = uniq([...getInputVariables(systemPrompt), ...getInputVariables(humanPrompt)])View on GitHub (pinned to abe4a8601a)
Solutions
- Connect an upstream sequential node's output into this LLM Node's 'Sequential Node' input.
- Save the chatflow to persist the edge.
- Remember the message is mislabeled — the fix is on the LLM Node, not an Agent node.
Defensive patterns
Strategy: validation
Validate before calling
const seq = nodeData.inputs?.sequentialNode
if (!Array.isArray(seq) || seq.length === 0) throw new Error('LLM Node must have a predecessor sequential node') Type guard
const hasPredecessor = (n: INodeData): boolean => Array.isArray(n.inputs?.sequentialNode) && (n.inputs!.sequentialNode as any[]).length > 0
Prevention
- Remember the thrown text ('Agent must have a predecessor!') is mislabeled — the fix is on the LLM Node.
- Lint the graph so every non-Start sequential node has an incoming edge.
When it happens
Trigger: An LLM Node placed on the canvas with no incoming wire from another sequential node; sequentialNode lost during import/copy.
Common situations: Forgotten wiring; copy-paste of nodes without edges; the misleading 'Agent' text sending debugging toward the wrong node.
Related errors
- Custom function must have a predecessor!
- End must have a predecessor!
- Execute Flow must have a predecessor!
- LLM Node name is required!
- Agent must have a predecessor!
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/12ec5a6beeef8afa.
Report an issue: GitHub.