Would love to understand how activity and local-activity replays work on workflow re-execution.
Let us assume the following workflow execution sequence for the same workflow.
Workflow retry, which is reexecuting workflow from the beginning, is entirely unrelated to workflow replay, which is used to recover a workflow to its current state.
Why are you even talking about workflow retry? We don’t recommend retrying workflows in the 99% of use cases. That’s why workflows don’t have retry options by default as opposed to activities that have them.
Got it. I want to use maxAttempts to retry after a few minutes in case of transient failures. I was originally thinking of using the workflow retry to retry after a few minutes.
Here is my scenario
There are 1000 items inside a batch that I need to process. Each batch would start as a workflow and the items would be processed inside a function. These call an internal system with low latency (~100ms) to process the item.
There is no guarantee that these 1000 inside a batch that would succeed - as there might be transient issues.
I would like to reprocess only the failed items after a few minutes - as these are transient errors.
There are two options that I can choose from.
Using Regular activities -
- This causes heavy load on the system. So we want to avoid them if local activities work.
Using Local activities
- I would love to understand the behavior better before using them. In case of local activities, how do I make sure 1) All items are processed successfully and reliably. 2) Successful items are not processed again ?