Parallel Nodes: how to manage failures or exceptions

Hi @carmine-sacco

yeah, you are actually right. The mechanizm works as described, but there is an aimportant limitation -Python’s threading limitation. The graph stops waiting for Node B and re-raises Node A’s exception, but Node B’s thread silently runs to completion in the background - concurrent.futures.Future.cancel() can only cancel tasks that haven’t started yet. It happend when you use sync api (.invoke()).

Could you try using ainvoke?

The async runner uses asyncio tasks instead of threads. When asyncio.Future.cancel() is called on an async task, it raises CancelledError inside the coroutine at the next await point - this actually interrupts execution.