{"record":{"id":"3e1f935e6798cf57","repo":"langchain-ai/langgraph","slug":"please-an-annotation-for-both-the-return-and-the","errorCode":null,"errorMessage":"Please an annotation for both the return_ and the save values.For example, `-> entrypoint.final[int, str]` would assign a return_ a type of `int` and save the type `str`.","messagePattern":"Please an annotation for both the return_ and the save values\\.For example, `-> entrypoint\\.final\\[int, str\\]` would assign a return_ a type of `int` and save the type `str`\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"libs/langgraph/langgraph/func/__init__.py","lineNumber":566,"sourceCode":"            return value.value if isinstance(value, entrypoint.final) else value\n\n        def _pluck_save_value(value: Any) -> Any:\n            \"\"\"Get save value from the entrypoint.final object or passthrough.\"\"\"\n            return value.save if isinstance(value, entrypoint.final) else value\n\n        output_type, save_type = Any, Any\n        if sig.return_annotation is not inspect.Signature.empty:\n            # User does not parameterize entrypoint.final properly\n            if (\n                sig.return_annotation is entrypoint.final\n            ):  # Un-parameterized entrypoint.final\n                output_type = save_type = Any\n            else:\n                origin = get_origin(sig.return_annotation)\n                if origin is entrypoint.final:\n                    type_annotations = get_args(sig.return_annotation)\n                    if len(type_annotations) != 2:\n                        raise TypeError(\n                            \"Please an annotation for both the return_ and \"\n                            \"the save values.\"\n                            \"For example, `-> entrypoint.final[int, str]` would assign a \"\n                            \"return_ a type of `int` and save the type `str`.\"\n                        )\n                    output_type, save_type = get_args(sig.return_annotation)\n                else:\n                    output_type = save_type = sig.return_annotation\n\n        graph: Pregel[Any, ContextT, Any, Any] = Pregel(\n            nodes={\n                func.__name__: PregelNode(\n                    bound=bound,\n                    triggers=[START],\n                    channels=START,\n                    timeout=self.timeout,\n                    writers=[\n                        ChannelWrite(","sourceCodeStart":548,"sourceCodeEnd":584,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/langgraph/langgraph/func/__init__.py#L548-L584","documentation":"Error \"Please an annotation for both the return_ and the save values.For example, `-> entrypoint.final[int, str]` would assign a return_ a type of `int` and save the type `str`.\" thrown in langchain-ai/langgraph.","triggerScenarios":"Thrown at libs/langgraph/langgraph/func/__init__.py:566 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"}