{"record":{"id":"12ec5a6beeef8afa","repo":"FlowiseAI/Flowise","slug":"agent-must-have-a-predecessor-12ec5a","errorCode":null,"errorMessage":"Agent must have a predecessor!","messagePattern":"Agent must have a predecessor!","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/sequentialagents/LLMNode/LLMNode.ts","lineNumber":412,"sourceCode":"        // Tools can be connected through ToolNodes\n        let tools = nodeData.inputs?.tools\n        tools = flatten(tools)\n\n        let systemPrompt = nodeData.inputs?.systemMessagePrompt as string\n        systemPrompt = transformBracesWithColon(systemPrompt)\n        let humanPrompt = nodeData.inputs?.humanMessagePrompt as string\n        humanPrompt = transformBracesWithColon(humanPrompt)\n        const llmNodeLabel = nodeData.inputs?.llmNodeName as string\n        const sequentialNodes = nodeData.inputs?.sequentialNode as ISeqAgentNode[]\n        const model = nodeData.inputs?.model as BaseChatModel\n        const promptValuesStr = nodeData.inputs?.promptValues\n        const output = nodeData.outputs?.output as string\n        const llmStructuredOutput = nodeData.inputs?.llmStructuredOutput\n\n        if (!llmNodeLabel) throw new Error('LLM Node name is required!')\n        const llmNodeName = llmNodeLabel.toLowerCase().replace(/\\s/g, '_').trim()\n\n        if (!sequentialNodes || !sequentialNodes.length) throw new Error('Agent must have a predecessor!')\n\n        let llmNodeInputVariablesValues: ICommonObject = {}\n        if (promptValuesStr) {\n            try {\n                llmNodeInputVariablesValues = typeof promptValuesStr === 'object' ? promptValuesStr : JSON.parse(promptValuesStr)\n            } catch (exception) {\n                throw new Error(\"Invalid JSON in the LLM Node's Prompt Input Values: \" + exception)\n            }\n        }\n        llmNodeInputVariablesValues = handleEscapeCharacters(llmNodeInputVariablesValues, true)\n\n        const startLLM = sequentialNodes[0].startLLM\n        const llm = model || startLLM\n        if (nodeData.inputs) nodeData.inputs.model = llm\n\n        const multiModalMessageContent = sequentialNodes[0]?.multiModalMessageContent || (await processImageMessage(llm, nodeData, options))\n        const abortControllerSignal = options.signal as AbortController\n        const llmNodeInputVariables = uniq([...getInputVariables(systemPrompt), ...getInputVariables(humanPrompt)])","sourceCodeStart":394,"sourceCodeEnd":430,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/sequentialagents/LLMNode/LLMNode.ts#L394-L430","documentation":"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.","triggerScenarios":"An LLM Node placed on the canvas with no incoming wire from another sequential node; sequentialNode lost during import/copy.","commonSituations":"Forgotten wiring; copy-paste of nodes without edges; the misleading 'Agent' text sending debugging toward the wrong node.","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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const seq = nodeData.inputs?.sequentialNode\nif (!Array.isArray(seq) || seq.length === 0) throw new Error('LLM Node must have a predecessor sequential node')","typeGuard":"const hasPredecessor = (n: INodeData): boolean => Array.isArray(n.inputs?.sequentialNode) && (n.inputs!.sequentialNode as any[]).length > 0","tryCatchPattern":null,"preventionTips":["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."],"tags":["sequential-agents","llm-node","graph-wiring","error-message","init"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}