A number of use-cases can be implemented cleanly using a recursive approach. This post is not to debate the pros and cons of recursion versus looping but provides a simple approach to achieve this.
For scenarios such as the ones listed below, and possibly more, this approach is quite efficient, concise, maintainable, and most importantly, it is highly scalable. It also leaves a smaller runtime footprint with a smaller execution time per instance than a looping flow instance. This also makes error handling easier as I will describe later.
- Polling (continuously monitoring an FTP location, a database, or an API output)
- Paginated API's (when the target system exposes an API with a paginated* interface such as the eBay findProducts operation)
- Retryable flows