I explored doing this, but if I am trying to process a few hundred records, a for loop within the script in place of the repeating block would go way over the 30-second run time limit. Instead, I have tried to break these out into two separate automations:
1. The first determines which records need to be processed and puts them in order, then updates a Date field within each record from a repeating block, with a 10-second delay in the script before it finishes.
2. The second automation gets triggered whenever that Date field in the record is updated, then it processes that one record accordingly. This is assuming that an automation itself does not run concurrently for multiple records that have triggered it, but one at a time.
I'll post an update if this works over the next few days, but it would be great to understand this as well from Airtable Support - whether one Automation will run on multiple records concurrently or one at a time.
OK I understand better now. Airtable will for sure run on multiple records concurrently with no logical order to them. Ive dealt with this before. My solution was to allow the first automation to run completely on all records, then manually trigger the second to start. I actually ended up creating an additional field that was populated by the first script with the index, and a formula field index+1. Then I triggered the second automation to start manually with a checkbox on the first record, run the normal process, and as a last step in the automation, I used the index+1 field to find the next record and check the checkbox for that record to start processing it. This effectively makes them process one at a time. Hope that makes sense.