{"record":{"id":"5b7d192d0acb030b","repo":"langchain-ai/langgraph","slug":"start-cannot-be-an-end-node","errorCode":null,"errorMessage":"START cannot be an end node","messagePattern":"START cannot be an end node","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/langgraph/langgraph/graph/state.py","lineNumber":955,"sourceCode":"            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\")\n            if start not in self.nodes:\n                raise ValueError(f\"Need to add_node `{start}` first\")","sourceCodeStart":937,"sourceCodeEnd":973,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/langgraph/langgraph/graph/state.py#L937-L973","documentation":"Error \"START cannot be an end node\" thrown in langchain-ai/langgraph.","triggerScenarios":"Thrown at libs/langgraph/langgraph/graph/state.py:955 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"}