Hello! I had a question about workflow lifecycles.
This is what I know so far: it seems like interceptors is the supported feature to help with “hooking into the lifecycle of workflows”?
- Middleware/Interceptors came up (/t/workflow-activity-middleware/1142).
- There was this forum documented feature request (/t/execute-some-code-immediately-after-workflow-completion/298), maybe the Temporal folks have since done it (this was back in 2020).
- Workflows also have Events (Workflows | Temporal Documentation) that we could maybe hook on to?
Our use case is having branching logic in which we would like to call the same activity. The big one is at each workflow completion, we would like to do X. Hooking into the lifecycle would help reduce duplication and ensure we don’t forget to do X. Are interceptors the right way to go? If so, can I get help/documentation understand the differences in the Workflow offered ones? Or at least some pointers on which one is more appropriate for the use case I described above. Thank you!
P.S. – apologies for the shortened references to community.temporal posts. I’m too new to post more links in one go!