diff --git a/libs/langgraph/langgraph/pregel/runner.py b/libs/langgraph/langgraph/pregel/runner.py index e60ae599b..e680518a5 100644 --- a/libs/langgraph/langgraph/pregel/runner.py +++ b/libs/langgraph/langgraph/pregel/runner.py @@ -133,6 +133,8 @@ def writer( CONFIG_KEY_CALL: partial(call, next_task), }, __reraise_on_exit__=reraise, + # starting a new task in the next tick ensures + # updates from this tick are committed/streamed first __next_tick__=True, ) fut.add_done_callback(partial(self.commit, next_task)) @@ -319,6 +321,9 @@ def writer( __name__=t.name, __cancel_on_exit__=True, __reraise_on_exit__=reraise, + # starting a new task in the next tick ensures + # updates from this tick are committed/streamed first + __next_tick__=True, ), ) fut.add_done_callback(partial(self.commit, next_task))