Pagination-and-Resume vs Long Running Workflows

Hi,
I have a Temporal Activity that fetches small blobs of data at a time (due to performance considerations). For the Activity to resume from where it left off, it needs to store its ongoing state and manage this Pagination related functionality. This makes the code look very different compared to writing it as a simple loop over the whole data and saving the results at specified batch sizes periodically (in keeping with the performance constraints).

What is a good way to model the above Pagination + Batch Save scenario within Temporal? Will a long running Workflow be a better fit here? Preferably I don’t want to manage explicit Pagination State + Resumption from previous state, and want the code to look like a for-loop, as I mentioned above.

1 Like