Salesforce record deleter

Hi, I feel like this is a really simple one, but for some reason it’s escaping me.

I have a lot of records in Salesforce called Mass Action Logs.

I want to use a simple workflow to delete these records, 50 at a time.

In my mind, I’d create a simple workflow to get 50 records at a time, run an if node to find out if there are more than 1 left, split them in to single batches using a loop, then delete them.
After the delete finishes, pass it back to the Get records to get another 50, and go through it agian.

However, when I loop back to the original get record node, it goes from getting 50, to 2,500 records?
I guess because it’s doing the get 50 times? (50*50)

Without seeing the workflow itself it is difficult to guess what’s going on, but it sounds like you might be feeding the 50 items you fetch within the loop back into the node that fetches the next batch, so yes, that would then run the fetch 50 times on the second time through the loop.

If you aren’t limited on the number of workflow executions (e.g. self hosted), then one way you could make things clearer is to pass each batch of 50 items into a sub-workflow and return only one “response/result” item.

If you need to do everything in a single workflow (to conserve executions), route the 50 “delete result” items into an aggregate or code node that only returns/outputs a single “summary” item that flows back into the loop.