{"record":{"id":"c96ea135e14e2cfa","repo":"langchain-ai/langgraph","slug":"type-self-name-schedule-requires-a-runnin","errorCode":null,"errorMessage":"{type(self).__name__}.schedule() requires a running event loop; this transformer must run under astream(), not stream(). Set requires_async=True on the class so this fails at registration rather than at first event.","messagePattern":"(.+?)\\.schedule\\(\\) requires a running event loop; this transformer must run under astream\\(\\), not stream\\(\\)\\. Set requires_async=True on the class so this fails at registration rather than at first event\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"libs/langgraph/langgraph/stream/_types.py","lineNumber":271,"sourceCode":"            on_error: `\"log\"` (default) catches and logs any exception\n                the coroutine raises, so a single failure doesn't tear\n                down the run. `\"raise\"` lets the exception propagate\n                when the mux joins pendings, converting the close path\n                into the fail path.\n\n        Returns:\n            The asyncio Task. Authors rarely need to await it directly\n            — consumers read results from whatever projection the\n            coroutine pushes into.\n\n        Raises:\n            RuntimeError: If called without a running event loop (i.e.\n                under sync `stream()` rather than `astream()`).\n        \"\"\"\n        try:\n            asyncio.get_running_loop()\n        except RuntimeError:\n            raise RuntimeError(\n                f\"{type(self).__name__}.schedule() requires a running \"\n                \"event loop; this transformer must run under astream(), \"\n                \"not stream(). Set requires_async=True on the class so \"\n                \"this fails at registration rather than at first event.\"\n            ) from None\n\n        wrapped = self._wrap_scheduled(coro) if on_error == \"log\" else coro\n        task = asyncio.create_task(wrapped)\n        tasks = self._scheduled_task_set()\n        tasks.add(task)\n        task.add_done_callback(tasks.discard)\n        return task\n\n    @staticmethod\n    async def _wrap_scheduled(coro: Coroutine[Any, Any, Any]) -> Any:\n        try:\n            return await coro\n        except asyncio.CancelledError:","sourceCodeStart":253,"sourceCodeEnd":289,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/langgraph/langgraph/stream/_types.py#L253-L289","documentation":"Error \"{type(self).__name__}.schedule() requires a running event loop; this transformer must run under astream(), not stream(). Set requires_async=True on the class so this fails at registration rather than at first event.\" thrown in langchain-ai/langgraph.","triggerScenarios":"Thrown at libs/langgraph/langgraph/stream/_types.py:271 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"}