I’m in the early stages of creating workflows & activities using the python SDK. My use case requires invoking multiple concurrent workflows with asyncio.gather(). My activities are written to return an output dataclass with attributes that include a tracking identifier. This works great as long as the activity doesn’t fail for any reason.
However, if an activity fails for any reason (timeout, or any other failure scenario), then the returned output dataclass code path is never reached and I get back a generic workflow failure exception with no identifying information.
I can work around this by wrapping every activity in an exception handler that catches the top level temporal activity failure exception and returning my output dataclass with internal failed status attribute. But this approach that means that the workflow itself is treated as not failed, which is not great from a reporting perspective.
I’d like to get back an output data that uniquely identifies the workflow result regardless of its state. Is there some way to get the best of both worlds?