{"record":{"id":"caafc61536a92870","repo":"langchain-ai/langgraph","slug":"at-least-one-of-func-or-afunc-must-be-provided","errorCode":null,"errorMessage":"At least one of func or afunc must be provided.","messagePattern":"At least one of func or afunc must be provided\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/langgraph/langgraph/_internal/_runnable.py","lineNumber":336,"sourceCode":"                    if func.__name__ != \"<lambda>\":\n                        self.name = func.__name__\n                except AttributeError:\n                    pass\n            elif afunc:\n                try:\n                    self.name = afunc.__name__\n                except AttributeError:\n                    pass\n        self.func = func\n        self.afunc = afunc\n        self.tags = tags\n        self.kwargs = kwargs\n        self.trace = trace\n        self.recurse = recurse\n        self.explode_args = explode_args\n        # check signature\n        if func is None and afunc is None:\n            raise ValueError(\"At least one of func or afunc must be provided.\")\n\n        self.func_accepts: dict[str, tuple[str, Any]] = {}\n        params = inspect.signature(cast(Callable, func or afunc)).parameters\n\n        for kw, typ, runtime_key, default in KWARGS_CONFIG_KEYS:\n            p = params.get(kw)\n\n            if p is None or p.kind not in VALID_KINDS:\n                # If parameter is not found or is not a valid kind, skip\n                continue\n\n            if typ != (ANY_TYPE,) and p.annotation not in typ:\n                # A specific type is required, but the function annotation does\n                # not match the expected type.\n\n                # If this is a config parameter with incorrect typing, emit a warning\n                # because we used to support any type but are moving towards more correct typing\n                if kw == \"config\" and p.annotation != inspect.Parameter.empty:","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/langgraph/langgraph/_internal/_runnable.py#L318-L354","documentation":"Error \"At least one of func or afunc must be provided.\" thrown in langchain-ai/langgraph.","triggerScenarios":"Thrown at libs/langgraph/langgraph/_internal/_runnable.py:336 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"}