FlowiseAI/Flowise · error · Error

End must have a predecessor!

Error message

End must have a predecessor!

What it means

The End node terminates the sequential graph; at init it records its single predecessor so LangGraph routes into the END node. Thrown when nodeData.inputs.sequentialNode is falsy — the End node has no incoming sequential edge.

Source

Thrown at packages/components/nodes/sequentialagents/End/End.ts:42

        this.category = 'Sequential Agents'
        this.description = 'End conversation'
        this.baseClasses = [this.type]
        this.documentation = 'https://docs.flowiseai.com/using-flowise/agentflows/sequential-agents#id-10.-end-node'
        this.inputs = [
            {
                label: 'Sequential Node',
                name: 'sequentialNode',
                type: 'Agent | Condition | LLMNode | ToolNode | CustomFunction | ExecuteFlow',
                description:
                    'Can be connected to one of the following nodes: Agent, Condition, LLM Node, Tool Node, Custom Function, Execute Flow'
            }
        ]
        this.hideOutput = true
    }

    async init(nodeData: INodeData): Promise<any> {
        const sequentialNode = nodeData.inputs?.sequentialNode as ISeqAgentNode
        if (!sequentialNode) throw new Error('End must have a predecessor!')

        const returnOutput: ISeqAgentNode = {
            id: nodeData.id,
            node: END,
            name: END,
            label: END,
            type: 'end',
            output: END,
            predecessorAgents: [sequentialNode]
        }

        return returnOutput
    }
}

module.exports = { nodeClass: End_SeqAgents }

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Connect an upstream sequential node's output into the End node's 'Sequential Node' input.
  2. Save the chatflow so the edge serializes into inputs.sequentialNode.
Defensive patterns

Strategy: validation

Validate before calling

const pred = nodeData.inputs?.sequentialNode
if (!pred) throw new Error('End node must be wired to a predecessor sequential node')

Type guard

const hasEndPredecessor = (n: INodeData): boolean => !!n.inputs?.sequentialNode

Prevention

When it happens

Trigger: End node placed on the canvas with no connection from a sequential node (Agent/Condition/LLMNode/ToolNode/CustomFunction/ExecuteFlow); the edge was lost during import/copy.

Common situations: Same wiring hazards as the other predecessor checks: forgotten wire, stale saved chatflow, copy without edges.

Related errors


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/1c0933e98659b6df. Report an issue: GitHub.