Tool calls that take a long time

If there are tools that might take a while to come back with a response, is there a good way to setup an architecture in langgraph for REACT agents where they fire off the tool calls async and come back in and check on the results from them… I am noticing my agent is equipped with tools that have important information but they take some time to respond and where I have this deployed cuts off the communication when making these calls.

Yes, you can implement async tool polling in LangGraph by splitting tool execution into separate nodes. Create a “tool dispatcher” node that initiates async calls and stores job IDs in state, then a “tool checker” node that polls for results. Use conditional edges to loop back to the checker until results are ready, with the agent continuing other work in between. You can also use LangGraph’s interrupt mechanism to pause execution, fire off async calls externally, and resume with results later. This prevents timeout issues and keeps the agent responsive while waiting for slow tools.

3 Likes

You may also be able to change the configuration to allow for these longer running tools without making many architectural changes. It might be as simple as changing timeout settings on the client used by the tools or something with the deployment configuration etc.

1 Like