{"record":{"id":"2f097b8864460426","repo":"langchain-ai/langgraph","slug":"end-cannot-be-a-start-node","errorCode":null,"errorMessage":"END cannot be a start node","messagePattern":"END cannot be a start node","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/langgraph/langgraph/graph/state.py","lineNumber":953,"sourceCode":"        Args:\n            start_key: The key(s) of the start node(s) of the edge.\n            end_key: The key of the end node of the edge.\n\n        Raises:\n            ValueError: If the start key is `'END'` or if the start key or end key is not present in the graph.\n\n        Returns:\n            Self: The instance of the `StateGraph`, allowing for method chaining.\n        \"\"\"\n        if self.compiled:\n            logger.warning(\n                \"Adding an edge to a graph that has already been compiled. This will \"\n                \"not be reflected in the compiled graph.\"\n            )\n\n        if isinstance(start_key, str):\n            if start_key == END:\n                raise ValueError(\"END cannot be a start node\")\n            if end_key == START:\n                raise ValueError(\"START cannot be an end node\")\n\n            # run this validation only for non-StateGraph graphs\n            if not hasattr(self, \"channels\") and start_key in set(\n                start for start, _ in self.edges\n            ):\n                raise ValueError(\n                    f\"Already found path for node '{start_key}'.\\n\"\n                    \"For multiple edges, use StateGraph with an Annotated state key.\"\n                )\n\n            self.edges.add((start_key, end_key))\n            return self\n\n        for start in start_key:\n            if start == END:\n                raise ValueError(\"END cannot be a start node\")","sourceCodeStart":935,"sourceCodeEnd":971,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/langgraph/langgraph/graph/state.py#L935-L971","documentation":"Error \"END cannot be a start node\" thrown in langchain-ai/langgraph.","triggerScenarios":"Thrown at libs/langgraph/langgraph/graph/state.py:953 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"38031739e551638e373fb553453256c23feeb41f","analyzedAt":"2026-08-26T18:02:49.312Z","schemaVersion":2},"datasetVersion":"2026-08-26T21:11:00.512Z"}