{"record":{"id":"8a3526eb41a38c08","repo":"langchain-ai/langgraph","slug":"draining-status-requires-run-control","errorCode":null,"errorMessage":"Draining status requires run control","messagePattern":"Draining status requires run control","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"libs/langgraph/langgraph/pregel/main.py","lineNumber":3014,"sourceCode":"                queue.Empty,\n                version,\n                _output_mapper,\n                _state_mapper,\n            )\n            # handle exit\n            if loop.status == \"out_of_steps\":\n                msg = create_error_message(\n                    message=(\n                        f\"Recursion limit of {config['recursion_limit']} reached \"\n                        \"without hitting a stop condition. You can increase the \"\n                        \"limit by setting the `recursion_limit` config key.\"\n                    ),\n                    error_code=ErrorCode.GRAPH_RECURSION_LIMIT,\n                )\n                raise GraphRecursionError(msg)\n            elif loop.status == \"draining\":\n                if loop.control is None:\n                    raise RuntimeError(\"Draining status requires run control\")\n                raise GraphDrained(loop.control.drain_reason or \"shutdown\")\n            # set final channel values as run output\n            run_manager.on_chain_end(loop.output)\n        except BaseException as e:\n            if run_manager is not None:\n                run_manager.on_chain_error(e)\n            raise\n\n    @overload\n    def astream(\n        self,\n        input: InputT | Command | None,\n        config: RunnableConfig | None = None,\n        *,\n        context: ContextT | None = None,\n        stream_mode: StreamMode | Sequence[StreamMode] | None = None,\n        print_mode: StreamMode | Sequence[StreamMode] = (),\n        output_keys: str | Sequence[str] | None = None,","sourceCodeStart":2996,"sourceCodeEnd":3032,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/langgraph/langgraph/pregel/main.py#L2996-L3032","documentation":"Error \"Draining status requires run control\" thrown in langchain-ai/langgraph.","triggerScenarios":"Thrown at libs/langgraph/langgraph/pregel/main.py:3014 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"}