LangGraph astream_events hangs on node with external api call
06:21 19 Jun 2026

I am building a LangGraph pipeline. Nodes 1 and 2 stream fine via astream_events. Node 3 calls an external API then an llm and the stream just hangs forever. No errors and no timeouts.

Sync invoke() works fine. I tried wrapping the httpx call in fetch_data_node with asyncio.to_thread but it still hangs. Is LangGraph's state update blocking the event loop during streaming ? How do I debug where the problem is ?

async def run_pipeline(user_input: str):
graph = StateGraph(AgentState)
graph.add_node("fetch_data", fetch_data_node) # Hangs here
graph.add_node("generate_response", generate_response_node)
app = graph.compile()
async for event in app.astream_events({"input": user_input}, version="v1"):
yield event
python-asyncio langchain langgraph