Hi everyone,
I’m working on migrating some long-running business processes to Temporal and would love to hear your experiences and best practices.
Specifically, I’m dealing with workflows that:
- Run for days or weeks (customer onboarding, approval chains)
- Need to handle human tasks and wait for external events
- Require visibility into current state for business stakeholders
How do you typically model these? Do you:
- Use signals for external events or prefer polling activities?
- Create child workflows for sub-processes or keep everything in one workflow?
- Handle versioning when business rules change mid-flight?
Any patterns or lessons learned would be greatly appreciated!
Thanks in advance.
Use signals for external events or prefer polling activities?
depends on your downstream apis. both good approaches imho, push-based (via signal) typically easier to implement and puts less “pressure” on large scale on Temporal server and downstream. be aware of limits of single execution, one of those being max signals received
Create child workflows for sub-processes or keep everything in one workflow?
imho depends on use case, but typically do not use child workflows to re-implement code-reuse features your programming langue gives you already
Handle versioning when business rules change mid-flight?
for potentially very long running executions, look at worker versioning, gives you some very nice features such as update version on ContinueAsNew, etc
Any patterns or lessons learned would be greatly appreciated!
whats the workload scale? for example how many running executions would you have at point in time?
how often and at what scale you need to poll visibility for these long-running executions?