Effect CommunityEC
Effect Community•7mo ago•
5 replies
jrmdayn

Handling Workflow Failures and Replays in Effect Typescript Library

I have a long running workflow that checks if a 3rd party operation is complete or not. I query a URL every 2 minutes and check the headers to know if it is indeed complete or if I should wait (retry-after header).
I deployed some code that modified the Schema used to decode the headers and I immediately got a failure (silly mistake) which put my workflow in a failed state. This is a shame because I don't want to restart it from the beginning. Some activities prior to the failure were a success.

I have followed along this Handling Defects in Effect/Cluster with Retries but I really don't think that I can or should write defensive code with retry logic for each part of the logic. In my case, the error is valid: I asked to decode a header that did not exist in the reponse (I should have used an Option...) so it is a valid failure - no need to retry it.

One thing that would be great is the possibility to trigger the same workflow (same payload) in a mode that disregards all the persisted failures. It would only replay the success, not the failures. Curious to hear your thoughts on that 🙂
Was this page helpful?