{"record":{"id":"9a27ca4ef9a66c06","repo":"langchain-ai/langgraph","slug":"node-name-must-be-provided-if-action-is-not-a-func","errorCode":null,"errorMessage":"Node name must be provided if action is not a function","messagePattern":"Node name must be provided if action is not a function","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/langgraph/langgraph/graph/state.py","lineNumber":785,"sourceCode":"                retry_policy = retry  # type: ignore[assignment]\n\n        if (input_ := kwargs.get(\"input\", MISSING)) is not MISSING:\n            warnings.warn(\n                \"`input` is deprecated and will be removed. Please use `input_schema` instead.\",\n                category=LangGraphDeprecatedSinceV05,\n            )\n            if input_schema is None:\n                input_schema = cast(type[NodeInputT] | None, input_)\n        timeout = coerce_timeout_policy(timeout)\n\n        if not isinstance(node, str):\n            action = node\n            if isinstance(action, Runnable):\n                node = action.get_name()\n            else:\n                node = getattr(action, \"__name__\", action.__class__.__name__)\n            if node is None:\n                raise ValueError(\n                    \"Node name must be provided if action is not a function\"\n                )\n        if self.compiled:\n            logger.warning(\n                \"Adding a node to a graph that has already been compiled. This will \"\n                \"not be reflected in the compiled graph.\"\n            )\n        if not isinstance(node, str):\n            action = node\n            node = cast(str, getattr(action, \"name\", getattr(action, \"__name__\", None)))\n            if node is None:\n                raise ValueError(\n                    \"Node name must be provided if action is not a function\"\n                )\n        if action is None:\n            raise RuntimeError\n        if node in self.nodes:\n            raise ValueError(f\"Node `{node}` already present.\")","sourceCodeStart":767,"sourceCodeEnd":803,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/langgraph/langgraph/graph/state.py#L767-L803","documentation":"Error \"Node name must be provided if action is not a function\" thrown in langchain-ai/langgraph.","triggerScenarios":"Thrown at libs/langgraph/langgraph/graph/state.py:785 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"}