langchain-ai/langgraph · error · RuntimeError
requires an async run — it overrides…
Error message
{type(transformer).__name__} requires an async run — it overrides aprocess/afinalize/afail or sets requires_async=True. Use astream(), not stream(). What it means
Raised by StreamMux._register when a transformer requires async (overrides aprocess/afinalize/afail or sets requires_async=True) but the mux runs in sync mode. Async-only transformers cannot run under sync stream().
Solutions
- Use astream()/stream_events v3 async path instead of stream()
- Provide sync process()/finalize() overrides in the transformer
- Set requires_async=False only if the transformer is genuinely sync-capable
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at libs/langgraph/langgraph/stream/_mux.py:235 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of langchain-ai/langgraph@38031739e5 (2026-08-26).
Data as JSON: /api/errors/02441df04476ad2e.
Report an issue: GitHub.
Appendix: source
Thrown at libs/langgraph/langgraph/stream/_mux.py:235
is_async=self.is_async,
scope=scope,
_assign_seq=False,
)
if self._pump_fn is not None:
child.bind_pump(self._pump_fn)
if self._apump_fn is not None:
child.bind_apump(self._apump_fn)
return child
def _register(self, transformer: StreamTransformer) -> None:
"""Register a single transformer.
Calls `transformer.init()`, stores the transformer for event
processing, binds any StreamChannel instances in the projection,
and merges the projection into `extensions`.
"""
if transformer_requires_async(transformer) and not self.is_async:
raise RuntimeError(
f"{type(transformer).__name__} requires an async run — "
"it overrides aprocess/afinalize/afail or sets "
"requires_async=True. Use astream(), not stream()."
)
projection = transformer.init()
if not isinstance(projection, dict):
raise TypeError(
f"StreamTransformer.init() must return a dict, "
f"got {type(projection).__name__}"
)
conflicts = set(projection) & set(self.extensions)
if conflicts:
attributions = ", ".join(
f"{key!r} (owned by {self._projection_owners[key]})"
for key in sorted(conflicts)
)
raise ValueError(
f"Transformer {type(transformer).__name__} returned "View on GitHub (pinned to 38031739e5)